From 342a17476c73575e9e94a0178eadb4fc1e78ad7a Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 6 Jan 2024 11:03:49 +0800 Subject: [PATCH] mediatek: remove custom layout for CMCC RAX3000M Since the mainline implementation has been accepted by upstream, it doesn't make sense to keep these hacks. People are also confused with these "custom layouts". Signed-off-by: Tianling Shen --- .../uboot-envtools/files/mediatek_filogic | 4 - .../mt7981b-cmcc-rax3000m-emmc-ubootmod.dts | 42 ------- .../mt7981b-cmcc-rax3000m-nand-ubootmod.dts | 119 ------------------ .../filogic/base-files/etc/board.d/02_network | 7 -- .../etc/hotplug.d/firmware/11-mt76-caldata | 1 - .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 10 +- .../base-files/lib/upgrade/platform.sh | 8 +- target/linux/mediatek/image/filogic.mk | 39 ------ 8 files changed, 7 insertions(+), 223 deletions(-) delete mode 100644 target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc-ubootmod.dts delete mode 100644 target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand-ubootmod.dts diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index 1e82f05fef..be7f2d49e0 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -43,7 +43,6 @@ bananapi,bpi-r3-mini) ;; cetron,ct3003-stock|\ cetron,ct3003-ubootmod|\ -cmcc,rax3000m-nand-ubootmod|\ h3c,magic-nx30-pro-nmbm|\ netgear,wax220|\ zbtlink,zbt-z8102ax|\ @@ -67,9 +66,6 @@ cmcc,rax3000m) ;; esac ;; -cmcc,rax3000m-emmc-ubootmod) - ubootenv_add_uci_config "/dev/mmcblk0p1" "0x0" "0x80000" "0x80000" - ;; glinet,gl-mt2500|\ glinet,gl-mt6000) local envdev=$(find_mmc_part "u-boot-env") diff --git a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc-ubootmod.dts deleted file mode 100644 index 8f5f9a601d..0000000000 --- a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc-ubootmod.dts +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT - -/dts-v1/; -#include "mt7981b-cmcc-rax3000m.dts" - -/ { - model = "CMCC RAX3000M eMMC version (custom U-Boot layout)"; - compatible = "cmcc,rax3000m-emmc-ubootmod", "mediatek,mt7981"; - - chosen { - bootargs = "root=PARTLABEL=rootfs rootwait rootfstype=squashfs,f2fs"; - }; -}; - -&mmc0 { - bus-width = <8>; - max-frequency = <26000000>; - no-sd; - no-sdio; - non-removable; - pinctrl-names = "default", "state_uhs"; - pinctrl-0 = <&mmc0_pins_default>; - pinctrl-1 = <&mmc0_pins_uhs>; - vmmc-supply = <®_3p3v>; - status = "okay"; -}; - -&pio { - mmc0_pins_default: mmc0-pins { - mux { - function = "flash"; - groups = "emmc_45"; - }; - }; - - mmc0_pins_uhs: mmc0-uhs-pins { - mux { - function = "flash"; - groups = "emmc_45"; - }; - }; -}; diff --git a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand-ubootmod.dts deleted file mode 100644 index 06b9f47453..0000000000 --- a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand-ubootmod.dts +++ /dev/null @@ -1,119 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT - -/dts-v1/; -#include "mt7981b-cmcc-rax3000m.dts" - -/ { - model = "CMCC RAX3000M NAND version (custom U-Boot layout)"; - compatible = "cmcc,rax3000m-nand-ubootmod", "mediatek,mt7981"; - - aliases { - label-mac-device = &gmac1; - }; -}; - -&gmac0 { - nvmem-cells = <&macaddr_factory_2a 0>; - nvmem-cell-names = "mac-address"; -}; - -&gmac1 { - nvmem-cells = <&macaddr_factory_24 0>; - nvmem-cell-names = "mac-address"; -}; - -&spi0 { - pinctrl-names = "default"; - pinctrl-0 = <&spi0_flash_pins>; - status = "okay"; - - spi_nand: flash@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "spi-nand"; - reg = <0>; - - spi-max-frequency = <52000000>; - spi-tx-bus-width = <4>; - spi-rx-bus-width = <4>; - mediatek,nmbm; - mediatek,bmt-max-ratio = <1>; - mediatek,bmt-max-reserved-blocks = <64>; - - partitions: partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "BL2"; - reg = <0x00000 0x100000>; - read-only; - }; - - partition@100000 { - label = "u-boot-env"; - reg = <0x100000 0x80000>; - }; - - factory: partition@180000 { - label = "Factory"; - reg = <0x180000 0x200000>; - - compatible = "nvmem-cells"; - nvmem-layout { - compatible = "fixed-layout"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_24: macaddr@24 { - compatible = "mac-base"; - reg = <0x24 0x6>; - #nvmem-cell-cells = <1>; - }; - - macaddr_factory_2a: macaddr@2a { - compatible = "mac-base"; - reg = <0x2a 0x6>; - #nvmem-cell-cells = <1>; - }; - }; - }; - - partition@380000 { - label = "FIP"; - reg = <0x380000 0x200000>; - }; - - partition@580000 { - label = "ubi"; - reg = <0x580000 0x7200000>; - }; - }; - }; -}; - -&pio { - spi0_flash_pins: spi0-pins { - mux { - function = "spi"; - groups = "spi0", "spi0_wp_hold"; - }; - - conf-pu { - pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; - drive-strength = ; - bias-pull-up = ; - }; - - conf-pd { - pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; - drive-strength = ; - bias-pull-down = ; - }; - }; -}; - -&wifi { - mediatek,mtd-eeprom = <&factory 0x0>; -}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 9cb0ecb77f..5a9d05d446 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -13,8 +13,6 @@ mediatek_setup_interfaces() ;; abt,asr3000-ubootmod|\ cmcc,rax3000m|\ - cmcc,rax3000m-emmc-ubootmod|\ - cmcc,rax3000m-nand-ubootmod|\ h3c,magic-nx30-pro|\ h3c,magic-nx30-pro-nmbm|\ imou,lc-hx3001-ubootmod|\ @@ -135,11 +133,6 @@ mediatek_setup_macs() ;; esac ;; - cmcc,rax3000m-emmc-ubootmod) - wan_mac=$(mmc_get_mac_binary factory 0x2a) - lan_mac=$(mmc_get_mac_binary factory 0x24) - label_mac=$wan_mac - ;; glinet,gl-mt2500) label_mac="$(get_mac_binary "/dev/mmcblk0boot1" 0xA)" wan_mac="$label_mac" diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata index b04d239736..22ab26608f 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata @@ -31,7 +31,6 @@ case "$FIRMWARE" in ;; esac ;; - cmcc,rax3000m-emmc-ubootmod|\ ubnt,unifi-6-plus) caldata_extract_mmc "factory" 0x0 0x1000 ;; diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 5abccbbe88..23d044927f 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -58,8 +58,7 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress ;; - cmcc,a10-ubootmod|\ - cmcc,rax3000m-nand-ubootmod) + cmcc,a10-ubootmod) [ "$PHYNBR" = "1" ] && mtd_get_mac_binary Factory 0xa > /sys${DEVPATH}/macaddress ;; cmcc,rax3000m) @@ -73,10 +72,6 @@ case "$board" in esac [ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress ;; - cmcc,rax3000m-emmc-ubootmod|\ - jdcloud,re-cp-03) - [ "$PHYNBR" = "1" ] && mmc_get_mac_binary factory 0xa > /sys${DEVPATH}/macaddress - ;; cudy,wr3000-v1) addr=$(mtd_get_mac_binary bdinfo 0xde00) # Originally, phy0 is phy1 mac with LA bit set. However, this would conflict @@ -108,6 +103,9 @@ case "$board" in # addresses on multiple VIFs with the other radio. Use label mac to set LA bit. [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(get_mac_label) > /sys${DEVPATH}/macaddress ;; + jdcloud,re-cp-03) + [ "$PHYNBR" = "1" ] && mmc_get_mac_binary factory 0xa > /sys${DEVPATH}/macaddress + ;; livinet,zr-3020|\ livinet,zr-3020-ubootmod) [ "$PHYNBR" = "0" ] && mtd_get_mac_ascii config2 wifi2gmac > /sys${DEVPATH}/macaddress diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index 58e6282a96..56b0192114 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -111,16 +111,15 @@ platform_do_upgrade() { ;; esac ;; - cmcc,rax3000m-emmc-ubootmod|\ + cudy,wr3000-v1) + default_do_upgrade "$1" + ;; glinet,gl-mt2500|\ glinet,gl-mt6000) CI_KERNPART="kernel" CI_ROOTPART="rootfs" emmc_do_upgrade "$1" ;; - cudy,wr3000-v1) - default_do_upgrade "$1" - ;; h3c,magic-nx30-pro|\ jcg,q30|\ mediatek,mt7981-rfb|\ @@ -193,7 +192,6 @@ platform_check_image() { platform_copy_config() { case "$(board_name)" in acer,predator-w6|\ - cmcc,rax3000m-emmc-ubootmod|\ glinet,gl-mt2500|\ glinet,gl-mt6000|\ jdcloud,re-cp-03|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 5d4a3a4ea3..6210fe321d 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -391,7 +391,6 @@ TARGET_DEVICES += cmcc_a10-ubootmod define Device/cmcc_rax3000m DEVICE_VENDOR := CMCC DEVICE_MODEL := RAX3000M - DEVICE_VARIANT := (OpenWrt U-Boot layout) DEVICE_DTS := mt7981b-cmcc-rax3000m DEVICE_DTS_OVERLAY := mt7981b-cmcc-rax3000m-emmc mt7981b-cmcc-rax3000m-nand DEVICE_DTS_DIR := ../dts @@ -422,44 +421,6 @@ define Device/cmcc_rax3000m endef TARGET_DEVICES += cmcc_rax3000m -define Device/cmcc_rax3000m-emmc-ubootmod - DEVICE_VENDOR := CMCC - DEVICE_MODEL := RAX3000M eMMC version - DEVICE_VARIANT := (custom U-Boot layout) - DEVICE_DTS := mt7981b-cmcc-rax3000m-emmc-ubootmod - DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 \ - automount f2fsck mkf2fs - 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 += cmcc_rax3000m-emmc-ubootmod - -define Device/cmcc_rax3000m-nand-ubootmod - DEVICE_VENDOR := CMCC - DEVICE_MODEL := RAX3000M NAND version - DEVICE_VARIANT := (custom U-Boot layout) - DEVICE_DTS := mt7981b-cmcc-rax3000m-nand-ubootmod - DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware \ - kmod-usb3 automount - UBINIZE_OPTS := -E 5 - BLOCKSIZE := 128k - PAGESIZE := 2048 - IMAGE_SIZE := 116736k - 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 += cmcc_rax3000m-nand-ubootmod - define Device/confiabits_mt7981 DEVICE_VENDOR := Confiabits DEVICE_MODEL := MT7981