openwrt/target/linux
Roland Reinl d0744c1f66 mediatek: Add support for D-Link EAGLE PRO AI R32
R32 is like the M32 part of the EAGLE PRO AI series from D-Link.

Specification:
 - MT7622BV SoC with 2.4GHz wifi
 - MT7975AN + MT7915AN for 5GHz
 - MT7531BE Switch
 - 512MB RAM
 - 128 MB flash
 - 2 LEDs (Status and Internet, both can be either orange or white)
 - 2 buttons (WPS and Reset)

Compared to M32, the R32 has the following differences:
 - 4 LAN ports instead of 2
 - The recory image starts with DLK6E6015001 instaed of DLK6E6010001
 - Individual LEDs for power and internet
 - MAC address is stored at another offset in the ODM partition

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:
 - Set your IP address to 192.168.0.10, subnetmask 255.255.255.0
 - Press the reset button while powering on the deivce
 - Keep the reset button pressed until the internet LED blinks fast
 - Open a Chromium based and goto http://192.168.0.1
 - Download openwrt-mediatek-mt7622-dlink_eagle-pro-ai-r32-a1-squashfs-recovery.bin

Flashing via uBoot:
 - Open the case, connect to the UART console
 - Set your IP address to 10.10.10.3, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
 - Run a tftp server which provides openwrt-mediatek-mt7622-dlink_eagle-pro-ai-r32-initramfs-kernel.bin.
 - You can rename the file to iverson_uImage (no extension), then you don't have to enter the whole file name in uboot later.
 - Power on the device and select "1. System Load Linux to SDRAM via TFTP." in the 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)
 - Create a backup of the Kernel1 partition, this file is required if a revert to stock should be done later
 - Perform a sysupgrade using openwrt-mediatek-mt7622-dlink_eagle-pro-ai-r32-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.0.10, subnetmask 255.255.255.0
 - Press the reset button while powering on the deivce
 - Keep the reset button pressed until the internet LED blinks fast
 - Open a Chromium based and goto http://192.168.0.1
 - 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 R32 --DecryptFactoryImage <OriginalFirmware> <OutputFile>
 - Example for firmware R32A1_FW103B01: ./m32-firmware-util R32 --DecryptFactoryImage R32A1_FW103B01.bin R32A1_FW103B01.decrypted.bin

Revert back to stock using uBoot:
 - Open the case, connect to the UART console
 - Set your IP address to 10.10.10.3, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
 - Run a tftp server which provides the previously created backup of the Kernel1 partition.
 - You can rename the file to iverson_uImage (no extension), then you don't have to enter the whole file name in uboot later.
 - Power on the device and select "2. System Load Linux Kernel then write to Flash via TFTP." in the boot menu
 - Enter image file, tftp server IP and device IP (if they differ from the default).
 - TFTP download to FLASH will start. After a few seconds the stock firmware should start again

There is also an image openwrt-mediatek-mt7622-dlink_eagle-pro-ai-r32-a1-squashfs-tftp.bin which can directly be flashed via U-Boot and TFTP.
It can be used if no backup of the Kernel1 partition is reuqired.

Flahsing via OEM web interface is currently not possible, the OEM images are encrypted. Creating images is only possible manually at the moment.
The support for the M32/R32 already includes support for flashing from the OEM web interface:
 - The device tree contains both partitions (Kernel1 and Kernel2) with conditions to select the correct one based on the kernel command line
 - The U-Boot variable "boot_part" is set accordingly during startup to finish the partition swap after flashing from the OEM web interface
 - OpenWrt sysupgrade flashing always uses the partition where it was initially flashed to (no partition swap)

Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
(cherry picked from commit fdb87a91b4)
Link: https://github.com/openwrt/openwrt/pull/15776
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:32:57 +02:00
..
airoha kernel: bump 5.15 to 5.15.125 2023-08-10 21:07:50 +02:00
apm821xx apm821xx: WNDR4700: fix broken sysupgrade, factory images 2023-10-21 16:42:26 +02:00
archs38 treewide: remove files for building 5.10 kernel 2023-05-12 13:02:43 +02:00
armsr armsr: preserve configuration during sysupgrade 2023-10-20 00:41:41 +02:00
at91 kernel: bump 5.15 to 5.15.157 2024-05-13 14:01:51 +02:00
ath25 kernel: bump 5.15 to 5.15.131 2023-09-25 23:04:37 +02:00
ath79 ath79: add support for Huawei AP5030DN 2024-04-03 02:56:56 +02:00
bcm27xx kernel: bump 5.15 to 5.15.161 2024-07-01 22:32:52 +02:00
bcm47xx kernel: bump 5.15 to 5.15.158 2024-05-13 18:38:23 +03:00
bcm53xx kernel: bump 5.15 to 5.15.152 2024-03-29 14:06:15 +01:00
bcm63xx kernel: bump 5.15 to 5.15.148 2024-02-10 20:19:28 +01:00
bcm4908 kernel: bump 5.15 to 5.15.153 2024-04-01 02:33:05 +02:00
bmips kernel: bump 5.15 to 5.15.148 2024-02-10 20:19:28 +01:00
gemini kernel: bump 5.15 to 5.15.146 2024-01-08 23:15:35 +01:00
generic kernel: backport some useful LED_FUNCTION_* defines for DT 2024-07-03 14:39:10 +02:00
imx kernel: backport NVMEM patches queued for the v6.5 2023-07-10 12:54:53 +02:00
ipq40xx ipq40xx: eap1300: add eap1300ext as alt model 2024-07-01 07:14:18 +02:00
ipq806x ipq806x: rt4230w-rev6: fix status reporting via the LEDs 2024-05-23 22:15:33 +02:00
ipq807x kernel: bump 5.15 to 5.15.155 2024-04-30 23:38:26 +02:00
kirkwood kirkwood: fix Ctera C200 V1 ubi part name 2023-12-14 21:40:20 +01:00
lantiq kernel: bump 5.15 to 5.15.155 2024-04-30 23:38:26 +02:00
layerscape kernel: 5.15: backport v6.1 PHY changes required for Aquantia 2024-01-31 11:57:41 +01:00
malta treewide: remove files for building 5.10 kernel 2023-05-12 13:02:43 +02:00
mediatek mediatek: Add support for D-Link EAGLE PRO AI R32 2024-07-06 18:32:57 +02:00
mpc85xx mpc85xx: fix label-mac-address for Enterasys WS-AP3710i 2024-06-16 14:03:03 +02:00
mvebu kernel: bump 5.15 to 5.15.157 2024-05-13 14:01:51 +02:00
mxs mxs: rework image generation 2023-07-06 17:04:13 +02:00
octeon kernel: bump 5.15 to 5.15.145 2024-01-07 12:57:30 +00:00
octeontx kernel: bump 5.15 to 5.15.155 2024-04-30 23:38:26 +02:00
omap treewide: remove files for building 5.10 kernel 2023-05-12 13:02:43 +02:00
oxnas kernel: bump 5.15 to 5.15.157 2024-05-13 14:01:51 +02:00
pistachio kernel: fix mtd/NVMEM regression affecting U-Boot env NVMEM driver 2023-11-02 09:45:08 +01:00
qoriq kernel: fix handling of CONFIG_DYNAMIC_DEBUG 2023-05-03 10:26:17 -07:00
ramips ramips: yuncore_g720: fix buttons 2024-06-26 02:47:57 +01:00
realtek realtek: Trap LLDP packets to the CPU 2024-05-10 16:08:34 +02:00
rockchip rockchip: remove redundant 'console' parameter from boot script 2024-03-31 20:39:57 +02:00
sifiveu kernel: bump 5.15 to 5.15.153 2024-04-01 02:33:05 +02:00
sunxi sunxi: fix network bringup on Olinuxino Micro boards 2024-04-21 23:26:53 +02:00
tegra treewide: remove files for building 5.10 kernel 2023-05-12 13:02:43 +02:00
uml kernel: bump 5.15 to 5.15.132 2023-09-25 23:04:37 +02:00
x86 kernel: bump 5.15 to 5.15.158 2024-05-13 18:38:23 +03:00
zynq generic: enable CONFIG_ARM_CRYPTO for 32bit arm targets 2023-05-10 19:01:45 +02:00
Makefile linux: add dtb makefile target to targets list 2024-02-10 13:29:43 +01:00