diff --git a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc-ubootmod.dts new file mode 100644 index 0000000000..4d92cff6ae --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc-ubootmod.dts @@ -0,0 +1,52 @@ +// 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"; + }; + + reg_1p8v: regulator-1p8v { + compatible = "regulator-fixed"; + regulator-name = "fixed-1.8V"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; +}; + +&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>; + vqmmc-supply = <®_1p8v>; + 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/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 5cadd76f43..3dae7d6ebf 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 @@ -37,6 +37,7 @@ mediatek_setup_interfaces() ucidef_set_interfaces_lan_wan eth1 eth0 ;; cmcc,rax3000m|\ + cmcc,rax3000m-emmc-ubootmod|\ cmcc,rax3000m-nand-ubootmod|\ h3c,magic-nx30-pro|\ h3c,magic-nx30-pro-nmbm|\ @@ -102,6 +103,11 @@ 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=$wan_mac + ;; h3c,magic-nx30-pro|\ h3c,magic-nx30-pro-nmbm) wan_mac=$(mtd_get_mac_ascii pdt_data_1 ethaddr) 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 b168294960..31b8f8d97b 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 @@ -23,6 +23,7 @@ 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 0c4ef891fc..a5e7ec7747 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 @@ -47,6 +47,9 @@ case "$board" in esac [ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress ;; + cmcc,rax3000m-emmc-ubootmod) + [ "$PHYNBR" = "1" ] && mmc_get_mac_binary factory 0xa > /sys${DEVPATH}/macaddress + ;; cmcc,rax3000m-nand-ubootmod) [ "$PHYNBR" = "1" ] && mtd_get_mac_binary Factory 0xa > /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 a205df22b7..238bc887d5 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -93,6 +93,11 @@ platform_do_upgrade() { ;; esac ;; + cmcc,rax3000m-emmc-ubootmod) + CI_KERNPART="kernel" + CI_ROOTPART="rootfs" + emmc_do_upgrade "$1" + ;; cudy,wr3000-v1) default_do_upgrade "$1" ;; @@ -164,6 +169,7 @@ platform_copy_config() { ;; esac ;; + cmcc,rax3000m-emmc-ubootmod|\ ubnt,unifi-6-plus) emmc_copy_config ;; diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 76f55857f5..87692a42ee 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -259,6 +259,20 @@ define Device/cmcc_rax3000m endef TARGET_DEVICES += cmcc_rax3000m +define Device/cmcc_rax3000m-emmc-ubootmod + DEVICE_VENDOR := CMCC + DEVICE_MODEL := RAX3000M eMMC version (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 (custom U-Boot layout)