ramips: add proper system clock and reset driver support for mt7621
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_samknows_whitebox-v8.dts
index 0319f05351e8f6141ff43821b6100348b29deb15..d1f51feddddf6a043d6184913d5ce77ebba85ca2 100644 (file)
@@ -1,6 +1,5 @@
-/dts-v1/;
-
 #include "mt7621.dtsi"
+
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/gpio/gpio.h>
 
                led-upgrade = &led_wps;
        };
 
-       chosen {
-               bootargs = "console=ttyS0,57600";
-       };
-
        leds {
                compatible = "gpio-leds";
 
                led_wps: wps {
-                       label = "sk-wb8:green:wps";
-                       gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
+                       label = "green:wps";
+                       gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
                };
 
                usb {
-                       label = "sk-wb8:green:usb";
-                       gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
+                       label = "green:usb";
+                       gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
                        trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
                        linux,default-trigger = "usbport";
                };
        };
 
        keys {
-               compatible = "gpio-keys-polled";
-               poll-interval = <20>;
+               compatible = "gpio-keys";
+
                wps {
                        label = "wps";
-                       gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
+                       gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WPS_BUTTON>;
                };
+
                reset {
                        label = "reset";
-                       gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
+                       gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
                };
        };
@@ -54,7 +50,7 @@
 &spi0 {
        status = "okay";
 
-       m25p80@0 {
+       flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
        };
 };
 
-&ethernet {
-       mtd-mac-address = <&factory 0xe000>;
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_e000>;
+       nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+       status = "okay";
+       label = "wan";
+       phy-handle = <&ethphy4>;
+
+       nvmem-cells = <&macaddr_factory_e006>;
+       nvmem-cell-names = "mac-address";
 };
 
-&pinctrl {
-       state_default: pinctrl0 {
-               gpio {
-                       ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
-                       ralink,function = "gpio";
+&mdio {
+       ethphy4: ethernet-phy@4 {
+               reg = <4>;
+       };
+};
+
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
                };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+       };
+};
+
+&state_default {
+       gpio {
+               groups = "sdhci";
+               function = "gpio";
+       };
+};
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_e000: macaddr@e000 {
+               reg = <0xe000 0x6>;
+       };
+
+       macaddr_factory_e006: macaddr@e006 {
+               reg = <0xe006 0x6>;
        };
 };