From a591f9cd1408477e3f99e079a5b95098bda82a2b Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 5 Apr 2024 15:44:24 +0800 Subject: [PATCH 1/2] mediatek: enable rootwait for cmcc rax3000m emmc version Sometimes the mmc deivce may come up later than kernel attempts to mount rootfs, resulting kernel panic. Enable rootwait to fix it. Reported-by: Yangyu Chen Signed-off-by: Tianling Shen Link: https://github.com/openwrt/openwrt/pull/15077 Signed-off-by: Hauke Mehrtens --- .../uboot-mediatek/patches/437-add-cmcc_rax3000m.patch | 2 +- .../linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc.dtso | 9 ++++++++- target/linux/mediatek/dts/mt7981b-cmcc-rax3000m.dts | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/package/boot/uboot-mediatek/patches/437-add-cmcc_rax3000m.patch b/package/boot/uboot-mediatek/patches/437-add-cmcc_rax3000m.patch index 26e0e30a99..1d636b64a7 100644 --- a/package/boot/uboot-mediatek/patches/437-add-cmcc_rax3000m.patch +++ b/package/boot/uboot-mediatek/patches/437-add-cmcc_rax3000m.patch @@ -585,7 +585,7 @@ +serverip=192.168.1.254 +loadaddr=0x46000000 +console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0 -+bootargs=root=/dev/mmcblk0p65 ++bootargs=root=/dev/mmcblk0p65 rootwait +bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi +bootconf=config-1#mt7981b-cmcc-rax3000m-emmc +bootdelay=0 diff --git a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc.dtso b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc.dtso index c1c9c75c27..df0a79eb1e 100644 --- a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc.dtso +++ b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc.dtso @@ -7,6 +7,13 @@ compatible = "cmcc,rax3000m", "mediatek,mt7981"; fragment@0 { + target = <&chosen>; + __overlay_ { + bootargs-append = " rootwait"; + }; + }; + + fragment@1 { target = <&mmc0>; __overlay__ { bus-width = <8>; @@ -22,7 +29,7 @@ }; }; - fragment@1 { + fragment@2 { target = <&pio>; __overlay__ { mmc0_pins_default: mmc0-pins { diff --git a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m.dts b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m.dts index 3f330f40fa..bb0d43c112 100644 --- a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m.dts +++ b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m.dts @@ -21,7 +21,7 @@ serial0 = &uart0; }; - chosen { + chosen: chosen { stdout-path = "serial0:115200n8"; }; From cce5b49de482d8c31f792eac1fe6147ae83c0e4f Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 6 Jun 2024 16:54:38 +0800 Subject: [PATCH 2/2] mediatek: fix lan/wan macaddr for cmcc rax3000m The MAC address assigned to lan/wan was reversed on eMMC boards. Fixes: d3c193525e62 ("mediatek: add CMCC RAX3000M support") Signed-off-by: Tianling Shen Link: https://github.com/openwrt/openwrt/pull/15077 Signed-off-by: Hauke Mehrtens --- .../linux/mediatek/filogic/base-files/etc/board.d/02_network | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 503171ae64..e8ce84dd4b 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 @@ -129,8 +129,8 @@ mediatek_setup_macs() cmcc,rax3000m) case "$(cmdline_get_var root)" in /dev/mmc*) - wan_mac=$(mmc_get_mac_binary factory 0x2a) - lan_mac=$(mmc_get_mac_binary factory 0x24) + wan_mac=$(mmc_get_mac_binary factory 0x24) + lan_mac=$(mmc_get_mac_binary factory 0x2a) label_mac=$wan_mac ;; esac