dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm-hana.dtb
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt7988a-rfb-emmc.dtso
-@@ -0,0 +1,33 @@
+@@ -0,0 +1,60 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 MediaTek Inc.
+ no-sd;
+ no-sdio;
+ status = "okay";
++
++ card@0 {
++ compatible = "mmc-card";
++ reg = <0>;
++
++ partitions {
++ compatible = "gpt-partitions";
++
++ block-partition-env {
++ partname = "ubootenv";
++ nvmem-layout {
++ compatible = "u-boot,env-layout";
++ };
++ };
++
++ emmc_root: block-partition-production {
++ partname = "production";
++ };
++ };
++ };
++ };
++ };
++
++ fragment@1 {
++ target-path = "/chosen";
++ __overlay__ {
++ rootdisk-emmc = <&emmc_root>;
+ };
+ };
+};
+};
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt7988a-rfb-sd.dtso
-@@ -0,0 +1,31 @@
+@@ -0,0 +1,58 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2023 MediaTek Inc.
+/ {
+ compatible = "mediatek,mt7988a-rfb", "mediatek,mt7988a";
+
-+ fragment@1 {
++ fragment@0 {
+ target-path = <&mmc0>;
+ __overlay__ {
+ pinctrl-names = "default", "state_uhs";
+ vqmmc-supply = <®_3p3v>;
+ no-mmc;
+ status = "okay";
++
++ card@0 {
++ compatible = "mmc-card";
++ reg = <0>;
++
++ partitions {
++ compatible = "gpt-partitions";
++
++ block-partition-env {
++ partname = "ubootenv";
++ nvmem-layout {
++ compatible = "u-boot,env-layout";
++ };
++ };
++
++ sd_root: block-partition-production {
++ partname = "production";
++ };
++ };
++ };
++ };
++ };
++
++ fragment@1 {
++ target-path = "/chosen";
++ __overlay__ {
++ rootdisk-sd = <&sd_root>;
+ };
+ };
+};
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt7988a-rfb-snfi-nand.dtso
-@@ -0,0 +1,70 @@
+@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2022 MediaTek Inc.
+ 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 {
-+ compatible = "fixed-partitions";
-+ #address-cells = <1>;
-+ #size-cells = <1>;
-+
+ partition@0 {
+ label = "BL2";
-+ reg = <0x00000 0x0100000>;
++ reg = <0x00000 0x0200000>;
+ read-only;
+ };
+
-+ partition@100000 {
-+ label = "u-boot-env";
-+ reg = <0x0100000 0x0080000>;
-+ };
-+
-+ partition@180000 {
-+ label = "Factory";
-+ reg = <0x180000 0x0400000>;
-+ };
-+
-+ partition@580000 {
-+ label = "FIP";
-+ reg = <0x580000 0x0200000>;
-+ };
-+
-+ partition@780000 {
++ ubi_part: partition@200000 {
+ label = "ubi";
-+ reg = <0x780000 0x7080000>;
++ reg = <0x0200000 0x7e00000>;
++ compatible = "linux,ubi";
++
++ volumes {
++ ubi-volume-ubootenv {
++ volname = "ubootenv";
++ nvmem-layout {
++ compatible = "u-boot,env-redundant-bool";
++ };
++ };
++
++ ubi-volume-ubootenv2 {
++ volname = "ubootenv2";
++ nvmem-layout {
++ compatible = "u-boot,env-redundant-bool";
++ };
++ };
++
++ snfi_root: ubi-volume-fit {
++ volname = "fit";
++ };
++ };
+ };
+ };
+ };
+ status = "okay";
+ };
+ };
++
++ fragment@2 {
++ target-path = "/chosen";
++ __overlay__ {
++ /*
++ * U-Boot currently cannot detect diffrentiate between
++ * SD and SNFI boot media and always uses rootdisk-sd in
++ * both cases
++ */
++ rootdisk-sd = <&snfi_root>;
++ };
++ };
+};
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt7988a-rfb-spim-nand-factory.dtso
+};
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt7988a-rfb-spim-nand.dtso
-@@ -0,0 +1,66 @@
+@@ -0,0 +1,77 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2022 MediaTek Inc.
+ 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 {
+ compatible = "fixed-partitions";
+
+ partition@0 {
+ label = "BL2";
-+ reg = <0x00000 0x0100000>;
++ reg = <0x00000 0x0200000>;
+ read-only;
+ };
+
-+ partition@100000 {
-+ label = "u-boot-env";
-+ reg = <0x0100000 0x0080000>;
-+ };
-+
-+ partition@180000 {
-+ label = "Factory";
-+ reg = <0x180000 0x0400000>;
-+ };
-+
-+ partition@580000 {
-+ label = "FIP";
-+ reg = <0x580000 0x0200000>;
-+ };
-+
-+ partition@780000 {
++ ubi_part: partition@200000 {
+ label = "ubi";
-+ reg = <0x780000 0x7080000>;
++ reg = <0x0200000 0x7e00000>;
++ compatible = "linux,ubi";
++
++ volumes {
++ ubi-volume-ubootenv {
++ volname = "ubootenv";
++ nvmem-layout {
++ compatible = "u-boot,env-redundant-bool";
++ };
++ };
++
++ ubi-volume-ubootenv2 {
++ volname = "ubootenv2";
++ nvmem-layout {
++ compatible = "u-boot,env-redundant-bool";
++ };
++ };
++
++ ubi_root: ubi-volume-fit {
++ volname = "fit";
++ };
++
++ };
+ };
+ };
+ };
+ };
+ };
++
++ fragment@1 {
++ target-path = "/chosen";
++ __overlay__ {
++ rootdisk-spim-nand = <&ubi_root>;
++ };
++ };
+};
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt7988a-rfb-spim-nor.dtso
-@@ -0,0 +1,61 @@
+@@ -0,0 +1,69 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2022 MediaTek Inc.
+ label = "FIP";
+ reg = <0x250000 0x80000>;
+ };
-+ partition@2D0000 {
++ nor_root: partition@2D0000 {
+ label = "firmware";
+ reg = <0x2d0000 0x1d30000>;
++ compatible = "denx,fit";
+ };
+ };
+ };
+ };
++
++ fragment@1 {
++ target-path = "/chosen";
++ __overlay__ {
++ rootdisk-nor = <&nor_root>;
++ };
++ };
+};
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt7988a-rfb.dts