ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_alfa-network_ac1200rm.dts
index 8632f5ce0433a1e4d26bab9676dad74916486c16..2b9434b2448a81bc27ca28cbe3b9aba0693d4c0a 100644 (file)
@@ -1,33 +1,7 @@
+// SPDX-License-Identifier: BSD-3-Clause
 /*
- *  BSD LICENSE
- *
  *  Copyright (C) 2018 Piotr Dymacz <pepe2k@gmail.com>
  *  All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions
- *  are met:
- *
- *    1. Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *    2. Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *    3. Neither the names of the copyright holders nor the names of any
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- *
- *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "mt7620a.dtsi"
                compatible = "gpio-leds";
 
                wlan2g {
-                       label = "ac1200rm:green:wlan2g";
+                       label = "green:wlan2g";
                        gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
                };
 
                led_wps: wps {
-                       label = "ac1200rm:green:wps";
+                       label = "green:wps";
                        gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
                };
        };
@@ -81,7 +55,8 @@
        pinctrl-names = "default";
        pinctrl-0 = <&ephy_pins>;
 
-       mtd-mac-address = <&factory 0x28>;
+       nvmem-cells = <&macaddr_factory_28>;
+       nvmem-cell-names = "mac-address";
 
        mediatek,portmap = "llllw";
 };
        status = "okay";
 };
 
-&gsw {
-       mediatek,port4 = "ephy";
-};
-
 &ohci {
        status = "okay";
 };
                        };
 
                        factory: partition@40000 {
+                               compatible = "nvmem-cells";
                                label = "factory";
                                reg = <0x40000 0x10000>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
                                read-only;
+
+                               eeprom_factory_0: eeprom@0 {
+                                       reg = <0x0 0x200>;
+                               };
+
+                               macaddr_factory_28: macaddr@28 {
+                                       reg = <0x28 0x6>;
+                               };
                        };
 
                        partition@50000 {
 };
 
 &wmac {
-       ralink,mtd-eeprom = <&factory 0x0>;
+       nvmem-cells = <&eeprom_factory_0>;
+       nvmem-cell-names = "eeprom";
 };