ramips: convert most mtd-mac-address cases in DTSI to nvmem
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Tue, 17 Aug 2021 18:53:27 +0000 (20:53 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Wed, 18 Aug 2021 21:46:02 +0000 (23:46 +0200)
Convert most of the cases from mtd-mac-address to nvmem where
MAC addresses are set in the DTSI, but the partitions are only
located in the device DTS. This posed some problems earlier, since
in these cases we are using partitions before they are defined,
and the nvmem system did not seem to like that.

There have been a few different resolution approaches, based on
the different tradeoffs of deduplication vs. maintainability:

 1. In many cases, the partition tables were identical except for
    the firmware partition size, and the firmware partition was
    the last in the table.
    In these cases, the partition table has been moved to the
    DTSI, and only the firmware partition's "reg" property has
    been kept in the DTS files. So, the updated nvmem definition
    could stay in the DTSI files as well.

 2. For all other cases, splitting up the partition table would
    have introduced additional complexity. Thus, the nodes to be
    converted to nvmem have been moved to the DTS files where the
    partitioning was defined.

 3. For Netgear EX2700 and WN3000RP v3, the remaining DTSI file
    was completely dissolved, as it was quite small and the name
    was not really nice either.

 4. The D-Link DIR-853 A3 was converted to nvmem as well, though
    it is just a plain DTS file not taken care of in the first
    wave.

In addition, some minor rearrangements have been made for tidyness.

Not covered (yet) by this patch are:

 * Various unielec devices
 * The D-Link DIR-8xx family

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
47 files changed:
target/linux/ramips/dts/mt7620a_netgear_ex2700.dts
target/linux/ramips/dts/mt7620a_netgear_ex2700_wn3000rp-v3.dtsi [deleted file]
target/linux/ramips/dts/mt7620a_netgear_wn3000rp-v3.dts
target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-16m.dts
target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-32m.dts
target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-e.dts
target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi
target/linux/ramips/dts/mt7620n_nexx_wt3020-4m.dts
target/linux/ramips/dts/mt7620n_nexx_wt3020-8m.dts
target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi
target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts
target/linux/ramips/dts/mt7621_netgear_r6220.dts
target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi
target/linux/ramips/dts/mt7621_netgear_wndr3700-v5.dts
target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts
target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts
target/linux/ramips/dts/mt7621_ubnt_unifi.dtsi
target/linux/ramips/dts/mt7628an_vocore_vocore2-lite.dts
target/linux/ramips/dts/mt7628an_vocore_vocore2.dts
target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi
target/linux/ramips/dts/mt7628an_widora_neo-16m.dts
target/linux/ramips/dts/mt7628an_widora_neo-32m.dts
target/linux/ramips/dts/mt7628an_widora_neo.dtsi
target/linux/ramips/dts/rt3050_allnet_all0256n-4m.dts
target/linux/ramips/dts/rt3050_allnet_all0256n-8m.dts
target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi
target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts
target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts
target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi
target/linux/ramips/dts/rt5350_7links_px-4885-4m.dts
target/linux/ramips/dts/rt5350_7links_px-4885-8m.dts
target/linux/ramips/dts/rt5350_7links_px-4885.dtsi
target/linux/ramips/dts/rt5350_asiarf_awm002-evb-4m.dts
target/linux/ramips/dts/rt5350_asiarf_awm002-evb-8m.dts
target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi
target/linux/ramips/dts/rt5350_nexx_wt1520-4m.dts
target/linux/ramips/dts/rt5350_nexx_wt1520-8m.dts
target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi
target/linux/ramips/dts/rt5350_nixcore_x1-16m.dts
target/linux/ramips/dts/rt5350_nixcore_x1-8m.dts
target/linux/ramips/dts/rt5350_nixcore_x1.dtsi
target/linux/ramips/dts/rt5350_poray_m4-4m.dts
target/linux/ramips/dts/rt5350_poray_m4-8m.dts
target/linux/ramips/dts/rt5350_poray_m4.dtsi
target/linux/ramips/dts/rt5350_vocore_vocore-16m.dts
target/linux/ramips/dts/rt5350_vocore_vocore-8m.dts
target/linux/ramips/dts/rt5350_vocore_vocore.dtsi

index 9ed0883b456c3d1f7ad6871b2b9321c9218a8857..e09d9c607b88661bf29f88e8c3b554b3b9c99ff6 100644 (file)
@@ -3,7 +3,10 @@
  * Copyright (C) 2016 Joseph C. Lehner <joseph.c.lehner@gmail.com>
  */
 
-#include "mt7620a_netgear_ex2700_wn3000rp-v3.dtsi"
+#include "mt7620a.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 
 / {
        compatible = "netgear,ex2700", "ralink,mt7620a-soc";
                led-upgrade = &led_power_green;
        };
 
+       keys {
+               compatible = "gpio-keys";
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+
+               wps {
+                       label = "wps";
+                       gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WPS_BUTTON>;
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
 
        };
 };
 
-&partitions {
-       partition@0 {
-               label = "u-boot";
-               reg = <0x0 0x30000>;
-               read-only;
+&gpio1 {
+       status = "okay";
+};
+
+&spi0 {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "u-boot-env";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       partition@40000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               reg = <0x40000 0x3b0000>;
+                       };
+
+                       art: partition@3f0000 {
+                               label = "art";
+                               reg = <0x3f0000 0x10000>;
+                               read-only;
+                       };
+               };
        };
+};
+
+&ethernet {
+       nvmem-cells = <&macaddr_art_0>;
+       nvmem-cell-names = "mac-address";
+};
+
+&wmac {
+       ralink,mtd-eeprom = <&art 0x1000>;
+
+       nvmem-cells = <&macaddr_art_6>;
+       nvmem-cell-names = "mac-address";
+};
 
-       partition@30000 {
-               label = "u-boot-env";
-               reg = <0x30000 0x10000>;
-               read-only;
+&state_default {
+       default {
+               groups = "i2c", "uartf", "spi refclk";
+               function = "gpio";
        };
+};
+
+&art {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
 
-       partition@40000 {
-               compatible = "denx,uimage";
-               label = "firmware";
-               reg = <0x40000 0x3b0000>;
+       macaddr_art_0: macaddr@0 {
+               reg = <0x0 0x6>;
        };
 
-       art: partition@3f0000 {
-               label = "art";
-               reg = <0x3f0000 0x10000>;
-               read-only;
+       macaddr_art_6: macaddr@6 {
+               reg = <0x6 0x6>;
        };
 };
diff --git a/target/linux/ramips/dts/mt7620a_netgear_ex2700_wn3000rp-v3.dtsi b/target/linux/ramips/dts/mt7620a_netgear_ex2700_wn3000rp-v3.dtsi
deleted file mode 100644 (file)
index e7b1f4b..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#include "mt7620a.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
-
-/ {
-       keys {
-               compatible = "gpio-keys";
-
-               reset {
-                       label = "reset";
-                       gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_RESTART>;
-               };
-
-               wps {
-                       label = "wps";
-                       gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_WPS_BUTTON>;
-               };
-       };
-};
-
-&gpio1 {
-       status = "okay";
-};
-
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions: partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-               };
-       };
-};
-
-&ethernet {
-       mtd-mac-address = <&art 0x0>;
-};
-
-&wmac {
-       ralink,mtd-eeprom = <&art 0x1000>;
-       mtd-mac-address = <&art 0x6>;
-};
-
-&state_default {
-       default {
-               groups = "i2c", "uartf", "spi refclk";
-               function = "gpio";
-       };
-};
index c9b180624348827c59123c2e6864a8f29190c426..c6fe7baa6782168af15c897c6d28f02e5d007a9d 100644 (file)
@@ -1,6 +1,9 @@
 /* This file is released into the public domain */
 
-#include "mt7620a_netgear_ex2700_wn3000rp-v3.dtsi"
+#include "mt7620a.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 
 / {
        compatible = "netgear,wn3000rp-v3", "ralink,mt7620a-soc";
                led-upgrade = &led_power_green;
        };
 
+       keys {
+               compatible = "gpio-keys";
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+
+               wps {
+                       label = "wps";
+                       gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WPS_BUTTON>;
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
 
        };
 };
 
-&partitions {
-       partition@0 {
-               label = "u-boot";
-               reg = <0x0 0x30000>;
-               read-only;
+&gpio1 {
+       status = "okay";
+};
+
+&spi0 {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "u-boot-env";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       partition@40000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               reg = <0x40000 0x7b0000>;
+                       };
+
+                       art: partition@7f0000 {
+                               label = "art";
+                               reg = <0x7f0000 0x10000>;
+                               read-only;
+                       };
+               };
        };
+};
+
+&ethernet {
+       nvmem-cells = <&macaddr_art_0>;
+       nvmem-cell-names = "mac-address";
+};
+
+&wmac {
+       ralink,mtd-eeprom = <&art 0x1000>;
 
-       partition@30000 {
-               label = "u-boot-env";
-               reg = <0x30000 0x10000>;
-               read-only;
+       nvmem-cells = <&macaddr_art_6>;
+       nvmem-cell-names = "mac-address";
+};
+
+&state_default {
+       default {
+               groups = "i2c", "uartf", "spi refclk";
+               function = "gpio";
        };
+};
+
+&art {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
 
-       partition@40000 {
-               compatible = "denx,uimage";
-               label = "firmware";
-               reg = <0x40000 0x7b0000>;
+       macaddr_art_0: macaddr@0 {
+               reg = <0x0 0x6>;
        };
 
-       art: partition@7f0000 {
-               label = "art";
-               reg = <0x7f0000 0x10000>;
-               read-only;
+       macaddr_art_6: macaddr@6 {
+               reg = <0x6 0x6>;
        };
 };
index c3de5330b0002bb1869a4a6f2e7ac3960f181572..ecad0d658235ec1dddb4c9c88d4aa4e3ad130d93 100644 (file)
@@ -5,42 +5,6 @@
        model = "Zbtlink ZBT-WE826 (16M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       firmware: partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0xfb0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0xfb0000>;
 };
index 6f5bc41d5d1dbfed2fc68fae88bded76fcabcf40..c86890193d96b7ca1fc88f22ceb2a2d7fcf121cd 100644 (file)
@@ -5,42 +5,6 @@
        model = "Zbtlink ZBT-WE826 (32M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       firmware: partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x1fb0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x1fb0000>;
 };
index bce6afe263fa3b362d62e01c40e05e59d0aa01c6..3808538ab8a35d1b8f25d471d51833ea6f0eccf0 100644 (file)
        };
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       firmware: partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x1fb0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x1fb0000>;
 };
 
 &state_default {
index cf2ca1cd2782ae74ffc4ba74df632e66b0c3399e..8e781aa505a6b0a7e76d34649051cb1997ac646f 100644 (file)
        };
 };
 
+&spi0 {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "u-boot-env";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       factory: partition@40000 {
+                               label = "factory";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       firmware: partition@50000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               /* reg property is set based on flash size in DTS files */
+                       };
+               };
+       };
+};
+
 &gpio1 {
        status = "okay";
 };
 };
 
 &ethernet {
-       mtd-mac-address = <&factory 0x4>;
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
 
        mediatek,portmap = "llllw";
 };
 &pcie {
        status = "okay";
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_4: macaddr@4 {
+               reg = <0x4 0x6>;
+       };
+};
index ed9170fed40b321c224a9dd2418741303726ff6d..bcbe22eaa4eaa0dfee9021b0e91c65fe84fd61c0 100644 (file)
@@ -5,42 +5,6 @@
        model = "Nexx WT3020 (4M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x3b0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x3b0000>;
 };
index ac46ccbfadb063e8eeb4980229bb1f15c4b6c445..8bbb22220bad318feeb356dde4099f4c50bc97b7 100644 (file)
@@ -5,50 +5,14 @@
        model = "Nexx WT3020 (8M)";
 };
 
-&ehci {
-       status = "okay";
+&firmware {
+       reg = <0x50000 0x7b0000>;
 };
 
-&ohci {
+&ehci {
        status = "okay";
 };
 
-&spi0 {
+&ohci {
        status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x7b0000>;
-                       };
-               };
-       };
 };
index 1597c088bcbe9b3c2b295e144a1e88bcac2e877c..7f17f1957f8dfedec784fc70c353207bb2af0154 100644 (file)
        };
 };
 
+&spi0 {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "u-boot-env";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       factory: partition@40000 {
+                               label = "factory";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       firmware: partition@50000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               /* reg property is set based on flash size in DTS files */
+                       };
+               };
+       };
+};
+
 &gpio3 {
        status = "okay";
 };
 
 &ethernet {
-       mtd-mac-address = <&factory 0x4>;
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
 
        mediatek,portmap = "wllll";
 };
                function = "gpio";
        };
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_4: macaddr@4 {
+               reg = <0x4 0x6>;
+       };
+};
index 738bcdc7d69228cdd7cb40ba08ede8cc7294341f..e866fb12427af33f394fbb6bf05c80dca2214f98 100644 (file)
                mediatek,mtd-eeprom = <&factory 0x0>;
                /* 5 GHz (phy1) does not take the address from calibration data,
                   but setting it manually here works */
-               mtd-mac-address = <&factory 0x4>;
+               nvmem-cells = <&macaddr_factory_4>;
+               nvmem-cell-names = "mac-address";
        };
 };
 
 &gmac0 {
-       mtd-mac-address = <&factory 0xe000>;
+       nvmem-cells = <&macaddr_factory_e000>;
+       nvmem-cell-names = "mac-address";
 };
 
 &switch0 {
                port@4 {
                        status = "okay";
                        label = "wan";
-                       mtd-mac-address = <&factory 0xe006>;
+                       nvmem-cells = <&macaddr_factory_e006>;
+                       nvmem-cell-names = "mac-address";
                };
        };
 };
                function = "gpio";
        };
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_4: macaddr@4 {
+               reg = <0x4 0x6>;
+       };
+
+       macaddr_factory_e000: macaddr@e000 {
+               reg = <0xe000 0x6>;
+       };
+
+       macaddr_factory_e006: macaddr@e006 {
+               reg = <0xe006 0x6>;
+       };
+};
index cc29d4ea8e55b6ab7b3b84b3ca2bde2e2795a2fd..54489243b88295515107cbaefafdc0a43a3f0be8 100644 (file)
@@ -5,6 +5,10 @@
 / {
        compatible = "netgear,r6220", "mediatek,mt7621-soc";
        model = "Netgear R6220";
+
+       aliases {
+               label-mac-device = &gmac0;
+       };
 };
 
 &nand {
                };
        };
 };
+
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
+};
+
+&wan {
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
+       mac-address-increment = <1>;
+};
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_4: macaddr@4 {
+               reg = <0x4 0x6>;
+       };
+};
index eaf9059e39d693bfab4d2e79bef56a034d143376..ae9e40e621160f4c914cd67ffa466d52ddb9a497 100644 (file)
@@ -13,7 +13,6 @@
                led-failsafe = &led_power;
                led-running = &led_power;
                led-upgrade = &led_power;
-               label-mac-device = &gmac0;
        };
 
        keys {
        };
 };
 
-&gmac0 {
-       mtd-mac-address = <&factory 0x4>;
-};
-
 &switch0 {
        ports {
                port@0 {
                        label = "lan1";
                };
 
-               port@4 {
+               wan: port@4 {
                        status = "okay";
                        label = "wan";
-                       mtd-mac-address = <&factory 0x4>;
-                       mac-address-increment = <1>;
                };
        };
 };
index 90c0ca1276db2b8e1a88b598f28ce32617b6ce95..972aba1c5e406a43f67ea505a1891839e67968d3 100644 (file)
@@ -5,6 +5,10 @@
 / {
        compatible = "netgear,wndr3700-v5", "mediatek,mt7621-soc";
        model = "Netgear WNDR3700 v5";
+
+       aliases {
+               label-mac-device = &gmac0;
+       };
 };
 
 &spi0 {
                };
        };
 };
+
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
+};
+
+&wan {
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
+       mac-address-increment = <1>;
+};
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_4: macaddr@4 {
+               reg = <0x4 0x6>;
+       };
+};
index 1265a921232fd60b7f5a746b9c898f564169c63e..0e56d16a7f7b0a663cf9b9ca96a17aed66f32316 100644 (file)
        };
 };
 
+&gmac0 {
+       nvmem-cells = <&macaddr_eeprom_0>;
+       nvmem-cell-names = "mac-address";
+};
+
 &wlan_2g {
+       mediatek,mtd-eeprom = <&factory 0x0>;
+
        nvmem-cells = <&macaddr_eeprom_0>;
        nvmem-cell-names = "mac-address";
 };
 
 &wlan_5g {
        mediatek,mtd-eeprom = <&factory 0x20000>;
+
        nvmem-cells = <&macaddr_eeprom_6>;
        nvmem-cell-names = "mac-address";
        ieee80211-freq-limit = <5000000 6000000>;
index 7a36ecfa7b6eef722620402176f83ba773e86ccc..2762a777a3533a2624b116a72efa395cd6e93e89 100644 (file)
        };
 };
 
+&gmac0 {
+       nvmem-cells = <&macaddr_eeprom_0>;
+       nvmem-cell-names = "mac-address";
+};
+
+&wlan_2g {
+       mediatek,mtd-eeprom = <&factory 0x0>;
+};
+
 &wlan_5g {
        mediatek,mtd-eeprom = <&factory 0x8000>;
 };
+
+&eeprom {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_eeprom_0: macaddr@0 {
+               reg = <0x0 0x6>;
+       };
+};
index e0625ba5005ed1eb9ccd6aaac8e9a420a126df8b..8a0109f91ba63713dc978a8e1657e1ea2f42602b 100644 (file)
@@ -50,7 +50,6 @@
 &pcie0 {
        wlan_2g: wifi@0,0 {
                reg = <0x0 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x0>;
        };
 };
 
        };
 };
 
-&gmac0 {
-       mtd-mac-address = <&eeprom 0x0>;
-};
-
 &switch0 {
        ports {
                port@0 {
index f8bdc27c4c6ff2fff25e0c73948a4499c1b0950c..26012a6a4f370302efac7a8b5a2d6add8eeb35ef 100644 (file)
        };
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x7b0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x7b0000>;
 };
index f4bb8720d313ef91a0cbf9116eaa33f0979af83b..44baa16bad2a3a0ba172536b9c409d454e1a1aef 100644 (file)
        };
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0xfb0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0xfb0000>;
 };
index 06a80fdde7771f63656afafc8ae78dbeed7a4749..9100e0225e8d3cb3a8c841edee17254f9d3e0b31 100644 (file)
        };
 };
 
+&spi0 {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "u-boot-env";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       factory: partition@40000 {
+                               label = "factory";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       firmware: partition@50000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               /* reg property is set based on flash size in DTS files */
+                       };
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "wled_an", "refclk", "wdt";
@@ -28,7 +68,8 @@
 };
 
 &ethernet {
-       mtd-mac-address = <&factory 0x28>;
+       nvmem-cells = <&macaddr_factory_28>;
+       nvmem-cell-names = "mac-address";
 };
 
 &esw {
 &uart2 {
        status = "okay";
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_28: macaddr@28 {
+               reg = <0x28 0x6>;
+       };
+};
index c6bd640a6d48ae55a41bcacb769a5782b25f8bca..bd72078effe7e73abecb5775344a1d99b30ca4c9 100644 (file)
@@ -5,52 +5,6 @@
        model = "Widora-NEO (16M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       pinctrl-names = "default";
-       pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <40000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x0fb0000>;
-                       };
-               };
-       };
-
-       spidev@1 {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               compatible = "linux,spidev";
-               reg = <1>;
-               spi-max-frequency = <40000000>;
-       };
+&firmware {
+       reg = <0x50000 0xfb0000>;
 };
index adc74e6643ce8bc91552b600e9d0665cce192460..c2387984c80dcbc6062a1522103fc00a5c82a153 100644 (file)
@@ -5,52 +5,6 @@
        model = "Widora-NEO (32M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       pinctrl-names = "default";
-       pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <40000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x1fb0000>;
-                       };
-               };
-       };
-
-       spidev@1 {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               compatible = "linux,spidev";
-               reg = <1>;
-               spi-max-frequency = <40000000>;
-       };
+&firmware {
+       reg = <0x50000 0x1fb0000>;
 };
index 185f554df74d7319ec47c41bf81e3bc4b4eaf883..74f865aac9a340bea976b3e21f78e2eb505fa694 100644 (file)
        };
 };
 
+&spi0 {
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <40000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "u-boot-env";
+                               reg = <0x30000 0x10000>;
+                       };
+
+                       factory: partition@40000 {
+                               label = "factory";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       firmware: partition@50000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               /* reg property is set based on flash size in DTS files */
+                       };
+               };
+       };
+
+       spidev@1 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "linux,spidev";
+               reg = <1>;
+               spi-max-frequency = <40000000>;
+       };
+};
+
 &state_default {
        gpio {
                groups = "gpio";
 };
 
 &ethernet {
-       mtd-mac-address = <&factory 0x28>;
+       nvmem-cells = <&macaddr_factory_28>;
+       nvmem-cell-names = "mac-address";
 };
 
 &sdhci {
 
        mediatek,mtd-eeprom = <&factory 0x0>;
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_28: macaddr@28 {
+               reg = <0x28 0x6>;
+       };
+};
index efb96da57a9584f45425427fd8300150e006fb87..fc1d050c0243d9323ed7f596922f7b62673a315a 100644 (file)
@@ -5,42 +5,6 @@
        model = "Allnet ALL0256N (4M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x3b0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x3b0000>;
 };
index 866d9a9b35539ddb837610010e0444efa9bb2ecb..c2ae6f423b9f7d672ccb04836ec3b215aa35203f 100644 (file)
@@ -5,42 +5,6 @@
        model = "Allnet ALL0256N (8M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x7b0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x7b0000>;
 };
index 7458165bc44c2f7afa11f3b080e82f1d16d88cc0..13933e335c3e14fcaed7872ca674fb5c85d3b3cb 100644 (file)
        };
 };
 
+&spi0 {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "u-boot-env";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       factory: partition@40000 {
+                               label = "factory";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       firmware: partition@50000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               /* reg property is set based on flash size in DTS files */
+                       };
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "jtag", "rgmii", "mdio", "uartf";
@@ -45,7 +85,8 @@
 };
 
 &ethernet {
-       mtd-mac-address = <&factory 0x28>;
+       nvmem-cells = <&macaddr_factory_28>;
+       nvmem-cell-names = "mac-address";
 };
 
 &esw {
 &wmac {
        ralink,mtd-eeprom = <&factory 0x0>;
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_28: macaddr@28 {
+               reg = <0x28 0x6>;
+       };
+};
index 9cc29d0afd5d94b4fc4c3b298b3e6fda96d7f1e4..52b8668be926dfb8dcaa986c2ca41a94f51b021d 100644 (file)
                };
        };
 };
+
+&ethernet {
+       nvmem-cells = <&macaddr_devdata_4004>;
+       nvmem-cell-names = "mac-address";
+};
+
+&devdata {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_devdata_4004: macaddr@4004 {
+               reg = <0x4004 0x6>;
+       };
+};
index c5465b4812efa538acc33f72adfc0676a2ab31ce..4e03f7beb74ee8be5ee2f176b5a3113a011445e7 100644 (file)
                };
        };
 };
+
+&ethernet {
+       nvmem-cells = <&macaddr_devdata_4004>;
+       nvmem-cell-names = "mac-address";
+};
+
+&devdata {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_devdata_4004: macaddr@4004 {
+               reg = <0x4004 0x6>;
+       };
+};
index 028238a3d2a7829b1e6cf28021586530aea304dc..6cd75da68bf1300e9975dbd563b60fb24f171cd8 100644 (file)
        };
 };
 
-&ethernet {
-       mtd-mac-address = <&devdata 0x4004>;
-};
-
 &esw {
        mediatek,portmap = <0x1e>;
 };
index 383bde706f08c42ab328c1a223c4e9ab6e98c0b2..40c4ff48b40e1ccfcc4799316b19e5e6b8625636 100644 (file)
@@ -5,42 +5,6 @@
        model = "7Links PX-4885 (4M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x20000>;
-                               read-only;
-                       };
-
-                       partition@20000 {
-                               label = "devdata";
-                               reg = <0x20000 0x20000>;
-                               read-only;
-                       };
-
-                       devconf: partition@40000 {
-                               label = "devconf";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x3b0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x3b0000>;
 };
index 25c635aa11a0665c43cd89d58b0adbe5fefe7620..930e875762030582a4aa840f6ae94d5360122979 100644 (file)
@@ -5,42 +5,6 @@
        model = "7Links PX-4885 (8M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x20000>;
-                               read-only;
-                       };
-
-                       partition@20000 {
-                               label = "devdata";
-                               reg = <0x20000 0x20000>;
-                               read-only;
-                       };
-
-                       devconf: partition@40000 {
-                               label = "devconf";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x7b0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x7b0000>;
 };
index a15d140f3e5b14261c51f742332c83f54a5d3046..2d43e0a30d1f0e8b9b7f563e07012fa1f8ecf3f5 100644 (file)
        };
 };
 
+&spi0 {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x20000>;
+                               read-only;
+                       };
+
+                       partition@20000 {
+                               label = "devdata";
+                               reg = <0x20000 0x20000>;
+                               read-only;
+                       };
+
+                       devconf: partition@40000 {
+                               label = "devconf";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       firmware: partition@50000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               /* reg property is set based on flash size in DTS files */
+                       };
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "jtag", "uartf";
@@ -49,7 +89,8 @@
 };
 
 &ethernet {
-       mtd-mac-address = <&devconf 0x28>;
+       nvmem-cells = <&macaddr_devconf_28>;
+       nvmem-cell-names = "mac-address";
 };
 
 &esw {
 &wmac {
        ralink,mtd-eeprom = <&devconf 0x0>;
 };
+
+&devconf {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_devconf_28: macaddr@28 {
+               reg = <0x28 0x6>;
+       };
+};
index 56f1cedebdf38b5ec515d03b6e4a8130f86c8702..0a60e07fcde06133dd5466def3d4496bfcc73d68 100644 (file)
@@ -5,42 +5,6 @@
        model = "AsiaRF AWM002 EVB (4M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               reg = <0>;
-               compatible = "jedec,spi-nor";
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x3b0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x3b0000>;
 };
index 43b599abe67a9318feefb02cb82ec809beb40318..529220ae9d72b72d003c2323c0b56b9ae7725b00 100644 (file)
@@ -5,42 +5,6 @@
        model = "AsiaRF AWM002 EVB (8M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               reg = <0>;
-               compatible = "jedec,spi-nor";
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x7b0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x7b0000>;
 };
index 80965a48b83478e761265976ef5d98058abcdc24..18e59431fbacf817c138d8734b84c2743f040af9 100644 (file)
        };
 };
 
+&spi0 {
+       status = "okay";
+
+       flash@0 {
+               reg = <0>;
+               compatible = "jedec,spi-nor";
+               spi-max-frequency = <10000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "u-boot-env";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       factory: partition@40000 {
+                               label = "factory";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       firmware: partition@50000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               /* reg property is set based on flash size in DTS files */
+                       };
+               };
+       };
+};
+
 &ethernet {
-       mtd-mac-address = <&factory 0x28>;
+       nvmem-cells = <&macaddr_factory_28>;
+       nvmem-cell-names = "mac-address";
 };
 
 &wmac {
 &esw {
        mediatek,portmap = <0x3f>;
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_28: macaddr@28 {
+               reg = <0x28 0x6>;
+       };
+};
index 0b1b57c99a7c77da66d179ef6a6a0bef514c8894..de291f7d512d4c64047fac0020c597f62e7ce191 100644 (file)
@@ -5,42 +5,6 @@
        model = "Nexx WT1520 (4M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x3b0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x3b0000>;
 };
index c28dae346815b5bef54ca81e8875685c0df27479..7520d21a634a60947f0dba3b76165f4bafb1dc8a 100644 (file)
@@ -5,42 +5,6 @@
        model = "Nexx WT1520 (8M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x7b0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x7b0000>;
 };
index 540fd253ebe9810447b80216b6a7b2f66a0b2044..9783e5a7e5ab36770a0f44aac7ace80b64cc07b6 100644 (file)
        };
 };
 
+&spi0 {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "u-boot-env";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       factory: partition@40000 {
+                               label = "factory";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       firmware: partition@50000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               /* reg property is set based on flash size in DTS files */
+                       };
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "jtag", "uartf";
 };
 
 &ethernet {
-       mtd-mac-address = <&factory 0x4>;
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
 };
 
 &wmac {
        ralink,mtd-eeprom = <&factory 0x0>;
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_4: macaddr@4 {
+               reg = <0x4 0x6>;
+       };
+};
index 19b7f39cf41b40eaca2106f35e0910232eee5943..ff4404157113248d2ea2dff85c4059781207b16a 100644 (file)
@@ -5,42 +5,6 @@
        model = "NixcoreX1 (16M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "uboot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "uboot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0xfb0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0xfb0000>;
 };
index 888c67ddf01179450cd47d7c905c870a267aa826..8cecba3fa70664e14503136c876a112a3654cbdf 100644 (file)
@@ -5,42 +5,6 @@
        model = "NixcoreX1 (8M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "uboot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "uboot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x7b0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x7b0000>;
 };
index 2459c6b65bc43de7172520ba471b2e86813781ad..ea10d501827b9c4352a4f86e047046add5f92cda 100644 (file)
        };
 };
 
+&spi0 {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "uboot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "uboot-env";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       factory: partition@40000 {
+                               label = "factory";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       firmware: partition@50000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               /* reg property is set based on flash size in DTS files */
+                       };
+               };
+       };
+};
+
 &gpio1 {
        status = "okay";
 };
 };
 
 &ethernet {
-       mtd-mac-address = <&factory 0x4>;
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
 };
 
 &esw {
 &wmac {
        ralink,mtd-eeprom = <&factory 0x0>;
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_4: macaddr@4 {
+               reg = <0x4 0x6>;
+       };
+};
index f6f6a5a332da1e4da69aada146e04dca14290147..a457929457f4916c4aa9215c4ad8bf95f390286d 100644 (file)
@@ -5,42 +5,6 @@
        model = "Poray M4 (4M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x3b0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x3b0000>;
 };
index 2cf5891495b10e5b6a2c4c21df1ad3a417d90499..7d860186f269950c82cd84c9562491e7b40833af 100644 (file)
@@ -5,42 +5,6 @@
        model = "Poray M4 (8M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "u-boot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "u-boot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x7b0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x7b0000>;
 };
index 9b36961ffb06699c8cbfafed8a644ac450fc66fe..4addfcbef8a146d743132a324d2fa739f50ee768 100644 (file)
        };
 };
 
+&spi0 {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "u-boot-env";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       factory: partition@40000 {
+                               label = "factory";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       firmware: partition@50000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               /* reg property is set based on flash size in DTS files */
+                       };
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "jtag", "uartf";
@@ -42,7 +82,8 @@
 };
 
 &ethernet {
-       mtd-mac-address = <&factory 0x4>;
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
 };
 
 &esw {
        ralink,mtd-eeprom = <&factory 0x0>;
        ralink,led-polarity = <1>;
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_4: macaddr@4 {
+               reg = <0x4 0x6>;
+       };
+};
index e28563c6089197ef2691772dc93a516d08c73f42..624f0fb6c92727c66fde43ab61718122f606ffce 100644 (file)
@@ -5,42 +5,6 @@
        model = "VoCore (16M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "uboot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "uboot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0xfb0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0xfb0000>;
 };
index 4fa291a2e2db905825ca26502f67932b87ac3dc7..a824e9dfc725cb5e02168a8e1c4dbf587fa684c6 100644 (file)
@@ -5,42 +5,6 @@
        model = "VoCore (8M)";
 };
 
-&spi0 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "uboot";
-                               reg = <0x0 0x30000>;
-                               read-only;
-                       };
-
-                       partition@30000 {
-                               label = "uboot-env";
-                               reg = <0x30000 0x10000>;
-                               read-only;
-                       };
-
-                       factory: partition@40000 {
-                               label = "factory";
-                               reg = <0x40000 0x10000>;
-                               read-only;
-                       };
-
-                       partition@50000 {
-                               compatible = "denx,uimage";
-                               label = "firmware";
-                               reg = <0x50000 0x7b0000>;
-                       };
-               };
-       };
+&firmware {
+       reg = <0x50000 0x7b0000>;
 };
index 0c829196691705a3e1ada4c098536eff4f073677..652f9384e56cbaf0f91391c73b780803722fbd13 100644 (file)
        };
 };
 
+&spi0 {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "uboot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "uboot-env";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       factory: partition@40000 {
+                               label = "factory";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       firmware: partition@50000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               /* reg property is set based on flash size in DTS files */
+                       };
+               };
+       };
+};
+
 &gpio1 {
        status = "okay";
 };
 };
 
 &ethernet {
-       mtd-mac-address = <&factory 0x4>;
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
 };
 
 &esw {
                reg = <0>;
        };
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_4: macaddr@4 {
+               reg = <0x4 0x6>;
+       };
+};