ramips: add support for Buffalo WSR-2533DHPL2
authorINAGAKI Hiroshi <musashino.open@gmail.com>
Sat, 30 Mar 2024 06:33:58 +0000 (15:33 +0900)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 5 Jun 2024 19:14:16 +0000 (21:14 +0200)
Buffalo WSR-2533DHPL2 is a 2.4/5 GHz band 11ac (Wi-Fi 5) router, based
on MediaTek MT7621A.

Specification:

- SoC           : MediaTek MT7621AT
- RAM           : DDR3 128 MiB (Winbond W631GG6MB12J)
- Flash         : RAW-NAND 128 MiB (Winbond W29N01HVSINF)
- WLAN          : 2.4/5 GHz (2x MediaTek MT7615N)
- Ethernet      : 10/100/1000 Mbps x4
  - Switch      : MediaTek MT7530 (SoC)
- LED/keys      : 8x/6x (2x buttons, 1x slide-switch)
- UART          : through-hole on PCB (J4)
  - arrangement : 3.3V, GND, TX, RX from triangle-mark
  - settings    : 57600n8
- Power         : 12VDC 1.5A

Flash instruction using factory.bin image:

1. boot WSR-2533DHPL2 normally with "Router" mode
2. access to the WebI ("http://192.168.11.1/") on the device and open
   firmware update page
   ("管理" -> "ファームウェア更新")
3. select the OpenWrt factory.bin image and click update ("更新実行")
   button
   Attention: do not use "factory-uboot.bin" image
4. Wait ~120 seconds to complete flashing

Flash instruction using initramfs image:

1. prepare the TFTP server with the initramfs image renamed to
   "linux.trx-recovery" and IP address "192.168.11.2"
2. press the "AOSS" button while powering on the WSR-2533DHPL2
3. after 10 seconds, release the "AOSS" button, WSR-2533DHPL2 downloads
   the initramfs image and boot with it automatically
4. on the initramfs image, download the factory-uboot.bin image to the
   device and perform sysupgrade with it and "-F" option
5. wait ~120 seconds to complete flashing

Notes:

- There are 2x factory*.bin images for different purposes.

  - factory.bin      : for flashing on OEM WebUI
  - factory-uboot.bin: for flashing on OEM bootloader or initramfs image

  factory-uboot.bin is useful for recoverying the device, or refreshing
  when the kernel partition is expanded in the future. sysupgrade on
  this device accepts factory-uboot.bin with option "-F", but on that
  situation, user configurations won't be kept, so it's not for normal
  use.

MAC addresses:

LAN    : 18:EC:E7:xx:xx:E0 (board_data, "mac" (text))
WAN    : 18:EC:E7:xx:xx:E0 (board_data, "mac" (text))
2.4 GHz: 18:EC:E7:xx:xx:E1 (Factory, 0x4    (hex))
5 GHz  : 18:EC:E7:xx:xx:E4 (Factory, 0x8004 (hex))

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl2.dts [new file with mode: 0644]
target/linux/ramips/image/mt7621.mk
target/linux/ramips/mt7621/base-files/etc/board.d/02_network
target/linux/ramips/mt7621/base-files/etc/uci-defaults/09_fix_crc
target/linux/ramips/mt7621/base-files/lib/upgrade/buffalo.sh
target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh

diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl2.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl2.dts
new file mode 100644 (file)
index 0000000..d189a5b
--- /dev/null
@@ -0,0 +1,70 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621_buffalo_wsr-2533dhplx.dtsi"
+
+/ {
+       compatible = "buffalo,wsr-2533dhpl2", "mediatek,mt7621-soc";
+       model = "Buffalo WSR-2533DHPL2";
+
+       chosen {
+               bootargs = "console=ttyS0,57600n8 ubi.block=0,rootfs root=/dev/ubiblock0_0";
+       };
+};
+
+&nand {
+       status = "okay";
+
+       mediatek,bbt;
+       /*
+        * -  u-boot - (kernel (6MiB, in "firmware"))
+        * - Kernel2 - board_data
+        */
+       mediatek,bmt-remap-range = <0x0 0x740000>,
+                                  <0x3e60000 0x4120000>;
+};
+
+&partitions {
+       partition@100000 {
+               label = "factory";
+               reg = <0x100000 0x40000>;
+               read-only;
+
+               nvmem-layout {
+                       compatible = "fixed-layout";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       eeprom_factory_0: eeprom@0 {
+                               reg = <0x0 0x4da8>;
+                       };
+
+                       eeprom_factory_8000: eeprom@8000 {
+                               reg = <0x8000 0x4da8>;
+                       };
+               };
+       };
+
+       partition@140000 {
+               compatible = "brcm,trx";
+               brcm,trx-magic = <0x324c4850>;
+               label = "firmware";
+               reg = <0x140000 0x3d20000>;
+       };
+
+       partition@3e60000 {
+               label = "Kernel2";
+               reg = <0x3e60000 0x3d20000>;
+       };
+
+       partition@7b80000 {
+               label = "glbcfg";
+               reg = <0x7b80000 0x200000>;
+               read-only;
+       };
+
+       partition@7d80000 {
+               label = "board_data";
+               reg = <0x7d80000 0x200000>;
+               read-only;
+       };
+};
index 904fd11b1ac922a1e0aac4207d0476e811f748f4..6827fdc1eba09cd37432d1323fcd416e62880ff2 100644 (file)
@@ -563,6 +563,14 @@ define Device/buffalo_wsr-2533dhplx
        sysupgrade-tar kernel=$$$$@ | append-metadata
 endef
 
+define Device/buffalo_wsr-2533dhpl2
+  $(Device/buffalo_wsr-2533dhplx)
+  DEVICE_MODEL := WSR-2533DHPL2
+  BUFFALO_TRX_MAGIC := 0x324c4850
+  IMAGE_SIZE := 62592k
+endef
+TARGET_DEVICES += buffalo_wsr-2533dhpl2
+
 define Device/buffalo_wsr-2533dhpls
   $(Device/buffalo_wsr-2533dhplx)
   DEVICE_MODEL := WSR-2533DHPLS
index 71a342f8f494aff94f83c814cf6cc11f187d3037..247a27d1459c6f382ad65f8db86b33a6f7ff77ac 100644 (file)
@@ -11,6 +11,7 @@ ramips_setup_interfaces()
        alfa-network,ax1800rm|\
        ampedwireless,ally-r1900k|\
        asus,rt-ax53u|\
+       buffalo,wsr-2533dhpl2|\
        buffalo,wsr-2533dhpls|\
        gehua,ghl-r-001|\
        h3c,tx1800-plus|\
@@ -217,6 +218,7 @@ ramips_setup_macs()
                lan_mac=$label_mac
                ;;
        buffalo,wsr-1166dhp|\
+       buffalo,wsr-2533dhpl2|\
        buffalo,wsr-2533dhpls)
                wan_mac=$(mtd_get_mac_ascii board_data "mac")
                lan_mac=$wan_mac
index 89889bc1c246851745d86b97fa790d4d2f511ed8..80e6d71d90b58a2ac21f260c74996b721da51da9 100644 (file)
@@ -13,6 +13,9 @@ fixup_trx_crc() {
 }
 
 case "$(board_name)" in
+buffalo,wsr-2533dhpl2)
+       fixup_trx_crc 0x50484c32
+       ;;
 buffalo,wsr-2533dhpls)
        fixup_trx_crc 0x44484C53
        ;;
index 8040d4c7683d1a8f0ef68380bcf0c3d57b530251..5d3e184d08f2afa0513dfee91224ac3d3d64836c 100644 (file)
@@ -17,6 +17,9 @@
 
 # TRX magic numbers of each model
 case "$(board_name)" in
+buffalo,wsr-2533dhpl2)
+       BUFFALO_TRX_MAGIC="50484c32" # "PHL2"
+       ;;
 buffalo,wsr-2533dhpls)
        BUFFALO_TRX_MAGIC="44484c53" # "DHLS"
        ;;
index 82eda0bf2f278809d11ce75d3c03c20b8929c94b..32dad7294467374f81a4205baf763dfff20a67a1 100755 (executable)
@@ -15,6 +15,7 @@ platform_check_image() {
        [ "$#" -gt 1 ] && return 1
 
        case "$board" in
+       buffalo,wsr-2533dhpl2|\
        buffalo,wsr-2533dhpls)
                buffalo_check_image "$board" "$magic" "$1" || return 1
                ;;
@@ -143,6 +144,7 @@ platform_do_upgrade() {
        zyxel,nwa55axe)
                nand_do_upgrade "$1"
                ;;
+       buffalo,wsr-2533dhpl2|\
        buffalo,wsr-2533dhpls)
                buffalo_do_upgrade "$1"
                ;;