summaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/mt7622
diff options
context:
space:
mode:
authorRoland Reinl <reinlroland+github@gmail.com>2023-11-12 19:04:32 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2024-01-02 21:22:46 +0100
commitfdb87a91b4202ad1a58fe46f499e4e68bf82de4e (patch)
tree5d2d24ff747270c4de940e0b6c6ea73fbb0ad809 /target/linux/mediatek/mt7622
parentb22539b5fef9572f9ce2bedcd01d083c918d82f1 (diff)
downloadopenwrt-fdb87a91b4202ad1a58fe46f499e4e68bf82de4e.tar.gz
openwrt-fdb87a91b4202ad1a58fe46f499e4e68bf82de4e.tar.bz2
openwrt-fdb87a91b4202ad1a58fe46f499e4e68bf82de4e.zip
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>
Diffstat (limited to 'target/linux/mediatek/mt7622')
-rw-r--r--target/linux/mediatek/mt7622/base-files/etc/board.d/02_network5
-rw-r--r--target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac4
-rwxr-xr-xtarget/linux/mediatek/mt7622/base-files/etc/init.d/bootcount8
-rwxr-xr-xtarget/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh4
4 files changed, 12 insertions, 9 deletions
diff --git a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
index 75c5e37be1..6c43e46222 100644
--- a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
+++ b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
@@ -10,6 +10,7 @@ mediatek_setup_interfaces()
case $board in
bananapi,bpi-r64|\
buffalo,wsr-3200ax4s|\
+ dlink,eagle-pro-ai-r32-a1|\
elecom,wrc-x3200gst3|\
linksys,e8450|\
linksys,e8450-ubi|\
@@ -64,10 +65,6 @@ mediatek_setup_macs()
wan_mac=$lan_mac
label_mac=$lan_mac
;;
- dlink,eagle-pro-ai-m32-a1)
- wan_mac=$(get_mac_label)
- lan_mac=$(macaddr_add $(get_mac_label) 1)
- ;;
reyee,ax3200-e5|\
ruijie,rg-ew3200gx-pro)
lan_mac=$(macaddr_add $(get_mac_label) 1)
diff --git a/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
index e9cc592237..7ee9f24071 100644
--- a/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+++ b/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
@@ -18,10 +18,6 @@ case "$board" in
[ "$PHYNBR" = "0" ] && macaddr_add $basemac 1 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $basemac 8 > /sys${DEVPATH}/macaddress
;;
- dlink,eagle-pro-ai-m32-a1)
- [ "$PHYNBR" = "0" ] && macaddr_add $(cat /sys/class/net/eth0/address) 2 > /sys${DEVPATH}/macaddress
- [ "$PHYNBR" = "1" ] && macaddr_add $(cat /sys/class/net/eth0/address) 3 > /sys${DEVPATH}/macaddress
- ;;
reyee,ax3200-e5|\
ruijie,rg-ew3200gx-pro)
[ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress
diff --git a/target/linux/mediatek/mt7622/base-files/etc/init.d/bootcount b/target/linux/mediatek/mt7622/base-files/etc/init.d/bootcount
index bc4eeb6530..19a321b48b 100755
--- a/target/linux/mediatek/mt7622/base-files/etc/init.d/bootcount
+++ b/target/linux/mediatek/mt7622/base-files/etc/init.d/bootcount
@@ -4,6 +4,14 @@ START=99
boot() {
case $(board_name) in
+ dlink,eagle-pro-ai-m32-a1|\
+ dlink,eagle-pro-ai-r32-a1)
+ if grep -q boot_part=Kernel1 /proc/cmdline; then
+ fw_setenv boot_part 1
+ else
+ fw_setenv boot_part 2
+ fi
+ ;;
linksys,e8450)
mtd erase senv || true
;;
diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
index e256d2b533..3a2d7a4cd6 100755
--- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
@@ -35,6 +35,7 @@ platform_do_upgrade() {
fi
;;
dlink,eagle-pro-ai-m32-a1|\
+ dlink,eagle-pro-ai-r32-a1|\
elecom,wrc-x3200gst3|\
mediatek,mt7622-rfb1-ubi|\
netgear,wax206|\
@@ -73,7 +74,8 @@ platform_check_image() {
buffalo,wsr-3200ax4s)
buffalo_check_image "$board" "$magic" "$1" || return 1
;;
- dlink,eagle-pro-ai-m32-a1|\
+ dlink,eagle-pro-ai-m32-a1|\
+ dlink,eagle-pro-ai-r32-a1|\
elecom,wrc-x3200gst3|\
mediatek,mt7622-rfb1-ubi|\
netgear,wax206|\