]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: drop the use of device tree overlays on mt7986a-rfb board
authorFelix Fietkau <nbd@nbd.name>
Sat, 29 Oct 2022 21:03:08 +0000 (23:03 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 9 Nov 2022 19:43:45 +0000 (20:43 +0100)
The boot loader does not support it. Instead make NAND the default image for
this board

Signed-off-by: Felix Fietkau <nbd@nbd.name>
target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb-spim-nand.dts
target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb-spim-nor.dts
target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi [moved from target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts with 100% similarity]
target/linux/mediatek/image/filogic.mk

index 72b8923b41dae7fb3bc2f8f53d87fcbea04ca670..938dd181b97221f700ff38c21dc4ba84d78cfcf2 100644 (file)
@@ -1,51 +1,52 @@
 /* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
 
-/dts-v1/;
-/plugin/;
+#include "mt7986a-rfb.dtsi"
 
 / {
-        compatible = "mediatek,mt7986a-spim-snand-rfb";
+       compatible = "mediatek,mt7986a-rfb-snand";
+};
+
+&spi0 {
+       status = "okay";
 
-        fragment@0 {
-               target-path = "/soc/spi@1100a000";
-                __overlay__ {
-                       status = "okay";
-                       spi_nand: spi_nand@0 {
-                               #address-cells = <1>;
-                               #size-cells = <1>;
-                               compatible = "spi-nand";
-                               reg = <1>;
-                               spi-max-frequency = <10000000>;
-                               spi-tx-buswidth = <4>;
-                               spi-rx-buswidth = <4>;
+       spi_nand: spi_nand@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "spi-nand";
+               reg = <1>;
+               spi-max-frequency = <10000000>;
+               spi-tx-buswidth = <4>;
+               spi-rx-buswidth = <4>;
 
-                               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>;
-                                       };
-                               };
+               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>;
                        };
                };
-        };
+       };
+};
+
+&wmac {
+       mediatek,mtd-eeprom = <&factory 0>;
 };
index b847e484556d9b56084e794b16ab7a802e22205c..8d94069dcffbd29a75ba6e279b89606bc6234c97 100644 (file)
@@ -1,50 +1,51 @@
 /* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
 
-/dts-v1/;
-/plugin/;
+#include "mt7986a-rfb.dtsi"
 
 / {
-        compatible = "mediatek,mt7986a-snor-rfb";
+        compatible = "mediatek,mt7986a-rfb-snor";
+};
+
+&spi0 {
+       status = "okay";
 
-        fragment@0 {
-               target-path = "/soc/spi@1100a000";
-               __overlay__ {
-                       status = "okay";
-                       spi_nor: spi_nor@0 {
-                               #address-cells = <1>;
-                               #size-cells = <1>;
-                               compatible = "jedec,spi-nor";
-                               reg = <0>;
-                               spi-max-frequency = <52000000>;
-                               spi-tx-buswidth = <4>;
-                               spi-rx-buswidth = <4>;
-                               partitions {
-                                       compatible = "fixed-partitions";
-                                       #address-cells = <1>;
-                                       #size-cells = <1>;
+       spi_nor: spi_nor@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <52000000>;
+               spi-tx-buswidth = <4>;
+               spi-rx-buswidth = <4>;
+               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>;
-                                       };
-                               };
+                       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>;
                        };
                };
-        };
+       };
+};
+
+&wmac {
+       mediatek,mtd-eeprom = <&factory 0>;
 };
index f7fc9e30d15db2627304bf4c8fb49266328bc1a2..1ece1465c23983aab9c9aa609a868b19183733e2 100644 (file)
@@ -84,14 +84,13 @@ define Device/bananapi_bpi-r3
 endef
 TARGET_DEVICES += bananapi_bpi-r3
 
-define Device/mediatek_mt7986a-rfb
+define Device/mediatek_mt7986a-rfb-nand
   DEVICE_VENDOR := MediaTek
-  DEVICE_MODEL := MTK7986 rfba AP
-  DEVICE_DTS := mt7986a-rfb
+  DEVICE_MODEL := MT7986 rfba AP (NAND)
+  DEVICE_DTS := mt7986a-rfb-spim-nand
   DEVICE_DTS_DIR := $(DTS_DIR)/
   KERNEL_LOADADDR := 0x48000000
-  DEVICE_DTS_OVERLAY := mt7986a-rfb-spim-nand mt7986a-rfb-spim-nor
-  SUPPORTED_DEVICES := mediatek,mt7986a-rfb
+  SUPPORTED_DEVICES := mediatek,mt7986a-rfb-snand
   UBINIZE_OPTS := -E 5
   BLOCKSIZE := 128k
   PAGESIZE := 2048
@@ -101,12 +100,12 @@ define Device/mediatek_mt7986a-rfb
   IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
   KERNEL = kernel-bin | lzma | \
-       fit lzma $$(KDIR)/$$(firstword $$(DEVICE_DTS)).dtb
+       fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
   KERNEL_INITRAMFS = kernel-bin | lzma | \
-       fit lzma $$(KDIR)/$$(firstword $$(DEVICE_DTS)).dtb with-initrd
+       fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
   DTC_FLAGS += -@ --space 32768
 endef
-TARGET_DEVICES += mediatek_mt7986a-rfb
+TARGET_DEVICES += mediatek_mt7986a-rfb-nand
 
 define Device/mediatek_mt7986b-rfb
   DEVICE_VENDOR := MediaTek