mediatek: more clean solution for out-of-tree DTS
authorDaniel Golle <daniel@makrotopia.org>
Fri, 19 Feb 2021 01:13:26 +0000 (01:13 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 19 Feb 2021 01:25:49 +0000 (01:25 +0000)
Use approach suggested by Adrian Schmutzler instead of introducing
another device variable.
Also revert the unnecessary white-space changes accidentally introduced
by the previous commit.

Fixed: c067b1e79b ("mediatek: move out-of-tree DTS files to dedicated dts folder")
Suggested-by: Adrian Schmutzler <mail@adrianschmutzler.de>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
include/image.mk
target/linux/mediatek/dts/mt7622-bananapi-bpi-r64-rootdisk.dts
target/linux/mediatek/dts/mt7622-elecom-wrc-2533gent.dts
target/linux/mediatek/image/mt7622.mk

index adb273459707502210e1fa9a0f4299d0ace06931..2530108211874df547e8f07bdc9d90e2102e95cb 100644 (file)
@@ -31,7 +31,7 @@ mkfs_target_dir = $(if $(call param_get,pkg,$(1)),$(KDIR)/target-dir-$(call para
 
 KDIR=$(KERNEL_BUILD_DIR)
 KDIR_TMP=$(KDIR)/tmp
-DTS_DIR:=$(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts$$(if $$(DTS_VENDOR),/$$(DTS_VENDOR))
+DTS_DIR:=$(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts
 
 IMG_PREFIX_EXTRA:=$(if $(EXTRA_IMAGE_NAME),$(call sanitize,$(EXTRA_IMAGE_NAME))-)
 IMG_PREFIX_VERNUM:=$(if $(CONFIG_VERSION_FILENAMES),$(call sanitize,$(VERSION_NUMBER))-)
@@ -416,7 +416,7 @@ DEFAULT_DEVICE_VARS := \
   DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_INITRAMFS_IMAGE KERNEL_SIZE \
   CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI BLOCKSIZE PAGESIZE SUBPAGESIZE \
   VID_HDR_OFFSET UBINIZE_OPTS UBINIZE_PARTS MKUBIFS_OPTS DEVICE_DTS \
-  DEVICE_DTS_CONFIG DEVICE_DTS_DIR DEVICE_FDT_NUM DTS_VENDOR SOC BOARD_NAME \
+  DEVICE_DTS_CONFIG DEVICE_DTS_DIR DEVICE_FDT_NUM SOC BOARD_NAME \
   UIMAGE_MAGIC UIMAGE_NAME \
   SUPPORTED_DEVICES IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR \
   UBOOT_PATH IMAGE_SIZE \
index 2235306b2b83e2d31844240ee871ec230480b0c7..36d908652d1ef50fc591b4c96bcc543a2be3fd63 100644 (file)
                green {
                        label = "bpi-r64:pio:green";
                        gpios = <&pio 89 GPIO_ACTIVE_HIGH>;
-                       default-state = "off";
                };
 
                red {
                        label = "bpi-r64:pio:red";
                        gpios = <&pio 88 GPIO_ACTIVE_HIGH>;
-                       default-state = "off";
                };
        };
 
 };
 
 &pcie0 {
-        pinctrl-names = "default";
-        pinctrl-0 = <&pcie0_pins>;
-        status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&pcie0_pins>;
+       status = "okay";
 };
 
 &pcie1 {
-        pinctrl-names = "default";
-        pinctrl-0 = <&pcie1_pins>;
-        status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&pcie1_pins>;
+       status = "okay";
 };
 
 &pio {
index 48865ada40a6fa73d5367b5953172f4287092ffa..2ac1c6a671688c0c543d207d2ad92ff151be7c28 100644 (file)
                regulator-always-on;
        };
 
-        rtkgsw: rtkgsw@0 {
-                compatible = "mediatek,rtk-gsw";
+       rtkgsw: rtkgsw@0 {
+               compatible = "mediatek,rtk-gsw";
                mediatek,ethsys = <&ethsys>;
-                mediatek,mdio = <&mdio>;
-                mediatek,reset-pin = <&pio 54 0>;
-                status = "okay";
-        };
+               mediatek,mdio = <&mdio>;
+               mediatek,reset-pin = <&pio 54 0>;
+               status = "okay";
+       };
 };
 
 &pcie0 {
-        pinctrl-names = "default";
-        pinctrl-0 = <&pcie0_pins>;
-        status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&pcie0_pins>;
+       status = "okay";
 };
 
 &slot0 {
        pinctrl-names = "default";
        pinctrl-0 = <&eth_pins>;
        gmac0: mac@0 {
-                compatible = "mediatek,eth-mac";
-                reg = <0>;
-                phy-mode = "sgmii";
-                fixed-link {
-                        speed = <1000>;
-                        full-duplex;
-                        pause;
-                };
-        };
-        gmac1: mac@1 {
-                compatible = "mediatek,eth-mac";
-                reg = <1>;
-                phy-mode = "rgmii";
-                fixed-link {
-                        speed = <1000>;
-                        full-duplex;
-                        pause;
-                };
-        };
-        mdio: mdio-bus {
-                #address-cells = <1>;
-                #size-cells = <0>;
-        };
+               compatible = "mediatek,eth-mac";
+               reg = <0>;
+               phy-mode = "sgmii";
+               fixed-link {
+                       speed = <1000>;
+                       full-duplex;
+                       pause;
+               };
+       };
+
+       gmac1: mac@1 {
+               compatible = "mediatek,eth-mac";
+               reg = <1>;
+               phy-mode = "rgmii";
+               fixed-link {
+                       speed = <1000>;
+                       full-duplex;
+                       pause;
+               };
+       };
+
+       mdio: mdio-bus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+       };
 };
 
 &i2c1 {
                spi-max-frequency = <104000000>;
                reg = <0>;
 
-               mediatek,bmt-v2;
-
                partitions {
-                        compatible = "fixed-partitions";
-                        #address-cells = <1>;
-                        #size-cells = <1>;
-
-                        partition@0 {
-                                label = "Preloader";
-                                reg = <0x00000 0x0080000>;
-                                read-only;
-                        };
-
-                        partition@80000 {
-                                label = "ATF";
-                                reg = <0x80000 0x0040000>;
-                                read-only;
-                        };
-
-                        partition@c0000 {
-                                label = "uboot";
-                                reg = <0xc0000 0x0080000>;
-                                read-only;
-                        };
-
-                        partition@140000 {
-                                label = "uboot-env";
-                                reg = <0x140000 0x0080000>;
-                                read-only;
-                        };
-
-                        factory: partition@1c0000 {
-                                label = "factory";
-                                reg = <0x1c0000 0x0040000>;
-                                read-only;
-                        };
-
-                        partition@200000 {
-                                label = "firmware";
-                                reg = <0x200000 0x2000000>;
-                        };
-
-                        partition@2200000 {
-                                label = "reserved";
-                                reg = <0x2200000 0x4000000>;
-                        };
-                };
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "Preloader";
+                               reg = <0x00000 0x0080000>;
+                               read-only;
+                       };
+
+                       partition@80000 {
+                               label = "ATF";
+                               reg = <0x80000 0x0040000>;
+                               read-only;
+                       };
+
+                       partition@c0000 {
+                               label = "uboot";
+                               reg = <0xc0000 0x0080000>;
+                               read-only;
+                       };
+
+                       partition@140000 {
+                               label = "uboot-env";
+                               reg = <0x140000 0x0080000>;
+                               read-only;
+                       };
+
+                       factory: partition@1c0000 {
+                               label = "factory";
+                               reg = <0x1c0000 0x0040000>;
+                               read-only;
+                       };
+
+                       partition@200000 {
+                               label = "firmware";
+                               reg = <0x200000 0x2000000>;
+                       };
+
+                       partition@2200000 {
+                               label = "reserved";
+                               reg = <0x2200000 0x4000000>;
+                       };
+               };
        };
 };
 
index e0a1ac7ba198ec907972de1444ce6043e3442b51..0298b78b5947ab6eae56c606f5a77fcc6a77d5b9 100644 (file)
@@ -1,4 +1,4 @@
-DTS_VENDOR := mediatek
+DTS_DIR := $(DTS_DIR)/mediatek
 KERNEL_LOADADDR := 0x44080000
 
 define Device/bpi_bananapi-r64