2022-07-06 12:06:30 +00:00
|
|
|
DTS_DIR := $(DTS_DIR)/mediatek
|
|
|
|
|
|
|
|
define Image/Prepare
|
|
|
|
# For UBI we want only one extra block
|
|
|
|
rm -f $(KDIR)/ubi_mark
|
|
|
|
echo -ne '\xde\xad\xc0\xde' > $(KDIR)/ubi_mark
|
|
|
|
endef
|
|
|
|
|
2023-04-25 15:06:20 +00:00
|
|
|
define Build/mt7981-bl2
|
|
|
|
cat $(STAGING_DIR_IMAGE)/mt7981-$1-bl2.img >> $@
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/mt7981-bl31-uboot
|
|
|
|
cat $(STAGING_DIR_IMAGE)/mt7981_$1-u-boot.fip >> $@
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/mt7986-bl2
|
2022-07-13 03:30:32 +00:00
|
|
|
cat $(STAGING_DIR_IMAGE)/mt7986-$1-bl2.img >> $@
|
|
|
|
endef
|
|
|
|
|
2023-04-25 15:06:20 +00:00
|
|
|
define Build/mt7986-bl31-uboot
|
2022-07-13 03:30:32 +00:00
|
|
|
cat $(STAGING_DIR_IMAGE)/mt7986_$1-u-boot.fip >> $@
|
|
|
|
endef
|
|
|
|
|
2023-08-25 03:09:28 +00:00
|
|
|
define Build/mt7988-bl2
|
|
|
|
cat $(STAGING_DIR_IMAGE)/mt7988-$1-bl2.img >> $@
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/mt7988-bl31-uboot
|
|
|
|
cat $(STAGING_DIR_IMAGE)/mt7988_$1-u-boot.fip >> $@
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/mt798x-gpt
|
2022-07-13 03:30:32 +00:00
|
|
|
cp $@ $@.tmp 2>/dev/null || true
|
|
|
|
ptgen -g -o $@.tmp -a 1 -l 1024 \
|
|
|
|
$(if $(findstring sdmmc,$1), \
|
|
|
|
-H \
|
|
|
|
-t 0x83 -N bl2 -r -p 4079k@17k \
|
|
|
|
) \
|
|
|
|
-t 0x83 -N ubootenv -r -p 512k@4M \
|
|
|
|
-t 0x83 -N factory -r -p 2M@4608k \
|
|
|
|
-t 0xef -N fip -r -p 4M@6656k \
|
|
|
|
-N recovery -r -p 32M@12M \
|
|
|
|
$(if $(findstring sdmmc,$1), \
|
|
|
|
-N install -r -p 20M@44M \
|
|
|
|
-t 0x2e -N production -p $(CONFIG_TARGET_ROOTFS_PARTSIZE)M@64M \
|
|
|
|
) \
|
|
|
|
$(if $(findstring emmc,$1), \
|
|
|
|
-t 0x2e -N production -p $(CONFIG_TARGET_ROOTFS_PARTSIZE)M@64M \
|
|
|
|
)
|
|
|
|
cat $@.tmp >> $@
|
|
|
|
rm $@.tmp
|
|
|
|
endef
|
|
|
|
|
2023-03-11 03:56:35 +00:00
|
|
|
metadata_gl_json = \
|
|
|
|
'{ $(if $(IMAGE_METADATA),$(IMAGE_METADATA)$(comma)) \
|
|
|
|
"metadata_version": "1.1", \
|
|
|
|
"compat_version": "$(call json_quote,$(compat_version))", \
|
|
|
|
$(if $(DEVICE_COMPAT_MESSAGE),"compat_message": "$(call json_quote,$(DEVICE_COMPAT_MESSAGE))"$(comma)) \
|
|
|
|
$(if $(filter-out 1.0,$(compat_version)),"new_supported_devices": \
|
|
|
|
[$(call metadata_devices,$(SUPPORTED_DEVICES))]$(comma) \
|
|
|
|
"supported_devices": ["$(call json_quote,$(legacy_supported_message))"]$(comma)) \
|
|
|
|
$(if $(filter 1.0,$(compat_version)),"supported_devices":[$(call metadata_devices,$(SUPPORTED_DEVICES))]$(comma)) \
|
|
|
|
"version": { \
|
|
|
|
"release": "$(call json_quote,$(VERSION_NUMBER))", \
|
|
|
|
"date": "$(shell TZ='Asia/Chongqing' date '+%Y%m%d%H%M%S')", \
|
|
|
|
"dist": "$(call json_quote,$(VERSION_DIST))", \
|
|
|
|
"version": "$(call json_quote,$(VERSION_NUMBER))", \
|
|
|
|
"revision": "$(call json_quote,$(REVISION))", \
|
|
|
|
"target": "$(call json_quote,$(TARGETID))", \
|
|
|
|
"board": "$(call json_quote,$(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)))" \
|
2023-05-18 10:21:48 +00:00
|
|
|
} \
|
2023-03-11 03:56:35 +00:00
|
|
|
}'
|
|
|
|
|
|
|
|
define Build/append-gl-metadata
|
|
|
|
$(if $(SUPPORTED_DEVICES),-echo $(call metadata_gl_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
|
2023-05-19 08:31:36 +00:00
|
|
|
sha256sum "$@" | cut -d" " -f1 > "$@.sha256sum"
|
|
|
|
[ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" -o ! -s "$@" ] || { \
|
|
|
|
cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
|
2023-03-11 03:56:35 +00:00
|
|
|
usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
|
2023-05-19 08:31:36 +00:00
|
|
|
ucert -A -c "$@.ucert" -x "$@.sig" ;\
|
|
|
|
fwtool -S "$@.ucert" "$@" ;\
|
2023-03-11 03:56:35 +00:00
|
|
|
}
|
|
|
|
endef
|
|
|
|
|
2024-09-20 15:10:26 +00:00
|
|
|
define Build/append-openwrt-one-eeprom
|
|
|
|
dd if=$(STAGING_DIR_IMAGE)/mt7981_eeprom_mt7976_dbdc.bin >> $@
|
|
|
|
endef
|
|
|
|
|
2023-07-15 16:10:31 +00:00
|
|
|
define Build/zyxel-nwa-fit-filogic
|
|
|
|
$(TOPDIR)/scripts/mkits-zyxel-fit-filogic.sh \
|
|
|
|
$@.its $@ "80 e1 ff ff ff ff ff ff ff ff"
|
|
|
|
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
|
|
|
|
@mv $@.new $@
|
|
|
|
endef
|
|
|
|
|
2023-08-30 11:50:54 +00:00
|
|
|
define Build/cetron-header
|
|
|
|
$(eval magic=$(word 1,$(1)))
|
|
|
|
$(eval model=$(word 2,$(1)))
|
|
|
|
( \
|
|
|
|
dd if=/dev/zero bs=856 count=1 2>/dev/null; \
|
|
|
|
printf "$(model)," | dd bs=128 count=1 conv=sync 2>/dev/null; \
|
|
|
|
md5sum $@ | cut -f1 -d" " | dd bs=32 count=1 2>/dev/null; \
|
|
|
|
printf "$(magic)" | dd bs=4 count=1 conv=sync 2>/dev/null; \
|
|
|
|
cat $@; \
|
|
|
|
) > $@.tmp
|
|
|
|
fw_crc=$$(gzip -c $@.tmp | tail -c 8 | od -An -N4 -tx4 --endian little | tr -d ' \n'); \
|
|
|
|
printf "$$(echo $$fw_crc | sed 's/../\\x&/g')" | cat - $@.tmp > $@
|
|
|
|
rm $@.tmp
|
|
|
|
endef
|
|
|
|
|
mediatek: add ABT ASR3000 support
Hardware specification:
SoC: MediaTek MT7981B 2x A53
Flash: 128 MB SPI-NAND
RAM: 256MB
Ethernet: 4x 10/100/1000 Mbps
Switch: MediaTek MT7531AE
WiFi: MediaTek MT7976C
Button: Reset, Mesh
Power: DC 12V 1A
Gain telnet access:
1. Login into web interface, and download the configuration.
2. Decode and uncompress the configuration:
* Enter fakeroot if you are not login as root.
base64 -d e-xxxxxxxxxxxx-cfg.tar.gz | tar -zx
3. Edit 'etc/passwd', remove root password: 'root::1:0:99999:7:::'.
4. Edit 'etc/rc.local', insert telnetd command before 'exit 0':
( sleep 3s; /usr/sbin/telnetd; ) &
5. Repack the configuration:
tar -zc etc/ | base64 > e-xxxxxxxxxxxx-cfg.tar.gz
6. Upload new configuration via web interface, now you can connect to
ASR3000 via telnet.
Flash instructions:
1. Connect to ASR3000, backup everything, especially 'Factory' part.
2. Write new BL2:
mtd write openwrt-mediatek-filogic-abt_asr3000-preloader.bin BL2
3. Write new FIP:
mtd write openwrt-mediatek-filogic-abt_asr3000-bl31-uboot.fip FIP
4. Set static IP on your PC:
IP 192.168.1.254/24, GW 192.168.1.1
5. Serve OpenWrt initramfs image using TFTP server.
6. Cut off the power and re-engage, wait for TFTP recovery to complete.
7. After OpenWrt has booted, perform sysupgrade.
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/15887
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 07:30:31 +00:00
|
|
|
define Device/abt_asr3000
|
|
|
|
DEVICE_VENDOR := ABT
|
|
|
|
DEVICE_MODEL := ASR3000
|
|
|
|
DEVICE_DTS := mt7981b-abt-asr3000
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot abt_asr3000
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += abt_asr3000
|
|
|
|
|
2023-11-20 10:46:26 +00:00
|
|
|
define Device/acelink_ew-7886cax
|
|
|
|
DEVICE_VENDOR := Acelink
|
|
|
|
DEVICE_MODEL := EW-7886CAX
|
|
|
|
DEVICE_DTS := mt7986a-acelink-ew-7886cax
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
2023-11-20 10:46:26 +00:00
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGES += factory.bin
|
|
|
|
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += acelink_ew-7886cax
|
|
|
|
|
2023-11-06 15:06:05 +00:00
|
|
|
define Device/acer_predator-w6
|
|
|
|
DEVICE_VENDOR := Acer
|
2024-11-11 09:40:45 +00:00
|
|
|
DEVICE_MODEL := Predator Connect W6
|
2023-11-06 15:06:05 +00:00
|
|
|
DEVICE_DTS := mt7986a-acer-predator-w6
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTS_LOADADDR := 0x47000000
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7916-firmware kmod-mt7986-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs
|
2023-11-06 15:06:05 +00:00
|
|
|
IMAGES := sysupgrade.bin
|
|
|
|
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += acer_predator-w6
|
|
|
|
|
2024-11-11 10:18:19 +00:00
|
|
|
define Device/acer_predator-w6d
|
|
|
|
DEVICE_VENDOR := Acer
|
|
|
|
DEVICE_MODEL := Predator Connect W6d
|
|
|
|
DEVICE_DTS := mt7986a-acer-predator-w6d
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTS_LOADADDR := 0x47000000
|
|
|
|
DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7916-firmware kmod-mt7986-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs
|
|
|
|
IMAGES := sysupgrade.bin
|
|
|
|
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += acer_predator-w6d
|
|
|
|
|
|
|
|
define Device/acer_vero-w6m
|
|
|
|
DEVICE_VENDOR := Acer
|
|
|
|
DEVICE_MODEL := Connect Vero W6m
|
|
|
|
DEVICE_DTS := mt7986a-acer-vero-w6m
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTS_LOADADDR := 0x47000000
|
2024-11-26 05:42:25 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7916-firmware kmod-mt7986-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs
|
2024-11-11 10:18:19 +00:00
|
|
|
IMAGES := sysupgrade.bin
|
|
|
|
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += acer_vero-w6m
|
|
|
|
|
2023-11-17 02:25:09 +00:00
|
|
|
define Device/adtran_smartrg
|
|
|
|
DEVICE_VENDOR := Adtran
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-19 16:51:51 +00:00
|
|
|
DEVICE_PACKAGES := e2fsprogs f2fsck mkf2fs kmod-hwmon-pwmfan
|
2023-11-17 02:25:09 +00:00
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/smartrg_sdg-8612
|
|
|
|
$(call Device/adtran_smartrg)
|
|
|
|
DEVICE_MODEL := SDG-8612
|
|
|
|
DEVICE_DTS := mt7986a-smartrg-SDG-8612
|
2024-04-19 16:51:51 +00:00
|
|
|
DEVICE_PACKAGES += kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
2023-11-17 02:25:09 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += smartrg_sdg-8612
|
|
|
|
|
|
|
|
define Device/smartrg_sdg-8614
|
|
|
|
$(call Device/adtran_smartrg)
|
|
|
|
DEVICE_MODEL := SDG-8614
|
|
|
|
DEVICE_DTS := mt7986a-smartrg-SDG-8614
|
2024-04-19 16:51:51 +00:00
|
|
|
DEVICE_PACKAGES += kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
2023-11-17 02:25:09 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += smartrg_sdg-8614
|
|
|
|
|
|
|
|
define Device/smartrg_sdg-8622
|
|
|
|
$(call Device/adtran_smartrg)
|
|
|
|
DEVICE_MODEL := SDG-8622
|
|
|
|
DEVICE_DTS := mt7986a-smartrg-SDG-8622
|
2024-04-19 16:51:51 +00:00
|
|
|
DEVICE_PACKAGES += kmod-mt7915e kmod-mt7915-firmware kmod-mt7986-firmware mt7986-wo-firmware
|
2023-11-17 02:25:09 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += smartrg_sdg-8622
|
|
|
|
|
|
|
|
define Device/smartrg_sdg-8632
|
|
|
|
$(call Device/adtran_smartrg)
|
|
|
|
DEVICE_MODEL := SDG-8632
|
|
|
|
DEVICE_DTS := mt7986a-smartrg-SDG-8632
|
2024-04-19 16:51:51 +00:00
|
|
|
DEVICE_PACKAGES += kmod-mt7915e kmod-mt7915-firmware kmod-mt7986-firmware mt7986-wo-firmware
|
2023-11-17 02:25:09 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += smartrg_sdg-8632
|
|
|
|
|
2024-04-19 16:51:51 +00:00
|
|
|
define Device/smartrg_sdg-8733
|
|
|
|
$(call Device/adtran_smartrg)
|
|
|
|
DEVICE_MODEL := SDG-8733
|
|
|
|
DEVICE_DTS := mt7988a-smartrg-SDG-8733
|
2024-10-23 12:38:55 +00:00
|
|
|
DEVICE_PACKAGES += kmod-mt7996-firmware kmod-phy-aquantia kmod-usb3 mt7988-wo-firmware
|
2024-04-19 16:51:51 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += smartrg_sdg-8733
|
|
|
|
|
2024-08-20 22:14:30 +00:00
|
|
|
define Device/smartrg_sdg-8733a
|
|
|
|
$(call Device/adtran_smartrg)
|
|
|
|
DEVICE_MODEL := SDG-8733A
|
|
|
|
DEVICE_DTS := mt7988d-smartrg-SDG-8733A
|
2024-10-23 12:38:55 +00:00
|
|
|
DEVICE_PACKAGES += mt7988-2p5g-phy-firmware kmod-mt7996-233-firmware kmod-phy-aquantia mt7988-wo-firmware
|
2024-08-20 22:14:30 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += smartrg_sdg-8733a
|
|
|
|
|
2024-04-19 16:51:51 +00:00
|
|
|
define Device/smartrg_sdg-8734
|
|
|
|
$(call Device/adtran_smartrg)
|
|
|
|
DEVICE_MODEL := SDG-8734
|
|
|
|
DEVICE_DTS := mt7988a-smartrg-SDG-8734
|
2024-10-23 12:38:55 +00:00
|
|
|
DEVICE_PACKAGES += kmod-mt7996-firmware kmod-phy-aquantia kmod-sfp kmod-usb3 mt7988-wo-firmware
|
2024-04-19 16:51:51 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += smartrg_sdg-8734
|
|
|
|
|
2023-11-20 07:18:00 +00:00
|
|
|
define Device/asus_rt-ax59u
|
|
|
|
DEVICE_VENDOR := ASUS
|
|
|
|
DEVICE_MODEL := RT-AX59U
|
|
|
|
DEVICE_DTS := mt7986a-asus-rt-ax59u
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
2023-11-20 07:18:00 +00:00
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += asus_rt-ax59u
|
|
|
|
|
2023-01-26 16:39:43 +00:00
|
|
|
define Device/asus_tuf-ax4200
|
|
|
|
DEVICE_VENDOR := ASUS
|
|
|
|
DEVICE_MODEL := TUF-AX4200
|
|
|
|
DEVICE_DTS := mt7986a-asus-tuf-ax4200
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTS_LOADADDR := 0x47000000
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
2023-01-26 16:39:43 +00:00
|
|
|
IMAGES := sysupgrade.bin
|
2023-04-04 00:08:32 +00:00
|
|
|
KERNEL := kernel-bin | lzma | \
|
2023-01-26 16:39:43 +00:00
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += asus_tuf-ax4200
|
|
|
|
|
2024-09-21 07:48:47 +00:00
|
|
|
define Device/arcadyan_mozart
|
|
|
|
DEVICE_VENDOR := Arcadyan
|
|
|
|
DEVICE_MODEL := Mozart
|
|
|
|
DEVICE_DTS := mt7988a-arcadyan-mozart
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTC_FLAGS := --pad 4096
|
|
|
|
DEVICE_DTS_LOADADDR := 0x45f00000
|
|
|
|
DEVICE_PACKAGES := kmod-hwmon-pwmfan e2fsprogs f2fsck mkf2fs kmod-mt7996-firmware
|
|
|
|
KERNEL_LOADADDR := 0x46000000
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := .itb
|
|
|
|
IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | pad-rootfs | append-metadata
|
|
|
|
ARTIFACTS := emmc-preloader.bin emmc-bl31-uboot.fip emmc-gpt.bin
|
|
|
|
ARTIFACT/emmc-gpt.bin := mt798x-gpt emmc
|
|
|
|
ARTIFACT/emmc-preloader.bin := mt7988-bl2 emmc-comb
|
|
|
|
ARTIFACT/emmc-bl31-uboot.fip := mt7988-bl31-uboot arcadyan_mozart
|
|
|
|
SUPPORTED_DEVICES += arcadyan,mozart
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += arcadyan_mozart
|
|
|
|
|
2023-09-16 01:02:35 +00:00
|
|
|
define Device/asus_tuf-ax6000
|
|
|
|
DEVICE_VENDOR := ASUS
|
|
|
|
DEVICE_MODEL := TUF-AX6000
|
|
|
|
DEVICE_DTS := mt7986a-asus-tuf-ax6000
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTS_LOADADDR := 0x47000000
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
2023-09-16 01:02:35 +00:00
|
|
|
IMAGES := sysupgrade.bin
|
|
|
|
KERNEL := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += asus_tuf-ax6000
|
|
|
|
|
2022-07-13 03:30:32 +00:00
|
|
|
define Device/bananapi_bpi-r3
|
|
|
|
DEVICE_VENDOR := Bananapi
|
|
|
|
DEVICE_MODEL := BPi-R3
|
|
|
|
DEVICE_DTS := mt7986a-bananapi-bpi-r3
|
|
|
|
DEVICE_DTS_CONFIG := config-mt7986a-bananapi-bpi-r3
|
2023-12-10 23:09:00 +00:00
|
|
|
DEVICE_DTS_OVERLAY:= mt7986a-bananapi-bpi-r3-emmc mt7986a-bananapi-bpi-r3-nand \
|
|
|
|
mt7986a-bananapi-bpi-r3-nor mt7986a-bananapi-bpi-r3-sd \
|
|
|
|
mt7986a-bananapi-bpi-r3-respeaker-2mics
|
2023-06-04 14:56:15 +00:00
|
|
|
DEVICE_DTS_DIR := $(DTS_DIR)/
|
2023-07-22 11:30:43 +00:00
|
|
|
DEVICE_DTS_LOADADDR := 0x43f00000
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-i2c-gpio kmod-mt7915e kmod-mt7986-firmware kmod-sfp kmod-usb3 \
|
2024-01-18 22:15:35 +00:00
|
|
|
e2fsprogs f2fsck mkf2fs mt7986-wo-firmware
|
2022-07-13 03:30:32 +00:00
|
|
|
IMAGES := sysupgrade.itb
|
2023-04-05 15:56:54 +00:00
|
|
|
KERNEL_LOADADDR := 0x44000000
|
2022-07-13 03:30:32 +00:00
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
ARTIFACTS := \
|
|
|
|
emmc-preloader.bin emmc-bl31-uboot.fip \
|
|
|
|
nor-preloader.bin nor-bl31-uboot.fip \
|
|
|
|
sdcard.img.gz \
|
|
|
|
snand-preloader.bin snand-bl31-uboot.fip
|
2023-04-25 15:06:20 +00:00
|
|
|
ARTIFACT/emmc-preloader.bin := mt7986-bl2 emmc-ddr4
|
|
|
|
ARTIFACT/emmc-bl31-uboot.fip := mt7986-bl31-uboot bananapi_bpi-r3-emmc
|
|
|
|
ARTIFACT/nor-preloader.bin := mt7986-bl2 nor-ddr4
|
|
|
|
ARTIFACT/nor-bl31-uboot.fip := mt7986-bl31-uboot bananapi_bpi-r3-nor
|
2024-01-18 22:15:35 +00:00
|
|
|
ARTIFACT/snand-preloader.bin := mt7986-bl2 spim-nand-ubi-ddr4
|
2023-04-25 15:06:20 +00:00
|
|
|
ARTIFACT/snand-bl31-uboot.fip := mt7986-bl31-uboot bananapi_bpi-r3-snand
|
2023-08-25 03:09:28 +00:00
|
|
|
ARTIFACT/sdcard.img.gz := mt798x-gpt sdmmc |\
|
2023-04-25 15:06:20 +00:00
|
|
|
pad-to 17k | mt7986-bl2 sdmmc-ddr4 |\
|
|
|
|
pad-to 6656k | mt7986-bl31-uboot bananapi_bpi-r3-sdmmc |\
|
2022-09-08 01:34:28 +00:00
|
|
|
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\
|
|
|
|
pad-to 12M | append-image-stage initramfs-recovery.itb | check-size 44m |\
|
|
|
|
) \
|
2024-01-18 22:15:35 +00:00
|
|
|
pad-to 44M | mt7986-bl2 spim-nand-ubi-ddr4 |\
|
2023-04-25 15:06:20 +00:00
|
|
|
pad-to 45M | mt7986-bl31-uboot bananapi_bpi-r3-snand |\
|
|
|
|
pad-to 49M | mt7986-bl2 nor-ddr4 |\
|
|
|
|
pad-to 50M | mt7986-bl31-uboot bananapi_bpi-r3-nor |\
|
|
|
|
pad-to 51M | mt7986-bl2 emmc-ddr4 |\
|
|
|
|
pad-to 52M | mt7986-bl31-uboot bananapi_bpi-r3-emmc |\
|
2023-08-25 03:09:28 +00:00
|
|
|
pad-to 56M | mt798x-gpt emmc |\
|
2022-09-08 01:34:28 +00:00
|
|
|
$(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),\
|
2023-05-26 09:26:49 +00:00
|
|
|
pad-to 64M | append-image squashfs-sysupgrade.itb | check-size |\
|
|
|
|
) \
|
|
|
|
gzip
|
2023-06-15 14:11:27 +00:00
|
|
|
ifeq ($(DUMP),)
|
2022-09-08 01:34:28 +00:00
|
|
|
IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
|
2023-06-15 14:11:27 +00:00
|
|
|
endif
|
2022-07-13 03:30:32 +00:00
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | pad-rootfs | append-metadata
|
2023-06-06 12:05:50 +00:00
|
|
|
DEVICE_DTC_FLAGS := --pad 4096
|
2024-01-18 22:15:35 +00:00
|
|
|
DEVICE_COMPAT_VERSION := 1.2
|
|
|
|
DEVICE_COMPAT_MESSAGE := SPI-NAND flash layout changes require bootloader update
|
2022-07-13 03:30:32 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += bananapi_bpi-r3
|
|
|
|
|
mediatek: filogic: add BananaPi BPi-R3 mini
Hardware specification
----------------------
SoC: MediaTek MT7986A 4x A53
Flash: 128MB SPI-NAND, 8GB eMMC
RAM: 2GB DDR4
Ethernet: 2x 2.5GbE (Airoha EN8811H)
WiFi: MediaTek MT7976C 2x2 2.4G + 3x3 5G
Interfaces:
* M.2 Key-M: PCIe 2.0 x2 for NVMe SSD
* M.2 Key-B: USB 3.0 with SIM slot
* front USB 2.0 port
LED: Power, Status, WLAN2G, WLAN5G, LTE, SSD
Button: Reset, internal boot switch
Fan: PWM-controlled 5V fan
Power: 12V Type-C PD
Installation instructions for eMMC
----------------------------------
0. Set boot switch to boot from SPI-NAND (assuming stock rom or immortalwrt
running there).
1. Write GPT partition table to eMMC
Move openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-gpt.bin to
the device /tmp using scp and write it to /dev/mmcblk0:
dd if=/tmp/openwrt-*-r3-mini-emmc-gpt.bin of=/dev/mmcblk0
2. Reboot (to reload partition table)
3. Write bootloader and OpenWrt images
Move files to the device /tmp using scp:
- openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin
- openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip
- openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
- openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
Write them to the appropriate partitions:
echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin of=/dev/mmcblk0boot0
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip of=/dev/mmcblk0p3
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb of=/dev/mmcblk0p4
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb of=/dev/mmcblk0p5
sync
4. Remove the device from power, set boot switch to eMMC and boot into
OpenWrt. The device will come up with IP 192.168.1.1 and assume the
Ethernet port closer to the USB-C power connector as LAN port.
5. If you like to have Ethernet support inside U-Boot (eg. to boot via
TFTP) you also need to write the PHY firmware to /dev/mmcblk0boot1:
echo 0 > /sys/block/mmcblk0boot1/force_ro
dd if=/lib/firmware/airoha/EthMD32.dm.bin of=/dev/mmcblk0boot1
dd if=/lib/firmware/airoha/EthMD32.DSP.bin bs=16384 seek=1 of=/dev/mmcblk0boot1
Installation instructions for NAND
----------------------------------
0. Set boot switch to boot from eMMC (assuming OpenWrt is installed there
by instructions above. Using stock rom or immortalwrt does NOT work!)
1. Write things to NAND
Move files to the device /tmp using scp:
- openwrt-*-bananapi_bpi-r3-mini-snand-preloader.bin
- openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
- openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
- openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
Write them to the appropriate locations:
mtd write /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-preloader.bin /dev/mtd0
ubidetach -m 1
ubiformat /dev/mtd1
ubiattach -m 1
volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip)
ubimkvol /dev/ubi0 -N fip -n 0 -s $volsize -t static
ubiupdatevol /dev/ubi0_0 /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
cd /lib/firmware/airoha
cat EthMD32.dm.bin EthMD32.DSP.bin > /tmp/en8811h-fw.bin
ubimkvol /dev/ubi0 -N en8811h-firmware -n 1 -s 147456 -t static
ubiupdatevol /dev/ubi0_1 /tmp/en8811h-fw.bin
ubimkvol /dev/ubi0 -n 2 -N ubootenv -s 126976
ubimkvol /dev/ubi0 -n 3 -N ubootenv2 -s 126976
volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb)
ubimkvol /dev/ubi0 -n 4 -N recovery -s $volsize
ubiupdatevol /dev/ubi0_4 /tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb)
ubimkvol /dev/ubi0 -n 4 -N recovery -s $volsize
ubiupdatevol /dev/ubi0_4 /tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
3. Remove the device from power, set boot switch to NAND, power up and
boot into OpenWrt.
Partially based on immortalwrt support for the R3 mini, big thanks for
doing the ground work!
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-01-26 17:28:01 +00:00
|
|
|
define Device/bananapi_bpi-r3-mini
|
|
|
|
DEVICE_VENDOR := Bananapi
|
|
|
|
DEVICE_MODEL := BPi-R3 Mini
|
|
|
|
DEVICE_DTS := mt7986a-bananapi-bpi-r3-mini
|
|
|
|
DEVICE_DTS_CONFIG := config-mt7986a-bananapi-bpi-r3-mini
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTS_LOADADDR := 0x43f00000
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-mt7915e kmod-mt7986-firmware kmod-phy-airoha-en8811h \
|
2024-02-17 01:23:34 +00:00
|
|
|
kmod-usb3 e2fsprogs f2fsck mkf2fs mt7986-wo-firmware
|
mediatek: filogic: add BananaPi BPi-R3 mini
Hardware specification
----------------------
SoC: MediaTek MT7986A 4x A53
Flash: 128MB SPI-NAND, 8GB eMMC
RAM: 2GB DDR4
Ethernet: 2x 2.5GbE (Airoha EN8811H)
WiFi: MediaTek MT7976C 2x2 2.4G + 3x3 5G
Interfaces:
* M.2 Key-M: PCIe 2.0 x2 for NVMe SSD
* M.2 Key-B: USB 3.0 with SIM slot
* front USB 2.0 port
LED: Power, Status, WLAN2G, WLAN5G, LTE, SSD
Button: Reset, internal boot switch
Fan: PWM-controlled 5V fan
Power: 12V Type-C PD
Installation instructions for eMMC
----------------------------------
0. Set boot switch to boot from SPI-NAND (assuming stock rom or immortalwrt
running there).
1. Write GPT partition table to eMMC
Move openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-gpt.bin to
the device /tmp using scp and write it to /dev/mmcblk0:
dd if=/tmp/openwrt-*-r3-mini-emmc-gpt.bin of=/dev/mmcblk0
2. Reboot (to reload partition table)
3. Write bootloader and OpenWrt images
Move files to the device /tmp using scp:
- openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin
- openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip
- openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
- openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
Write them to the appropriate partitions:
echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin of=/dev/mmcblk0boot0
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip of=/dev/mmcblk0p3
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb of=/dev/mmcblk0p4
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb of=/dev/mmcblk0p5
sync
4. Remove the device from power, set boot switch to eMMC and boot into
OpenWrt. The device will come up with IP 192.168.1.1 and assume the
Ethernet port closer to the USB-C power connector as LAN port.
5. If you like to have Ethernet support inside U-Boot (eg. to boot via
TFTP) you also need to write the PHY firmware to /dev/mmcblk0boot1:
echo 0 > /sys/block/mmcblk0boot1/force_ro
dd if=/lib/firmware/airoha/EthMD32.dm.bin of=/dev/mmcblk0boot1
dd if=/lib/firmware/airoha/EthMD32.DSP.bin bs=16384 seek=1 of=/dev/mmcblk0boot1
Installation instructions for NAND
----------------------------------
0. Set boot switch to boot from eMMC (assuming OpenWrt is installed there
by instructions above. Using stock rom or immortalwrt does NOT work!)
1. Write things to NAND
Move files to the device /tmp using scp:
- openwrt-*-bananapi_bpi-r3-mini-snand-preloader.bin
- openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
- openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
- openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
Write them to the appropriate locations:
mtd write /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-preloader.bin /dev/mtd0
ubidetach -m 1
ubiformat /dev/mtd1
ubiattach -m 1
volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip)
ubimkvol /dev/ubi0 -N fip -n 0 -s $volsize -t static
ubiupdatevol /dev/ubi0_0 /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
cd /lib/firmware/airoha
cat EthMD32.dm.bin EthMD32.DSP.bin > /tmp/en8811h-fw.bin
ubimkvol /dev/ubi0 -N en8811h-firmware -n 1 -s 147456 -t static
ubiupdatevol /dev/ubi0_1 /tmp/en8811h-fw.bin
ubimkvol /dev/ubi0 -n 2 -N ubootenv -s 126976
ubimkvol /dev/ubi0 -n 3 -N ubootenv2 -s 126976
volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb)
ubimkvol /dev/ubi0 -n 4 -N recovery -s $volsize
ubiupdatevol /dev/ubi0_4 /tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb)
ubimkvol /dev/ubi0 -n 4 -N recovery -s $volsize
ubiupdatevol /dev/ubi0_4 /tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
3. Remove the device from power, set boot switch to NAND, power up and
boot into OpenWrt.
Partially based on immortalwrt support for the R3 mini, big thanks for
doing the ground work!
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-01-26 17:28:01 +00:00
|
|
|
KERNEL_LOADADDR := 0x44000000
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGES := snand-factory.bin sysupgrade.itb
|
|
|
|
ifeq ($(DUMP),)
|
|
|
|
IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
|
|
|
|
endif
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | \
|
|
|
|
pad-rootfs | append-metadata
|
|
|
|
ARTIFACTS := \
|
|
|
|
emmc-gpt.bin emmc-preloader.bin emmc-bl31-uboot.fip \
|
2024-02-16 05:36:26 +00:00
|
|
|
snand-factory.bin snand-preloader.bin snand-bl31-uboot.fip
|
mediatek: filogic: add BananaPi BPi-R3 mini
Hardware specification
----------------------
SoC: MediaTek MT7986A 4x A53
Flash: 128MB SPI-NAND, 8GB eMMC
RAM: 2GB DDR4
Ethernet: 2x 2.5GbE (Airoha EN8811H)
WiFi: MediaTek MT7976C 2x2 2.4G + 3x3 5G
Interfaces:
* M.2 Key-M: PCIe 2.0 x2 for NVMe SSD
* M.2 Key-B: USB 3.0 with SIM slot
* front USB 2.0 port
LED: Power, Status, WLAN2G, WLAN5G, LTE, SSD
Button: Reset, internal boot switch
Fan: PWM-controlled 5V fan
Power: 12V Type-C PD
Installation instructions for eMMC
----------------------------------
0. Set boot switch to boot from SPI-NAND (assuming stock rom or immortalwrt
running there).
1. Write GPT partition table to eMMC
Move openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-gpt.bin to
the device /tmp using scp and write it to /dev/mmcblk0:
dd if=/tmp/openwrt-*-r3-mini-emmc-gpt.bin of=/dev/mmcblk0
2. Reboot (to reload partition table)
3. Write bootloader and OpenWrt images
Move files to the device /tmp using scp:
- openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin
- openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip
- openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
- openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
Write them to the appropriate partitions:
echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin of=/dev/mmcblk0boot0
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip of=/dev/mmcblk0p3
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb of=/dev/mmcblk0p4
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb of=/dev/mmcblk0p5
sync
4. Remove the device from power, set boot switch to eMMC and boot into
OpenWrt. The device will come up with IP 192.168.1.1 and assume the
Ethernet port closer to the USB-C power connector as LAN port.
5. If you like to have Ethernet support inside U-Boot (eg. to boot via
TFTP) you also need to write the PHY firmware to /dev/mmcblk0boot1:
echo 0 > /sys/block/mmcblk0boot1/force_ro
dd if=/lib/firmware/airoha/EthMD32.dm.bin of=/dev/mmcblk0boot1
dd if=/lib/firmware/airoha/EthMD32.DSP.bin bs=16384 seek=1 of=/dev/mmcblk0boot1
Installation instructions for NAND
----------------------------------
0. Set boot switch to boot from eMMC (assuming OpenWrt is installed there
by instructions above. Using stock rom or immortalwrt does NOT work!)
1. Write things to NAND
Move files to the device /tmp using scp:
- openwrt-*-bananapi_bpi-r3-mini-snand-preloader.bin
- openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
- openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
- openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
Write them to the appropriate locations:
mtd write /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-preloader.bin /dev/mtd0
ubidetach -m 1
ubiformat /dev/mtd1
ubiattach -m 1
volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip)
ubimkvol /dev/ubi0 -N fip -n 0 -s $volsize -t static
ubiupdatevol /dev/ubi0_0 /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
cd /lib/firmware/airoha
cat EthMD32.dm.bin EthMD32.DSP.bin > /tmp/en8811h-fw.bin
ubimkvol /dev/ubi0 -N en8811h-firmware -n 1 -s 147456 -t static
ubiupdatevol /dev/ubi0_1 /tmp/en8811h-fw.bin
ubimkvol /dev/ubi0 -n 2 -N ubootenv -s 126976
ubimkvol /dev/ubi0 -n 3 -N ubootenv2 -s 126976
volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb)
ubimkvol /dev/ubi0 -n 4 -N recovery -s $volsize
ubiupdatevol /dev/ubi0_4 /tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb)
ubimkvol /dev/ubi0 -n 4 -N recovery -s $volsize
ubiupdatevol /dev/ubi0_4 /tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
3. Remove the device from power, set boot switch to NAND, power up and
boot into OpenWrt.
Partially based on immortalwrt support for the R3 mini, big thanks for
doing the ground work!
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-01-26 17:28:01 +00:00
|
|
|
ARTIFACT/emmc-gpt.bin := mt798x-gpt emmc
|
|
|
|
ARTIFACT/emmc-preloader.bin := mt7986-bl2 emmc-ddr4
|
|
|
|
ARTIFACT/emmc-bl31-uboot.fip := mt7986-bl31-uboot bananapi_bpi-r3-mini-emmc
|
2024-02-16 05:36:26 +00:00
|
|
|
ARTIFACT/snand-factory.bin := mt7986-bl2 spim-nand-ubi-ddr4 | pad-to 256k | \
|
|
|
|
mt7986-bl2 spim-nand-ubi-ddr4 | pad-to 512k | \
|
|
|
|
mt7986-bl2 spim-nand-ubi-ddr4 | pad-to 768k | \
|
|
|
|
mt7986-bl2 spim-nand-ubi-ddr4 | pad-to 2048k | \
|
|
|
|
ubinize-image fit squashfs-sysupgrade.itb
|
mediatek: filogic: add BananaPi BPi-R3 mini
Hardware specification
----------------------
SoC: MediaTek MT7986A 4x A53
Flash: 128MB SPI-NAND, 8GB eMMC
RAM: 2GB DDR4
Ethernet: 2x 2.5GbE (Airoha EN8811H)
WiFi: MediaTek MT7976C 2x2 2.4G + 3x3 5G
Interfaces:
* M.2 Key-M: PCIe 2.0 x2 for NVMe SSD
* M.2 Key-B: USB 3.0 with SIM slot
* front USB 2.0 port
LED: Power, Status, WLAN2G, WLAN5G, LTE, SSD
Button: Reset, internal boot switch
Fan: PWM-controlled 5V fan
Power: 12V Type-C PD
Installation instructions for eMMC
----------------------------------
0. Set boot switch to boot from SPI-NAND (assuming stock rom or immortalwrt
running there).
1. Write GPT partition table to eMMC
Move openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-gpt.bin to
the device /tmp using scp and write it to /dev/mmcblk0:
dd if=/tmp/openwrt-*-r3-mini-emmc-gpt.bin of=/dev/mmcblk0
2. Reboot (to reload partition table)
3. Write bootloader and OpenWrt images
Move files to the device /tmp using scp:
- openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin
- openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip
- openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
- openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
Write them to the appropriate partitions:
echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin of=/dev/mmcblk0boot0
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip of=/dev/mmcblk0p3
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb of=/dev/mmcblk0p4
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb of=/dev/mmcblk0p5
sync
4. Remove the device from power, set boot switch to eMMC and boot into
OpenWrt. The device will come up with IP 192.168.1.1 and assume the
Ethernet port closer to the USB-C power connector as LAN port.
5. If you like to have Ethernet support inside U-Boot (eg. to boot via
TFTP) you also need to write the PHY firmware to /dev/mmcblk0boot1:
echo 0 > /sys/block/mmcblk0boot1/force_ro
dd if=/lib/firmware/airoha/EthMD32.dm.bin of=/dev/mmcblk0boot1
dd if=/lib/firmware/airoha/EthMD32.DSP.bin bs=16384 seek=1 of=/dev/mmcblk0boot1
Installation instructions for NAND
----------------------------------
0. Set boot switch to boot from eMMC (assuming OpenWrt is installed there
by instructions above. Using stock rom or immortalwrt does NOT work!)
1. Write things to NAND
Move files to the device /tmp using scp:
- openwrt-*-bananapi_bpi-r3-mini-snand-preloader.bin
- openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
- openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
- openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
Write them to the appropriate locations:
mtd write /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-preloader.bin /dev/mtd0
ubidetach -m 1
ubiformat /dev/mtd1
ubiattach -m 1
volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip)
ubimkvol /dev/ubi0 -N fip -n 0 -s $volsize -t static
ubiupdatevol /dev/ubi0_0 /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
cd /lib/firmware/airoha
cat EthMD32.dm.bin EthMD32.DSP.bin > /tmp/en8811h-fw.bin
ubimkvol /dev/ubi0 -N en8811h-firmware -n 1 -s 147456 -t static
ubiupdatevol /dev/ubi0_1 /tmp/en8811h-fw.bin
ubimkvol /dev/ubi0 -n 2 -N ubootenv -s 126976
ubimkvol /dev/ubi0 -n 3 -N ubootenv2 -s 126976
volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb)
ubimkvol /dev/ubi0 -n 4 -N recovery -s $volsize
ubiupdatevol /dev/ubi0_4 /tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb)
ubimkvol /dev/ubi0 -n 4 -N recovery -s $volsize
ubiupdatevol /dev/ubi0_4 /tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
3. Remove the device from power, set boot switch to NAND, power up and
boot into OpenWrt.
Partially based on immortalwrt support for the R3 mini, big thanks for
doing the ground work!
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-01-26 17:28:01 +00:00
|
|
|
ARTIFACT/snand-preloader.bin := mt7986-bl2 spim-nand-ubi-ddr4
|
|
|
|
ARTIFACT/snand-bl31-uboot.fip := mt7986-bl31-uboot bananapi_bpi-r3-mini-snand
|
|
|
|
UBINIZE_PARTS := fip=:$(STAGING_DIR_IMAGE)/mt7986_bananapi_bpi-r3-mini-snand-u-boot.fip
|
|
|
|
ifneq ($(CONFIG_PACKAGE_airoha-en8811h-firmware),)
|
|
|
|
UBINIZE_PARTS += en8811h-fw=:$(STAGING_DIR_IMAGE)/EthMD32.bin
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += bananapi_bpi-r3-mini
|
|
|
|
|
2024-04-30 08:50:51 +00:00
|
|
|
define Device/bananapi_bpi-r4-common
|
2023-07-23 11:38:15 +00:00
|
|
|
DEVICE_VENDOR := Bananapi
|
|
|
|
DEVICE_DTS_DIR := $(DTS_DIR)/
|
|
|
|
DEVICE_DTS_LOADADDR := 0x45f00000
|
|
|
|
DEVICE_DTS_OVERLAY:= mt7988a-bananapi-bpi-r4-emmc mt7988a-bananapi-bpi-r4-rtc mt7988a-bananapi-bpi-r4-sd mt7988a-bananapi-bpi-r4-wifi-mt7996a
|
|
|
|
DEVICE_DTC_FLAGS := --pad 4096
|
2024-09-29 18:17:23 +00:00
|
|
|
DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-i2c-mux-pca954x kmod-eeprom-at24 kmod-mt7996-firmware kmod-mt7996-233-firmware \
|
2024-10-23 12:38:55 +00:00
|
|
|
kmod-rtc-pcf8563 kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs mt7988-wo-firmware
|
2023-07-23 11:38:15 +00:00
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
KERNEL_LOADADDR := 0x46000000
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
ARTIFACTS := \
|
|
|
|
emmc-preloader.bin emmc-bl31-uboot.fip \
|
|
|
|
sdcard.img.gz \
|
|
|
|
snand-preloader.bin snand-bl31-uboot.fip
|
|
|
|
ARTIFACT/emmc-preloader.bin := mt7988-bl2 emmc-comb
|
2024-04-30 08:50:51 +00:00
|
|
|
ARTIFACT/emmc-bl31-uboot.fip := mt7988-bl31-uboot $$(DEVICE_NAME)-emmc
|
2023-07-23 11:38:15 +00:00
|
|
|
ARTIFACT/snand-preloader.bin := mt7988-bl2 spim-nand-ubi-comb
|
2024-04-30 08:50:51 +00:00
|
|
|
ARTIFACT/snand-bl31-uboot.fip := mt7988-bl31-uboot $$(DEVICE_NAME)-snand
|
2023-07-23 11:38:15 +00:00
|
|
|
ARTIFACT/sdcard.img.gz := mt798x-gpt sdmmc |\
|
|
|
|
pad-to 17k | mt7988-bl2 sdmmc-comb |\
|
2024-04-30 08:50:51 +00:00
|
|
|
pad-to 6656k | mt7988-bl31-uboot $$(DEVICE_NAME)-sdmmc |\
|
2023-07-23 11:38:15 +00:00
|
|
|
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\
|
|
|
|
pad-to 12M | append-image-stage initramfs-recovery.itb | check-size 44m |\
|
|
|
|
) \
|
|
|
|
pad-to 44M | mt7988-bl2 spim-nand-ubi-comb |\
|
2024-04-30 08:50:51 +00:00
|
|
|
pad-to 45M | mt7988-bl31-uboot $$(DEVICE_NAME)-snand |\
|
2023-07-23 11:38:15 +00:00
|
|
|
pad-to 51M | mt7988-bl2 emmc-comb |\
|
2024-04-30 08:50:51 +00:00
|
|
|
pad-to 52M | mt7988-bl31-uboot $$(DEVICE_NAME)-emmc |\
|
2023-07-23 11:38:15 +00:00
|
|
|
pad-to 56M | mt798x-gpt emmc |\
|
|
|
|
$(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),\
|
|
|
|
pad-to 64M | append-image squashfs-sysupgrade.itb | check-size |\
|
|
|
|
) \
|
|
|
|
gzip
|
|
|
|
IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | pad-rootfs | append-metadata
|
|
|
|
endef
|
2024-04-30 08:50:51 +00:00
|
|
|
|
|
|
|
define Device/bananapi_bpi-r4
|
|
|
|
DEVICE_MODEL := BPi-R4
|
|
|
|
DEVICE_DTS := mt7988a-bananapi-bpi-r4
|
|
|
|
DEVICE_DTS_CONFIG := config-mt7988a-bananapi-bpi-r4
|
|
|
|
$(call Device/bananapi_bpi-r4-common)
|
|
|
|
endef
|
2023-07-23 11:38:15 +00:00
|
|
|
TARGET_DEVICES += bananapi_bpi-r4
|
|
|
|
|
2024-04-30 08:50:51 +00:00
|
|
|
define Device/bananapi_bpi-r4-poe
|
|
|
|
DEVICE_MODEL := BPi-R4 2.5GE
|
|
|
|
DEVICE_DTS := mt7988a-bananapi-bpi-r4-poe
|
|
|
|
DEVICE_DTS_CONFIG := config-mt7988a-bananapi-bpi-r4-poe
|
|
|
|
$(call Device/bananapi_bpi-r4-common)
|
|
|
|
DEVICE_PACKAGES += mt7988-2p5g-phy-firmware
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += bananapi_bpi-r4-poe
|
|
|
|
|
2023-08-30 11:50:54 +00:00
|
|
|
define Device/cetron_ct3003
|
|
|
|
DEVICE_VENDOR := Cetron
|
|
|
|
DEVICE_MODEL := CT3003
|
|
|
|
DEVICE_DTS := mt7981b-cetron-ct3003
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-rfb
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
2023-08-30 11:50:54 +00:00
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
IMAGES += factory.bin
|
|
|
|
IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | cetron-header rd30 CT3003
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += cetron_ct3003
|
|
|
|
|
mediatek: add CMCC RAX3000M support
Hardware specification:
SoC: MediaTek MT7981B 2x A53
Flash: 64GB eMMC or 128 MB SPI-NAND
RAM: 512MB
Ethernet: 4x 10/100/1000 Mbps
Switch: MediaTek MT7531AE
WiFi: MediaTek MT7976C
Button: Reset, Mesh
Power: DC 12V 1A
- UART: 3.3v, 115200n8
--------------------------
| Layout |
| ----------------- |
| 4 | GND TX VCC RX | <= |
| ----------------- |
--------------------------
Gain SSH access:
1. Login into web interface, and download the configuration.
2. Enter fakeroot, decompress the configuration:
tar -zxf cfg_export_config_file.conf
3. Edit 'etc/config/dropbear', set 'enable' to '1'.
4. Edit 'etc/shadow', update (remove) root password:
'root::19523:0:99999:7:::'
5. Repack 'etc' directory:
tar -zcf cfg_export_config_file.conf etc/
* If you find an error about 'etc/wireless/mediatek/DBDC_card0.dat',
just ignore it.
6. Upload new configuration via web interface, now you can SSH to RAX3000M.
Check stroage type:
Check the label on the back of the device:
"CH EC CMIIT ID: xxxx" is eMMC version
"CH CMIIT ID: xxxx" is NAND version
eMMC Flash instructions:
1. SSH to RAX3000M, and backup everything, especially 'factory' part.
('data' partition can be ignored, it's useless.)
2. Write new GPT table:
dd if=openwrt-mediatek-filogic-cmcc_rax3000m-emmc-gpt.bin of=/dev/mmcblk0 bs=512 seek=0 count=34 conv=fsync
3. Erase and write new BL2:
echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=/dev/zero of=/dev/mmcblk0boot0 bs=512 count=8192 conv=fsync
dd if=openwrt-mediatek-filogic-cmcc_rax3000m-emmc-preloader.bin of=/dev/mmcblk0boot0 bs=512 conv=fsync
4. Erase and write new FIP:
dd if=/dev/zero of=/dev/mmcblk0 bs=512 seek=13312 count=8192 conv=fsync
dd if=openwrt-mediatek-filogic-cmcc_rax3000m-emmc-bl31-uboot.fip of=/dev/mmcblk0 bs=512 seek=13312 conv=fsync
5. Set static IP on your PC:
IP 192.168.1.254, GW 192.168.1.1
6. Serve OpenWrt initramfs image using TFTP server.
7. Cut off the power and re-engage, wait for TFTP recovery to complete.
8. After OpenWrt has booted, perform sysupgrade.
9. Additionally, if you want to have eMMC recovery boot feature:
(Don't worry! You will always have TFTP recovery boot feature.)
dd if=openwrt-mediatek-filogic-cmcc_rax3000m-initramfs-recovery.itb of=/dev/mmcblk0p4 bs=512 conv=fsync
NAND Flash instructions:
1. SSH to RAX3000M, and backup everything, especially 'Factory' part.
2. Erase and write new BL2:
mtd erase BL2
mtd write openwrt-mediatek-filogic-cmcc_rax3000m-nand-preloader.bin BL2
3. Erase and write new FIP:
mtd erase FIP
mtd write openwrt-mediatek-filogic-cmcc_rax3000m-nand-bl31-uboot.fip FIP
4. Set static IP on your PC:
IP 192.168.1.254, GW 192.168.1.1
5. Serve OpenWrt initramfs image using TFTP server.
6. Cut off the power and re-engage, wait for TFTP recovery to complete.
7. After OpenWrt has booted, erase UBI volumes:
ubidetach -p /dev/mtd0
ubiformat -y /dev/mtd0
ubiattach -p /dev/mtd0
8. Create new ubootenv volumes:
ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
9. Additionally, if you want to have NAND recovery boot feature:
(Don't worry! You will always have TFTP recovery boot feature.)
ubimkvol /dev/ubi0 -n 2 -N recovery -s 20MiB
ubiupdatevol /dev/ubi0_2 openwrt-mediatek-filogic-cmcc_rax3000m-initramfs-recovery.itb
10. Perform sysupgrade.
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-09-23 07:04:09 +00:00
|
|
|
define Device/cmcc_rax3000m
|
|
|
|
DEVICE_VENDOR := CMCC
|
|
|
|
DEVICE_MODEL := RAX3000M
|
|
|
|
DEVICE_DTS := mt7981b-cmcc-rax3000m
|
|
|
|
DEVICE_DTS_OVERLAY := mt7981b-cmcc-rax3000m-emmc mt7981b-cmcc-rax3000m-nand
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTC_FLAGS := --pad 4096
|
|
|
|
DEVICE_DTS_LOADADDR := 0x43f00000
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 \
|
mediatek: add CMCC RAX3000M support
Hardware specification:
SoC: MediaTek MT7981B 2x A53
Flash: 64GB eMMC or 128 MB SPI-NAND
RAM: 512MB
Ethernet: 4x 10/100/1000 Mbps
Switch: MediaTek MT7531AE
WiFi: MediaTek MT7976C
Button: Reset, Mesh
Power: DC 12V 1A
- UART: 3.3v, 115200n8
--------------------------
| Layout |
| ----------------- |
| 4 | GND TX VCC RX | <= |
| ----------------- |
--------------------------
Gain SSH access:
1. Login into web interface, and download the configuration.
2. Enter fakeroot, decompress the configuration:
tar -zxf cfg_export_config_file.conf
3. Edit 'etc/config/dropbear', set 'enable' to '1'.
4. Edit 'etc/shadow', update (remove) root password:
'root::19523:0:99999:7:::'
5. Repack 'etc' directory:
tar -zcf cfg_export_config_file.conf etc/
* If you find an error about 'etc/wireless/mediatek/DBDC_card0.dat',
just ignore it.
6. Upload new configuration via web interface, now you can SSH to RAX3000M.
Check stroage type:
Check the label on the back of the device:
"CH EC CMIIT ID: xxxx" is eMMC version
"CH CMIIT ID: xxxx" is NAND version
eMMC Flash instructions:
1. SSH to RAX3000M, and backup everything, especially 'factory' part.
('data' partition can be ignored, it's useless.)
2. Write new GPT table:
dd if=openwrt-mediatek-filogic-cmcc_rax3000m-emmc-gpt.bin of=/dev/mmcblk0 bs=512 seek=0 count=34 conv=fsync
3. Erase and write new BL2:
echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=/dev/zero of=/dev/mmcblk0boot0 bs=512 count=8192 conv=fsync
dd if=openwrt-mediatek-filogic-cmcc_rax3000m-emmc-preloader.bin of=/dev/mmcblk0boot0 bs=512 conv=fsync
4. Erase and write new FIP:
dd if=/dev/zero of=/dev/mmcblk0 bs=512 seek=13312 count=8192 conv=fsync
dd if=openwrt-mediatek-filogic-cmcc_rax3000m-emmc-bl31-uboot.fip of=/dev/mmcblk0 bs=512 seek=13312 conv=fsync
5. Set static IP on your PC:
IP 192.168.1.254, GW 192.168.1.1
6. Serve OpenWrt initramfs image using TFTP server.
7. Cut off the power and re-engage, wait for TFTP recovery to complete.
8. After OpenWrt has booted, perform sysupgrade.
9. Additionally, if you want to have eMMC recovery boot feature:
(Don't worry! You will always have TFTP recovery boot feature.)
dd if=openwrt-mediatek-filogic-cmcc_rax3000m-initramfs-recovery.itb of=/dev/mmcblk0p4 bs=512 conv=fsync
NAND Flash instructions:
1. SSH to RAX3000M, and backup everything, especially 'Factory' part.
2. Erase and write new BL2:
mtd erase BL2
mtd write openwrt-mediatek-filogic-cmcc_rax3000m-nand-preloader.bin BL2
3. Erase and write new FIP:
mtd erase FIP
mtd write openwrt-mediatek-filogic-cmcc_rax3000m-nand-bl31-uboot.fip FIP
4. Set static IP on your PC:
IP 192.168.1.254, GW 192.168.1.1
5. Serve OpenWrt initramfs image using TFTP server.
6. Cut off the power and re-engage, wait for TFTP recovery to complete.
7. After OpenWrt has booted, erase UBI volumes:
ubidetach -p /dev/mtd0
ubiformat -y /dev/mtd0
ubiattach -p /dev/mtd0
8. Create new ubootenv volumes:
ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
9. Additionally, if you want to have NAND recovery boot feature:
(Don't worry! You will always have TFTP recovery boot feature.)
ubimkvol /dev/ubi0 -n 2 -N recovery -s 20MiB
ubiupdatevol /dev/ubi0_2 openwrt-mediatek-filogic-cmcc_rax3000m-initramfs-recovery.itb
10. Perform sysupgrade.
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-09-23 07:04:09 +00:00
|
|
|
e2fsprogs f2fsck mkf2fs
|
|
|
|
KERNEL_LOADADDR := 0x44000000
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | \
|
|
|
|
pad-rootfs | append-metadata
|
|
|
|
ARTIFACTS := \
|
|
|
|
emmc-gpt.bin emmc-preloader.bin emmc-bl31-uboot.fip \
|
|
|
|
nand-preloader.bin nand-bl31-uboot.fip
|
|
|
|
ARTIFACT/emmc-gpt.bin := mt798x-gpt emmc
|
|
|
|
ARTIFACT/emmc-preloader.bin := mt7981-bl2 emmc-ddr4
|
|
|
|
ARTIFACT/emmc-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-emmc
|
|
|
|
ARTIFACT/nand-preloader.bin := mt7981-bl2 spim-nand-ddr4
|
|
|
|
ARTIFACT/nand-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-nand
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += cmcc_rax3000m
|
|
|
|
|
2023-11-10 18:50:38 +00:00
|
|
|
define Device/comfast_cf-e393ax
|
2024-07-10 16:48:39 +00:00
|
|
|
DEVICE_VENDOR := COMFAST
|
2023-11-10 18:50:38 +00:00
|
|
|
DEVICE_MODEL := CF-E393AX
|
|
|
|
DEVICE_DTS := mt7981a-comfast-cf-e393ax
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTC_FLAGS := --pad 4096
|
|
|
|
DEVICE_DTS_LOADADDR := 0x43f00000
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
2023-11-10 18:50:38 +00:00
|
|
|
KERNEL_LOADADDR := 0x44000000
|
|
|
|
KERNEL = kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
|
|
|
KERNEL_INITRAMFS = kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGES := sysupgrade.bin factory.bin
|
|
|
|
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += comfast_cf-e393ax
|
|
|
|
|
2023-11-22 19:13:04 +00:00
|
|
|
define Device/confiabits_mt7981
|
|
|
|
DEVICE_VENDOR := Confiabits
|
|
|
|
DEVICE_MODEL := MT7981
|
|
|
|
DEVICE_DTS := mt7981b-confiabits-mt7981
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-2500wan-gmac2-rfb
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
2023-11-22 19:13:04 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += confiabits_mt7981
|
|
|
|
|
2024-08-04 20:47:47 +00:00
|
|
|
define Device/cudy_ap3000outdoor-v1
|
|
|
|
DEVICE_VENDOR := Cudy
|
|
|
|
DEVICE_MODEL := AP3000 Outdoor
|
|
|
|
DEVICE_VARIANT := v1
|
|
|
|
DEVICE_DTS := mt7981b-cudy-ap3000outdoor-v1
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
SUPPORTED_DEVICES += R51
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += cudy_ap3000outdoor-v1
|
|
|
|
|
2024-01-12 15:10:40 +00:00
|
|
|
define Device/cudy_m3000-v1
|
|
|
|
DEVICE_VENDOR := Cudy
|
|
|
|
DEVICE_MODEL := M3000
|
|
|
|
DEVICE_VARIANT := v1
|
|
|
|
DEVICE_DTS := mt7981b-cudy-m3000-v1
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
SUPPORTED_DEVICES += R37
|
|
|
|
DEVICE_DTS_LOADADDR := 0x44000000
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
KERNEL := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGES := sysupgrade.bin
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
2024-01-12 15:10:40 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += cudy_m3000-v1
|
|
|
|
|
2024-02-16 13:04:40 +00:00
|
|
|
define Device/cudy_re3000-v1
|
|
|
|
DEVICE_VENDOR := Cudy
|
|
|
|
DEVICE_MODEL := RE3000
|
|
|
|
DEVICE_VARIANT := v1
|
|
|
|
DEVICE_DTS := mt7981b-cudy-re3000-v1
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTS_LOADADDR := 0x47000000
|
|
|
|
IMAGES := sysupgrade.bin
|
|
|
|
IMAGE_SIZE := 15424k
|
|
|
|
SUPPORTED_DEVICES += R36
|
|
|
|
KERNEL := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | check-size | append-metadata
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
2024-02-16 13:04:40 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += cudy_re3000-v1
|
|
|
|
|
mediatek: add support for Cudy TR3000 v1
Hardware:
- SoC: MediaTek MT7981B
- CPU: 2x 1.3 GHz Cortex-A53
- Flash: 128 MiB SPI NAND
- RAM: 512 MiB
- WLAN: 2.4 GHz, 5 GHz (MediaTek MT7976CN, 802.11ax)
- Ethernet: 1x 10/100/1000/2500 Mbps RTL8221B WAN, 1x10/100/1000 Mbps MT7981 LAN
- USB 3.0 port
- Buttons: 1 Reset button, 1 slider button
- LEDs: 1x Red, 1x White
- Serial console: internal test points, 115200 8n1
- Power: 5 VDC, 3 A
MAC addresses:
+---------+-------------------+-----------+
| | MAC | Algorithm |
+---------+-------------------+-----------+
| WAN | 80:af:ca:xx:xx:x1 | label+1 |
| LAN | 80:af:ca:xx:xx:x0 | label |
| WLAN 2g | 80:af:ca:xx:xx:x0 | label |
| WLAN 5g | 82:af:ca:xx:xx:x0 | |
+---------+-------------------+-----------+
Installation:
The installation must be done via TFTP by disassembling the router. On other occasions Cudy has distributed intermediate firmware to make installation easier, and so I recommend checking the Wiki for this device if there is a more convenient solution than the one below.
To install using TFTP:
1. Connect to UART.
2. With the router off, press the RESET button. While the router is turning on, the button should continue to be pressed for at least 5 seconds.
3. A u-boot shell will automatically open.
4. Connect to LAN and set your IP to 192.168.1.88/24. Configure a TFTP server and an OpenWrt initramfs-kernel.bin firmware file.
5. Run these steps in u-boot using the name of your file.
setenv bootfile initramfs-kernel.bin
tftpboot
bootm
6. If you can reach LuCI or SSH now, just use the sysupgrade image with the 'Keep settings' option turned off.
Signed-off-by: Luis Mita <luis@luismita.com>
2024-05-07 15:48:37 +00:00
|
|
|
define Device/cudy_tr3000-v1
|
|
|
|
DEVICE_VENDOR := Cudy
|
|
|
|
DEVICE_MODEL := TR3000
|
|
|
|
DEVICE_VARIANT := v1
|
|
|
|
DEVICE_DTS := mt7981b-cudy-tr3000-v1
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
SUPPORTED_DEVICES += R47
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
mediatek: add support for Cudy TR3000 v1
Hardware:
- SoC: MediaTek MT7981B
- CPU: 2x 1.3 GHz Cortex-A53
- Flash: 128 MiB SPI NAND
- RAM: 512 MiB
- WLAN: 2.4 GHz, 5 GHz (MediaTek MT7976CN, 802.11ax)
- Ethernet: 1x 10/100/1000/2500 Mbps RTL8221B WAN, 1x10/100/1000 Mbps MT7981 LAN
- USB 3.0 port
- Buttons: 1 Reset button, 1 slider button
- LEDs: 1x Red, 1x White
- Serial console: internal test points, 115200 8n1
- Power: 5 VDC, 3 A
MAC addresses:
+---------+-------------------+-----------+
| | MAC | Algorithm |
+---------+-------------------+-----------+
| WAN | 80:af:ca:xx:xx:x1 | label+1 |
| LAN | 80:af:ca:xx:xx:x0 | label |
| WLAN 2g | 80:af:ca:xx:xx:x0 | label |
| WLAN 5g | 82:af:ca:xx:xx:x0 | |
+---------+-------------------+-----------+
Installation:
The installation must be done via TFTP by disassembling the router. On other occasions Cudy has distributed intermediate firmware to make installation easier, and so I recommend checking the Wiki for this device if there is a more convenient solution than the one below.
To install using TFTP:
1. Connect to UART.
2. With the router off, press the RESET button. While the router is turning on, the button should continue to be pressed for at least 5 seconds.
3. A u-boot shell will automatically open.
4. Connect to LAN and set your IP to 192.168.1.88/24. Configure a TFTP server and an OpenWrt initramfs-kernel.bin firmware file.
5. Run these steps in u-boot using the name of your file.
setenv bootfile initramfs-kernel.bin
tftpboot
bootm
6. If you can reach LuCI or SSH now, just use the sysupgrade image with the 'Keep settings' option turned off.
Signed-off-by: Luis Mita <luis@luismita.com>
2024-05-07 15:48:37 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += cudy_tr3000-v1
|
|
|
|
|
2023-05-17 13:55:42 +00:00
|
|
|
define Device/cudy_wr3000-v1
|
|
|
|
DEVICE_VENDOR := Cudy
|
|
|
|
DEVICE_MODEL := WR3000
|
|
|
|
DEVICE_VARIANT := v1
|
|
|
|
DEVICE_DTS := mt7981b-cudy-wr3000-v1
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTS_LOADADDR := 0x47000000
|
|
|
|
IMAGES := sysupgrade.bin
|
|
|
|
IMAGE_SIZE := 15424k
|
|
|
|
SUPPORTED_DEVICES += R31
|
|
|
|
KERNEL := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | check-size | append-metadata
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
2023-05-17 13:55:42 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += cudy_wr3000-v1
|
|
|
|
|
2024-11-13 10:20:27 +00:00
|
|
|
define Device/cudy_wr3000s-v1
|
|
|
|
DEVICE_VENDOR := Cudy
|
|
|
|
DEVICE_MODEL := WR3000S
|
|
|
|
DEVICE_VARIANT := v1
|
|
|
|
DEVICE_DTS := mt7981b-cudy-wr3000s-v1
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
SUPPORTED_DEVICES += R59
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += cudy_wr3000s-v1
|
|
|
|
|
filogic: Add support for D-Link AQUILA PRO AI M30
Specification:
- MT7981 CPU using 2.4GHz and 5GHz WiFi (both AX)
- MT7531 switch
- 512MB RAM
- 128MB NAND flash with two UBI partitions with identical size
- 1 multi color LED (red, green, blue, white) connected via GCA230718
- 3 buttons (WPS, reset, LED on/off)
- 1 1Gbit WAN port
- 4 1Gbit LAN ports
Disassembly:
- There are four screws at the bottom: 2 under the rubber feets, 2 under the label.
- After removing the screws, the white plastic part can be shifted out of the blue part.
- Be careful because the antennas are mounted on the side and the top of the white part.
Serial Interface
- The serial interface can be connected to the 4 pin holes on the side of the board.
- Pins (from front to rear):
- 3.3V
- RX
- TX
- GND
- Settings: 115200, 8N1
MAC addresses:
- WAN MAC is stored in partition "Odm" at offset 0x81
- LAN (as printed on the device) is WAN MAC + 1
- WLAN MAC (2.4 GHz) is WAN MAC + 2
- WLAN MAC (5GHz) is WAN MAC + 3
Flashing via Recovery Web Interface:
- The recovery web interface always flashes to the currently active partition.
- If OpenWrt is flahsed to the second partition, it will not boot.
- Ensure that you have an OEM image available (encrypted and decrypted version). Decryption is described in the end.
- Set your IP address to 192.168.200.10, subnetmask 255.255.255.0
- Press the reset button while powering on the device
- Keep the reset button pressed until the LED blinks red
- Open a Chromium based and goto http://192.168.200.1 (recovery web interface)
- Download openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-squashfs-recovery.bin
- The recovery web interface always reports successful flashing, even if it fails
- After flashing, the recovery web interface will try to forward the browser to 192.168.0.1 (can be ignored)
- If OpenWrt was flashed to the first partition, OpenWrt will boot (The status LED will start blinking white and stay white in the end). In this case you're done and can use OpenWrt.
- If OpenWrt was flashed to the second partition, OpenWrt won't boot (The status LED will stay red forever). In this case, the following steps are reuqired:
- Start the web recovery interface again and flash the **decrypted OEM image**. This will be flashed to the second partition as well. The OEM firmware web interface is afterwards accessible via http://192.168.200.1.
- Now flash the **encrypted OEM image** via OEM firmware web interface. In this case, the new firmware is flashed to the first partition. After flashing and the following reboot, the OEM firmware web interface should still be accessible via http://192.168.200.1.
- Start the web recovery interface again and flash the OpenWrt recovery image. Now it will be flashed to the first partition, OpenWrt will boot correctly afterwards and is accessible via 192.168.1.1.
Flashing via U-Boot:
- Open the case, connect to the UART console
- Set your IP address to 192.168.200.2, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
- Run a tftp server which provides openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-initramfs-kernel.bin.
- Power on the device and select "7. Load image" in the U-Boot menu
- Enter image file, tftp server IP and device IP (if they differ from the default).
- TFTP download to RAM will start. After a few seconds OpenWrt initramfs should start
- The initramfs is accessible via 192.168.1.1, change your IP address accordingly (or use multiple IP addresses on your interface)
- Perform a sysupgrade using openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-squashfs-sysupgrade.bin
- Reboot the device. OpenWrt should start from flash now
Revert back to stock using the Recovery Web Interface:
- Set your IP address to 192.168.200.2, subnetmask 255.255.255.0
- Press the reset button while powering on the device
- Keep the reset button pressed until the LED blinks red
- Open a Chromium based and goto http://192.168.200.1 (recovery web interface)
- Flash a decrypted firmware image from D-Link. Decrypting an firmware image is described below.
Decrypting a D-Link firmware image:
- Download https://github.com/RolandoMagico/firmware-utils/blob/M32/src/m32-firmware-util.c
- Compile a binary from the downloaded file, e.g. gcc m32-firmware-util.c -lcrypto -o m32-firmware-util
- Run ./m32-firmware-util M30 --DecryptFactoryImage <OriginalFirmware> <OutputFile>
- Example for firmware M30A1_FW101B05: ./m32-firmware-util M30 --DecryptFactoryImage M30A1_FW101B05\(0725091522\).bin M30A1_FW101B05\(0725091522\)_decrypted.bin
Flashing via OEM web interface is not possible, as it will change the active partition and OpenWrt is only running on the first UBI partition.
Controlling the LEDs:
- The LEDs are controlled by a chip called "GCA230718" which is connected to the main CPU via I2C (address 0x40)
- I didn't find any documentation or driver for it, so the information below is purely based on my investigations
- If there is already I driver for it, please tell me. Maybe I didn't search enough
- I implemented a kernel module (leds-gca230718) to access the LEDs via DTS
- The LED controller supports PWM for brightness control and ramp control for smooth blinking. This is not implemented in the driver
- The LED controller supports toggling (on -> off -> on -> off) where the brightness of the LEDs can be set individually for each on cycle
- Until now, only simple active/inactive control is implemented (like when the LEDs would have been connected via GPIO)
- Controlling the LEDs requires three sequences sent to the chip. Each sequence consists of
- A reset command (0x81 0xE4) written to register 0x00
- A control command (for example 0x0C 0x02 0x01 0x00 0x00 0x00 0xFF 0x01 0x00 0x00 0x00 0xFF 0x87 written to register 0x03)
- The reset command is always the same
- In the control command
- byte 0 is always the same
- byte 1 (0x02 in the example above) must be changed in every sequence: 0x02 -> 0x01 -> 0x03)
- byte 2 is set to 0x01 which disables toggling. 0x02 would be LED toggling without ramp control, 0x03 would be toggling with ramp control
- byte 3 to 6 define the brightness values for the LEDs (R,G,B,W) for the first on cycle when toggling
- byte 7 defines the toggling frequency (if toggling enabled)
- byte 8 to 11 define the brightness values for the LEDs (R,G,B,W) for the second on cycle when toggling
- byte 12 is constant 0x87
Comparison to M32/R32:
- The algorithms for decrypting the OEM firmware are the same for M30/M32/R32, only the keys differ
- The keys are available in the GPL sources for the M32
- The M32/R32 contained raw data in the firmware images (kernel, rootfs), the R30 uses a sysupgrade tar instead
- Creation of the recovery image is quite similar, only the header start string changes. So mostly takeover from M32/R32 for that.
- Turned out that the bytes at offset 0x0E and 0x0F in the recovery image header are the checksum over the data area
- This checksum was not checked in the recovery web interface of M32/R32 devices, but is now active in R30
- I adapted the recovery image creation to also calculate the checksum over the data area
- The recovery image header for M30 contains addresses which don't match the memory layout in the DTS. The same addresses are also present in the OEM images
- The recovery web interface either calculates the correct addresses from it or has it's own logic to determine where which information must be written
Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
2023-12-24 13:42:23 +00:00
|
|
|
define Device/dlink_aquila-pro-ai-m30-a1
|
|
|
|
DEVICE_VENDOR := D-Link
|
|
|
|
DEVICE_MODEL := AQUILA PRO AI M30
|
|
|
|
DEVICE_VARIANT := A1
|
|
|
|
DEVICE_DTS := mt7981b-dlink-aquila-pro-ai-m30-a1
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-leds-gca230718 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
filogic: Add support for D-Link AQUILA PRO AI M30
Specification:
- MT7981 CPU using 2.4GHz and 5GHz WiFi (both AX)
- MT7531 switch
- 512MB RAM
- 128MB NAND flash with two UBI partitions with identical size
- 1 multi color LED (red, green, blue, white) connected via GCA230718
- 3 buttons (WPS, reset, LED on/off)
- 1 1Gbit WAN port
- 4 1Gbit LAN ports
Disassembly:
- There are four screws at the bottom: 2 under the rubber feets, 2 under the label.
- After removing the screws, the white plastic part can be shifted out of the blue part.
- Be careful because the antennas are mounted on the side and the top of the white part.
Serial Interface
- The serial interface can be connected to the 4 pin holes on the side of the board.
- Pins (from front to rear):
- 3.3V
- RX
- TX
- GND
- Settings: 115200, 8N1
MAC addresses:
- WAN MAC is stored in partition "Odm" at offset 0x81
- LAN (as printed on the device) is WAN MAC + 1
- WLAN MAC (2.4 GHz) is WAN MAC + 2
- WLAN MAC (5GHz) is WAN MAC + 3
Flashing via Recovery Web Interface:
- The recovery web interface always flashes to the currently active partition.
- If OpenWrt is flahsed to the second partition, it will not boot.
- Ensure that you have an OEM image available (encrypted and decrypted version). Decryption is described in the end.
- Set your IP address to 192.168.200.10, subnetmask 255.255.255.0
- Press the reset button while powering on the device
- Keep the reset button pressed until the LED blinks red
- Open a Chromium based and goto http://192.168.200.1 (recovery web interface)
- Download openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-squashfs-recovery.bin
- The recovery web interface always reports successful flashing, even if it fails
- After flashing, the recovery web interface will try to forward the browser to 192.168.0.1 (can be ignored)
- If OpenWrt was flashed to the first partition, OpenWrt will boot (The status LED will start blinking white and stay white in the end). In this case you're done and can use OpenWrt.
- If OpenWrt was flashed to the second partition, OpenWrt won't boot (The status LED will stay red forever). In this case, the following steps are reuqired:
- Start the web recovery interface again and flash the **decrypted OEM image**. This will be flashed to the second partition as well. The OEM firmware web interface is afterwards accessible via http://192.168.200.1.
- Now flash the **encrypted OEM image** via OEM firmware web interface. In this case, the new firmware is flashed to the first partition. After flashing and the following reboot, the OEM firmware web interface should still be accessible via http://192.168.200.1.
- Start the web recovery interface again and flash the OpenWrt recovery image. Now it will be flashed to the first partition, OpenWrt will boot correctly afterwards and is accessible via 192.168.1.1.
Flashing via U-Boot:
- Open the case, connect to the UART console
- Set your IP address to 192.168.200.2, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
- Run a tftp server which provides openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-initramfs-kernel.bin.
- Power on the device and select "7. Load image" in the U-Boot menu
- Enter image file, tftp server IP and device IP (if they differ from the default).
- TFTP download to RAM will start. After a few seconds OpenWrt initramfs should start
- The initramfs is accessible via 192.168.1.1, change your IP address accordingly (or use multiple IP addresses on your interface)
- Perform a sysupgrade using openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-squashfs-sysupgrade.bin
- Reboot the device. OpenWrt should start from flash now
Revert back to stock using the Recovery Web Interface:
- Set your IP address to 192.168.200.2, subnetmask 255.255.255.0
- Press the reset button while powering on the device
- Keep the reset button pressed until the LED blinks red
- Open a Chromium based and goto http://192.168.200.1 (recovery web interface)
- Flash a decrypted firmware image from D-Link. Decrypting an firmware image is described below.
Decrypting a D-Link firmware image:
- Download https://github.com/RolandoMagico/firmware-utils/blob/M32/src/m32-firmware-util.c
- Compile a binary from the downloaded file, e.g. gcc m32-firmware-util.c -lcrypto -o m32-firmware-util
- Run ./m32-firmware-util M30 --DecryptFactoryImage <OriginalFirmware> <OutputFile>
- Example for firmware M30A1_FW101B05: ./m32-firmware-util M30 --DecryptFactoryImage M30A1_FW101B05\(0725091522\).bin M30A1_FW101B05\(0725091522\)_decrypted.bin
Flashing via OEM web interface is not possible, as it will change the active partition and OpenWrt is only running on the first UBI partition.
Controlling the LEDs:
- The LEDs are controlled by a chip called "GCA230718" which is connected to the main CPU via I2C (address 0x40)
- I didn't find any documentation or driver for it, so the information below is purely based on my investigations
- If there is already I driver for it, please tell me. Maybe I didn't search enough
- I implemented a kernel module (leds-gca230718) to access the LEDs via DTS
- The LED controller supports PWM for brightness control and ramp control for smooth blinking. This is not implemented in the driver
- The LED controller supports toggling (on -> off -> on -> off) where the brightness of the LEDs can be set individually for each on cycle
- Until now, only simple active/inactive control is implemented (like when the LEDs would have been connected via GPIO)
- Controlling the LEDs requires three sequences sent to the chip. Each sequence consists of
- A reset command (0x81 0xE4) written to register 0x00
- A control command (for example 0x0C 0x02 0x01 0x00 0x00 0x00 0xFF 0x01 0x00 0x00 0x00 0xFF 0x87 written to register 0x03)
- The reset command is always the same
- In the control command
- byte 0 is always the same
- byte 1 (0x02 in the example above) must be changed in every sequence: 0x02 -> 0x01 -> 0x03)
- byte 2 is set to 0x01 which disables toggling. 0x02 would be LED toggling without ramp control, 0x03 would be toggling with ramp control
- byte 3 to 6 define the brightness values for the LEDs (R,G,B,W) for the first on cycle when toggling
- byte 7 defines the toggling frequency (if toggling enabled)
- byte 8 to 11 define the brightness values for the LEDs (R,G,B,W) for the second on cycle when toggling
- byte 12 is constant 0x87
Comparison to M32/R32:
- The algorithms for decrypting the OEM firmware are the same for M30/M32/R32, only the keys differ
- The keys are available in the GPL sources for the M32
- The M32/R32 contained raw data in the firmware images (kernel, rootfs), the R30 uses a sysupgrade tar instead
- Creation of the recovery image is quite similar, only the header start string changes. So mostly takeover from M32/R32 for that.
- Turned out that the bytes at offset 0x0E and 0x0F in the recovery image header are the checksum over the data area
- This checksum was not checked in the recovery web interface of M32/R32 devices, but is now active in R30
- I adapted the recovery image creation to also calculate the checksum over the data area
- The recovery image header for M30 contains addresses which don't match the memory layout in the DTS. The same addresses are also present in the OEM images
- The recovery web interface either calculates the correct addresses from it or has it's own logic to determine where which information must be written
Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
2023-12-24 13:42:23 +00:00
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGES += recovery.bin
|
|
|
|
IMAGE_SIZE := 51200k
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
IMAGE/recovery.bin := sysupgrade-tar | pad-to $$(IMAGE_SIZE) | dlink-ai-recovery-header DLK6E6110001 \x6A\x28\xEE\x0B \x00\x00\x2C\x00 \x00\x00\x20\x03 \x61\x6E
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += dlink_aquila-pro-ai-m30-a1
|
|
|
|
|
2024-03-23 19:03:34 +00:00
|
|
|
define Device/edgecore_eap111
|
|
|
|
DEVICE_VENDOR := Edgecore
|
|
|
|
DEVICE_MODEL := EAP111
|
|
|
|
DEVICE_DTS := mt7981a-edgecore-eap111
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTS_LOADADDR := 0x47000000
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
IMAGES := sysupgrade.bin factory.bin
|
|
|
|
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
2024-03-23 19:03:34 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += edgecore_eap111
|
|
|
|
|
mediatek: filogic: add support for GatoNetworks GDSP
The GatoNetworks GDSP is a re-branded version of the R5000 5G Industrial
router from Yinghua Technologies.
The re-branded device comes with OpenWrt preinstalled, and an OpenWrt-based
U-Boot bootloader version. While the flash layout has been kept compatible
with the OpenWrt version found on the stock device (see [5]), the image format
changed, making a bootloader upgrade necessary.
Specifications:
SoC: Mediatek MT7981BA
RAM: 256MB
Flash: SPI-NOR 32 MiB (Winbond W25Q256)
WLAN: MT7976CN DBDC AX Wi-Fi
Switch: MT7531AE (4x LAN Gigabit ports, 1x WAN Gigabit port)
5G: Quectel RM520N modem
Watchdog: an external WDT connected to GPIO 6 is present and always running;
the built-in Mediatek watchdog is also present and effective, but
not used at the moment.
This porting has been tested only with 1x 5G modems installed (the device
supports up to two).
Installation:
Installation is possible via sysupgrade both in the stock device and
re-branded version. However, in the former case, updating the bootloader is
required.
OpenWrt-based U-Boot Bootloader installation
--------------------------------------------
The firmware flashed in the re-branded device at manifacturing time will
flash an OpenWrt-based U-Boot bootloader with some extra recovery features
(see [1]) at first boot.
To update the bootloader, you need to install the mtd-rw module and
insmod it:
insmod mtd-rw i_want_a_brick=1
Then update relevant flash partitions:
mtd erase u-boot-env
mtd erase BL2
mtd erase FIP
mtd write openwrt-mediatek-filogic-gatonetworks_gdsp-preloader.bin BL2
mtd write openwrt-mediatek-filogic-gatonetworks_gdsp-bl31-uboot.fip FIP
And reboot, making sure all previous commands ran succesfully.
If something goes wrong, you can recover your device via the mtk_uartboot
tool.
In my testing, it was possible to start the process even without (un)-plugging
the device, may be handy for remote recovery.
Installation from stock device and firmware
-------------------------------------------
To install vanilla OpenWrt in the stock device (R5000 5G Industrial router
from Yinghua Technologies) running the stock vendor firmware, you will need
to update your bootloader as described in previous section. Remember to use
-F (force upgrade) and -n (not keeping settings).
U-Boot Recovery
---------------
This procedure has been tested only with the OpenWrt-based U-boot bootloader.
Assign your system static IP address 192.168.1.1 and start a TFTP server. The
device will look for an initramfs image named
openwrt-mediatek-filogic-gatonetworks_gdsp-initramfs-kernel.bin
(so you may use openwrt/bin/targets/mediatek/filogic as root dir for your
TFTP server).
Power on the device while keeping the reset button pressed, until you see
a TFTP request from 192.168.1.10. Your environment will be restored to it's
default state.
MAC addresses assignment
------------------------
MAC addresses are assigned slightly differently than in stock firmware. In
particular, the 5 GHz Wi-Fi uses 2.4 GHZ MAC + 1, rather than reusing it with
LA bit set as done in stock firmware. This MAC address is allocated to the
device, so it can be used.
The 2.4 GHz Wi-Fi MAC address is the label MAC. LAN MAC is used to set the
special U-Boot environment ethaddr variable.
device MAC address U-Boot env variable factory partition offset
2.4 GHz Wi-Fi :84 wifi_mac 0x4
5.8 GHz Wi-Fi :85 not present not present
WAN :86 wan_mac 0x24
LAN :87 lan_mac 0x2A
Notes
-----
[1]: the OpenWrt-based U-Boot bootloader you will find installed in the
re-branded device is configured to request for the initramfs image via
TFTP for $gdsp_tftp_tries times before trying normal boot from NOR flash.
Setting this U-Boot environment variable to 0x0 will disable the feature,
which is not implemented in this patch.
[2]: the exposed UART port is connected to ttyS1; the ttyS0 console port is
not exposed.
[3]: the provided bootloader environment has no provision for operating on
BL2 and the FIP partitions. This is an intentional choice to make it
(slightly) more difficult to brick the device.
[4]: it seems GPIO 6 is used both for the "SYS" LED and external WDT.
[5] BL2 expects to find FIP payload at a fixed offset, so some constraints
apply.
Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
(cherry picked from commit b43194e041b17fbb574fb3721dafedcc30a20ab5)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-09 21:14:33 +00:00
|
|
|
define Device/gatonetworks_gdsp
|
|
|
|
DEVICE_VENDOR := GatoNetworks
|
|
|
|
DEVICE_MODEL := gdsp
|
|
|
|
DEVICE_DTS := mt7981b-gatonetworks-gdsp
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
IMAGE_SIZE := 32768k
|
|
|
|
DEVICE_PACKAGES := fitblk kmod-mt7915e kmod-mt7981-firmware \
|
|
|
|
kmod-usb-net-qmi-wwan kmod-usb-serial-option kmod-usb3 \
|
|
|
|
mt7981-wo-firmware -kmod-phy-aquantia
|
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := mt7981-bl2 nor-ddr3
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot gatonetworks_gdsp
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | pad-rootfs | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += gatonetworks_gdsp
|
|
|
|
|
2023-04-20 17:49:55 +00:00
|
|
|
define Device/glinet_gl-mt2500
|
|
|
|
DEVICE_VENDOR := GL.iNet
|
|
|
|
DEVICE_MODEL := GL-MT2500
|
|
|
|
DEVICE_DTS := mt7981b-glinet-gl-mt2500
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTS_LOADADDR := 0x47000000
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3
|
2023-04-20 17:49:55 +00:00
|
|
|
SUPPORTED_DEVICES += glinet,mt2500-emmc
|
|
|
|
IMAGES := sysupgrade.bin
|
2023-11-28 00:03:48 +00:00
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
|
2023-04-20 17:49:55 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += glinet_gl-mt2500
|
|
|
|
|
2023-03-11 03:56:35 +00:00
|
|
|
define Device/glinet_gl-mt3000
|
|
|
|
DEVICE_VENDOR := GL.iNet
|
|
|
|
DEVICE_MODEL := GL-MT3000
|
|
|
|
DEVICE_DTS := mt7981b-glinet-gl-mt3000
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
SUPPORTED_DEVICES += glinet,mt3000-snand
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-hwmon-pwmfan kmod-usb3
|
2023-03-11 03:56:35 +00:00
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 246272k
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += glinet_gl-mt3000
|
|
|
|
|
2023-09-24 14:34:12 +00:00
|
|
|
define Device/glinet_gl-mt6000
|
|
|
|
DEVICE_VENDOR := GL.iNet
|
|
|
|
DEVICE_MODEL := GL-MT6000
|
|
|
|
DEVICE_DTS := mt7986a-glinet-gl-mt6000
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := e2fsprogs f2fsck mkf2fs kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
2023-09-24 14:34:12 +00:00
|
|
|
IMAGES += factory.bin
|
|
|
|
IMAGE/factory.bin := append-kernel | pad-to 32M | append-rootfs
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
|
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := mt7986-bl2 emmc-ddr4
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot glinet_gl-mt6000
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += glinet_gl-mt6000
|
|
|
|
|
mediatek: Add support for GL.iNet X3000 (Spitz AX) and XE3000 (Puli AX)
The GL.iNet X3000 and XE3000 are Wi-Fi 6 5G cellular routers, based on
MediaTek MT7981A SoC. The XE3000 is the same device as the X3000,
except for an additional battery.
Specifications:
- SoC: Filogic 820 MT7981A (1.3GHz)
- RAM: DDR4 512M
- Flash: eMMC 8G, MicroSD card slot
- WiFi: 2.4GHz and 5GHz with 6 antennas
- Ethernet:
- 1x LAN (10/100/1000M)
- 1x WAN (10/100/1000/2500M)
- 5G: Quectel RM520N-GL with two nano-SIM card slots
- USB: 1x USB 2.0 port
- UART:
- 3.3V, TX, RX, GND / 115200 8N1
MAC addresses as verified by OEM firmware:
vendor OpenWrt address source
WAN eth0 label factory 0x0a (label)
LAN eth1 label + 1
2g phy0-ap0 label + 2 factory 0x04
5g phy1-ap0 label + 3
Installation via U-Boot rescue:
1. Press and hold reset button while booting the device
2. Wait for the Internet led to blink 5 times
3. Release reset button
4. The rescue page is accessible via http://192.168.1.1
5. Select the OpenWrt sysupgrade image and start upgrade
6. Wait for the router to flash new firmware and reboot
Revert to stock firmware:
1. Download the stock firmware from GL.iNet website
2. Use the method explained above to flash the stock firmware
Switch the modem network port between PCIe and USB interfaces:
1. Connect to the AT commands (/dev/ttyUSB2) port using
e.g. minicom: minicom -D /dev/ttyUSB2
2. Check the current modem mode with 'AT+QCFG="data_interface"':
- 0,0 indicates that the network port uses the USB interface
- 1,0 indicates that the network port uses the PCIe interface
3. Switch the active interface with:
- 'AT+QCFG="data_interface",0,0' to use the USB interface
- 'AT+QCFG="data_interface",1,0' to use the PCIe interface
4. Reboot
Signed-off-by: Jean Thomas <jean.thomas@wifirst.fr>
2023-11-09 10:28:45 +00:00
|
|
|
define Device/glinet_gl-x3000-xe3000-common
|
|
|
|
DEVICE_VENDOR := GL.iNet
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware mkf2fs \
|
mediatek: Add support for GL.iNet X3000 (Spitz AX) and XE3000 (Puli AX)
The GL.iNet X3000 and XE3000 are Wi-Fi 6 5G cellular routers, based on
MediaTek MT7981A SoC. The XE3000 is the same device as the X3000,
except for an additional battery.
Specifications:
- SoC: Filogic 820 MT7981A (1.3GHz)
- RAM: DDR4 512M
- Flash: eMMC 8G, MicroSD card slot
- WiFi: 2.4GHz and 5GHz with 6 antennas
- Ethernet:
- 1x LAN (10/100/1000M)
- 1x WAN (10/100/1000/2500M)
- 5G: Quectel RM520N-GL with two nano-SIM card slots
- USB: 1x USB 2.0 port
- UART:
- 3.3V, TX, RX, GND / 115200 8N1
MAC addresses as verified by OEM firmware:
vendor OpenWrt address source
WAN eth0 label factory 0x0a (label)
LAN eth1 label + 1
2g phy0-ap0 label + 2 factory 0x04
5g phy1-ap0 label + 3
Installation via U-Boot rescue:
1. Press and hold reset button while booting the device
2. Wait for the Internet led to blink 5 times
3. Release reset button
4. The rescue page is accessible via http://192.168.1.1
5. Select the OpenWrt sysupgrade image and start upgrade
6. Wait for the router to flash new firmware and reboot
Revert to stock firmware:
1. Download the stock firmware from GL.iNet website
2. Use the method explained above to flash the stock firmware
Switch the modem network port between PCIe and USB interfaces:
1. Connect to the AT commands (/dev/ttyUSB2) port using
e.g. minicom: minicom -D /dev/ttyUSB2
2. Check the current modem mode with 'AT+QCFG="data_interface"':
- 0,0 indicates that the network port uses the USB interface
- 1,0 indicates that the network port uses the PCIe interface
3. Switch the active interface with:
- 'AT+QCFG="data_interface",0,0' to use the USB interface
- 'AT+QCFG="data_interface",1,0' to use the PCIe interface
4. Reboot
Signed-off-by: Jean Thomas <jean.thomas@wifirst.fr>
2023-11-09 10:28:45 +00:00
|
|
|
kmod-fs-f2fs kmod-hwmon-pwmfan kmod-usb3 kmod-usb-serial-option \
|
|
|
|
kmod-usb-storage kmod-usb-net-qmi-wwan uqmi
|
2024-06-10 08:54:23 +00:00
|
|
|
IMAGES += factory.bin
|
|
|
|
IMAGE/factory.bin := append-kernel | pad-to 32M | append-rootfs
|
mediatek: Add support for GL.iNet X3000 (Spitz AX) and XE3000 (Puli AX)
The GL.iNet X3000 and XE3000 are Wi-Fi 6 5G cellular routers, based on
MediaTek MT7981A SoC. The XE3000 is the same device as the X3000,
except for an additional battery.
Specifications:
- SoC: Filogic 820 MT7981A (1.3GHz)
- RAM: DDR4 512M
- Flash: eMMC 8G, MicroSD card slot
- WiFi: 2.4GHz and 5GHz with 6 antennas
- Ethernet:
- 1x LAN (10/100/1000M)
- 1x WAN (10/100/1000/2500M)
- 5G: Quectel RM520N-GL with two nano-SIM card slots
- USB: 1x USB 2.0 port
- UART:
- 3.3V, TX, RX, GND / 115200 8N1
MAC addresses as verified by OEM firmware:
vendor OpenWrt address source
WAN eth0 label factory 0x0a (label)
LAN eth1 label + 1
2g phy0-ap0 label + 2 factory 0x04
5g phy1-ap0 label + 3
Installation via U-Boot rescue:
1. Press and hold reset button while booting the device
2. Wait for the Internet led to blink 5 times
3. Release reset button
4. The rescue page is accessible via http://192.168.1.1
5. Select the OpenWrt sysupgrade image and start upgrade
6. Wait for the router to flash new firmware and reboot
Revert to stock firmware:
1. Download the stock firmware from GL.iNet website
2. Use the method explained above to flash the stock firmware
Switch the modem network port between PCIe and USB interfaces:
1. Connect to the AT commands (/dev/ttyUSB2) port using
e.g. minicom: minicom -D /dev/ttyUSB2
2. Check the current modem mode with 'AT+QCFG="data_interface"':
- 0,0 indicates that the network port uses the USB interface
- 1,0 indicates that the network port uses the PCIe interface
3. Switch the active interface with:
- 'AT+QCFG="data_interface",0,0' to use the USB interface
- 'AT+QCFG="data_interface",1,0' to use the PCIe interface
4. Reboot
Signed-off-by: Jean Thomas <jean.thomas@wifirst.fr>
2023-11-09 10:28:45 +00:00
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
2024-06-10 08:54:23 +00:00
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := mt7981-bl2 emmc-ddr4
|
mediatek: Add support for GL.iNet X3000 (Spitz AX) and XE3000 (Puli AX)
The GL.iNet X3000 and XE3000 are Wi-Fi 6 5G cellular routers, based on
MediaTek MT7981A SoC. The XE3000 is the same device as the X3000,
except for an additional battery.
Specifications:
- SoC: Filogic 820 MT7981A (1.3GHz)
- RAM: DDR4 512M
- Flash: eMMC 8G, MicroSD card slot
- WiFi: 2.4GHz and 5GHz with 6 antennas
- Ethernet:
- 1x LAN (10/100/1000M)
- 1x WAN (10/100/1000/2500M)
- 5G: Quectel RM520N-GL with two nano-SIM card slots
- USB: 1x USB 2.0 port
- UART:
- 3.3V, TX, RX, GND / 115200 8N1
MAC addresses as verified by OEM firmware:
vendor OpenWrt address source
WAN eth0 label factory 0x0a (label)
LAN eth1 label + 1
2g phy0-ap0 label + 2 factory 0x04
5g phy1-ap0 label + 3
Installation via U-Boot rescue:
1. Press and hold reset button while booting the device
2. Wait for the Internet led to blink 5 times
3. Release reset button
4. The rescue page is accessible via http://192.168.1.1
5. Select the OpenWrt sysupgrade image and start upgrade
6. Wait for the router to flash new firmware and reboot
Revert to stock firmware:
1. Download the stock firmware from GL.iNet website
2. Use the method explained above to flash the stock firmware
Switch the modem network port between PCIe and USB interfaces:
1. Connect to the AT commands (/dev/ttyUSB2) port using
e.g. minicom: minicom -D /dev/ttyUSB2
2. Check the current modem mode with 'AT+QCFG="data_interface"':
- 0,0 indicates that the network port uses the USB interface
- 1,0 indicates that the network port uses the PCIe interface
3. Switch the active interface with:
- 'AT+QCFG="data_interface",0,0' to use the USB interface
- 'AT+QCFG="data_interface",1,0' to use the PCIe interface
4. Reboot
Signed-off-by: Jean Thomas <jean.thomas@wifirst.fr>
2023-11-09 10:28:45 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/glinet_gl-x3000
|
|
|
|
DEVICE_MODEL := GL-X3000
|
|
|
|
DEVICE_DTS := mt7981a-glinet-gl-x3000
|
|
|
|
SUPPORTED_DEVICES := glinet,gl-x3000
|
|
|
|
$(call Device/glinet_gl-x3000-xe3000-common)
|
2024-06-10 08:54:23 +00:00
|
|
|
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot glinet_gl-x3000
|
mediatek: Add support for GL.iNet X3000 (Spitz AX) and XE3000 (Puli AX)
The GL.iNet X3000 and XE3000 are Wi-Fi 6 5G cellular routers, based on
MediaTek MT7981A SoC. The XE3000 is the same device as the X3000,
except for an additional battery.
Specifications:
- SoC: Filogic 820 MT7981A (1.3GHz)
- RAM: DDR4 512M
- Flash: eMMC 8G, MicroSD card slot
- WiFi: 2.4GHz and 5GHz with 6 antennas
- Ethernet:
- 1x LAN (10/100/1000M)
- 1x WAN (10/100/1000/2500M)
- 5G: Quectel RM520N-GL with two nano-SIM card slots
- USB: 1x USB 2.0 port
- UART:
- 3.3V, TX, RX, GND / 115200 8N1
MAC addresses as verified by OEM firmware:
vendor OpenWrt address source
WAN eth0 label factory 0x0a (label)
LAN eth1 label + 1
2g phy0-ap0 label + 2 factory 0x04
5g phy1-ap0 label + 3
Installation via U-Boot rescue:
1. Press and hold reset button while booting the device
2. Wait for the Internet led to blink 5 times
3. Release reset button
4. The rescue page is accessible via http://192.168.1.1
5. Select the OpenWrt sysupgrade image and start upgrade
6. Wait for the router to flash new firmware and reboot
Revert to stock firmware:
1. Download the stock firmware from GL.iNet website
2. Use the method explained above to flash the stock firmware
Switch the modem network port between PCIe and USB interfaces:
1. Connect to the AT commands (/dev/ttyUSB2) port using
e.g. minicom: minicom -D /dev/ttyUSB2
2. Check the current modem mode with 'AT+QCFG="data_interface"':
- 0,0 indicates that the network port uses the USB interface
- 1,0 indicates that the network port uses the PCIe interface
3. Switch the active interface with:
- 'AT+QCFG="data_interface",0,0' to use the USB interface
- 'AT+QCFG="data_interface",1,0' to use the PCIe interface
4. Reboot
Signed-off-by: Jean Thomas <jean.thomas@wifirst.fr>
2023-11-09 10:28:45 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += glinet_gl-x3000
|
|
|
|
|
|
|
|
define Device/glinet_gl-xe3000
|
|
|
|
DEVICE_MODEL := GL-XE3000
|
|
|
|
DEVICE_DTS := mt7981a-glinet-gl-xe3000
|
|
|
|
SUPPORTED_DEVICES := glinet,gl-xe3000
|
|
|
|
$(call Device/glinet_gl-x3000-xe3000-common)
|
2024-06-10 08:54:23 +00:00
|
|
|
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot glinet_gl-xe3000
|
mediatek: Add support for GL.iNet X3000 (Spitz AX) and XE3000 (Puli AX)
The GL.iNet X3000 and XE3000 are Wi-Fi 6 5G cellular routers, based on
MediaTek MT7981A SoC. The XE3000 is the same device as the X3000,
except for an additional battery.
Specifications:
- SoC: Filogic 820 MT7981A (1.3GHz)
- RAM: DDR4 512M
- Flash: eMMC 8G, MicroSD card slot
- WiFi: 2.4GHz and 5GHz with 6 antennas
- Ethernet:
- 1x LAN (10/100/1000M)
- 1x WAN (10/100/1000/2500M)
- 5G: Quectel RM520N-GL with two nano-SIM card slots
- USB: 1x USB 2.0 port
- UART:
- 3.3V, TX, RX, GND / 115200 8N1
MAC addresses as verified by OEM firmware:
vendor OpenWrt address source
WAN eth0 label factory 0x0a (label)
LAN eth1 label + 1
2g phy0-ap0 label + 2 factory 0x04
5g phy1-ap0 label + 3
Installation via U-Boot rescue:
1. Press and hold reset button while booting the device
2. Wait for the Internet led to blink 5 times
3. Release reset button
4. The rescue page is accessible via http://192.168.1.1
5. Select the OpenWrt sysupgrade image and start upgrade
6. Wait for the router to flash new firmware and reboot
Revert to stock firmware:
1. Download the stock firmware from GL.iNet website
2. Use the method explained above to flash the stock firmware
Switch the modem network port between PCIe and USB interfaces:
1. Connect to the AT commands (/dev/ttyUSB2) port using
e.g. minicom: minicom -D /dev/ttyUSB2
2. Check the current modem mode with 'AT+QCFG="data_interface"':
- 0,0 indicates that the network port uses the USB interface
- 1,0 indicates that the network port uses the PCIe interface
3. Switch the active interface with:
- 'AT+QCFG="data_interface",0,0' to use the USB interface
- 'AT+QCFG="data_interface",1,0' to use the PCIe interface
4. Reboot
Signed-off-by: Jean Thomas <jean.thomas@wifirst.fr>
2023-11-09 10:28:45 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += glinet_gl-xe3000
|
|
|
|
|
2023-05-21 15:00:16 +00:00
|
|
|
define Device/h3c_magic-nx30-pro
|
|
|
|
DEVICE_VENDOR := H3C
|
|
|
|
DEVICE_MODEL := Magic NX30 Pro
|
|
|
|
DEVICE_DTS := mt7981b-h3c-magic-nx30-pro
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
2023-05-21 15:00:16 +00:00
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot h3c_magic-nx30-pro
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += h3c_magic-nx30-pro
|
|
|
|
|
mediatek: filogic: add JCG Q30 PRO support
Hardware specification:
SoC: MediaTek MT7981B 2x A53
Flash: Winbond 128MB
RAM: DDR3 256MB
Ethernet: 4x 10/100/1000 Mbps
Switch: MediaTek MT7531AE
WiFi: MediaTek MT7976C
Button: Reset
Power: DC 12V 1A
Flash instructions:
1. Connect to your PC via the Gigabit port of the router,
set a static ip on the ethernet interface of your PC.
(ip 192.168.1.254, gateway 192.168.1.1)
2. Attach UART, pause at u-boot menu.
3. Select "Upgrade ATF BL2", then use preloader.bin
4. Select "Upgrade ATF FIP", then use bl31-uboot.fip
5. Download the initramfs image, and type "reset",
waiting for tftp recovery to complete.
6. After openwrt boots up, perform sysupgrade.
Note:
1. Since NMBM is disabled, we must back up all partitions.
2. Although we can upgrade new firmware in the stock firmware,
we need the special fit image signature of MediaTek and
dual boot (hack kernel) to make u-boot boot it. So just
abandon these hacks and flash it via the serial port.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2023-06-16 15:16:30 +00:00
|
|
|
define Device/jcg_q30-pro
|
|
|
|
DEVICE_VENDOR := JCG
|
|
|
|
DEVICE_MODEL := Q30 PRO
|
|
|
|
DEVICE_DTS := mt7981b-jcg-q30-pro
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
mediatek: filogic: add JCG Q30 PRO support
Hardware specification:
SoC: MediaTek MT7981B 2x A53
Flash: Winbond 128MB
RAM: DDR3 256MB
Ethernet: 4x 10/100/1000 Mbps
Switch: MediaTek MT7531AE
WiFi: MediaTek MT7976C
Button: Reset
Power: DC 12V 1A
Flash instructions:
1. Connect to your PC via the Gigabit port of the router,
set a static ip on the ethernet interface of your PC.
(ip 192.168.1.254, gateway 192.168.1.1)
2. Attach UART, pause at u-boot menu.
3. Select "Upgrade ATF BL2", then use preloader.bin
4. Select "Upgrade ATF FIP", then use bl31-uboot.fip
5. Download the initramfs image, and type "reset",
waiting for tftp recovery to complete.
6. After openwrt boots up, perform sysupgrade.
Note:
1. Since NMBM is disabled, we must back up all partitions.
2. Although we can upgrade new firmware in the stock firmware,
we need the special fit image signature of MediaTek and
dual boot (hack kernel) to make u-boot boot it. So just
abandon these hacks and flash it via the serial port.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2023-06-16 15:16:30 +00:00
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot jcg_q30-pro
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += jcg_q30-pro
|
|
|
|
|
2023-11-01 06:46:15 +00:00
|
|
|
define Device/jdcloud_re-cp-03
|
|
|
|
DEVICE_VENDOR := JDCloud
|
|
|
|
DEVICE_MODEL := RE-CP-03
|
|
|
|
DEVICE_DTS := mt7986a-jdcloud-re-cp-03
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTC_FLAGS := --pad 4096
|
|
|
|
DEVICE_DTS_LOADADDR := 0x43f00000
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware \
|
2023-11-01 06:46:15 +00:00
|
|
|
e2fsprogs f2fsck mkf2fs
|
|
|
|
KERNEL_LOADADDR := 0x44000000
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | \
|
|
|
|
pad-rootfs | append-metadata
|
|
|
|
ARTIFACTS :=gpt.bin preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/gpt.bin := mt798x-gpt emmc
|
|
|
|
ARTIFACT/preloader.bin := mt7986-bl2 emmc-ddr4
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot jdcloud_re-cp-03
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += jdcloud_re-cp-03
|
|
|
|
|
2023-09-12 23:57:49 +00:00
|
|
|
define Device/mediatek_mt7981-rfb
|
|
|
|
DEVICE_VENDOR := MediaTek
|
|
|
|
DEVICE_MODEL := MT7981 rfb
|
|
|
|
DEVICE_DTS := mt7981-rfb
|
|
|
|
DEVICE_DTS_OVERLAY:= \
|
|
|
|
mt7981-rfb-spim-nand \
|
|
|
|
mt7981-rfb-mxl-2p5g-phy-eth1 \
|
|
|
|
mt7981-rfb-mxl-2p5g-phy-swp5
|
|
|
|
DEVICE_DTS_DIR := $(DTS_DIR)/
|
|
|
|
DEVICE_DTC_FLAGS := --pad 4096
|
|
|
|
DEVICE_DTS_LOADADDR := 0x43f00000
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware kmod-usb3 e2fsprogs f2fsck mkf2fs mt7981-wo-firmware
|
2023-09-12 23:57:49 +00:00
|
|
|
KERNEL_LOADADDR := 0x44000000
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := .itb
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | pad-rootfs | append-metadata
|
|
|
|
ARTIFACTS := \
|
|
|
|
emmc-preloader.bin emmc-bl31-uboot.fip \
|
|
|
|
nor-preloader.bin nor-bl31-uboot.fip \
|
|
|
|
sdcard.img.gz \
|
|
|
|
snfi-nand-preloader.bin snfi-nand-bl31-uboot.fip \
|
|
|
|
spim-nand-preloader.bin spim-nand-bl31-uboot.fip
|
|
|
|
ARTIFACT/emmc-preloader.bin := mt7981-bl2 emmc-ddr3
|
|
|
|
ARTIFACT/emmc-bl31-uboot.fip := mt7981-bl31-uboot rfb-emmc
|
|
|
|
ARTIFACT/nor-preloader.bin := mt7981-bl2 nor-ddr3
|
|
|
|
ARTIFACT/nor-bl31-uboot.fip := mt7981-bl31-uboot rfb-emmc
|
|
|
|
ARTIFACT/snfi-nand-preloader.bin := mt7981-bl2 snand-ddr3
|
|
|
|
ARTIFACT/snfi-nand-bl31-uboot.fip := mt7981-bl31-uboot rfb-snfi
|
|
|
|
ARTIFACT/spim-nand-preloader.bin := mt7981-bl2 spim-nand-ddr3
|
|
|
|
ARTIFACT/spim-nand-bl31-uboot.fip := mt7981-bl31-uboot rfb-spim-nand
|
|
|
|
ARTIFACT/sdcard.img.gz := mt798x-gpt sdmmc |\
|
|
|
|
pad-to 17k | mt7981-bl2 sdmmc-ddr3 |\
|
|
|
|
pad-to 6656k | mt7981-bl31-uboot rfb-sd |\
|
|
|
|
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\
|
|
|
|
pad-to 12M | append-image-stage initramfs.itb | check-size 44m |\
|
|
|
|
) \
|
|
|
|
pad-to 44M | mt7981-bl2 spim-nand-ddr3 |\
|
|
|
|
pad-to 45M | mt7981-bl31-uboot rfb-spim-nand |\
|
|
|
|
pad-to 49M | mt7981-bl2 nor-ddr3 |\
|
|
|
|
pad-to 50M | mt7981-bl31-uboot rfb-nor |\
|
|
|
|
pad-to 51M | mt7981-bl2 snand-ddr3 |\
|
|
|
|
pad-to 53M | mt7981-bl31-uboot rfb-snfi |\
|
|
|
|
$(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),\
|
|
|
|
pad-to 64M | append-image squashfs-sysupgrade.itb | check-size |\
|
|
|
|
) \
|
|
|
|
gzip
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += mediatek_mt7981-rfb
|
|
|
|
|
2022-10-29 21:03:08 +00:00
|
|
|
define Device/mediatek_mt7986a-rfb-nand
|
2022-07-06 12:06:30 +00:00
|
|
|
DEVICE_VENDOR := MediaTek
|
2022-10-29 21:03:08 +00:00
|
|
|
DEVICE_MODEL := MT7986 rfba AP (NAND)
|
|
|
|
DEVICE_DTS := mt7986a-rfb-spim-nand
|
2022-07-06 12:06:30 +00:00
|
|
|
DEVICE_DTS_DIR := $(DTS_DIR)/
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
2022-10-29 21:03:08 +00:00
|
|
|
SUPPORTED_DEVICES := mediatek,mt7986a-rfb-snand
|
2022-07-06 12:06:30 +00:00
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGES += factory.bin
|
|
|
|
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
KERNEL = kernel-bin | lzma | \
|
2022-10-29 21:03:08 +00:00
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
2022-07-06 12:06:30 +00:00
|
|
|
KERNEL_INITRAMFS = kernel-bin | lzma | \
|
2022-10-29 21:03:08 +00:00
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
|
2022-07-06 12:06:30 +00:00
|
|
|
endef
|
2022-10-29 21:03:08 +00:00
|
|
|
TARGET_DEVICES += mediatek_mt7986a-rfb-nand
|
2022-07-06 12:06:30 +00:00
|
|
|
|
|
|
|
define Device/mediatek_mt7986b-rfb
|
|
|
|
DEVICE_VENDOR := MediaTek
|
|
|
|
DEVICE_MODEL := MTK7986 rfbb AP
|
|
|
|
DEVICE_DTS := mt7986b-rfb
|
|
|
|
DEVICE_DTS_DIR := $(DTS_DIR)/
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
2022-07-06 12:06:30 +00:00
|
|
|
SUPPORTED_DEVICES := mediatek,mt7986b-rfb
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGES += factory.bin
|
|
|
|
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += mediatek_mt7986b-rfb
|
mediatek: add Xiaomi Redmi Router AX6000 support
Hardware specification:
SoC: MediaTek MT7986A 4x A53
Flash: ESMT F50L1G41LB 128 MB
RAM: K4A4G165WF-BCWE 512 MB
Ethernet: 4x 10/100/1000 Mbps
WiFi1: MT7976GN 2.4GHz ax 4x4
WiFi2: MT7976AN 5GHz ax 4x4
Button: Mesh, Reset
Flash instructions:
1. Gain ssh and serial port access, see the link below:
https://openwrt.org/toh/xiaomi/redmi_ax6000#installation
2. Use ssh or serial port to log in to the router, and
execute the following command:
nvram set boot_wait=on
nvram set flag_boot_rootfs=0
nvram set flag_boot_success=1
nvram set flag_last_success=1
nvram set flag_try_sys1_failed=8
nvram set flag_try_sys2_failed=8
nvram commit
3. Set a static ip on the ethernet interface of your computer
(e.g. default: ip 192.168.31.100, gateway 192.168.31.1)
4. Download the initramfs image, rename it to initramfs.bin,
and host it with the tftp server.
5. Interrupt U-Boot and run these commands:
setenv mtdparts nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),2048k(factory),2048k(fip),256k(crash),256k(crash_log),112640k(ubi)
saveenv
tftpboot initramfs.bin
bootm
6. After openwrt boots up, use scp or luci web
to upload sysupgrade.bin to upgrade.
Revert to stock firmware:
Restore mtdparts back to default, then use the
vendor's recovery tool (Windows only).
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2022-09-18 15:16:18 +00:00
|
|
|
|
2023-08-25 03:09:28 +00:00
|
|
|
define Device/mediatek_mt7988a-rfb
|
2023-02-19 02:18:36 +00:00
|
|
|
DEVICE_VENDOR := MediaTek
|
2023-08-25 03:09:28 +00:00
|
|
|
DEVICE_MODEL := MT7988A rfb
|
|
|
|
DEVICE_DTS := mt7988a-rfb
|
|
|
|
DEVICE_DTS_OVERLAY:= \
|
|
|
|
mt7988a-rfb-emmc \
|
|
|
|
mt7988a-rfb-sd \
|
|
|
|
mt7988a-rfb-snfi-nand \
|
|
|
|
mt7988a-rfb-spim-nand \
|
2024-05-08 11:40:14 +00:00
|
|
|
mt7988a-rfb-spim-nand-factory \
|
2023-08-25 03:09:28 +00:00
|
|
|
mt7988a-rfb-spim-nor \
|
|
|
|
mt7988a-rfb-eth1-aqr \
|
|
|
|
mt7988a-rfb-eth1-i2p5g-phy \
|
|
|
|
mt7988a-rfb-eth1-mxl \
|
|
|
|
mt7988a-rfb-eth1-sfp \
|
|
|
|
mt7988a-rfb-eth2-aqr \
|
|
|
|
mt7988a-rfb-eth2-mxl \
|
|
|
|
mt7988a-rfb-eth2-sfp
|
2023-02-19 02:18:36 +00:00
|
|
|
DEVICE_DTS_DIR := $(DTS_DIR)/
|
2023-08-25 03:09:28 +00:00
|
|
|
DEVICE_DTC_FLAGS := --pad 4096
|
|
|
|
DEVICE_DTS_LOADADDR := 0x45f00000
|
2024-01-08 21:08:13 +00:00
|
|
|
DEVICE_PACKAGES := mt7988-2p5g-phy-firmware kmod-sfp
|
2023-08-25 03:09:28 +00:00
|
|
|
KERNEL_LOADADDR := 0x46000000
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := .itb
|
2023-02-19 02:18:36 +00:00
|
|
|
KERNEL_IN_UBI := 1
|
2023-08-25 03:09:28 +00:00
|
|
|
IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | pad-rootfs | append-metadata
|
|
|
|
ARTIFACTS := \
|
|
|
|
emmc-gpt.bin emmc-preloader.bin emmc-bl31-uboot.fip \
|
|
|
|
nor-preloader.bin nor-bl31-uboot.fip \
|
|
|
|
sdcard.img.gz \
|
|
|
|
snand-preloader.bin snand-bl31-uboot.fip
|
|
|
|
ARTIFACT/emmc-gpt.bin := mt798x-gpt emmc
|
|
|
|
ARTIFACT/emmc-preloader.bin := mt7988-bl2 emmc-comb
|
|
|
|
ARTIFACT/emmc-bl31-uboot.fip := mt7988-bl31-uboot rfb-emmc
|
|
|
|
ARTIFACT/nor-preloader.bin := mt7988-bl2 nor-comb
|
|
|
|
ARTIFACT/nor-bl31-uboot.fip := mt7988-bl31-uboot rfb-nor
|
2024-05-08 11:40:14 +00:00
|
|
|
ARTIFACT/snand-preloader.bin := mt7988-bl2 spim-nand-ubi-comb
|
2023-08-25 03:09:28 +00:00
|
|
|
ARTIFACT/snand-bl31-uboot.fip := mt7988-bl31-uboot rfb-snand
|
|
|
|
ARTIFACT/sdcard.img.gz := mt798x-gpt sdmmc |\
|
|
|
|
pad-to 17k | mt7988-bl2 sdmmc-comb |\
|
|
|
|
pad-to 6656k | mt7988-bl31-uboot rfb-sd |\
|
|
|
|
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\
|
|
|
|
pad-to 12M | append-image-stage initramfs.itb | check-size 44m |\
|
|
|
|
) \
|
|
|
|
pad-to 44M | mt7988-bl2 spim-nand-comb |\
|
|
|
|
pad-to 45M | mt7988-bl31-uboot rfb-snand |\
|
|
|
|
pad-to 51M | mt7988-bl2 nor-comb |\
|
|
|
|
pad-to 51M | mt7988-bl31-uboot rfb-nor |\
|
|
|
|
pad-to 55M | mt7988-bl2 emmc-comb |\
|
|
|
|
pad-to 56M | mt7988-bl31-uboot rfb-emmc |\
|
|
|
|
pad-to 62M | mt798x-gpt emmc |\
|
|
|
|
$(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),\
|
|
|
|
pad-to 64M | append-image squashfs-sysupgrade.itb | check-size |\
|
|
|
|
) \
|
|
|
|
gzip
|
2023-02-19 02:18:36 +00:00
|
|
|
endef
|
2023-08-25 03:09:28 +00:00
|
|
|
TARGET_DEVICES += mediatek_mt7988a-rfb
|
2023-02-19 02:18:36 +00:00
|
|
|
|
mediatek: add support for Mercusys MR90X v1
This commit adds support for Mercusys MR90X(EU) v1 router.
Device specification
--------------------
SoC Type: MediaTek MT7986BLA, Cortex-A53, 64-bit
RAM: MediaTek MT7986BLA (512MB)
Flash: SPI NAND GigaDevice GD5F1GQ5UEYIGY (128 MB)
Ethernet: MediaTek MT7531AE + 2.5GbE MaxLinear GPY211C0VC (SLNW8)
Ethernet: 1x2.5Gbe (WAN/LAN 2.5Gbps), 3xGbE (WAN/LAN 1Gbps, LAN1, LAN2)
WLAN 2g: MediaTek MT7975N, b/g/n/ax, MIMO 4x4
WLAN 5g: MediaTek MT7975P(N), a/n/ac/ax, MIMO 4x4
LEDs: 1 orange and 1 green status LEDs, 4 green gpio-controlled
LEDs on ethernet ports
Button: 1 (Reset)
USB ports: No
Power: 12 VDC, 2 A
Connector: Barrel
Bootloader: Main U-Boot - U-Boot 2022.01-rc4. Additionally, both UBI
slots contain "seconduboot" (also U-Boot 2022.01-rc4)
Serial console (UART)
---------------------
V
+-------+-------+-------+-------+
| +3.3V | GND | TX | RX |
+---+---+-------+-------+-------+
|
+--- Don't connect
The R3 (TX line) and R6 (RX line) are absent on the PCB. You should
solder them or solder the jumpers.
Installation (UART)
-------------------
1. Place OpenWrt initramfs image on tftp server with IP 192.168.1.2
2. Attach UART, switch on the router and interrupt the boot process by
pressing 'Ctrl-C'
3. Load and run OpenWrt initramfs image:
tftpboot initramfs-kernel.bin
bootm
4. Once inside OpenWrt, set / update env variables:
fw_setenv baudrate 115200
fw_setenv bootargs "ubi.mtd=ubi0 console=ttyS0,115200n1 loglevel=8 earlycon=uart8250,mmio32,0x11002000 init=/etc/preinit"
fw_setenv fdtcontroladdr 5ffc0e70
fw_setenv ipaddr 192.168.1.1
fw_setenv loadaddr 0x46000000
fw_setenv mtdids "spi-nand0=spi-nand0"
fw_setenv mtdparts "spi-nand0:2M(boot),1M(u-boot-env),50M(ubi0),50M(ubi1),8M(userconfig),4M(tp_data)"
fw_setenv netmask 255.255.255.0
fw_setenv serverip 192.168.1.2
fw_setenv stderr serial@11002000
fw_setenv stdin serial@11002000
fw_setenv stdout serial@11002000
fw_setenv tp_boot_idx 0
5. Run 'sysupgrade -n' with the sysupgrade OpenWrt image
Installation (without UART)
---------------------------
1. Login as root via SSH (router IP, port 20001, password - your web
interface password)
2. Open for editing /etc/hotplug.d/iface/65-iptv (e.g., using WinSCP and
SSH settings from the p.1)
3. Add a newline after "#!/bin/sh":
telnetd -l /bin/login.sh
4. Save "65-iptv" file
5. Toggle "IPTV/VLAN Enable" checkbox in the router web interface and
save
6. Make sure that telnetd is running:
netstat -ltunp | grep 23
7. Login via telnet to router IP, port 23 (no username and password are
required)
8 Upload OpenWrt "initramfs-kernel.bin" to the "/tmp" folder of the
router (e.g., using WinSCP and SSH settings from the p.1)
9. Stock busybox doesn't contain ubiupdatevol command. Hence, we need to
download and upload the full version of busybox to the router. For
example, from here:
https://github.com/xerta555/Busybox-Binaries/raw/master/busybox-arm64
Upload busybox-arm64 to the /tmp dir of the router and run:
in the telnet shell:
cd /tmp
chmod a+x busybox-arm64
10. Check "initramfs-kernel.bin" size:
du -h initramfs-kernel.bin
11. Delete old and create new "kernel" volume with appropriate size
(greater than "initramfs-kernel.bin" size):
ubirmvol /dev/ubi0 -N kernel
ubimkvol /dev/ubi0 -n 1 -N kernel -s 9MiB
12. Write OpenWrt "initramfs-kernel.bin" to the flash:
./busybox-arm64 ubiupdatevol /dev/ubi0_1 /tmp/initramfs-kernel.bin
13. u-boot-env can be empty so lets create it (or overwrite it if it
already exists) with the necessary values:
fw_setenv baudrate 115200
fw_setenv bootargs "ubi.mtd=ubi0 console=ttyS0,115200n1 loglevel=8 earlycon=uart8250,mmio32,0x11002000 init=/etc/preinit"
fw_setenv fdtcontroladdr 5ffc0e70
fw_setenv ipaddr 192.168.1.1
fw_setenv loadaddr 0x46000000
fw_setenv mtdids "spi-nand0=spi-nand0"
fw_setenv mtdparts "spi-nand0:2M(boot),1M(u-boot-env),50M(ubi0),50M(ubi1),8M(userconfig),4M(tp_data)"
fw_setenv netmask 255.255.255.0
fw_setenv serverip 192.168.1.2
fw_setenv stderr serial@11002000
fw_setenv stdin serial@11002000
fw_setenv stdout serial@11002000
fw_setenv tp_boot_idx 0
14. Reboot to OpenWrt initramfs:
reboot
15. Login as root via SSH (IP 192.168.1.1, port 22)
16. Upload OpenWrt sysupgrade.bin image to the /tmp dir of the router
17. Run sysupgrade:
sysupgrade -n /tmp/sysupgrade.bin
Recovery
--------
1. Press Reset button and power on the router
2. Navigate to U-Boot recovery web server (http://192.168.1.1/) and
upload the OEM firmware
Recovery (UART)
---------------
1. Place OpenWrt initramfs image on tftp server with IP 192.168.1.2
2. Attach UART, switch on the router and interrupt the boot process by
pressing 'Ctrl-C'
3. Load and run OpenWrt initramfs image:
tftpboot initramfs-kernel.bin
bootm
4. Do what you need (restore partitions from a backup, install OpenWrt
etc.)
Stock layout
------------
0x000000000000-0x000000200000 : "boot"
0x000000200000-0x000000300000 : "u-boot-env"
0x000000300000-0x000003500000 : "ubi0"
0x000003500000-0x000006700000 : "ubi1"
0x000006700000-0x000006f00000 : "userconfig"
0x000006f00000-0x000007300000 : "tp_data"
ubi0/ubi1 format
----------------
U-Boot at boot checks that all volumes are in place:
+-------------------------------+
| Volume Name: uboot Vol ID: 0|
| Volume Name: kernel Vol ID: 1|
| Volume Name: rootfs Vol ID: 2|
+-------------------------------+
MAC addresses
-------------
+---------+-------------------+-----------+
| | MAC | Algorithm |
+---------+-------------------+-----------+
| label | 00:eb:xx:xx:xx:be | label |
| LAN | 00:eb:xx:xx:xx:be | label |
| WAN | 00:eb:xx:xx:xx:bf | label+1 |
| WLAN 2g | 00:eb:xx:xx:xx:be | label |
| WLAN 5g | 00:eb:xx:xx:xx:bd | label-1 |
+---------+-------------------+-----------+
label MAC address was found in UBI partition "tp_data", file
"default-mac". OEM wireless eeprom is also there (file
"MT7986_EEPROM.bin").
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2023-05-13 13:51:45 +00:00
|
|
|
define Device/mercusys_mr90x-v1
|
2023-10-29 14:51:32 +00:00
|
|
|
DEVICE_VENDOR := MERCUSYS
|
mediatek: add support for Mercusys MR90X v1
This commit adds support for Mercusys MR90X(EU) v1 router.
Device specification
--------------------
SoC Type: MediaTek MT7986BLA, Cortex-A53, 64-bit
RAM: MediaTek MT7986BLA (512MB)
Flash: SPI NAND GigaDevice GD5F1GQ5UEYIGY (128 MB)
Ethernet: MediaTek MT7531AE + 2.5GbE MaxLinear GPY211C0VC (SLNW8)
Ethernet: 1x2.5Gbe (WAN/LAN 2.5Gbps), 3xGbE (WAN/LAN 1Gbps, LAN1, LAN2)
WLAN 2g: MediaTek MT7975N, b/g/n/ax, MIMO 4x4
WLAN 5g: MediaTek MT7975P(N), a/n/ac/ax, MIMO 4x4
LEDs: 1 orange and 1 green status LEDs, 4 green gpio-controlled
LEDs on ethernet ports
Button: 1 (Reset)
USB ports: No
Power: 12 VDC, 2 A
Connector: Barrel
Bootloader: Main U-Boot - U-Boot 2022.01-rc4. Additionally, both UBI
slots contain "seconduboot" (also U-Boot 2022.01-rc4)
Serial console (UART)
---------------------
V
+-------+-------+-------+-------+
| +3.3V | GND | TX | RX |
+---+---+-------+-------+-------+
|
+--- Don't connect
The R3 (TX line) and R6 (RX line) are absent on the PCB. You should
solder them or solder the jumpers.
Installation (UART)
-------------------
1. Place OpenWrt initramfs image on tftp server with IP 192.168.1.2
2. Attach UART, switch on the router and interrupt the boot process by
pressing 'Ctrl-C'
3. Load and run OpenWrt initramfs image:
tftpboot initramfs-kernel.bin
bootm
4. Once inside OpenWrt, set / update env variables:
fw_setenv baudrate 115200
fw_setenv bootargs "ubi.mtd=ubi0 console=ttyS0,115200n1 loglevel=8 earlycon=uart8250,mmio32,0x11002000 init=/etc/preinit"
fw_setenv fdtcontroladdr 5ffc0e70
fw_setenv ipaddr 192.168.1.1
fw_setenv loadaddr 0x46000000
fw_setenv mtdids "spi-nand0=spi-nand0"
fw_setenv mtdparts "spi-nand0:2M(boot),1M(u-boot-env),50M(ubi0),50M(ubi1),8M(userconfig),4M(tp_data)"
fw_setenv netmask 255.255.255.0
fw_setenv serverip 192.168.1.2
fw_setenv stderr serial@11002000
fw_setenv stdin serial@11002000
fw_setenv stdout serial@11002000
fw_setenv tp_boot_idx 0
5. Run 'sysupgrade -n' with the sysupgrade OpenWrt image
Installation (without UART)
---------------------------
1. Login as root via SSH (router IP, port 20001, password - your web
interface password)
2. Open for editing /etc/hotplug.d/iface/65-iptv (e.g., using WinSCP and
SSH settings from the p.1)
3. Add a newline after "#!/bin/sh":
telnetd -l /bin/login.sh
4. Save "65-iptv" file
5. Toggle "IPTV/VLAN Enable" checkbox in the router web interface and
save
6. Make sure that telnetd is running:
netstat -ltunp | grep 23
7. Login via telnet to router IP, port 23 (no username and password are
required)
8 Upload OpenWrt "initramfs-kernel.bin" to the "/tmp" folder of the
router (e.g., using WinSCP and SSH settings from the p.1)
9. Stock busybox doesn't contain ubiupdatevol command. Hence, we need to
download and upload the full version of busybox to the router. For
example, from here:
https://github.com/xerta555/Busybox-Binaries/raw/master/busybox-arm64
Upload busybox-arm64 to the /tmp dir of the router and run:
in the telnet shell:
cd /tmp
chmod a+x busybox-arm64
10. Check "initramfs-kernel.bin" size:
du -h initramfs-kernel.bin
11. Delete old and create new "kernel" volume with appropriate size
(greater than "initramfs-kernel.bin" size):
ubirmvol /dev/ubi0 -N kernel
ubimkvol /dev/ubi0 -n 1 -N kernel -s 9MiB
12. Write OpenWrt "initramfs-kernel.bin" to the flash:
./busybox-arm64 ubiupdatevol /dev/ubi0_1 /tmp/initramfs-kernel.bin
13. u-boot-env can be empty so lets create it (or overwrite it if it
already exists) with the necessary values:
fw_setenv baudrate 115200
fw_setenv bootargs "ubi.mtd=ubi0 console=ttyS0,115200n1 loglevel=8 earlycon=uart8250,mmio32,0x11002000 init=/etc/preinit"
fw_setenv fdtcontroladdr 5ffc0e70
fw_setenv ipaddr 192.168.1.1
fw_setenv loadaddr 0x46000000
fw_setenv mtdids "spi-nand0=spi-nand0"
fw_setenv mtdparts "spi-nand0:2M(boot),1M(u-boot-env),50M(ubi0),50M(ubi1),8M(userconfig),4M(tp_data)"
fw_setenv netmask 255.255.255.0
fw_setenv serverip 192.168.1.2
fw_setenv stderr serial@11002000
fw_setenv stdin serial@11002000
fw_setenv stdout serial@11002000
fw_setenv tp_boot_idx 0
14. Reboot to OpenWrt initramfs:
reboot
15. Login as root via SSH (IP 192.168.1.1, port 22)
16. Upload OpenWrt sysupgrade.bin image to the /tmp dir of the router
17. Run sysupgrade:
sysupgrade -n /tmp/sysupgrade.bin
Recovery
--------
1. Press Reset button and power on the router
2. Navigate to U-Boot recovery web server (http://192.168.1.1/) and
upload the OEM firmware
Recovery (UART)
---------------
1. Place OpenWrt initramfs image on tftp server with IP 192.168.1.2
2. Attach UART, switch on the router and interrupt the boot process by
pressing 'Ctrl-C'
3. Load and run OpenWrt initramfs image:
tftpboot initramfs-kernel.bin
bootm
4. Do what you need (restore partitions from a backup, install OpenWrt
etc.)
Stock layout
------------
0x000000000000-0x000000200000 : "boot"
0x000000200000-0x000000300000 : "u-boot-env"
0x000000300000-0x000003500000 : "ubi0"
0x000003500000-0x000006700000 : "ubi1"
0x000006700000-0x000006f00000 : "userconfig"
0x000006f00000-0x000007300000 : "tp_data"
ubi0/ubi1 format
----------------
U-Boot at boot checks that all volumes are in place:
+-------------------------------+
| Volume Name: uboot Vol ID: 0|
| Volume Name: kernel Vol ID: 1|
| Volume Name: rootfs Vol ID: 2|
+-------------------------------+
MAC addresses
-------------
+---------+-------------------+-----------+
| | MAC | Algorithm |
+---------+-------------------+-----------+
| label | 00:eb:xx:xx:xx:be | label |
| LAN | 00:eb:xx:xx:xx:be | label |
| WAN | 00:eb:xx:xx:xx:bf | label+1 |
| WLAN 2g | 00:eb:xx:xx:xx:be | label |
| WLAN 5g | 00:eb:xx:xx:xx:bd | label-1 |
+---------+-------------------+-----------+
label MAC address was found in UBI partition "tp_data", file
"default-mac". OEM wireless eeprom is also there (file
"MT7986_EEPROM.bin").
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2023-05-13 13:51:45 +00:00
|
|
|
DEVICE_MODEL := MR90X v1
|
|
|
|
DEVICE_DTS := mt7986b-mercusys-mr90x-v1
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
mediatek: add support for Mercusys MR90X v1
This commit adds support for Mercusys MR90X(EU) v1 router.
Device specification
--------------------
SoC Type: MediaTek MT7986BLA, Cortex-A53, 64-bit
RAM: MediaTek MT7986BLA (512MB)
Flash: SPI NAND GigaDevice GD5F1GQ5UEYIGY (128 MB)
Ethernet: MediaTek MT7531AE + 2.5GbE MaxLinear GPY211C0VC (SLNW8)
Ethernet: 1x2.5Gbe (WAN/LAN 2.5Gbps), 3xGbE (WAN/LAN 1Gbps, LAN1, LAN2)
WLAN 2g: MediaTek MT7975N, b/g/n/ax, MIMO 4x4
WLAN 5g: MediaTek MT7975P(N), a/n/ac/ax, MIMO 4x4
LEDs: 1 orange and 1 green status LEDs, 4 green gpio-controlled
LEDs on ethernet ports
Button: 1 (Reset)
USB ports: No
Power: 12 VDC, 2 A
Connector: Barrel
Bootloader: Main U-Boot - U-Boot 2022.01-rc4. Additionally, both UBI
slots contain "seconduboot" (also U-Boot 2022.01-rc4)
Serial console (UART)
---------------------
V
+-------+-------+-------+-------+
| +3.3V | GND | TX | RX |
+---+---+-------+-------+-------+
|
+--- Don't connect
The R3 (TX line) and R6 (RX line) are absent on the PCB. You should
solder them or solder the jumpers.
Installation (UART)
-------------------
1. Place OpenWrt initramfs image on tftp server with IP 192.168.1.2
2. Attach UART, switch on the router and interrupt the boot process by
pressing 'Ctrl-C'
3. Load and run OpenWrt initramfs image:
tftpboot initramfs-kernel.bin
bootm
4. Once inside OpenWrt, set / update env variables:
fw_setenv baudrate 115200
fw_setenv bootargs "ubi.mtd=ubi0 console=ttyS0,115200n1 loglevel=8 earlycon=uart8250,mmio32,0x11002000 init=/etc/preinit"
fw_setenv fdtcontroladdr 5ffc0e70
fw_setenv ipaddr 192.168.1.1
fw_setenv loadaddr 0x46000000
fw_setenv mtdids "spi-nand0=spi-nand0"
fw_setenv mtdparts "spi-nand0:2M(boot),1M(u-boot-env),50M(ubi0),50M(ubi1),8M(userconfig),4M(tp_data)"
fw_setenv netmask 255.255.255.0
fw_setenv serverip 192.168.1.2
fw_setenv stderr serial@11002000
fw_setenv stdin serial@11002000
fw_setenv stdout serial@11002000
fw_setenv tp_boot_idx 0
5. Run 'sysupgrade -n' with the sysupgrade OpenWrt image
Installation (without UART)
---------------------------
1. Login as root via SSH (router IP, port 20001, password - your web
interface password)
2. Open for editing /etc/hotplug.d/iface/65-iptv (e.g., using WinSCP and
SSH settings from the p.1)
3. Add a newline after "#!/bin/sh":
telnetd -l /bin/login.sh
4. Save "65-iptv" file
5. Toggle "IPTV/VLAN Enable" checkbox in the router web interface and
save
6. Make sure that telnetd is running:
netstat -ltunp | grep 23
7. Login via telnet to router IP, port 23 (no username and password are
required)
8 Upload OpenWrt "initramfs-kernel.bin" to the "/tmp" folder of the
router (e.g., using WinSCP and SSH settings from the p.1)
9. Stock busybox doesn't contain ubiupdatevol command. Hence, we need to
download and upload the full version of busybox to the router. For
example, from here:
https://github.com/xerta555/Busybox-Binaries/raw/master/busybox-arm64
Upload busybox-arm64 to the /tmp dir of the router and run:
in the telnet shell:
cd /tmp
chmod a+x busybox-arm64
10. Check "initramfs-kernel.bin" size:
du -h initramfs-kernel.bin
11. Delete old and create new "kernel" volume with appropriate size
(greater than "initramfs-kernel.bin" size):
ubirmvol /dev/ubi0 -N kernel
ubimkvol /dev/ubi0 -n 1 -N kernel -s 9MiB
12. Write OpenWrt "initramfs-kernel.bin" to the flash:
./busybox-arm64 ubiupdatevol /dev/ubi0_1 /tmp/initramfs-kernel.bin
13. u-boot-env can be empty so lets create it (or overwrite it if it
already exists) with the necessary values:
fw_setenv baudrate 115200
fw_setenv bootargs "ubi.mtd=ubi0 console=ttyS0,115200n1 loglevel=8 earlycon=uart8250,mmio32,0x11002000 init=/etc/preinit"
fw_setenv fdtcontroladdr 5ffc0e70
fw_setenv ipaddr 192.168.1.1
fw_setenv loadaddr 0x46000000
fw_setenv mtdids "spi-nand0=spi-nand0"
fw_setenv mtdparts "spi-nand0:2M(boot),1M(u-boot-env),50M(ubi0),50M(ubi1),8M(userconfig),4M(tp_data)"
fw_setenv netmask 255.255.255.0
fw_setenv serverip 192.168.1.2
fw_setenv stderr serial@11002000
fw_setenv stdin serial@11002000
fw_setenv stdout serial@11002000
fw_setenv tp_boot_idx 0
14. Reboot to OpenWrt initramfs:
reboot
15. Login as root via SSH (IP 192.168.1.1, port 22)
16. Upload OpenWrt sysupgrade.bin image to the /tmp dir of the router
17. Run sysupgrade:
sysupgrade -n /tmp/sysupgrade.bin
Recovery
--------
1. Press Reset button and power on the router
2. Navigate to U-Boot recovery web server (http://192.168.1.1/) and
upload the OEM firmware
Recovery (UART)
---------------
1. Place OpenWrt initramfs image on tftp server with IP 192.168.1.2
2. Attach UART, switch on the router and interrupt the boot process by
pressing 'Ctrl-C'
3. Load and run OpenWrt initramfs image:
tftpboot initramfs-kernel.bin
bootm
4. Do what you need (restore partitions from a backup, install OpenWrt
etc.)
Stock layout
------------
0x000000000000-0x000000200000 : "boot"
0x000000200000-0x000000300000 : "u-boot-env"
0x000000300000-0x000003500000 : "ubi0"
0x000003500000-0x000006700000 : "ubi1"
0x000006700000-0x000006f00000 : "userconfig"
0x000006f00000-0x000007300000 : "tp_data"
ubi0/ubi1 format
----------------
U-Boot at boot checks that all volumes are in place:
+-------------------------------+
| Volume Name: uboot Vol ID: 0|
| Volume Name: kernel Vol ID: 1|
| Volume Name: rootfs Vol ID: 2|
+-------------------------------+
MAC addresses
-------------
+---------+-------------------+-----------+
| | MAC | Algorithm |
+---------+-------------------+-----------+
| label | 00:eb:xx:xx:xx:be | label |
| LAN | 00:eb:xx:xx:xx:be | label |
| WAN | 00:eb:xx:xx:xx:bf | label+1 |
| WLAN 2g | 00:eb:xx:xx:xx:be | label |
| WLAN 5g | 00:eb:xx:xx:xx:bd | label-1 |
+---------+-------------------+-----------+
label MAC address was found in UBI partition "tp_data", file
"default-mac". OEM wireless eeprom is also there (file
"MT7986_EEPROM.bin").
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2023-05-13 13:51:45 +00:00
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 51200k
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += mercusys_mr90x-v1
|
|
|
|
|
2024-10-20 12:21:33 +00:00
|
|
|
define Device/mercusys_mr90x-v1-ubi
|
|
|
|
DEVICE_VENDOR := MERCUSYS
|
|
|
|
DEVICE_MODEL := MR90X v1 (UBI)
|
|
|
|
DEVICE_DTS := mt7986b-mercusys-mr90x-v1-ubi
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTC_FLAGS := --pad 4096
|
|
|
|
DEVICE_DTS_LOADADDR := 0x43f00000
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | \
|
|
|
|
pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | \
|
|
|
|
append-metadata
|
|
|
|
ARTIFACTS := bl31-uboot.fip preloader.bin
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot mercusys_mr90x-v1
|
|
|
|
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ubi-ddr3
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += mercusys_mr90x-v1-ubi
|
|
|
|
|
2023-11-03 15:02:35 +00:00
|
|
|
define Device/netcore_n60
|
|
|
|
DEVICE_VENDOR := Netcore
|
|
|
|
DEVICE_MODEL := N60
|
|
|
|
DEVICE_DTS := mt7986a-netcore-n60
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
2023-11-03 15:02:35 +00:00
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr3
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot netcore_n60
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += netcore_n60
|
|
|
|
|
2023-11-06 15:06:05 +00:00
|
|
|
define Device/netgear_wax220
|
|
|
|
DEVICE_VENDOR := NETGEAR
|
|
|
|
DEVICE_MODEL := WAX220
|
|
|
|
DEVICE_DTS := mt7986b-netgear-wax220
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
NETGEAR_ENC_MODEL := WAX220
|
|
|
|
NETGEAR_ENC_REGION := US
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
2023-11-06 15:06:05 +00:00
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
IMAGE_SIZE := 32768k
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
IMAGES += factory.img
|
|
|
|
# Padding to 10M seems to be required by OEM web interface
|
|
|
|
IMAGE/factory.img := sysupgrade-tar | \
|
|
|
|
pad-to 10M | check-size | netgear-encrypted-factory
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += netgear_wax220
|
|
|
|
|
mediatek: add Nokia EA0326GMP support
Hardware specification:
SoC: MediaTek MT7981B 2x A53
Flash: 128 MB SPI-NAND
RAM: 256MB
Ethernet: 4x 10/100/1000 Mbps
Switch: MediaTek MT7531AE
WiFi: MediaTek MT7976C
Button: Reset, WPS/Mesh
Power: DC 12V 1A
Gain SSH access:
1. Login into web interface, and download the configuration.
2. Download the configration utilities:
https://firmware.download.immortalwrt.eu.org/cnsztl/mediatek/filogic/openwrt-mediatek-mt7981-nokia-ea0326gmp-config-utils.tar.gz
These binaries are extraced from the factory firmware, which are
dynamically linked with aarch64 musl 1.1.24. To use them, you
must run them under the same runtime environment, otherwise the
binaries will not work properly!
3. Upload the configuration and utilities to a suitable environment.
4. Uncompress the utilities, move them to '/bin' and give them executable permisison:
tar -zxf openwrt-mediatek-mt7981-nokia-ea0326gmp-config-utils.tar.gz
mv mkconfig seama /bin
chmod +x /bin/mkconfig
chmod +x /bin/seama
5. Decrypt and uncompress the configuration:
Enter fakeroot if you are not login as root.
mkconfig -a de-enca -m EA0326GMP_3FE79221BAAA -i EA0326GMP_3FE79221BAAA-xxxxxxxx-backup.tar.gz -o backup.tar.gz
tar -zxf backup.tar.gz
6. Edit 'etc/config/dropbear', set 'enable' to '1'.
7. Edit 'etc/passwd', remove root password: 'root::1:0:99999:7:::'.
8. Repack the configuration:
tar -zcf backup.tar.gz etc/
mkconfig -a enca -m EA0326GMP_3FE79221BAAA -i backup.tar.gz -o EA0326GMP_3FE79221BAAA-xxxxxxxx-backup.tar.gz
9. Upload new configuration via web interface, now you can SSH to EA0326GMP.
A minimum configuration which enabled SSH access is also provided
to simplify the process:
https://firmware.download.immortalwrt.eu.org/cnsztl/mediatek/filogic/openwrt-mediatek-mt7981-nokia-ea0326gmp-enable-ssh.tar.gz
Flash instructions:
1. SSH to EA0326GMP, backup everything, especially 'Factory' part.
2. Write new BL2:
mtd write openwrt-mediatek-filogic-nokia_ea0326gmp-preloader.bin BL2
3. Write new FIP:
mtd write openwrt-mediatek-filogic-nokia_ea0326gmp-bl31-uboot.fip FIP
4. Set static IP on your PC:
IP 192.168.1.254/24, GW 192.168.1.1
5. Serve OpenWrt initramfs image using TFTP server.
6. Cut off the power and re-engage, wait for TFTP recovery to complete.
7. After OpenWrt has booted, perform sysupgrade.
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-03-24 13:26:07 +00:00
|
|
|
define Device/nokia_ea0326gmp
|
|
|
|
DEVICE_VENDOR := Nokia
|
|
|
|
DEVICE_MODEL := EA0326GMP
|
|
|
|
DEVICE_DTS := mt7981b-nokia-ea0326gmp
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot nokia_ea0326gmp
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += nokia_ea0326gmp
|
|
|
|
|
2024-03-07 06:19:08 +00:00
|
|
|
define Device/openembed_som7981
|
|
|
|
DEVICE_VENDOR := OpenEmbed
|
|
|
|
DEVICE_MODEL := SOM7981
|
|
|
|
DEVICE_DTS := mt7981b-openembed-som7981
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3
|
2024-03-07 06:19:08 +00:00
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 244224k
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGES += factory.bin
|
|
|
|
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += openembed_som7981
|
|
|
|
|
2024-04-04 20:38:50 +00:00
|
|
|
define Device/openwrt_one
|
|
|
|
DEVICE_VENDOR := OpenWrt
|
|
|
|
DEVICE_MODEL := One
|
|
|
|
DEVICE_DTS := mt7981b-openwrt-one
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTC_FLAGS := --pad 4096
|
|
|
|
DEVICE_DTS_LOADADDR := 0x43f00000
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-rtc-pcf8563 kmod-usb3 kmod-nvme kmod-phy-airoha-en8811h
|
2024-04-04 20:38:50 +00:00
|
|
|
KERNEL_LOADADDR := 0x44000000
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := .itb
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | pad-rootfs | append-metadata
|
|
|
|
ARTIFACTS := \
|
|
|
|
nor-preloader.bin nor-bl31-uboot.fip \
|
|
|
|
snand-preloader.bin snand-bl31-uboot.fip \
|
|
|
|
factory.ubi snand-factory.bin nor-factory.bin
|
|
|
|
ARTIFACT/nor-preloader.bin := mt7981-bl2 nor-ddr4
|
|
|
|
ARTIFACT/nor-bl31-uboot.fip := mt7981-bl31-uboot openwrt_one-nor
|
|
|
|
ARTIFACT/snand-preloader.bin := mt7981-bl2 spim-nand-ubi-ddr4
|
|
|
|
ARTIFACT/snand-bl31-uboot.fip := mt7981-bl31-uboot openwrt_one-snand
|
|
|
|
ARTIFACT/factory.ubi := ubinize-image fit squashfs-sysupgrade.itb
|
|
|
|
ARTIFACT/snand-factory.bin := mt7981-bl2 spim-nand-ubi-ddr4 | pad-to 256k | \
|
|
|
|
mt7981-bl2 spim-nand-ubi-ddr4 | pad-to 512k | \
|
|
|
|
mt7981-bl2 spim-nand-ubi-ddr4 | pad-to 768k | \
|
|
|
|
mt7981-bl2 spim-nand-ubi-ddr4 | pad-to 1024k | \
|
|
|
|
ubinize-image fit squashfs-sysupgrade.itb
|
|
|
|
ARTIFACT/nor-factory.bin := mt7981-bl2 nor-ddr4 | pad-to 256k | \
|
|
|
|
append-openwrt-one-eeprom | pad-to 1024k | \
|
|
|
|
mt7981-bl31-uboot openwrt_one-nor | pad-to 512k | \
|
|
|
|
append-image-stage initramfs.itb
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
2024-10-19 23:48:57 +00:00
|
|
|
UBINIZE_PARTS := fip=:$(STAGING_DIR_IMAGE)/mt7981_openwrt_one-snand-u-boot.fip \
|
|
|
|
$(if $(IB),recovery=:$(STAGING_DIR_IMAGE)/mediatek-filogic-openwrt_one-initramfs.itb,\
|
|
|
|
recovery=:$(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE)) \
|
2024-04-04 20:38:50 +00:00
|
|
|
$(if $(wildcard $(TOPDIR)/openwrt-mediatek-filogic-openwrt_one-calibration.itb), calibration=:$(TOPDIR)/openwrt-mediatek-filogic-openwrt_one-calibration.itb)
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += openwrt_one
|
|
|
|
|
mediatek: filogic: add Qihoo 360T7 support
Hardware specification:
SoC: MediaTek MT7981B 2x A53
Flash: ESMT F50L1G41LB 128MB
RAM: MT5CC128M16JR-EK 256MB
Ethernet: 4x 10/100/1000 Mbps
Switch: MediaTek MT7531AE
WiFi: MediaTek MT7976C
Button: Reset, WPS
Power: DC 12V 1A
Flash instructions:
1. Attach UART, boot the stock firmware until
the message about failsafe mode appears.
2. Enter failsafe mode by pressing "f" and "Enter"
3. Type "mount_root", then run
"fw_setenv bootmenu_delay 3"
4. Back up all mtd partitions before flashing.
5. Reboot, U-Boot now presents a menu.
6. Connect to your PC via the Gigabit port of the router,
set a static ip on the ethernet interface of your PC.
(ip 192.168.1.254, gateway 192.168.1.1)
7. Select "Upgrade ATF BL2", then use this file:
openwrt-mediatek-filogic-qihoo_360t7-preloader.bin
8. Select "Upgrade ATF FIP", then use this file:
openwrt-mediatek-filogic-qihoo_360t7-bl31-uboot.fip
9. Download the initramfs image, and type "reset",
waiting for tftp recovery to complete.
a. After openwrt boots up, perform sysupgrade.
Note:
1. Since NMBM is disabled, we must back up all partitions.
2. Flash instructions is based on commit 28df7f7.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2023-04-29 15:08:26 +00:00
|
|
|
define Device/qihoo_360t7
|
|
|
|
DEVICE_VENDOR := Qihoo
|
|
|
|
DEVICE_MODEL := 360T7
|
|
|
|
DEVICE_DTS := mt7981b-qihoo-360t7
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
mediatek: filogic: add Qihoo 360T7 support
Hardware specification:
SoC: MediaTek MT7981B 2x A53
Flash: ESMT F50L1G41LB 128MB
RAM: MT5CC128M16JR-EK 256MB
Ethernet: 4x 10/100/1000 Mbps
Switch: MediaTek MT7531AE
WiFi: MediaTek MT7976C
Button: Reset, WPS
Power: DC 12V 1A
Flash instructions:
1. Attach UART, boot the stock firmware until
the message about failsafe mode appears.
2. Enter failsafe mode by pressing "f" and "Enter"
3. Type "mount_root", then run
"fw_setenv bootmenu_delay 3"
4. Back up all mtd partitions before flashing.
5. Reboot, U-Boot now presents a menu.
6. Connect to your PC via the Gigabit port of the router,
set a static ip on the ethernet interface of your PC.
(ip 192.168.1.254, gateway 192.168.1.1)
7. Select "Upgrade ATF BL2", then use this file:
openwrt-mediatek-filogic-qihoo_360t7-preloader.bin
8. Select "Upgrade ATF FIP", then use this file:
openwrt-mediatek-filogic-qihoo_360t7-bl31-uboot.fip
9. Download the initramfs image, and type "reset",
waiting for tftp recovery to complete.
a. After openwrt boots up, perform sysupgrade.
Note:
1. Since NMBM is disabled, we must back up all partitions.
2. Flash instructions is based on commit 28df7f7.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2023-04-29 15:08:26 +00:00
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot qihoo_360t7
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += qihoo_360t7
|
|
|
|
|
2023-12-09 17:17:02 +00:00
|
|
|
define Device/routerich_ax3000
|
|
|
|
DEVICE_VENDOR := Routerich
|
|
|
|
DEVICE_MODEL := AX3000
|
|
|
|
DEVICE_DTS := mt7981b-routerich-ax3000
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3
|
2023-12-09 17:17:02 +00:00
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-rfb
|
2024-10-21 18:34:34 +00:00
|
|
|
DEVICE_COMPAT_VERSION := 1.1
|
|
|
|
DEVICE_COMPAT_MESSAGE := Partition layout has been changed. Bootloader MUST be \
|
|
|
|
upgraded to avoid data corruption and getting bricked. \
|
|
|
|
Please, contact your vendor and follow the guide: \
|
|
|
|
https://openwrt.org/toh/routerich/ax3000#web_ui_method
|
2023-12-09 17:17:02 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += routerich_ax3000
|
|
|
|
|
2024-10-26 09:37:14 +00:00
|
|
|
define Device/routerich_ax3000-ubootmod
|
|
|
|
DEVICE_VENDOR := Routerich
|
|
|
|
DEVICE_MODEL := AX3000 (OpenWrt U-Boot layout)
|
|
|
|
DEVICE_DTS := mt7981b-routerich-ax3000-ubootmod
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | \
|
|
|
|
append-metadata
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware kmod-usb3 mt7981-wo-firmware
|
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot routerich_ax3000
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += routerich_ax3000-ubootmod
|
|
|
|
|
mediatek: add support for Ruijie RG-X60 Pro
This pull request ports Ruijie RG-X60 Pro router support to the main branch.
Parameters:
- SoC : MediaTek MT7986A Quad-core ARM Cortex-A53 2.0GHz
- RAM : DDR3 512MiB (W634GU6QB)
- Flash : SPI-NAND 128 MiB (W25N01GVZEIG)
- WLAN : MediaTek MT7986A integration dual-band WiFi 6
- 2.4 GHz : b/g/n/ax, MIMO 4x4
- 5 GHz : a/n/ac/ax, MIMO 4x4
- Ethernet : 10/100/1000 Mbps x4 (MediaTek MT7531AE)
2500Mbps x 1 (Realtek RTL8221B-VB-CG)
- UART : through-hole on PCB
- [J500] GND, TX, RX, 3.3V (115200n1)
- Buttons : Mesh, Reset
- LEDs : 1x Power (Blue)
1x Turbo (Purple)
- Power : 12 VDC, 3 A
How to Installation:
1. Remove the case and connect the TTL cable to the corresponding position.
2. Power on the device and quickly press "down" on the keyboard, then
U-Boot will stay in the menu.
3. Select "1. Upgrade Firmware", select "0. TFTP Client(Default)".
4. Input the IP address, input the Openwrt image file name to be
flashed, start the TFTP server, and press "Enter".
5. Wait for the flashing to complete.
How return to stock:
1. Remove the case and connect the TTL cable to the corresponding
position.
2. Power on the device and quickly press "down" on the keyboard, then
U-Boot will stay in the menu.
3. Select "1. Upgrade Firmware", select "0. TFTP Client(Default)".
4. Input the IP address, input the Stock “E-WEBOS” image file name to
be flashed, start the TFTP server, and press "Enter".
5. Wait for the flashing to complete.
About recovery:
Connect uart, use u-boot menu to flash stock firmware image or boot
OpenWrt initramfs image.
About MAC Address:
+---------+-------------------+-----------+
| | MAC | Algorithm |
+---------+-------------------+-----------+
| WAN | 10:82:3D:XX:XX:9E | label |
| LAN | 10:82:3D:XX:XX:9F | label+1 |
| WLAN 2g | 10:82:3D:XX:XX:A0 | label+2 |
| WLAN 5g | 10:82:3D:XX:XX:A1 | label+3 |
+---------+-------------------+-----------+
Signed-off-by: Ashley Lee <code@emtips.net>
2023-12-30 14:54:54 +00:00
|
|
|
define Device/ruijie_rg-x60-pro
|
|
|
|
DEVICE_VENDOR := Ruijie
|
|
|
|
DEVICE_MODEL := RG-X60 Pro
|
|
|
|
DEVICE_DTS := mt7986a-ruijie-rg-x60-pro
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-06-09 13:16:22 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
mediatek: add support for Ruijie RG-X60 Pro
This pull request ports Ruijie RG-X60 Pro router support to the main branch.
Parameters:
- SoC : MediaTek MT7986A Quad-core ARM Cortex-A53 2.0GHz
- RAM : DDR3 512MiB (W634GU6QB)
- Flash : SPI-NAND 128 MiB (W25N01GVZEIG)
- WLAN : MediaTek MT7986A integration dual-band WiFi 6
- 2.4 GHz : b/g/n/ax, MIMO 4x4
- 5 GHz : a/n/ac/ax, MIMO 4x4
- Ethernet : 10/100/1000 Mbps x4 (MediaTek MT7531AE)
2500Mbps x 1 (Realtek RTL8221B-VB-CG)
- UART : through-hole on PCB
- [J500] GND, TX, RX, 3.3V (115200n1)
- Buttons : Mesh, Reset
- LEDs : 1x Power (Blue)
1x Turbo (Purple)
- Power : 12 VDC, 3 A
How to Installation:
1. Remove the case and connect the TTL cable to the corresponding position.
2. Power on the device and quickly press "down" on the keyboard, then
U-Boot will stay in the menu.
3. Select "1. Upgrade Firmware", select "0. TFTP Client(Default)".
4. Input the IP address, input the Openwrt image file name to be
flashed, start the TFTP server, and press "Enter".
5. Wait for the flashing to complete.
How return to stock:
1. Remove the case and connect the TTL cable to the corresponding
position.
2. Power on the device and quickly press "down" on the keyboard, then
U-Boot will stay in the menu.
3. Select "1. Upgrade Firmware", select "0. TFTP Client(Default)".
4. Input the IP address, input the Stock “E-WEBOS” image file name to
be flashed, start the TFTP server, and press "Enter".
5. Wait for the flashing to complete.
About recovery:
Connect uart, use u-boot menu to flash stock firmware image or boot
OpenWrt initramfs image.
About MAC Address:
+---------+-------------------+-----------+
| | MAC | Algorithm |
+---------+-------------------+-----------+
| WAN | 10:82:3D:XX:XX:9E | label |
| LAN | 10:82:3D:XX:XX:9F | label+1 |
| WLAN 2g | 10:82:3D:XX:XX:A0 | label+2 |
| WLAN 5g | 10:82:3D:XX:XX:A1 | label+3 |
+---------+-------------------+-----------+
Signed-off-by: Ashley Lee <code@emtips.net>
2023-12-30 14:54:54 +00:00
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += ruijie_rg-x60-pro
|
|
|
|
|
mediatek: filogic: add support for TP-LINK RE6000XD
This commit adds support for TP-LINK RE6000XD.
The device is quite similar to the Mercusys MR90X V1,
except only 3 LAN ports and more LEDs.
So thanks to csharper2005 for doing all the groundwork.
Device specification
--------------------
SoC Type: MediaTek MT7986BLA, Cortex-A53, 64-bit
RAM: MediaTek MT7986BLA (512MB)
Flash: SPI NAND GigaDevice (128 MB)
Ethernet: MediaTek MT7531AE + 2.5GbE MaxLinear GPY211C0VC (SLNW8)
Ethernet: 1x2.5Gbe (LAN3 2.5Gbps), 2xGbE (LAN 1Gbps, LAN1,
LAN2)
WLAN 2g: MediaTek MT7975N, b/g/n/ax, MIMO 4x4
WLAN 5g: MediaTek MT7975P(N), a/n/ac/ax, MIMO 4x4
LEDs: 8 LEDs, 1 status blue, 2x WIFI blue, 2x signal
blue/red, 3 LAN blue gpio-controlled
Button: 2 (Reset, WPS)
USB ports: No
Power: 12 VDC, 2 A
Connector: Barrel
Bootloader: Main U-Boot - U-Boot 2022.01-rc4. Additionally, ubi0
partition contain "seconduboot" (also U-Boot 2022.01-rc4)
Serial console (UART), unpopulated
---------------------
V
+-------+-------+-------+-------+
| +3.3V | GND | TX | RX |
+---+---+-------+-------+-------+
|
+--- Don't connect
Disassemble: rm the 2 screws at the bottom and the one at the backside.
un-clip the case starting at the edge above the LEDs.
Installation (UART)
-------------------
1. Place OpenWrt initramfs image on tftp server with IP 192.168.1.2
2. Attach UART, switch on the router and interrupt the boot process by
pressing 'Ctrl-C'
3. Load and run OpenWrt initramfs image:
tftpboot openwrt-mediatek-filogic-tplink_re6000xd-initramfs-kernel.bin bootm
4. Run 'sysupgrade -n' with the sysupgrade OpenWrt image
Notice: while I was successfull at activating ssh (as described
here:
https://www.lisenet.com/2023/gaining-ssh-access-to-tp-link-re200-wi-fi-range-extender/)
Unfortunately I haven't found the correct root password.
Looks like they are using a static password
(md5crypt, salt + 21 characters) that is not the web
interface admin password.
The TP-LINK RE900XD looks like the very same device,
according to the pictures and the firmware.
But I haven't checked if the OpenWrt firmware works as well
on that device.
The second ubi partition (ubi1) is empty and there is no known
dual-partition mechanism, neither in u-boot nor in the stock firmware.
Signed-off-by: Dirk Buchwalder <buchwalder@posteo.de>
2024-05-17 15:33:00 +00:00
|
|
|
define Device/tplink_re6000xd
|
|
|
|
DEVICE_VENDOR := TP-Link
|
|
|
|
DEVICE_MODEL := RE6000XD
|
|
|
|
DEVICE_DTS := mt7986b-tplink-re6000xd
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 51200k
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += tplink_re6000xd
|
|
|
|
|
mediatek: add support for TP-Link TL-XDR4288/608x
Hardware specification:
SoC: MediaTek MT7986A 4x A53
Flash: ESMT F50L1G41LB 128MB
RAM: ESMT M15T4G16256A 512MB
Ethernet (Max Speed):
XDR4288: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan
XDR6086: 1x 2.5G Wan, 1x 2.5G Lan, 1x 1G Lan
XDR6088: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan
WiFi:
XDR4288: MT7976DAN (2.4G 2T2R, 5G 3T3R)
XDR6086/XDR6088:
WiFi1: MT7976GN 2.4GHz 4T4R
WiFi2: MT7976AN 5GHz 4T4R
Button: Reset, WPS, Turbo
USB: 1 x USB 3.0
Power: DC 12V 4A
Flash instructions:
1. Execute the following operation to open nc shell:
https://openwrt.org/inbox/toh/tp-link/xdr-6086#rooting
2. Replace the stock bootloader to OpenWrt's:
dd bs=131072 conv=sync of=/dev/mtdblock9 if=/tmp/xxx-preloader.bin
dd bs=131072 conv=sync of=/dev/mtdblock9 seek=28 if=/tmp/xxx-bl31-uboot.fip
3. Connect to your PC via the Gigabit port of the router,
set a static ip on the ethernet interface of your PC.
(ip 192.168.1.254, gateway 192.168.1.1)
4. Download the initramfs image, and restart the router,
waiting for tftp recovery to complete.
5. After openwrt boots up, perform sysupgrade.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
[Add uboot build, fit and sysupgrade support, fix RealTek PHYs]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-10 15:08:25 +00:00
|
|
|
define Device/tplink_tl-xdr-common
|
|
|
|
DEVICE_VENDOR := TP-Link
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
2023-08-25 03:09:28 +00:00
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | append-metadata
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := fitblk kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
mediatek: add support for TP-Link TL-XDR4288/608x
Hardware specification:
SoC: MediaTek MT7986A 4x A53
Flash: ESMT F50L1G41LB 128MB
RAM: ESMT M15T4G16256A 512MB
Ethernet (Max Speed):
XDR4288: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan
XDR6086: 1x 2.5G Wan, 1x 2.5G Lan, 1x 1G Lan
XDR6088: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan
WiFi:
XDR4288: MT7976DAN (2.4G 2T2R, 5G 3T3R)
XDR6086/XDR6088:
WiFi1: MT7976GN 2.4GHz 4T4R
WiFi2: MT7976AN 5GHz 4T4R
Button: Reset, WPS, Turbo
USB: 1 x USB 3.0
Power: DC 12V 4A
Flash instructions:
1. Execute the following operation to open nc shell:
https://openwrt.org/inbox/toh/tp-link/xdr-6086#rooting
2. Replace the stock bootloader to OpenWrt's:
dd bs=131072 conv=sync of=/dev/mtdblock9 if=/tmp/xxx-preloader.bin
dd bs=131072 conv=sync of=/dev/mtdblock9 seek=28 if=/tmp/xxx-bl31-uboot.fip
3. Connect to your PC via the Gigabit port of the router,
set a static ip on the ethernet interface of your PC.
(ip 192.168.1.254, gateway 192.168.1.1)
4. Download the initramfs image, and restart the router,
waiting for tftp recovery to complete.
5. After openwrt boots up, perform sysupgrade.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
[Add uboot build, fit and sysupgrade support, fix RealTek PHYs]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-10 15:08:25 +00:00
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
2023-05-27 20:49:55 +00:00
|
|
|
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr3
|
mediatek: add support for TP-Link TL-XDR4288/608x
Hardware specification:
SoC: MediaTek MT7986A 4x A53
Flash: ESMT F50L1G41LB 128MB
RAM: ESMT M15T4G16256A 512MB
Ethernet (Max Speed):
XDR4288: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan
XDR6086: 1x 2.5G Wan, 1x 2.5G Lan, 1x 1G Lan
XDR6088: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan
WiFi:
XDR4288: MT7976DAN (2.4G 2T2R, 5G 3T3R)
XDR6086/XDR6088:
WiFi1: MT7976GN 2.4GHz 4T4R
WiFi2: MT7976AN 5GHz 4T4R
Button: Reset, WPS, Turbo
USB: 1 x USB 3.0
Power: DC 12V 4A
Flash instructions:
1. Execute the following operation to open nc shell:
https://openwrt.org/inbox/toh/tp-link/xdr-6086#rooting
2. Replace the stock bootloader to OpenWrt's:
dd bs=131072 conv=sync of=/dev/mtdblock9 if=/tmp/xxx-preloader.bin
dd bs=131072 conv=sync of=/dev/mtdblock9 seek=28 if=/tmp/xxx-bl31-uboot.fip
3. Connect to your PC via the Gigabit port of the router,
set a static ip on the ethernet interface of your PC.
(ip 192.168.1.254, gateway 192.168.1.1)
4. Download the initramfs image, and restart the router,
waiting for tftp recovery to complete.
5. After openwrt boots up, perform sysupgrade.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
[Add uboot build, fit and sysupgrade support, fix RealTek PHYs]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-10 15:08:25 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/tplink_tl-xdr4288
|
|
|
|
DEVICE_MODEL := TL-XDR4288
|
|
|
|
DEVICE_DTS := mt7986a-tplink-tl-xdr4288
|
2023-05-27 20:49:55 +00:00
|
|
|
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot tplink_tl-xdr4288
|
mediatek: add support for TP-Link TL-XDR4288/608x
Hardware specification:
SoC: MediaTek MT7986A 4x A53
Flash: ESMT F50L1G41LB 128MB
RAM: ESMT M15T4G16256A 512MB
Ethernet (Max Speed):
XDR4288: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan
XDR6086: 1x 2.5G Wan, 1x 2.5G Lan, 1x 1G Lan
XDR6088: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan
WiFi:
XDR4288: MT7976DAN (2.4G 2T2R, 5G 3T3R)
XDR6086/XDR6088:
WiFi1: MT7976GN 2.4GHz 4T4R
WiFi2: MT7976AN 5GHz 4T4R
Button: Reset, WPS, Turbo
USB: 1 x USB 3.0
Power: DC 12V 4A
Flash instructions:
1. Execute the following operation to open nc shell:
https://openwrt.org/inbox/toh/tp-link/xdr-6086#rooting
2. Replace the stock bootloader to OpenWrt's:
dd bs=131072 conv=sync of=/dev/mtdblock9 if=/tmp/xxx-preloader.bin
dd bs=131072 conv=sync of=/dev/mtdblock9 seek=28 if=/tmp/xxx-bl31-uboot.fip
3. Connect to your PC via the Gigabit port of the router,
set a static ip on the ethernet interface of your PC.
(ip 192.168.1.254, gateway 192.168.1.1)
4. Download the initramfs image, and restart the router,
waiting for tftp recovery to complete.
5. After openwrt boots up, perform sysupgrade.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
[Add uboot build, fit and sysupgrade support, fix RealTek PHYs]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-10 15:08:25 +00:00
|
|
|
$(call Device/tplink_tl-xdr-common)
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += tplink_tl-xdr4288
|
|
|
|
|
|
|
|
define Device/tplink_tl-xdr6086
|
|
|
|
DEVICE_MODEL := TL-XDR6086
|
|
|
|
DEVICE_DTS := mt7986a-tplink-tl-xdr6086
|
2023-05-27 20:49:55 +00:00
|
|
|
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot tplink_tl-xdr6086
|
mediatek: add support for TP-Link TL-XDR4288/608x
Hardware specification:
SoC: MediaTek MT7986A 4x A53
Flash: ESMT F50L1G41LB 128MB
RAM: ESMT M15T4G16256A 512MB
Ethernet (Max Speed):
XDR4288: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan
XDR6086: 1x 2.5G Wan, 1x 2.5G Lan, 1x 1G Lan
XDR6088: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan
WiFi:
XDR4288: MT7976DAN (2.4G 2T2R, 5G 3T3R)
XDR6086/XDR6088:
WiFi1: MT7976GN 2.4GHz 4T4R
WiFi2: MT7976AN 5GHz 4T4R
Button: Reset, WPS, Turbo
USB: 1 x USB 3.0
Power: DC 12V 4A
Flash instructions:
1. Execute the following operation to open nc shell:
https://openwrt.org/inbox/toh/tp-link/xdr-6086#rooting
2. Replace the stock bootloader to OpenWrt's:
dd bs=131072 conv=sync of=/dev/mtdblock9 if=/tmp/xxx-preloader.bin
dd bs=131072 conv=sync of=/dev/mtdblock9 seek=28 if=/tmp/xxx-bl31-uboot.fip
3. Connect to your PC via the Gigabit port of the router,
set a static ip on the ethernet interface of your PC.
(ip 192.168.1.254, gateway 192.168.1.1)
4. Download the initramfs image, and restart the router,
waiting for tftp recovery to complete.
5. After openwrt boots up, perform sysupgrade.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
[Add uboot build, fit and sysupgrade support, fix RealTek PHYs]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-10 15:08:25 +00:00
|
|
|
$(call Device/tplink_tl-xdr-common)
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += tplink_tl-xdr6086
|
|
|
|
|
|
|
|
define Device/tplink_tl-xdr6088
|
|
|
|
DEVICE_MODEL := TL-XDR6088
|
|
|
|
DEVICE_DTS := mt7986a-tplink-tl-xdr6088
|
2023-05-27 20:49:55 +00:00
|
|
|
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot tplink_tl-xdr6088
|
mediatek: add support for TP-Link TL-XDR4288/608x
Hardware specification:
SoC: MediaTek MT7986A 4x A53
Flash: ESMT F50L1G41LB 128MB
RAM: ESMT M15T4G16256A 512MB
Ethernet (Max Speed):
XDR4288: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan
XDR6086: 1x 2.5G Wan, 1x 2.5G Lan, 1x 1G Lan
XDR6088: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan
WiFi:
XDR4288: MT7976DAN (2.4G 2T2R, 5G 3T3R)
XDR6086/XDR6088:
WiFi1: MT7976GN 2.4GHz 4T4R
WiFi2: MT7976AN 5GHz 4T4R
Button: Reset, WPS, Turbo
USB: 1 x USB 3.0
Power: DC 12V 4A
Flash instructions:
1. Execute the following operation to open nc shell:
https://openwrt.org/inbox/toh/tp-link/xdr-6086#rooting
2. Replace the stock bootloader to OpenWrt's:
dd bs=131072 conv=sync of=/dev/mtdblock9 if=/tmp/xxx-preloader.bin
dd bs=131072 conv=sync of=/dev/mtdblock9 seek=28 if=/tmp/xxx-bl31-uboot.fip
3. Connect to your PC via the Gigabit port of the router,
set a static ip on the ethernet interface of your PC.
(ip 192.168.1.254, gateway 192.168.1.1)
4. Download the initramfs image, and restart the router,
waiting for tftp recovery to complete.
5. After openwrt boots up, perform sysupgrade.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
[Add uboot build, fit and sysupgrade support, fix RealTek PHYs]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-10 15:08:25 +00:00
|
|
|
$(call Device/tplink_tl-xdr-common)
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += tplink_tl-xdr6088
|
|
|
|
|
2024-06-18 15:02:12 +00:00
|
|
|
define Device/tplink_tl-xtr8488
|
|
|
|
DEVICE_MODEL := TL-XTR8488
|
|
|
|
DEVICE_DTS := mt7986a-tplink-tl-xtr8488
|
|
|
|
$(call Device/tplink_tl-xdr-common)
|
|
|
|
DEVICE_PACKAGES += kmod-mt7915-firmware
|
|
|
|
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr4
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot tplink_tl-xtr8488
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += tplink_tl-xtr8488
|
|
|
|
|
2023-09-17 14:59:48 +00:00
|
|
|
define Device/ubnt_unifi-6-plus
|
|
|
|
DEVICE_VENDOR := Ubiquiti
|
2024-07-18 08:37:38 +00:00
|
|
|
DEVICE_MODEL := UniFi U6+
|
2023-09-17 14:59:48 +00:00
|
|
|
DEVICE_DTS := mt7981a-ubnt-unifi-6-plus
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware e2fsprogs f2fsck mkf2fs fdisk partx-utils
|
2023-09-17 14:59:48 +00:00
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += ubnt_unifi-6-plus
|
|
|
|
|
2024-03-09 02:44:58 +00:00
|
|
|
define Device/unielec_u7981-01
|
|
|
|
DEVICE_VENDOR := Unielec
|
|
|
|
DEVICE_MODEL := U7981-01
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 e2fsprogs f2fsck mkf2fs fdisk partx-utils
|
2024-03-09 02:44:58 +00:00
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/unielec_u7981-01-emmc
|
|
|
|
DEVICE_DTS := mt7981b-unielec-u7981-01-emmc
|
|
|
|
DEVICE_VARIANT := (EMMC)
|
|
|
|
$(call Device/unielec_u7981-01)
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += unielec_u7981-01-emmc
|
|
|
|
|
|
|
|
define Device/unielec_u7981-01-nand
|
|
|
|
DEVICE_DTS := mt7981b-unielec-u7981-01-nand
|
|
|
|
DEVICE_VARIANT := (NAND)
|
|
|
|
$(call Device/unielec_u7981-01)
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += unielec_u7981-01-nand
|
|
|
|
|
mediatek: filogic: Add support for Wavlink WL-WN586X3
Hardware
--------
- SOC: MediaTek MT7981
- ram: 256MB DDR3
- FLASH: 16MB SPI-NOR
- Ethernet: 2x1Gb Lan 1x1Gb Wan
- WIFI: MediaTek MT7981 2x2 DBDC 802.11ax 2T2R (2.4/5)
- LEDs: 2xLan 1x Wan 1x WIFI 1xSTATUS
MAC table, same as stock firmware:
LAN: 80:3F:5D:xx:xx:x1 partition "hw" at 0x44e (ASCII)
WAN: 80:3F:5D:xx:xx:x2 partition "hw" at 0x460 (ASCII)
2G: 80:3F:5D:xx:xx:x3 partition "factory" at 0x4 (binary), on label
5G: 80:3F:5D:xx:xx:x3 Same as 2G
Installation Method 1: ssh
--------------------------
1. Connect PC to the lan port. Set the PC IP to 192.168.10.100 if
required.
2. Navigate to http://192.168.10.1/
3. Log into the Wavlink WebGUI. Default username/password is
admin/admin.
4. Use WebGUI to upgrade the firmware to
WAVLINK_WN586X3-A_M86X3A_V240113_WO-GDBYFM-modified.bin
downloaded from
https://github.com/themaverickdm/firmware-misc/tree/main/wavlink/wl-wn586x3
Warning: All settings will be lost!
5. Wait about 5 minutes, and after flashing is completed, log into
the router using (with admin123 as password):
ssh root@192.168.10.1
6. scp the openwrt image file onto the router, usually under /tmp
somewhere.
openwrt-mediatek-filogic-wavlink_wl-wn586x3-squashfs-sysupgrade.bin
7. Flash openwrt image file like so:
mtd write \
openwrt-mediatek-filogic-wavlink_wl-wn586x3-squashfs-sysupgrade.bin \
firmware
Warning: Previous firmware will be overwritten!
8. Wait about 5 minutes, and after the flashing is completed, set
the PC IP to 192.168.1.100 if required and log into the router
like so:
ssh root@192.168.1.1
Installation Method 2: u-boot
-----------------------------
1. Connect UART: TX-> 586X3 RX, RX-> 586X3 TX, GND-> 586 GND.
2. Connect PC to the wan (not lan!) port.
3. Setup the tftp server on PC, set IP to 192.168.10.100,
4. Power on the device. Select '2' to upgrade firmware in Uboot.
5. Input the image name and start to upgrade.
Uboot console log:
CPU: MediaTek MT7981
Model: mt7981-rfb
DRAM: 256 MiB
Core: 34 devices, 13 uclasses, devicetree: embed
Loading Environment from nowhere... OK
In: serial@11002000
Out: serial@11002000
Err: serial@11002000
Net:
Warning: ethernet@15100000 (eth0) using random MAC address -
02:47:fb:b2:53:2d
eth0: ethernet@15100000
UBOOT WN586X3A
gpio: pin 9 (gpio 9) value is 0
gpio: pin 10 (gpio 10) value is 0
gpio: pin 5 (gpio 5) value is 0
gpio: pin 12 (gpio 12) value is 0
gpio: pin 13 (gpio 13) value is 0
*** U-Boot Boot Menu ***
1. Startup system (Default)
2. Upgrade firmware
3. Upgrade ATF BL2
4. Upgrade ATF FIP
5. Upgrade single image
6. Load image
0. U-Boot console
Co-authored-by: R Maru <deviantmaru@gmail.com>
Signed-off-by: R Maru <deviantmaru@gmail.com>
Signed-off-by: Sijia Huang <engineer31@win-star.com>
2024-03-07 02:12:11 +00:00
|
|
|
define Device/wavlink_wl-wn586x3
|
|
|
|
DEVICE_VENDOR := WAVLINK
|
|
|
|
DEVICE_MODEL := WL-WN586X3
|
|
|
|
DEVICE_DTS := mt7981b-wavlink-wl-wn586x3
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTS_LOADADDR := 0x47000000
|
|
|
|
IMAGE_SIZE := 15424k
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += wavlink_wl-wn586x3
|
|
|
|
|
2023-11-27 09:01:34 +00:00
|
|
|
define Device/xiaomi_mi-router-ax3000t
|
|
|
|
DEVICE_VENDOR := Xiaomi
|
|
|
|
DEVICE_MODEL := Mi Router AX3000T
|
|
|
|
DEVICE_DTS := mt7981b-xiaomi-mi-router-ax3000t
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
2023-11-27 09:01:34 +00:00
|
|
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
|
|
|
ARTIFACTS := initramfs-factory.ubi
|
|
|
|
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-kernel.bin | ubinize-kernel
|
|
|
|
endif
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += xiaomi_mi-router-ax3000t
|
|
|
|
|
|
|
|
define Device/xiaomi_mi-router-ax3000t-ubootmod
|
|
|
|
DEVICE_VENDOR := Xiaomi
|
|
|
|
DEVICE_MODEL := Mi Router AX3000T (OpenWrt U-Boot layout)
|
|
|
|
DEVICE_DTS := mt7981b-xiaomi-mi-router-ax3000t-ubootmod
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
2023-11-27 09:01:34 +00:00
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot xiaomi_mi-router-ax3000t
|
|
|
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
|
|
|
ARTIFACTS += initramfs-factory.ubi
|
|
|
|
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += xiaomi_mi-router-ax3000t-ubootmod
|
|
|
|
|
mediatek: filogic: add support for Xiaomi WR30U
Hardware specification:
SoC: MediaTek MT7981B 2x A53
Flash: ESMT F50L1G41LB 128MB
RAM: NT52B128M16JR-FL 256MB
Ethernet: 4x 10/100/1000 Mbps
Switch: MediaTek MT7531AE
WiFi: MediaTek MT7976C
Button: Reset, Mesh
Power: DC 12V 1A
Flash instructions:
1. Get ssh access
Check this link: https://forum.openwrt.org/t/openwrt-support-for-xiaomi-ax3000ne/153769/22
2. Backup import partitions
```
dev: size erasesize name
mtd1: 00100000 00020000 "BL2"
mtd2: 00040000 00020000 "Nvram"
mtd3: 00040000 00020000 "Bdata"
mtd4: 00200000 00020000 "Factory"
mtd5: 00200000 00020000 "FIP"
mtd8: 02200000 00020000 "ubi"
mtd9: 02200000 00020000 "ubi1"
mtd12: 00040000 00020000 "KF"
```
Use these commands blow to backup your stock partitions.
```
nanddump -f /tmp/BL2.bin /dev/mtd1
nanddump -f /tmp/Nvram.bin /dev/mtd2
nanddump -f /tmp/Bdata.bin /dev/mtd3
nanddump -f /tmp/Factory.bin /dev/mtd4
nanddump -f /tmp/FIP.bin /dev/mtd5
nanddump -f /tmp/ubi.bin /dev/mtd8
nanddump -f /tmp/KF.bin /dev/mtd12
```
Then, transfer them to your computer via scp, netcat, tftp
or others and keep them in a safe place.
3. Setup Nvram
Get the current stock: `cat /proc/cmdline`
If you find `firmware=0` or `mtd=ubi`, use these commands:
```
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=1
nvram set flag_last_success=1
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
```
If you find `firmware=1` or `mtd=ubi1`, use these commands:
```
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=0
nvram set flag_last_success=0
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
```
4. Flash stock-initramfs-factory.ubi
If you find `firmware=0` or `mtd=ubi`:
`ubiformat /dev/mtd9 -y -f /tmp/stock-initramfs-factory.ubi`
If you find `firmware=1` or `mtd=ubi1`:
`ubiformat /dev/mtd8 -y -f /tmp/stock-initramfs-factory.ubi`
Then reboot your router, it should boot to the openwrt
initramfs system now.
5. Setup uboot-env
Now it will be setup automatically in upgrade process,
you can skip this step.
If your `fw_setenv` did not work, you need run this command:
`echo "/dev/mtd1 0x0 0x10000 0x20000" > /etc/fw_env.config`
Then setup uboot-env:
```
fw_setenv boot_wait on
fw_setenv uart_en 1
fw_setenv flag_boot_rootfs 0
fw_setenv flag_last_success 1
fw_setenv flag_boot_success 1
fw_setenv flag_try_sys1_failed 8
fw_setenv flag_try_sys2_failed 8
fw_setenv mtdparts "nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),
2048k(factory),2048k(fip),256k(crash),256k(crash_log),
34816k(ubi),34816k(ubi1),32768k(overlay),12288k(data),256k(KF)"
```
6. Flash stock-squashfs-sysupgrade.bin
Use shell command:
`sysupgrade -n /tmp/stock-squashfs-sysupgrade.bin`
Or go to luci web.
If you need to change to Openwrt U-Boot layout, do next. If you
do not need, please ignore it.
Change to OpenWrt U-Boot:
1. Flash ubootmod-initramfs-factory.ubi
Check mtd partitions: `cat /proc/mtd`
```
mtd7: 00040000 00020000 "KF"
mtd8: 02200000 00020000 "ubi_kernel"
mtd9: 04e00000 00020000 "ubi"
```
Run following command:
`ubiformat /dev/mtd8 -y -f /tmp/ubootmod-initramfs-factory.ubi`
Then reboot your router, it should boot to the openwrt initramfs
system now.
2. Check mtd again
```
mtd7: 00040000 00020000 "KF"
mtd8: 07000000 00020000 "ubi"
```
Make sure mtd8 is ubi.
3. Install kmod-mtd-rw
Run command: `opkg update && opkg install kmod-mtd-rw`
Or get it in openwrt server, or build it yourself, then install
it manually
Then run this command:
`insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`
4. Clean up pstore
Run Command: `rm -f /sys/fs/pstore/*`
5. Format ubi and create new ubootenv volume
```
ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
```
6. (Optional) Add recovery boot feature.
```
ubimkvol /dev/ubi0 -n 2 -N recovery -s 10MiB
ubiupdatevol /dev/ubi0_2 /tmp/ubootmod-initramfs-recovery.itb
```
7. Flash Openwrt U-Boot
```
mtd write /tmp/ubootmod-preloader.bin BL2
mtd write /tmp/ubootmod-bl31-uboot.fip FIP
```
6. Flash ubootmod-squashfs-sysupgrade.itb
Use shell command:
`sysupgrade -n /tmp/ubootmod-squashfs-sysupgrade.itb`
Or go to luci web.
Now everything is done, Enjoy!
Go Back to stock from Openwrt U-Boot:
1. Force flash ubootmod-initramfs-recovery.itb
Use shell command:
`sysupgrade -F -n /tmp/ubootmod-initramfs-recovery.itb`
Or go to luci web.
Then it should boot to the openwrt initramfs system now.
2. Format ubi and Nvram
```
ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
mtd erase Nvram
```
3. Install kmod-mtd-rw
Run command: `opkg update && opkg install kmod-mtd-rw`
Or get it in openwrt server, or build it yourself, then install
it manually
Then run this command:
`insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`
4. Flash stock U-Boot and ubi
```
mtd write /tmp/BL2.bin BL2
mtd write /tmp/FIP.bin FIP
mtd write /tmp/ubi.bin ubi
```
Then reboot your router, waiting it finished rollback in minutes.
Go Back to stock from stock layout Openwrt:
Just run command: `ubiformat /dev/mtd8 -y -f /tmp/ubi.bin`
Then reboot your router, waiting it finished rollback in minutes.
Notes:
1. Openwrt U-Boot and ubootmod openwrt did not enable NMBM.
Please make your backup safe.
Signed-off-by: Hank Moretti <mchank9999@gmail.com>
2023-07-21 03:54:52 +00:00
|
|
|
define Device/xiaomi_mi-router-wr30u-stock
|
|
|
|
DEVICE_VENDOR := Xiaomi
|
|
|
|
DEVICE_MODEL := Mi Router WR30U (stock layout)
|
|
|
|
DEVICE_DTS := mt7981b-xiaomi-mi-router-wr30u-stock
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
mediatek: filogic: add support for Xiaomi WR30U
Hardware specification:
SoC: MediaTek MT7981B 2x A53
Flash: ESMT F50L1G41LB 128MB
RAM: NT52B128M16JR-FL 256MB
Ethernet: 4x 10/100/1000 Mbps
Switch: MediaTek MT7531AE
WiFi: MediaTek MT7976C
Button: Reset, Mesh
Power: DC 12V 1A
Flash instructions:
1. Get ssh access
Check this link: https://forum.openwrt.org/t/openwrt-support-for-xiaomi-ax3000ne/153769/22
2. Backup import partitions
```
dev: size erasesize name
mtd1: 00100000 00020000 "BL2"
mtd2: 00040000 00020000 "Nvram"
mtd3: 00040000 00020000 "Bdata"
mtd4: 00200000 00020000 "Factory"
mtd5: 00200000 00020000 "FIP"
mtd8: 02200000 00020000 "ubi"
mtd9: 02200000 00020000 "ubi1"
mtd12: 00040000 00020000 "KF"
```
Use these commands blow to backup your stock partitions.
```
nanddump -f /tmp/BL2.bin /dev/mtd1
nanddump -f /tmp/Nvram.bin /dev/mtd2
nanddump -f /tmp/Bdata.bin /dev/mtd3
nanddump -f /tmp/Factory.bin /dev/mtd4
nanddump -f /tmp/FIP.bin /dev/mtd5
nanddump -f /tmp/ubi.bin /dev/mtd8
nanddump -f /tmp/KF.bin /dev/mtd12
```
Then, transfer them to your computer via scp, netcat, tftp
or others and keep them in a safe place.
3. Setup Nvram
Get the current stock: `cat /proc/cmdline`
If you find `firmware=0` or `mtd=ubi`, use these commands:
```
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=1
nvram set flag_last_success=1
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
```
If you find `firmware=1` or `mtd=ubi1`, use these commands:
```
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=0
nvram set flag_last_success=0
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
```
4. Flash stock-initramfs-factory.ubi
If you find `firmware=0` or `mtd=ubi`:
`ubiformat /dev/mtd9 -y -f /tmp/stock-initramfs-factory.ubi`
If you find `firmware=1` or `mtd=ubi1`:
`ubiformat /dev/mtd8 -y -f /tmp/stock-initramfs-factory.ubi`
Then reboot your router, it should boot to the openwrt
initramfs system now.
5. Setup uboot-env
Now it will be setup automatically in upgrade process,
you can skip this step.
If your `fw_setenv` did not work, you need run this command:
`echo "/dev/mtd1 0x0 0x10000 0x20000" > /etc/fw_env.config`
Then setup uboot-env:
```
fw_setenv boot_wait on
fw_setenv uart_en 1
fw_setenv flag_boot_rootfs 0
fw_setenv flag_last_success 1
fw_setenv flag_boot_success 1
fw_setenv flag_try_sys1_failed 8
fw_setenv flag_try_sys2_failed 8
fw_setenv mtdparts "nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),
2048k(factory),2048k(fip),256k(crash),256k(crash_log),
34816k(ubi),34816k(ubi1),32768k(overlay),12288k(data),256k(KF)"
```
6. Flash stock-squashfs-sysupgrade.bin
Use shell command:
`sysupgrade -n /tmp/stock-squashfs-sysupgrade.bin`
Or go to luci web.
If you need to change to Openwrt U-Boot layout, do next. If you
do not need, please ignore it.
Change to OpenWrt U-Boot:
1. Flash ubootmod-initramfs-factory.ubi
Check mtd partitions: `cat /proc/mtd`
```
mtd7: 00040000 00020000 "KF"
mtd8: 02200000 00020000 "ubi_kernel"
mtd9: 04e00000 00020000 "ubi"
```
Run following command:
`ubiformat /dev/mtd8 -y -f /tmp/ubootmod-initramfs-factory.ubi`
Then reboot your router, it should boot to the openwrt initramfs
system now.
2. Check mtd again
```
mtd7: 00040000 00020000 "KF"
mtd8: 07000000 00020000 "ubi"
```
Make sure mtd8 is ubi.
3. Install kmod-mtd-rw
Run command: `opkg update && opkg install kmod-mtd-rw`
Or get it in openwrt server, or build it yourself, then install
it manually
Then run this command:
`insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`
4. Clean up pstore
Run Command: `rm -f /sys/fs/pstore/*`
5. Format ubi and create new ubootenv volume
```
ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
```
6. (Optional) Add recovery boot feature.
```
ubimkvol /dev/ubi0 -n 2 -N recovery -s 10MiB
ubiupdatevol /dev/ubi0_2 /tmp/ubootmod-initramfs-recovery.itb
```
7. Flash Openwrt U-Boot
```
mtd write /tmp/ubootmod-preloader.bin BL2
mtd write /tmp/ubootmod-bl31-uboot.fip FIP
```
6. Flash ubootmod-squashfs-sysupgrade.itb
Use shell command:
`sysupgrade -n /tmp/ubootmod-squashfs-sysupgrade.itb`
Or go to luci web.
Now everything is done, Enjoy!
Go Back to stock from Openwrt U-Boot:
1. Force flash ubootmod-initramfs-recovery.itb
Use shell command:
`sysupgrade -F -n /tmp/ubootmod-initramfs-recovery.itb`
Or go to luci web.
Then it should boot to the openwrt initramfs system now.
2. Format ubi and Nvram
```
ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
mtd erase Nvram
```
3. Install kmod-mtd-rw
Run command: `opkg update && opkg install kmod-mtd-rw`
Or get it in openwrt server, or build it yourself, then install
it manually
Then run this command:
`insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`
4. Flash stock U-Boot and ubi
```
mtd write /tmp/BL2.bin BL2
mtd write /tmp/FIP.bin FIP
mtd write /tmp/ubi.bin ubi
```
Then reboot your router, waiting it finished rollback in minutes.
Go Back to stock from stock layout Openwrt:
Just run command: `ubiformat /dev/mtd8 -y -f /tmp/ubi.bin`
Then reboot your router, waiting it finished rollback in minutes.
Notes:
1. Openwrt U-Boot and ubootmod openwrt did not enable NMBM.
Please make your backup safe.
Signed-off-by: Hank Moretti <mchank9999@gmail.com>
2023-07-21 03:54:52 +00:00
|
|
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
|
|
|
ARTIFACTS := initramfs-factory.ubi
|
|
|
|
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-kernel.bin | ubinize-kernel
|
|
|
|
endif
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += xiaomi_mi-router-wr30u-stock
|
|
|
|
|
|
|
|
define Device/xiaomi_mi-router-wr30u-ubootmod
|
|
|
|
DEVICE_VENDOR := Xiaomi
|
|
|
|
DEVICE_MODEL := Mi Router WR30U (OpenWrt U-Boot layout)
|
|
|
|
DEVICE_DTS := mt7981b-xiaomi-mi-router-wr30u-ubootmod
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
mediatek: filogic: add support for Xiaomi WR30U
Hardware specification:
SoC: MediaTek MT7981B 2x A53
Flash: ESMT F50L1G41LB 128MB
RAM: NT52B128M16JR-FL 256MB
Ethernet: 4x 10/100/1000 Mbps
Switch: MediaTek MT7531AE
WiFi: MediaTek MT7976C
Button: Reset, Mesh
Power: DC 12V 1A
Flash instructions:
1. Get ssh access
Check this link: https://forum.openwrt.org/t/openwrt-support-for-xiaomi-ax3000ne/153769/22
2. Backup import partitions
```
dev: size erasesize name
mtd1: 00100000 00020000 "BL2"
mtd2: 00040000 00020000 "Nvram"
mtd3: 00040000 00020000 "Bdata"
mtd4: 00200000 00020000 "Factory"
mtd5: 00200000 00020000 "FIP"
mtd8: 02200000 00020000 "ubi"
mtd9: 02200000 00020000 "ubi1"
mtd12: 00040000 00020000 "KF"
```
Use these commands blow to backup your stock partitions.
```
nanddump -f /tmp/BL2.bin /dev/mtd1
nanddump -f /tmp/Nvram.bin /dev/mtd2
nanddump -f /tmp/Bdata.bin /dev/mtd3
nanddump -f /tmp/Factory.bin /dev/mtd4
nanddump -f /tmp/FIP.bin /dev/mtd5
nanddump -f /tmp/ubi.bin /dev/mtd8
nanddump -f /tmp/KF.bin /dev/mtd12
```
Then, transfer them to your computer via scp, netcat, tftp
or others and keep them in a safe place.
3. Setup Nvram
Get the current stock: `cat /proc/cmdline`
If you find `firmware=0` or `mtd=ubi`, use these commands:
```
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=1
nvram set flag_last_success=1
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
```
If you find `firmware=1` or `mtd=ubi1`, use these commands:
```
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=0
nvram set flag_last_success=0
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
```
4. Flash stock-initramfs-factory.ubi
If you find `firmware=0` or `mtd=ubi`:
`ubiformat /dev/mtd9 -y -f /tmp/stock-initramfs-factory.ubi`
If you find `firmware=1` or `mtd=ubi1`:
`ubiformat /dev/mtd8 -y -f /tmp/stock-initramfs-factory.ubi`
Then reboot your router, it should boot to the openwrt
initramfs system now.
5. Setup uboot-env
Now it will be setup automatically in upgrade process,
you can skip this step.
If your `fw_setenv` did not work, you need run this command:
`echo "/dev/mtd1 0x0 0x10000 0x20000" > /etc/fw_env.config`
Then setup uboot-env:
```
fw_setenv boot_wait on
fw_setenv uart_en 1
fw_setenv flag_boot_rootfs 0
fw_setenv flag_last_success 1
fw_setenv flag_boot_success 1
fw_setenv flag_try_sys1_failed 8
fw_setenv flag_try_sys2_failed 8
fw_setenv mtdparts "nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),
2048k(factory),2048k(fip),256k(crash),256k(crash_log),
34816k(ubi),34816k(ubi1),32768k(overlay),12288k(data),256k(KF)"
```
6. Flash stock-squashfs-sysupgrade.bin
Use shell command:
`sysupgrade -n /tmp/stock-squashfs-sysupgrade.bin`
Or go to luci web.
If you need to change to Openwrt U-Boot layout, do next. If you
do not need, please ignore it.
Change to OpenWrt U-Boot:
1. Flash ubootmod-initramfs-factory.ubi
Check mtd partitions: `cat /proc/mtd`
```
mtd7: 00040000 00020000 "KF"
mtd8: 02200000 00020000 "ubi_kernel"
mtd9: 04e00000 00020000 "ubi"
```
Run following command:
`ubiformat /dev/mtd8 -y -f /tmp/ubootmod-initramfs-factory.ubi`
Then reboot your router, it should boot to the openwrt initramfs
system now.
2. Check mtd again
```
mtd7: 00040000 00020000 "KF"
mtd8: 07000000 00020000 "ubi"
```
Make sure mtd8 is ubi.
3. Install kmod-mtd-rw
Run command: `opkg update && opkg install kmod-mtd-rw`
Or get it in openwrt server, or build it yourself, then install
it manually
Then run this command:
`insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`
4. Clean up pstore
Run Command: `rm -f /sys/fs/pstore/*`
5. Format ubi and create new ubootenv volume
```
ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
```
6. (Optional) Add recovery boot feature.
```
ubimkvol /dev/ubi0 -n 2 -N recovery -s 10MiB
ubiupdatevol /dev/ubi0_2 /tmp/ubootmod-initramfs-recovery.itb
```
7. Flash Openwrt U-Boot
```
mtd write /tmp/ubootmod-preloader.bin BL2
mtd write /tmp/ubootmod-bl31-uboot.fip FIP
```
6. Flash ubootmod-squashfs-sysupgrade.itb
Use shell command:
`sysupgrade -n /tmp/ubootmod-squashfs-sysupgrade.itb`
Or go to luci web.
Now everything is done, Enjoy!
Go Back to stock from Openwrt U-Boot:
1. Force flash ubootmod-initramfs-recovery.itb
Use shell command:
`sysupgrade -F -n /tmp/ubootmod-initramfs-recovery.itb`
Or go to luci web.
Then it should boot to the openwrt initramfs system now.
2. Format ubi and Nvram
```
ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
mtd erase Nvram
```
3. Install kmod-mtd-rw
Run command: `opkg update && opkg install kmod-mtd-rw`
Or get it in openwrt server, or build it yourself, then install
it manually
Then run this command:
`insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`
4. Flash stock U-Boot and ubi
```
mtd write /tmp/BL2.bin BL2
mtd write /tmp/FIP.bin FIP
mtd write /tmp/ubi.bin ubi
```
Then reboot your router, waiting it finished rollback in minutes.
Go Back to stock from stock layout Openwrt:
Just run command: `ubiformat /dev/mtd8 -y -f /tmp/ubi.bin`
Then reboot your router, waiting it finished rollback in minutes.
Notes:
1. Openwrt U-Boot and ubootmod openwrt did not enable NMBM.
Please make your backup safe.
Signed-off-by: Hank Moretti <mchank9999@gmail.com>
2023-07-21 03:54:52 +00:00
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot xiaomi_mi-router-wr30u
|
|
|
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
|
|
|
ARTIFACTS += initramfs-factory.ubi
|
|
|
|
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += xiaomi_mi-router-wr30u-ubootmod
|
|
|
|
|
mediatek: add alternative stock layout for Xiaomi Redmi Router AX6000
In this implementation, the flash partition layout is adjusted to avoid
modifying the uboot environment of mtdparts. This ensures that the 30M
ubi_kernel partition remains aligned with the stock ubi partition, and
the kernel volume is placed in it. This allows the stock uboot to boot
from it without changing the mtdparts, which is useful for reverting back
to the stock firmware using Xiaomi Firmware Tools. In actual testing,
modifying mtdparts has been found to break Xiaomi Firmware Tools.
1. use ARTIFACTS to generate initramfs-factory.ubi for easy installation.
2. The NAND flash layout is changed to allow for reverting back to the
stock firmware.
3. Before performing sysupgrade, do some cleanup in platform_pre_upgrade
to ensure a clean installation of OpenWRT.
4. Setup the uboot env to ensure that the system always boot, which can
be helpful for users who may forget to do this before sysupgrade in
the initramfs.
New flash instructions:
1. Gain ssh access. Please refer to:
https://openwrt.org/toh/xiaomi/redmi_ax6000#installation)
2. Check which system current u-boot is loading from:
COMMAND: `cat /proc/cmdline`
sample OUTPUT: `console=ttyS0,115200n1 loglevel=8 firmware=1 uart_en=1`
if firmware=1, current system is ubi1
if firmware=0, current system is ubi0
3. Setup nvram and write the firmware:
If the current system is ubi1, please set it up so that the next time
it will boot from ubi, and write the firmware to ubi:
```
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=0
nvram set flag_last_success=0
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
ubiformat /dev/mtd8 -y -f /tmp/initramfs-factory.ubi
```
If the current system is ubi, please set it up so that the next time
it will boot from ubi1, and write the firmware to ubi1:
```
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=1
nvram set flag_last_success=1
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
ubiformat /dev/mtd9 -y -f /tmp/initramfs-factory.ubi
```
4. After rebooting, the system should now boot into the openwrt initramfs.
Flash the squashfs-sysupgrade.bin via using ssh or luci.
```
sysupgrade -n /tmp/squashfs-sysupgrade.bin
```
Done.
For existing users of the Redmi AX6000 running OpenWrt, here are the steps to
switch to this new layout:
1. Flash initramfs-factory.ubi
```
mtd -r -e ubi write /tmp/initramfs-factory.ubi ubi
```
2. After rebooting, the system will boot into the new openwrt-initramfs.
Log in and perform a sysupgrade to complete the process.
```
sysupgrade -n /tmp/squashfs-sysupgrade.bin
```
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2022-09-13 05:46:20 +00:00
|
|
|
define Device/xiaomi_redmi-router-ax6000-stock
|
|
|
|
DEVICE_VENDOR := Xiaomi
|
|
|
|
DEVICE_MODEL := Redmi Router AX6000 (stock layout)
|
|
|
|
DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000-stock
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-leds-ws2812b kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
mediatek: add alternative stock layout for Xiaomi Redmi Router AX6000
In this implementation, the flash partition layout is adjusted to avoid
modifying the uboot environment of mtdparts. This ensures that the 30M
ubi_kernel partition remains aligned with the stock ubi partition, and
the kernel volume is placed in it. This allows the stock uboot to boot
from it without changing the mtdparts, which is useful for reverting back
to the stock firmware using Xiaomi Firmware Tools. In actual testing,
modifying mtdparts has been found to break Xiaomi Firmware Tools.
1. use ARTIFACTS to generate initramfs-factory.ubi for easy installation.
2. The NAND flash layout is changed to allow for reverting back to the
stock firmware.
3. Before performing sysupgrade, do some cleanup in platform_pre_upgrade
to ensure a clean installation of OpenWRT.
4. Setup the uboot env to ensure that the system always boot, which can
be helpful for users who may forget to do this before sysupgrade in
the initramfs.
New flash instructions:
1. Gain ssh access. Please refer to:
https://openwrt.org/toh/xiaomi/redmi_ax6000#installation)
2. Check which system current u-boot is loading from:
COMMAND: `cat /proc/cmdline`
sample OUTPUT: `console=ttyS0,115200n1 loglevel=8 firmware=1 uart_en=1`
if firmware=1, current system is ubi1
if firmware=0, current system is ubi0
3. Setup nvram and write the firmware:
If the current system is ubi1, please set it up so that the next time
it will boot from ubi, and write the firmware to ubi:
```
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=0
nvram set flag_last_success=0
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
ubiformat /dev/mtd8 -y -f /tmp/initramfs-factory.ubi
```
If the current system is ubi, please set it up so that the next time
it will boot from ubi1, and write the firmware to ubi1:
```
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=1
nvram set flag_last_success=1
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
ubiformat /dev/mtd9 -y -f /tmp/initramfs-factory.ubi
```
4. After rebooting, the system should now boot into the openwrt initramfs.
Flash the squashfs-sysupgrade.bin via using ssh or luci.
```
sysupgrade -n /tmp/squashfs-sysupgrade.bin
```
Done.
For existing users of the Redmi AX6000 running OpenWrt, here are the steps to
switch to this new layout:
1. Flash initramfs-factory.ubi
```
mtd -r -e ubi write /tmp/initramfs-factory.ubi ubi
```
2. After rebooting, the system will boot into the new openwrt-initramfs.
Log in and perform a sysupgrade to complete the process.
```
sysupgrade -n /tmp/squashfs-sysupgrade.bin
```
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2022-09-13 05:46:20 +00:00
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
|
|
|
ARTIFACTS := initramfs-factory.ubi
|
|
|
|
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-kernel.bin | ubinize-kernel
|
|
|
|
endif
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += xiaomi_redmi-router-ax6000-stock
|
2022-12-22 02:40:26 +00:00
|
|
|
|
|
|
|
define Device/xiaomi_redmi-router-ax6000-ubootmod
|
|
|
|
DEVICE_VENDOR := Xiaomi
|
|
|
|
DEVICE_MODEL := Redmi Router AX6000 (OpenWrt U-Boot layout)
|
|
|
|
DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000-ubootmod
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-leds-ws2812b kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
2022-12-22 02:40:26 +00:00
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
2023-05-27 20:49:55 +00:00
|
|
|
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr4
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot xiaomi_redmi-router-ax6000
|
2022-12-22 02:40:26 +00:00
|
|
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
|
|
|
ARTIFACTS += initramfs-factory.ubi
|
|
|
|
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += xiaomi_redmi-router-ax6000-ubootmod
|
mediatek: add support for Zyxel EX5601-T0 router
Zyxel EX5601-T0 specifics
--------------
The operator specific firmware running on the Zyxel branded
EX5601-T0 includes U-Boot modifications affecting the OpenWrt
installation.
Partition Table
| dev | size | erasesize | name |
| ---- | -------- | --------- | ------------- |
| mtd0 | 20000000 | 00040000 | "spi0.1" |
| mtd1 | 00100000 | 00040000 | "BL2" |
| mtd2 | 00080000 | 00040000 | "u-boot-env" |
| mtd3 | 00200000 | 00040000 | "Factory" |
| mtd4 | 001c0000 | 00040000 | "FIP" |
| mtd5 | 00040000 | 00040000 | "zloader" |
| mtd6 | 04000000 | 00040000 | "ubi" |
| mtd7 | 04000000 | 00040000 | "ubi2" |
| mtd8 | 15a80000 | 00040000 | "zyubi" |
The router boots BL2 which than loads FIP (u-boot).
U-boot has hardcoded a command to always launch Zloader "mtd read zloader 0x46000000" and than "bootm". Bootargs are deactivated.
Zloader is the zyxel booloader which allow to dual-boot ubi or ubi2, by default access to zloader is blocked.
Too zloader checks that the firmware contains a particolar file called zyfwinfo.
Additional details regarding Zloader can be found here:
https://hack-gpon.github.io/zyxel/
https://forum.openwrt.org/t/adding-openwrt-support-for-zyxel-ex5601-t0/155914
Hardware
--------
SOC: MediaTek MT7986a
CPU: 4 core cortex-a53 (2000MHz)
RAM: 1GB DDR4
FLASH: 512MB SPI-NAND (Micron xxx)
WIFI: Wifi6 Mediatek MT7976 802.11ax 5 GHz 4x4 + 2.4GHZ 4x4
ETH: MediaTek MT7531 Switch + SoC
3 x builtin 1G phy (lan1, lan2, lan3)
1 x MaxLinear GPY211B 2.5 N-Base-T phy5 (lan4)
1 x MaxLinear GPY211B 2.5Gbit xor SFP/N-Base-T phy6 (wan)
USB: 1 x USB 3.2 Enhanced SuperSpeed port
UART: 3V3 115200 8N1 (Pinout: GND KEY RX TX VCC)
VOIP: 2 FXS ports for analog phones
MAC Address Table
-----------------
eth0/lan Factory 0x002a
eth1/wan Factory 0x0024
wifi 2.4Ghz Factory 0x0004
wifi 5Ghz Factory 0x0004 + 1
Serial console (UART)
---------------------
+-------+-------+-------+-------+-------+
| +3.3V | RX | TX | KEY | GND |
+---+---+-------+-------+-------+-------+
|
+--- Don't connect
Installation
------------
Keep in mind that openwrt can only run on the UBI partition, the openwrt firmware is not able to understand the zloader bootargs.
The procedure allows restoring the UBI partition with the Zyxel firmware and retains all the OEM functionalities.
1. Unlock Zloader (this will allow to swap manually between partitions UBI and UBI2):
- Attach a usb-ttl adapter to your computer and boot the router.
- While the router is booting at some point you will read the following: `Please press Enter to activate this console.`
- As soon as you read that press enter, type root and than press enter again (just do it, don't care about the logs scrolling).
- Most likely the router is still printing the boot log, leave it boot until it stops.
- If everything went ok you should have full root access "root@EX5601-T0:/#".
- Type the following command and press enter: "fw_setenv EngDebugFlag 0x1".
- Reboot the router.
- As soon as you read `Hit any key to stop autoboot:` press Enter.
- If everything went ok you should have the following prompt: "ZHAL>".
- You have successfully unlocked zloader access, this procedure must be done only once.
2. Check the current active partition:
- Boot the router and repeat the steps above to gain root access.
- Type the following command to check the current active image: "cat /proc/cmdline".
- If `rootubi=ubi` it means that the active partition is `mtd6`
- If `rootubi=ubi2` it means that the active partition is `mtd7`
- As mentioned earlier we need to flash openwrt into ubi/mtd6 and never overwrite ubi2/mtd7 to be able to fully roll-back.
- To activate and boot from mtd7 (ubi2) enter into ZHAL> command prompt and type the following commands:
atbt 1 # unlock write
atsw # swap boot partition
atsr # reboot the router
- After rebooting check again with "cat /proc/cmdline" that you are correctly booting from mtd7/ubi2
- If yes proceed with the installation guide. If not probably you don't have a firmware into ubi2 or you did something wrong.
3. Flashing:
- Download the sysupgrade file for the router from openwrt, than we need to add the zyfwinfo file into the sysupgrade tar.
Zloader only checks for the magic (which is a fixed value 'EXYZ') and the crc of the file itself (256bytes).
I created a script to create a valid zyfwinfo file but you can use anything that does exactly the same:
https://raw.githubusercontent.com/pameruoso/OpenWRT-Zyxel-EX5601-T0/main/gen_zyfwinfo.sh
- Add the zyfwinfo file into the sysupgrade tar.
- Enter via telnet or ssh into the router with admin credentials
- Enter the following commands to disable the firmware and model checks
"zycli fwidcheck off" and "zycli modelcheck off"
- Open the router web interface and in the update firmware page select the "restore default settings option"
- Select the sysupgrade file and click on upload.
- The router will flash and reboot itself into openwrt from UBI
4. Restoring and going back to Zyxel firmware.
- Use the ZHAL> command line to manually swap the boot parition to UBI2 with the following:
atbt 1 # unlock write
atsw # swap boot partition
atsr # reboot the router
- You will boot again the Zyxel firmware you have into UBI2 and you can flash the zyxel firmware to overwrite the UBI partition and openwrt.
Working features
----------------
3 gbit lan ports
Wifi
Zyxel partitioning for coexistance with Zloader and dual boot.
WAN SFP port (only after exporting pins 57 and 10. gpiobase411)
leds
reset button
serial interface
usb port
lan ethernet 2.5 gbit port (autosense)
wan ethernet 2.5 gbit port (autosense)
Not working
----------------
voip (missing drivers or proper zyxel platform software)
Swapping the wan ethernet/sfp xor port
----------------
The way to swap the wan port between sfp and ethernet is the following:
export the pins 57 and 10.
Pin 57 is used to probe if an sfp is present.
If pin 57 value is 0 it means that an sfp is present into the cage (cat /sys/class/gpio/gpio468/value).
If pin 57 value is 1 it means that no sfp is inserted into the cage.
In conclusion by default both 57 an 10 pins are by default 1, which means that the active port is the ethernet one.
After inserting an SFP pin 57 will become 0 and you have to manually change the value of pin 10 to 0 too.
This is totally scriptable of course.
Leds description
------------
All the leds are working out of the box but the leds managed by the 2 maxlinear phy (phy 5 lan, phy6 wan).
To activate the phy5 led (rj45 ethernet port led on the back of the router) you have to use mdio-tools.
To activate the phy6 led (led on the front of the router for 2.5gbit link) you have to use mdio-tools.
Example:
Set lan5 led to fast blink on 2500/1000, slow blink on 10/100:
mdio mdio-bus mmd 5:30 raw 0x0001 0x33FC
Set wan 2.5gbit led to constant on when wan is 2.5gbit:
mdio mdio-bus mmd 6:30 raw 0x0001 0x0080
Signed-off-by: Pietro Ameruoso <p.ameruoso@live.it>
2023-05-22 07:52:47 +00:00
|
|
|
|
2023-10-13 10:44:11 +00:00
|
|
|
define Device/yuncore_ax835
|
|
|
|
DEVICE_VENDOR := YunCore
|
|
|
|
DEVICE_MODEL := AX835
|
|
|
|
DEVICE_DTS := mt7981b-yuncore-ax835
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_DTS_LOADADDR := 0x47000000
|
|
|
|
IMAGES := sysupgrade.bin
|
|
|
|
IMAGE_SIZE := 14336k
|
|
|
|
SUPPORTED_DEVICES += mediatek,mt7981-spim-nor-rfb
|
|
|
|
KERNEL := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | check-size | append-metadata
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
2023-10-13 10:44:11 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += yuncore_ax835
|
|
|
|
|
2023-11-20 20:23:42 +00:00
|
|
|
define Device/zbtlink_zbt-z8102ax
|
|
|
|
DEVICE_VENDOR := Zbtlink
|
|
|
|
DEVICE_MODEL := ZBT-Z8102AX
|
|
|
|
DEVICE_DTS := mt7981b-zbtlink-zbt-z8102ax
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 kmod-usb-net-qmi-wwan kmod-usb-serial-option
|
2023-11-20 20:23:42 +00:00
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
IMAGES += factory.bin
|
|
|
|
IMAGE/factory.bin := append-ubi | check-size $$(IMAGE_SIZE)
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += zbtlink_zbt-z8102ax
|
|
|
|
|
2023-12-09 04:48:35 +00:00
|
|
|
define Device/zbtlink_zbt-z8103ax
|
|
|
|
DEVICE_VENDOR := Zbtlink
|
|
|
|
DEVICE_MODEL := ZBT-Z8103AX
|
|
|
|
DEVICE_DTS := mt7981b-zbtlink-zbt-z8103ax
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
2023-12-09 04:48:35 +00:00
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
IMAGES += factory.bin
|
|
|
|
IMAGE/factory.bin := append-ubi | check-size $$(IMAGE_SIZE)
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += zbtlink_zbt-z8103ax
|
|
|
|
|
mediatek: add support for Zyxel EX5601-T0 router
Zyxel EX5601-T0 specifics
--------------
The operator specific firmware running on the Zyxel branded
EX5601-T0 includes U-Boot modifications affecting the OpenWrt
installation.
Partition Table
| dev | size | erasesize | name |
| ---- | -------- | --------- | ------------- |
| mtd0 | 20000000 | 00040000 | "spi0.1" |
| mtd1 | 00100000 | 00040000 | "BL2" |
| mtd2 | 00080000 | 00040000 | "u-boot-env" |
| mtd3 | 00200000 | 00040000 | "Factory" |
| mtd4 | 001c0000 | 00040000 | "FIP" |
| mtd5 | 00040000 | 00040000 | "zloader" |
| mtd6 | 04000000 | 00040000 | "ubi" |
| mtd7 | 04000000 | 00040000 | "ubi2" |
| mtd8 | 15a80000 | 00040000 | "zyubi" |
The router boots BL2 which than loads FIP (u-boot).
U-boot has hardcoded a command to always launch Zloader "mtd read zloader 0x46000000" and than "bootm". Bootargs are deactivated.
Zloader is the zyxel booloader which allow to dual-boot ubi or ubi2, by default access to zloader is blocked.
Too zloader checks that the firmware contains a particolar file called zyfwinfo.
Additional details regarding Zloader can be found here:
https://hack-gpon.github.io/zyxel/
https://forum.openwrt.org/t/adding-openwrt-support-for-zyxel-ex5601-t0/155914
Hardware
--------
SOC: MediaTek MT7986a
CPU: 4 core cortex-a53 (2000MHz)
RAM: 1GB DDR4
FLASH: 512MB SPI-NAND (Micron xxx)
WIFI: Wifi6 Mediatek MT7976 802.11ax 5 GHz 4x4 + 2.4GHZ 4x4
ETH: MediaTek MT7531 Switch + SoC
3 x builtin 1G phy (lan1, lan2, lan3)
1 x MaxLinear GPY211B 2.5 N-Base-T phy5 (lan4)
1 x MaxLinear GPY211B 2.5Gbit xor SFP/N-Base-T phy6 (wan)
USB: 1 x USB 3.2 Enhanced SuperSpeed port
UART: 3V3 115200 8N1 (Pinout: GND KEY RX TX VCC)
VOIP: 2 FXS ports for analog phones
MAC Address Table
-----------------
eth0/lan Factory 0x002a
eth1/wan Factory 0x0024
wifi 2.4Ghz Factory 0x0004
wifi 5Ghz Factory 0x0004 + 1
Serial console (UART)
---------------------
+-------+-------+-------+-------+-------+
| +3.3V | RX | TX | KEY | GND |
+---+---+-------+-------+-------+-------+
|
+--- Don't connect
Installation
------------
Keep in mind that openwrt can only run on the UBI partition, the openwrt firmware is not able to understand the zloader bootargs.
The procedure allows restoring the UBI partition with the Zyxel firmware and retains all the OEM functionalities.
1. Unlock Zloader (this will allow to swap manually between partitions UBI and UBI2):
- Attach a usb-ttl adapter to your computer and boot the router.
- While the router is booting at some point you will read the following: `Please press Enter to activate this console.`
- As soon as you read that press enter, type root and than press enter again (just do it, don't care about the logs scrolling).
- Most likely the router is still printing the boot log, leave it boot until it stops.
- If everything went ok you should have full root access "root@EX5601-T0:/#".
- Type the following command and press enter: "fw_setenv EngDebugFlag 0x1".
- Reboot the router.
- As soon as you read `Hit any key to stop autoboot:` press Enter.
- If everything went ok you should have the following prompt: "ZHAL>".
- You have successfully unlocked zloader access, this procedure must be done only once.
2. Check the current active partition:
- Boot the router and repeat the steps above to gain root access.
- Type the following command to check the current active image: "cat /proc/cmdline".
- If `rootubi=ubi` it means that the active partition is `mtd6`
- If `rootubi=ubi2` it means that the active partition is `mtd7`
- As mentioned earlier we need to flash openwrt into ubi/mtd6 and never overwrite ubi2/mtd7 to be able to fully roll-back.
- To activate and boot from mtd7 (ubi2) enter into ZHAL> command prompt and type the following commands:
atbt 1 # unlock write
atsw # swap boot partition
atsr # reboot the router
- After rebooting check again with "cat /proc/cmdline" that you are correctly booting from mtd7/ubi2
- If yes proceed with the installation guide. If not probably you don't have a firmware into ubi2 or you did something wrong.
3. Flashing:
- Download the sysupgrade file for the router from openwrt, than we need to add the zyfwinfo file into the sysupgrade tar.
Zloader only checks for the magic (which is a fixed value 'EXYZ') and the crc of the file itself (256bytes).
I created a script to create a valid zyfwinfo file but you can use anything that does exactly the same:
https://raw.githubusercontent.com/pameruoso/OpenWRT-Zyxel-EX5601-T0/main/gen_zyfwinfo.sh
- Add the zyfwinfo file into the sysupgrade tar.
- Enter via telnet or ssh into the router with admin credentials
- Enter the following commands to disable the firmware and model checks
"zycli fwidcheck off" and "zycli modelcheck off"
- Open the router web interface and in the update firmware page select the "restore default settings option"
- Select the sysupgrade file and click on upload.
- The router will flash and reboot itself into openwrt from UBI
4. Restoring and going back to Zyxel firmware.
- Use the ZHAL> command line to manually swap the boot parition to UBI2 with the following:
atbt 1 # unlock write
atsw # swap boot partition
atsr # reboot the router
- You will boot again the Zyxel firmware you have into UBI2 and you can flash the zyxel firmware to overwrite the UBI partition and openwrt.
Working features
----------------
3 gbit lan ports
Wifi
Zyxel partitioning for coexistance with Zloader and dual boot.
WAN SFP port (only after exporting pins 57 and 10. gpiobase411)
leds
reset button
serial interface
usb port
lan ethernet 2.5 gbit port (autosense)
wan ethernet 2.5 gbit port (autosense)
Not working
----------------
voip (missing drivers or proper zyxel platform software)
Swapping the wan ethernet/sfp xor port
----------------
The way to swap the wan port between sfp and ethernet is the following:
export the pins 57 and 10.
Pin 57 is used to probe if an sfp is present.
If pin 57 value is 0 it means that an sfp is present into the cage (cat /sys/class/gpio/gpio468/value).
If pin 57 value is 1 it means that no sfp is inserted into the cage.
In conclusion by default both 57 an 10 pins are by default 1, which means that the active port is the ethernet one.
After inserting an SFP pin 57 will become 0 and you have to manually change the value of pin 10 to 0 too.
This is totally scriptable of course.
Leds description
------------
All the leds are working out of the box but the leds managed by the 2 maxlinear phy (phy 5 lan, phy6 wan).
To activate the phy5 led (rj45 ethernet port led on the back of the router) you have to use mdio-tools.
To activate the phy6 led (led on the front of the router for 2.5gbit link) you have to use mdio-tools.
Example:
Set lan5 led to fast blink on 2500/1000, slow blink on 10/100:
mdio mdio-bus mmd 5:30 raw 0x0001 0x33FC
Set wan 2.5gbit led to constant on when wan is 2.5gbit:
mdio mdio-bus mmd 6:30 raw 0x0001 0x0080
Signed-off-by: Pietro Ameruoso <p.ameruoso@live.it>
2023-05-22 07:52:47 +00:00
|
|
|
define Device/zyxel_ex5601-t0-stock
|
|
|
|
DEVICE_VENDOR := Zyxel
|
2023-10-04 09:43:25 +00:00
|
|
|
DEVICE_MODEL := EX5601-T0
|
|
|
|
DEVICE_VARIANT := (stock layout)
|
mediatek: add support for Zyxel EX5601-T0 router
Zyxel EX5601-T0 specifics
--------------
The operator specific firmware running on the Zyxel branded
EX5601-T0 includes U-Boot modifications affecting the OpenWrt
installation.
Partition Table
| dev | size | erasesize | name |
| ---- | -------- | --------- | ------------- |
| mtd0 | 20000000 | 00040000 | "spi0.1" |
| mtd1 | 00100000 | 00040000 | "BL2" |
| mtd2 | 00080000 | 00040000 | "u-boot-env" |
| mtd3 | 00200000 | 00040000 | "Factory" |
| mtd4 | 001c0000 | 00040000 | "FIP" |
| mtd5 | 00040000 | 00040000 | "zloader" |
| mtd6 | 04000000 | 00040000 | "ubi" |
| mtd7 | 04000000 | 00040000 | "ubi2" |
| mtd8 | 15a80000 | 00040000 | "zyubi" |
The router boots BL2 which than loads FIP (u-boot).
U-boot has hardcoded a command to always launch Zloader "mtd read zloader 0x46000000" and than "bootm". Bootargs are deactivated.
Zloader is the zyxel booloader which allow to dual-boot ubi or ubi2, by default access to zloader is blocked.
Too zloader checks that the firmware contains a particolar file called zyfwinfo.
Additional details regarding Zloader can be found here:
https://hack-gpon.github.io/zyxel/
https://forum.openwrt.org/t/adding-openwrt-support-for-zyxel-ex5601-t0/155914
Hardware
--------
SOC: MediaTek MT7986a
CPU: 4 core cortex-a53 (2000MHz)
RAM: 1GB DDR4
FLASH: 512MB SPI-NAND (Micron xxx)
WIFI: Wifi6 Mediatek MT7976 802.11ax 5 GHz 4x4 + 2.4GHZ 4x4
ETH: MediaTek MT7531 Switch + SoC
3 x builtin 1G phy (lan1, lan2, lan3)
1 x MaxLinear GPY211B 2.5 N-Base-T phy5 (lan4)
1 x MaxLinear GPY211B 2.5Gbit xor SFP/N-Base-T phy6 (wan)
USB: 1 x USB 3.2 Enhanced SuperSpeed port
UART: 3V3 115200 8N1 (Pinout: GND KEY RX TX VCC)
VOIP: 2 FXS ports for analog phones
MAC Address Table
-----------------
eth0/lan Factory 0x002a
eth1/wan Factory 0x0024
wifi 2.4Ghz Factory 0x0004
wifi 5Ghz Factory 0x0004 + 1
Serial console (UART)
---------------------
+-------+-------+-------+-------+-------+
| +3.3V | RX | TX | KEY | GND |
+---+---+-------+-------+-------+-------+
|
+--- Don't connect
Installation
------------
Keep in mind that openwrt can only run on the UBI partition, the openwrt firmware is not able to understand the zloader bootargs.
The procedure allows restoring the UBI partition with the Zyxel firmware and retains all the OEM functionalities.
1. Unlock Zloader (this will allow to swap manually between partitions UBI and UBI2):
- Attach a usb-ttl adapter to your computer and boot the router.
- While the router is booting at some point you will read the following: `Please press Enter to activate this console.`
- As soon as you read that press enter, type root and than press enter again (just do it, don't care about the logs scrolling).
- Most likely the router is still printing the boot log, leave it boot until it stops.
- If everything went ok you should have full root access "root@EX5601-T0:/#".
- Type the following command and press enter: "fw_setenv EngDebugFlag 0x1".
- Reboot the router.
- As soon as you read `Hit any key to stop autoboot:` press Enter.
- If everything went ok you should have the following prompt: "ZHAL>".
- You have successfully unlocked zloader access, this procedure must be done only once.
2. Check the current active partition:
- Boot the router and repeat the steps above to gain root access.
- Type the following command to check the current active image: "cat /proc/cmdline".
- If `rootubi=ubi` it means that the active partition is `mtd6`
- If `rootubi=ubi2` it means that the active partition is `mtd7`
- As mentioned earlier we need to flash openwrt into ubi/mtd6 and never overwrite ubi2/mtd7 to be able to fully roll-back.
- To activate and boot from mtd7 (ubi2) enter into ZHAL> command prompt and type the following commands:
atbt 1 # unlock write
atsw # swap boot partition
atsr # reboot the router
- After rebooting check again with "cat /proc/cmdline" that you are correctly booting from mtd7/ubi2
- If yes proceed with the installation guide. If not probably you don't have a firmware into ubi2 or you did something wrong.
3. Flashing:
- Download the sysupgrade file for the router from openwrt, than we need to add the zyfwinfo file into the sysupgrade tar.
Zloader only checks for the magic (which is a fixed value 'EXYZ') and the crc of the file itself (256bytes).
I created a script to create a valid zyfwinfo file but you can use anything that does exactly the same:
https://raw.githubusercontent.com/pameruoso/OpenWRT-Zyxel-EX5601-T0/main/gen_zyfwinfo.sh
- Add the zyfwinfo file into the sysupgrade tar.
- Enter via telnet or ssh into the router with admin credentials
- Enter the following commands to disable the firmware and model checks
"zycli fwidcheck off" and "zycli modelcheck off"
- Open the router web interface and in the update firmware page select the "restore default settings option"
- Select the sysupgrade file and click on upload.
- The router will flash and reboot itself into openwrt from UBI
4. Restoring and going back to Zyxel firmware.
- Use the ZHAL> command line to manually swap the boot parition to UBI2 with the following:
atbt 1 # unlock write
atsw # swap boot partition
atsr # reboot the router
- You will boot again the Zyxel firmware you have into UBI2 and you can flash the zyxel firmware to overwrite the UBI partition and openwrt.
Working features
----------------
3 gbit lan ports
Wifi
Zyxel partitioning for coexistance with Zloader and dual boot.
WAN SFP port (only after exporting pins 57 and 10. gpiobase411)
leds
reset button
serial interface
usb port
lan ethernet 2.5 gbit port (autosense)
wan ethernet 2.5 gbit port (autosense)
Not working
----------------
voip (missing drivers or proper zyxel platform software)
Swapping the wan ethernet/sfp xor port
----------------
The way to swap the wan port between sfp and ethernet is the following:
export the pins 57 and 10.
Pin 57 is used to probe if an sfp is present.
If pin 57 value is 0 it means that an sfp is present into the cage (cat /sys/class/gpio/gpio468/value).
If pin 57 value is 1 it means that no sfp is inserted into the cage.
In conclusion by default both 57 an 10 pins are by default 1, which means that the active port is the ethernet one.
After inserting an SFP pin 57 will become 0 and you have to manually change the value of pin 10 to 0 too.
This is totally scriptable of course.
Leds description
------------
All the leds are working out of the box but the leds managed by the 2 maxlinear phy (phy 5 lan, phy6 wan).
To activate the phy5 led (rj45 ethernet port led on the back of the router) you have to use mdio-tools.
To activate the phy6 led (led on the front of the router for 2.5gbit link) you have to use mdio-tools.
Example:
Set lan5 led to fast blink on 2500/1000, slow blink on 10/100:
mdio mdio-bus mmd 5:30 raw 0x0001 0x33FC
Set wan 2.5gbit led to constant on when wan is 2.5gbit:
mdio mdio-bus mmd 6:30 raw 0x0001 0x0080
Signed-off-by: Pietro Ameruoso <p.ameruoso@live.it>
2023-05-22 07:52:47 +00:00
|
|
|
DEVICE_DTS := mt7986a-zyxel-ex5601-t0-stock
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware kmod-usb3
|
mediatek: add support for Zyxel EX5601-T0 router
Zyxel EX5601-T0 specifics
--------------
The operator specific firmware running on the Zyxel branded
EX5601-T0 includes U-Boot modifications affecting the OpenWrt
installation.
Partition Table
| dev | size | erasesize | name |
| ---- | -------- | --------- | ------------- |
| mtd0 | 20000000 | 00040000 | "spi0.1" |
| mtd1 | 00100000 | 00040000 | "BL2" |
| mtd2 | 00080000 | 00040000 | "u-boot-env" |
| mtd3 | 00200000 | 00040000 | "Factory" |
| mtd4 | 001c0000 | 00040000 | "FIP" |
| mtd5 | 00040000 | 00040000 | "zloader" |
| mtd6 | 04000000 | 00040000 | "ubi" |
| mtd7 | 04000000 | 00040000 | "ubi2" |
| mtd8 | 15a80000 | 00040000 | "zyubi" |
The router boots BL2 which than loads FIP (u-boot).
U-boot has hardcoded a command to always launch Zloader "mtd read zloader 0x46000000" and than "bootm". Bootargs are deactivated.
Zloader is the zyxel booloader which allow to dual-boot ubi or ubi2, by default access to zloader is blocked.
Too zloader checks that the firmware contains a particolar file called zyfwinfo.
Additional details regarding Zloader can be found here:
https://hack-gpon.github.io/zyxel/
https://forum.openwrt.org/t/adding-openwrt-support-for-zyxel-ex5601-t0/155914
Hardware
--------
SOC: MediaTek MT7986a
CPU: 4 core cortex-a53 (2000MHz)
RAM: 1GB DDR4
FLASH: 512MB SPI-NAND (Micron xxx)
WIFI: Wifi6 Mediatek MT7976 802.11ax 5 GHz 4x4 + 2.4GHZ 4x4
ETH: MediaTek MT7531 Switch + SoC
3 x builtin 1G phy (lan1, lan2, lan3)
1 x MaxLinear GPY211B 2.5 N-Base-T phy5 (lan4)
1 x MaxLinear GPY211B 2.5Gbit xor SFP/N-Base-T phy6 (wan)
USB: 1 x USB 3.2 Enhanced SuperSpeed port
UART: 3V3 115200 8N1 (Pinout: GND KEY RX TX VCC)
VOIP: 2 FXS ports for analog phones
MAC Address Table
-----------------
eth0/lan Factory 0x002a
eth1/wan Factory 0x0024
wifi 2.4Ghz Factory 0x0004
wifi 5Ghz Factory 0x0004 + 1
Serial console (UART)
---------------------
+-------+-------+-------+-------+-------+
| +3.3V | RX | TX | KEY | GND |
+---+---+-------+-------+-------+-------+
|
+--- Don't connect
Installation
------------
Keep in mind that openwrt can only run on the UBI partition, the openwrt firmware is not able to understand the zloader bootargs.
The procedure allows restoring the UBI partition with the Zyxel firmware and retains all the OEM functionalities.
1. Unlock Zloader (this will allow to swap manually between partitions UBI and UBI2):
- Attach a usb-ttl adapter to your computer and boot the router.
- While the router is booting at some point you will read the following: `Please press Enter to activate this console.`
- As soon as you read that press enter, type root and than press enter again (just do it, don't care about the logs scrolling).
- Most likely the router is still printing the boot log, leave it boot until it stops.
- If everything went ok you should have full root access "root@EX5601-T0:/#".
- Type the following command and press enter: "fw_setenv EngDebugFlag 0x1".
- Reboot the router.
- As soon as you read `Hit any key to stop autoboot:` press Enter.
- If everything went ok you should have the following prompt: "ZHAL>".
- You have successfully unlocked zloader access, this procedure must be done only once.
2. Check the current active partition:
- Boot the router and repeat the steps above to gain root access.
- Type the following command to check the current active image: "cat /proc/cmdline".
- If `rootubi=ubi` it means that the active partition is `mtd6`
- If `rootubi=ubi2` it means that the active partition is `mtd7`
- As mentioned earlier we need to flash openwrt into ubi/mtd6 and never overwrite ubi2/mtd7 to be able to fully roll-back.
- To activate and boot from mtd7 (ubi2) enter into ZHAL> command prompt and type the following commands:
atbt 1 # unlock write
atsw # swap boot partition
atsr # reboot the router
- After rebooting check again with "cat /proc/cmdline" that you are correctly booting from mtd7/ubi2
- If yes proceed with the installation guide. If not probably you don't have a firmware into ubi2 or you did something wrong.
3. Flashing:
- Download the sysupgrade file for the router from openwrt, than we need to add the zyfwinfo file into the sysupgrade tar.
Zloader only checks for the magic (which is a fixed value 'EXYZ') and the crc of the file itself (256bytes).
I created a script to create a valid zyfwinfo file but you can use anything that does exactly the same:
https://raw.githubusercontent.com/pameruoso/OpenWRT-Zyxel-EX5601-T0/main/gen_zyfwinfo.sh
- Add the zyfwinfo file into the sysupgrade tar.
- Enter via telnet or ssh into the router with admin credentials
- Enter the following commands to disable the firmware and model checks
"zycli fwidcheck off" and "zycli modelcheck off"
- Open the router web interface and in the update firmware page select the "restore default settings option"
- Select the sysupgrade file and click on upload.
- The router will flash and reboot itself into openwrt from UBI
4. Restoring and going back to Zyxel firmware.
- Use the ZHAL> command line to manually swap the boot parition to UBI2 with the following:
atbt 1 # unlock write
atsw # swap boot partition
atsr # reboot the router
- You will boot again the Zyxel firmware you have into UBI2 and you can flash the zyxel firmware to overwrite the UBI partition and openwrt.
Working features
----------------
3 gbit lan ports
Wifi
Zyxel partitioning for coexistance with Zloader and dual boot.
WAN SFP port (only after exporting pins 57 and 10. gpiobase411)
leds
reset button
serial interface
usb port
lan ethernet 2.5 gbit port (autosense)
wan ethernet 2.5 gbit port (autosense)
Not working
----------------
voip (missing drivers or proper zyxel platform software)
Swapping the wan ethernet/sfp xor port
----------------
The way to swap the wan port between sfp and ethernet is the following:
export the pins 57 and 10.
Pin 57 is used to probe if an sfp is present.
If pin 57 value is 0 it means that an sfp is present into the cage (cat /sys/class/gpio/gpio468/value).
If pin 57 value is 1 it means that no sfp is inserted into the cage.
In conclusion by default both 57 an 10 pins are by default 1, which means that the active port is the ethernet one.
After inserting an SFP pin 57 will become 0 and you have to manually change the value of pin 10 to 0 too.
This is totally scriptable of course.
Leds description
------------
All the leds are working out of the box but the leds managed by the 2 maxlinear phy (phy 5 lan, phy6 wan).
To activate the phy5 led (rj45 ethernet port led on the back of the router) you have to use mdio-tools.
To activate the phy6 led (led on the front of the router for 2.5gbit link) you have to use mdio-tools.
Example:
Set lan5 led to fast blink on 2500/1000, slow blink on 10/100:
mdio mdio-bus mmd 5:30 raw 0x0001 0x33FC
Set wan 2.5gbit led to constant on when wan is 2.5gbit:
mdio mdio-bus mmd 6:30 raw 0x0001 0x0080
Signed-off-by: Pietro Ameruoso <p.ameruoso@live.it>
2023-05-22 07:52:47 +00:00
|
|
|
SUPPORTED_DEVICES := mediatek,mt7986a-rfb-snand
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 256k
|
|
|
|
PAGESIZE := 4096
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGES += factory.bin
|
|
|
|
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
KERNEL = kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
|
|
|
KERNEL_INITRAMFS = kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += zyxel_ex5601-t0-stock
|
2023-07-15 16:10:31 +00:00
|
|
|
|
2023-10-04 09:43:25 +00:00
|
|
|
define Device/zyxel_ex5601-t0-ubootmod
|
|
|
|
DEVICE_VENDOR := Zyxel
|
|
|
|
DEVICE_MODEL := EX5601-T0
|
|
|
|
DEVICE_VARIANT := (OpenWrt U-Boot layout)
|
|
|
|
DEVICE_DTS := mt7986a-zyxel-ex5601-t0-ubootmod
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware kmod-usb3
|
2023-10-04 09:43:25 +00:00
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 256k
|
|
|
|
PAGESIZE := 4096
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
KERNEL := kernel-bin | lzma
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-4k-ddr4
|
|
|
|
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot zyxel_ex5601-t0
|
|
|
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
|
|
|
ARTIFACTS += initramfs-factory.ubi
|
|
|
|
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += zyxel_ex5601-t0-ubootmod
|
|
|
|
|
filogic: support Telenor branded ZyXEL EX5700
Telenor quirks
--------------
The operator specific firmware running on the Telenor branded
ZyXEL EX5700 includes U-Boot modifications affecting the OpenWrt
installation.
Notable changes to U-Boot include
- environment is stored in RAM and reset to defaults when power
cycled
- dual partition scheme with "nomimal" or "rescue" systems, falling
back to "rescue" unless the OS signals success in 3 attempts
- several runtime additions to the device-tree
Some of these modifications have side effects requiring workarounds
- U-Boot modifies /chosen/bootargs in an unsafe manner, and will crash
unless this node exists
- U-Boot verifies that the selected rootfs UBI volume exists, and
refuses to boot if it doesn't. The chosen "rootfs" volume must contain
a squashfs signature even for tftp or initramfs booting.
- U-Boot parses the "factoryparams" UBI volume, setting the "ethaddr"
variable to the label mac. But "factoryparams" does not always
exist. Instead there is a "RIP" volume containing all the factory
data. Copying the "RIP" volume to "factoryparams" will fix this
Hardware
--------
SOC: MediaTek MT7986
RAM: 1GB DDR4
FLASH: 512MB SPI-NAND (Mikron xxx)
WIFI: Mediatek MT7986 802.11ax 5 GHz
Mediatek MT7916 DBDC 802.11ax 2.4 + 6 GHz
ETH: MediaTek MT7531 Switch + SoC
3 x builtin 1G phy (lan1, lan2, lan3)
2 x MaxLinear GPY211C 2.5 N-Base-T phy (lan4, wan)
USB: 1 x USB 3.2 Enhanced SuperSpeed port
UART: 3V3 115200 8N1 (Pinout: GND KEY RX TX VCC)
Installation
------------
1. Download the OpenWrt initramfs image. Copy the image to a TFTP server
reachable at 192.168.1.2/24. Rename the image to C0A80101.img.
2. Connect the TFTP server to lan1, lan2 or lan3. Connect to the serial
console, Interrupt the autoboot process by pressing ESC when prompted.
3. Download and boot the OpenWrt initramfs image.
$ env set uboot_bootcount 0
$ env set firmware nominal
$ tftpboot
$ bootm
4. Wait for OpenWrt to boot. Transfer the sysupgrade image to the device
using scp and install using sysupgrade.
$ sysupgrade -n <path-to-sysupgrade.bin>
Missing features
----------------
- The "lan1", "lan2" and "lan3" port LEDs are driven by the switch but
OpenWrt does not correctly configure the output.
- The "lan4" and "wan" port LEDs are driven by the GPH211C phys and
not configured by OpenWrt.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2023-03-28 13:04:21 +00:00
|
|
|
define Device/zyxel_ex5700-telenor
|
2024-06-07 12:42:32 +00:00
|
|
|
DEVICE_VENDOR := Zyxel
|
filogic: support Telenor branded ZyXEL EX5700
Telenor quirks
--------------
The operator specific firmware running on the Telenor branded
ZyXEL EX5700 includes U-Boot modifications affecting the OpenWrt
installation.
Notable changes to U-Boot include
- environment is stored in RAM and reset to defaults when power
cycled
- dual partition scheme with "nomimal" or "rescue" systems, falling
back to "rescue" unless the OS signals success in 3 attempts
- several runtime additions to the device-tree
Some of these modifications have side effects requiring workarounds
- U-Boot modifies /chosen/bootargs in an unsafe manner, and will crash
unless this node exists
- U-Boot verifies that the selected rootfs UBI volume exists, and
refuses to boot if it doesn't. The chosen "rootfs" volume must contain
a squashfs signature even for tftp or initramfs booting.
- U-Boot parses the "factoryparams" UBI volume, setting the "ethaddr"
variable to the label mac. But "factoryparams" does not always
exist. Instead there is a "RIP" volume containing all the factory
data. Copying the "RIP" volume to "factoryparams" will fix this
Hardware
--------
SOC: MediaTek MT7986
RAM: 1GB DDR4
FLASH: 512MB SPI-NAND (Mikron xxx)
WIFI: Mediatek MT7986 802.11ax 5 GHz
Mediatek MT7916 DBDC 802.11ax 2.4 + 6 GHz
ETH: MediaTek MT7531 Switch + SoC
3 x builtin 1G phy (lan1, lan2, lan3)
2 x MaxLinear GPY211C 2.5 N-Base-T phy (lan4, wan)
USB: 1 x USB 3.2 Enhanced SuperSpeed port
UART: 3V3 115200 8N1 (Pinout: GND KEY RX TX VCC)
Installation
------------
1. Download the OpenWrt initramfs image. Copy the image to a TFTP server
reachable at 192.168.1.2/24. Rename the image to C0A80101.img.
2. Connect the TFTP server to lan1, lan2 or lan3. Connect to the serial
console, Interrupt the autoboot process by pressing ESC when prompted.
3. Download and boot the OpenWrt initramfs image.
$ env set uboot_bootcount 0
$ env set firmware nominal
$ tftpboot
$ bootm
4. Wait for OpenWrt to boot. Transfer the sysupgrade image to the device
using scp and install using sysupgrade.
$ sysupgrade -n <path-to-sysupgrade.bin>
Missing features
----------------
- The "lan1", "lan2" and "lan3" port LEDs are driven by the switch but
OpenWrt does not correctly configure the output.
- The "lan4" and "wan" port LEDs are driven by the GPH211C phys and
not configured by OpenWrt.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2023-03-28 13:04:21 +00:00
|
|
|
DEVICE_MODEL := EX5700 (Telenor)
|
|
|
|
DEVICE_DTS := mt7986a-zyxel-ex5700-telenor
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-ubootenv-nvram kmod-usb3 kmod-mt7915e kmod-mt7916-firmware kmod-mt7986-firmware mt7986-wo-firmware
|
filogic: support Telenor branded ZyXEL EX5700
Telenor quirks
--------------
The operator specific firmware running on the Telenor branded
ZyXEL EX5700 includes U-Boot modifications affecting the OpenWrt
installation.
Notable changes to U-Boot include
- environment is stored in RAM and reset to defaults when power
cycled
- dual partition scheme with "nomimal" or "rescue" systems, falling
back to "rescue" unless the OS signals success in 3 attempts
- several runtime additions to the device-tree
Some of these modifications have side effects requiring workarounds
- U-Boot modifies /chosen/bootargs in an unsafe manner, and will crash
unless this node exists
- U-Boot verifies that the selected rootfs UBI volume exists, and
refuses to boot if it doesn't. The chosen "rootfs" volume must contain
a squashfs signature even for tftp or initramfs booting.
- U-Boot parses the "factoryparams" UBI volume, setting the "ethaddr"
variable to the label mac. But "factoryparams" does not always
exist. Instead there is a "RIP" volume containing all the factory
data. Copying the "RIP" volume to "factoryparams" will fix this
Hardware
--------
SOC: MediaTek MT7986
RAM: 1GB DDR4
FLASH: 512MB SPI-NAND (Mikron xxx)
WIFI: Mediatek MT7986 802.11ax 5 GHz
Mediatek MT7916 DBDC 802.11ax 2.4 + 6 GHz
ETH: MediaTek MT7531 Switch + SoC
3 x builtin 1G phy (lan1, lan2, lan3)
2 x MaxLinear GPY211C 2.5 N-Base-T phy (lan4, wan)
USB: 1 x USB 3.2 Enhanced SuperSpeed port
UART: 3V3 115200 8N1 (Pinout: GND KEY RX TX VCC)
Installation
------------
1. Download the OpenWrt initramfs image. Copy the image to a TFTP server
reachable at 192.168.1.2/24. Rename the image to C0A80101.img.
2. Connect the TFTP server to lan1, lan2 or lan3. Connect to the serial
console, Interrupt the autoboot process by pressing ESC when prompted.
3. Download and boot the OpenWrt initramfs image.
$ env set uboot_bootcount 0
$ env set firmware nominal
$ tftpboot
$ bootm
4. Wait for OpenWrt to boot. Transfer the sysupgrade image to the device
using scp and install using sysupgrade.
$ sysupgrade -n <path-to-sysupgrade.bin>
Missing features
----------------
- The "lan1", "lan2" and "lan3" port LEDs are driven by the switch but
OpenWrt does not correctly configure the output.
- The "lan4" and "wan" port LEDs are driven by the GPH211C phys and
not configured by OpenWrt.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2023-03-28 13:04:21 +00:00
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 65536k
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += zyxel_ex5700-telenor
|
|
|
|
|
2023-07-15 16:10:31 +00:00
|
|
|
define Device/zyxel_nwa50ax-pro
|
2024-06-07 12:42:32 +00:00
|
|
|
DEVICE_VENDOR := Zyxel
|
2023-07-15 16:10:31 +00:00
|
|
|
DEVICE_MODEL := NWA50AX Pro
|
|
|
|
DEVICE_DTS := mt7981b-zyxel-nwa50ax-pro
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2024-04-22 21:13:11 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware zyxel-bootconfig
|
2023-07-15 16:10:31 +00:00
|
|
|
DEVICE_DTS_LOADADDR := 0x44000000
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
IMAGE_SIZE := 51200k
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGES += factory.bin
|
|
|
|
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE) | zyxel-nwa-fit-filogic
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += zyxel_nwa50ax-pro
|