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 <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2024-01-06 11:03:49 +08:00
parent 445458316b
commit 342a17476c
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
8 changed files with 7 additions and 223 deletions

View File

@ -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")

View File

@ -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 = <&reg_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";
};
};
};

View File

@ -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 = <MTK_DRIVE_8mA>;
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
};
conf-pd {
pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
};
};
};
&wifi {
mediatek,mtd-eeprom = <&factory 0x0>;
};

View File

@ -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"

View File

@ -31,7 +31,6 @@ case "$FIRMWARE" in
;;
esac
;;
cmcc,rax3000m-emmc-ubootmod|\
ubnt,unifi-6-plus)
caldata_extract_mmc "factory" 0x0 0x1000
;;

View File

@ -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

View File

@ -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|\

View File

@ -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