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 index 00000000000000..d189a5ba0988d9 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl2.dts @@ -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; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index d8f19d2b834051..b830ccb3de6839 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -561,6 +561,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 diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 2b5a85980d2e50..112dd011af512c 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -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|\ @@ -215,6 +216,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 diff --git a/target/linux/ramips/mt7621/base-files/etc/uci-defaults/09_fix_crc b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/09_fix_crc index a19d502021fbb9..74432e94f5be4f 100644 --- a/target/linux/ramips/mt7621/base-files/etc/uci-defaults/09_fix_crc +++ b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/09_fix_crc @@ -6,6 +6,9 @@ fstype="$(/bin/mount | awk '($3 ~ /^\/$/) && ($5 !~ /rootfs/) { print $5 }')" exit 0 case "$(board_name)" in +buffalo,wsr-2533dhpl2) + trx_magic=0x50484c32 + ;; buffalo,wsr-2533dhpls) trx_magic=0x44484C53 ;; diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/buffalo.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/buffalo.sh index 8040d4c7683d1a..5d3e184d08f2af 100644 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/buffalo.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/buffalo.sh @@ -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" ;; diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 9e6d60eea7859c..cb585b15acb263 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -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 ;; @@ -140,6 +141,7 @@ platform_do_upgrade() { zyxel,nwa55axe) nand_do_upgrade "$1" ;; + buffalo,wsr-2533dhpl2|\ buffalo,wsr-2533dhpls) buffalo_do_upgrade "$1" ;;