[][Add flashes' fixed partitions to dts]

[Description]
Add flashes' fixed partitions to dts:
1. Move SPIM-NOR's & SPIM-NAND's fixed partitions to dts.
2. wbsys is enabled by default now. Move it back to dtsi.

[Release-log]
N/A

Change-Id: I173e0e4ed3c74081bc2e6d00ab1a039fcb56e6c7
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/5044106
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-2500wan-nor-rfb.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-2500wan-nor-rfb.dts
index 77c1d73..7ce8f5a 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-2500wan-nor-rfb.dts
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-2500wan-nor-rfb.dts
@@ -5,9 +5,44 @@
 	compatible = "mediatek,mt7986a-2500wan-nor-rfb";
 };
 
-&wbsys {
-	mediatek,mtd-eeprom = <&factory 0x0000>;
+&spi0 {
 	status = "okay";
+	spi_nor@0 {
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@00000 {
+				label = "BL2";
+				reg = <0x00000 0x0040000>;
+			};
+			partition@40000 {
+				label = "u-boot-env";
+				reg = <0x40000 0x0010000>;
+			};
+			factory: partition@50000 {
+				label = "Factory";
+				reg = <0x50000 0x00B0000>;
+			};
+			partition@100000 {
+				label = "FIP";
+				reg = <0x100000 0x0080000>;
+			};
+			partition@180000 {
+				label = "firmware";
+				reg = <0x180000 0xE00000>;
+			};
+		};
+	};
+};
+
+&snand {
+	status = "disabled";
+};
+
+&mmc0 {
+	status = "disabled";
 };
 
 &mdio {
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-2500wan-snand-rfb.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-2500wan-snand-rfb.dts
index 22cf909..c8b6849 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-2500wan-snand-rfb.dts
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-2500wan-snand-rfb.dts
@@ -3,13 +3,62 @@
 / {
 	model = "MediaTek MT7986a RFB";
 	compatible = "mediatek,mt7986a-2500wan-snand-rfb";
+
+	nmbm_spim_nand {
+		compatible = "generic,nmbm";
+
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		lower-mtd-device = <&spi_nand>;
+		forced-create;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "BL2";
+				reg = <0x00000 0x0100000>;
+				read-only;
+			};
+
+			partition@100000 {
+				label = "u-boot-env";
+				reg = <0x0100000 0x0080000>;
+			};
+
+			factory: partition@180000 {
+				label = "Factory";
+				reg = <0x180000 0x0200000>;
+			};
+
+			partition@380000 {
+				label = "FIP";
+				reg = <0x380000 0x0200000>;
+			};
+
+			partition@580000 {
+				label = "ubi";
+				reg = <0x580000 0x4000000>;
+			};
+		};
+	};
 };
 
-&wbsys {
-	mediatek,mtd-eeprom = <&factory 0x0000>;
+&spi0 {
 	status = "okay";
 };
 
+&snand {
+	status = "okay";
+};
+
+&mmc0 {
+	status = "disabled";
+};
+
 &mdio {
 	switch@0 {
 		ports {
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-emmc-rfb.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-emmc-rfb.dts
index 9887a87..655a600 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-emmc-rfb.dts
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-emmc-rfb.dts
@@ -11,10 +11,10 @@
 	};
 };
 
-&snand {
+&spi0 {
 	status = "disabled";
 };
 
-&spi0 {
+&snand {
 	status = "disabled";
 };
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-nor-rfb.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-nor-rfb.dts
index b273fee..878fad3 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-nor-rfb.dts
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-nor-rfb.dts
@@ -5,7 +5,42 @@
 	compatible = "mediatek,mt7986a-nor-rfb";
 };
 
-&wbsys {
-	mediatek,mtd-eeprom = <&factory 0x0000>;
+&spi0 {
 	status = "okay";
+	spi_nor@0 {
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@00000 {
+				label = "BL2";
+				reg = <0x00000 0x0040000>;
+			};
+			partition@40000 {
+				label = "u-boot-env";
+				reg = <0x40000 0x0010000>;
+			};
+			factory: partition@50000 {
+				label = "Factory";
+				reg = <0x50000 0x00B0000>;
+			};
+			partition@100000 {
+				label = "FIP";
+				reg = <0x100000 0x0080000>;
+			};
+			partition@180000 {
+				label = "firmware";
+				reg = <0x180000 0xE00000>;
+			};
+		};
+	};
+};
+
+&snand {
+	status = "disabled";
+};
+
+&mmc0 {
+	status = "disabled";
 };
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi
index dd15a85..8e34ff6 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi
@@ -55,48 +55,6 @@
 		};
 	};
 
-	nmbm_spim_nand {
-		compatible = "generic,nmbm";
-
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-		lower-mtd-device = <&spi_nand>;
-		forced-create;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition@0 {
-				label = "BL2";
-				reg = <0x00000 0x0100000>;
-				read-only;
-			};
-
-			partition@100000 {
-				label = "u-boot-env";
-				reg = <0x0100000 0x0080000>;
-			};
-
-			partition@180000 {
-				label = "Factory";
-				reg = <0x180000 0x0200000>;
-			};
-
-			partition@380000 {
-				label = "FIP";
-				reg = <0x380000 0x0200000>;
-			};
-
-			partition@580000 {
-				label = "ubi";
-				reg = <0x580000 0x4000000>;
-			};
-		};
-	};
-
 	reg_1p8v: regulator-1p8v {
 		compatible = "regulator-fixed";
 		regulator-name = "fixed-1.8V";
@@ -270,7 +228,6 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&spi_flash_pins>;
 	cs-gpios = <0>, <0>;		
-	status = "okay";
 	spi_nor@0 {
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -279,27 +236,6 @@
 		spi-max-frequency = <20000000>;
 		spi-tx-buswidth = <4>;
 		spi-rx-buswidth = <4>;
-
-		partition@00000 {
-			label = "BL2";
-			reg = <0x00000 0x0040000>;
-		};
-		partition@40000 {
-			label = "u-boot-env";
-			reg = <0x40000 0x0010000>;
-		};
-		factory: partition@50000 {
-			label = "Factory";
-			reg = <0x50000 0x00B0000>;
-		};
-		partition@100000 {
-			label = "FIP";
-			reg = <0x100000 0x0080000>;
-		};
-		partition@180000 {
-			label = "firmware";
-			reg = <0x180000 0xE00000>;
-		};
 	};
 	spi_nand: spi_nand@1 {
 		#address-cells = <1>;
@@ -315,7 +251,6 @@
 &snand {
 	pinctrl-names = "default";
 	pinctrl-0 = <&snfi_pins>;
-	status = "okay";
 	mediatek,quad-spi;
 
 	partitions {
@@ -346,7 +281,6 @@
 	non-removable;
 	no-sd;
 	no-sdio;
-	status = "okay";
 };
 
 &pcie0 {
@@ -355,6 +289,11 @@
 	status = "okay";
 };
 
+&wbsys {
+	mediatek,mtd-eeprom = <&factory 0x0000>;
+	status = "okay";
+};
+
 &pio {
 	wifi_led_pins: wifi_led-pins-1-2 {
 		mux {
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-snand-rfb.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-snand-rfb.dts
index fc2b997..eb6af6a 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-snand-rfb.dts
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-snand-rfb.dts
@@ -3,9 +3,58 @@
 / {
 	model = "MediaTek MT7986a RFB";
 	compatible = "mediatek,mt7986a-snand-rfb";
+
+	nmbm_spim_nand {
+		compatible = "generic,nmbm";
+
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		lower-mtd-device = <&spi_nand>;
+		forced-create;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "BL2";
+				reg = <0x00000 0x0100000>;
+				read-only;
+			};
+
+			partition@100000 {
+				label = "u-boot-env";
+				reg = <0x0100000 0x0080000>;
+			};
+
+			factory: partition@180000 {
+				label = "Factory";
+				reg = <0x180000 0x0200000>;
+			};
+
+			partition@380000 {
+				label = "FIP";
+				reg = <0x380000 0x0200000>;
+			};
+
+			partition@580000 {
+				label = "ubi";
+				reg = <0x580000 0x4000000>;
+			};
+		};
+	};
 };
 
-&wbsys {
-	mediatek,mtd-eeprom = <&factory 0x0000>;
+&spi0 {
 	status = "okay";
 };
+
+&snand {
+	status = "okay";
+};
+
+&mmc0 {
+	status = "disabled";
+};
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-2500wan-nor-rfb.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-2500wan-nor-rfb.dts
index 184d214..652458b 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-2500wan-nor-rfb.dts
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-2500wan-nor-rfb.dts
@@ -5,9 +5,44 @@
 	compatible = "mediatek,mt7986b-nor-rfb";
 };
 
-&wbsys {
-	mediatek,mtd-eeprom = <&factory 0x0000>;
+&spi0 {
 	status = "okay";
+	spi_nor@0 {
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@00000 {
+				label = "BL2";
+				reg = <0x00000 0x0040000>;
+			};
+			partition@40000 {
+				label = "u-boot-env";
+				reg = <0x40000 0x0010000>;
+			};
+			factory: partition@50000 {
+				label = "Factory";
+				reg = <0x50000 0x00B0000>;
+			};
+			partition@100000 {
+				label = "FIP";
+				reg = <0x100000 0x0080000>;
+			};
+			partition@180000 {
+				label = "firmware";
+				reg = <0x180000 0xE00000>;
+			};
+		};
+	};
+};
+
+&snand {
+	status = "disabled";
+};
+
+&mmc0 {
+	status = "disabled";
 };
 
 &mdio {
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-2500wan-snand-rfb.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-2500wan-snand-rfb.dts
index 475316d..c6efff3 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-2500wan-snand-rfb.dts
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-2500wan-snand-rfb.dts
@@ -3,13 +3,62 @@
 / {
 	model = "MediaTek MT7986b RFB";
 	compatible = "mediatek,mt7986b-snand-rfb";
+
+	nmbm_spim_nand {
+		compatible = "generic,nmbm";
+
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		lower-mtd-device = <&spi_nand>;
+		forced-create;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "BL2";
+				reg = <0x00000 0x0100000>;
+				read-only;
+			};
+
+			partition@100000 {
+				label = "u-boot-env";
+				reg = <0x0100000 0x0080000>;
+			};
+
+			factory: partition@180000 {
+				label = "Factory";
+				reg = <0x180000 0x0200000>;
+			};
+
+			partition@380000 {
+				label = "FIP";
+				reg = <0x380000 0x0200000>;
+			};
+
+			partition@580000 {
+				label = "ubi";
+				reg = <0x580000 0x4000000>;
+			};
+		};
+	};
 };
 
-&wbsys {
-	mediatek,mtd-eeprom = <&factory 0x0000>;
+&spi0 {
 	status = "okay";
 };
 
+&snand {
+	status = "okay";
+};
+
+&mmc0 {
+	status = "disabled";
+};
+
 &mdio {
 	switch@0 {
 		ports {
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-emmc-rfb.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-emmc-rfb.dts
index e12623c..66e63cb 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-emmc-rfb.dts
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-emmc-rfb.dts
@@ -11,14 +11,10 @@
 	};
 };
 
-&snand {
-	status = "disabled";
-};
-
 &spi0 {
 	status = "disabled";
 };
 
-&spi1 {
+&snand {
 	status = "disabled";
 };
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-mt7976-ax6000-rfb4.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-mt7976-ax6000-rfb4.dts
index 6a0fa7c..19e8d8b 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-mt7976-ax6000-rfb4.dts
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-mt7976-ax6000-rfb4.dts
@@ -4,8 +4,3 @@
 	model = "MediaTek MT7986b RFB";
 	compatible = "mediatek,mt7986b-snand-rfb";
 };
-
-&wbsys {
-	mediatek,mtd-eeprom = <&factory 0x0000>;
-	status = "disabled";
-};
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-nor-rfb.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-nor-rfb.dts
index dda5579..7ca8bd0 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-nor-rfb.dts
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-nor-rfb.dts
@@ -5,7 +5,42 @@
 	compatible = "mediatek,mt7986b-nor-rfb";
 };
 
-&wbsys {
-	mediatek,mtd-eeprom = <&factory 0x0000>;
+&spi0 {
 	status = "okay";
+	spi_nor@0 {
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@00000 {
+				label = "BL2";
+				reg = <0x00000 0x0040000>;
+			};
+			partition@40000 {
+				label = "u-boot-env";
+				reg = <0x40000 0x0010000>;
+			};
+			factory: partition@50000 {
+				label = "Factory";
+				reg = <0x50000 0x00B0000>;
+			};
+			partition@100000 {
+				label = "FIP";
+				reg = <0x100000 0x0080000>;
+			};
+			partition@180000 {
+				label = "firmware";
+				reg = <0x180000 0xE00000>;
+			};
+		};
+	};
+};
+
+&snand {
+	status = "disabled";
+};
+
+&mmc0 {
+	status = "disabled";
 };
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dtsi b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dtsi
index 7c24dcc..9c6f2e1 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dtsi
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dtsi
@@ -56,48 +56,6 @@
 		};
 	};
 
-	nmbm_spim_nand {
-		compatible = "generic,nmbm";
-
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-		lower-mtd-device = <&spi_nand>;
-		forced-create;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition@0 {
-				label = "BL2";
-				reg = <0x00000 0x0100000>;
-				read-only;
-			};
-
-			partition@100000 {
-				label = "u-boot-env";
-				reg = <0x0100000 0x0080000>;
-			};
-
-			partition@180000 {
-				label = "Factory";
-				reg = <0x180000 0x0200000>;
-			};
-
-			partition@380000 {
-				label = "FIP";
-				reg = <0x380000 0x0200000>;
-			};
-
-			partition@580000 {
-				label = "ubi";
-				reg = <0x580000 0x4000000>;
-			};
-		};
-	};
-
 	reg_3p3v: regulator-3p3v {
 		compatible = "regulator-fixed";
 		regulator-name = "fixed-3.3V";
@@ -238,7 +196,6 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&spi_flash_pins>;
 	cs-gpios = <0>, <0>;
-	status = "okay";
 	spi_nor@0 {
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -247,27 +204,6 @@
 		spi-max-frequency = <20000000>;
 		spi-tx-buswidth = <4>;
 		spi-rx-buswidth = <4>;
-
-		partition@00000 {
-			label = "BL2";
-			reg = <0x00000 0x0040000>;
-		};
-		partition@40000 {
-			label = "u-boot-env";
-			reg = <0x40000 0x0010000>;
-		};
-		factory: partition@50000 {
-			label = "Factory";
-			reg = <0x50000 0x00B0000>;
-		};
-		partition@100000 {
-			label = "FIP";
-			reg = <0x100000 0x0080000>;
-		};
-		partition@180000 {
-			label = "firmware";
-			reg = <0x180000 0xE00000>;
-		};
 	};
 	spi_nand: spi_nand@1 {
 		#address-cells = <1>;
@@ -284,7 +220,6 @@
 &snand {
 	pinctrl-names = "default";
 	pinctrl-0 = <&snfi_pins>;
-	status = "okay";
 	mediatek,quad-spi;
 
 	partitions {
@@ -311,6 +246,10 @@
 	vmmc-supply = <&reg_3p3v>;
 	vqmmc-supply = <&reg_3p3v>;
 	non-removable;
+};
+
+&wbsys {
+	mediatek,mtd-eeprom = <&factory 0x0000>;
 	status = "okay";
 };
 
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-snand-rfb.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-snand-rfb.dts
index 383e649..5215812 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-snand-rfb.dts
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986b-snand-rfb.dts
@@ -3,9 +3,58 @@
 / {
 	model = "MediaTek MT7986b RFB";
 	compatible = "mediatek,mt7986b-snand-rfb";
+
+	nmbm_spim_nand {
+		compatible = "generic,nmbm";
+
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		lower-mtd-device = <&spi_nand>;
+		forced-create;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "BL2";
+				reg = <0x00000 0x0100000>;
+				read-only;
+			};
+
+			partition@100000 {
+				label = "u-boot-env";
+				reg = <0x0100000 0x0080000>;
+			};
+
+			factory: partition@180000 {
+				label = "Factory";
+				reg = <0x180000 0x0200000>;
+			};
+
+			partition@380000 {
+				label = "FIP";
+				reg = <0x380000 0x0200000>;
+			};
+
+			partition@580000 {
+				label = "ubi";
+				reg = <0x580000 0x4000000>;
+			};
+		};
+	};
 };
 
-&wbsys {
-	mediatek,mtd-eeprom = <&factory 0x0000>;
+&spi0 {
 	status = "okay";
 };
+
+&snand {
+	status = "okay";
+};
+
+&mmc0 {
+	status = "disabled";
+};