ramips: rtxxxx: convert to nvmem-layout
[openwrt/openwrt.git] / target / linux / ramips / dts / rt3052_alfa-network_w502u.dts
1 #include "rt3050.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "alfa-network,w502u", "ralink,rt3052-soc";
8 model = "ALFA Network W502U";
9
10 aliases {
11 led-boot = &led_wps;
12 led-failsafe = &led_wps;
13 led-running = &led_wps;
14 led-upgrade = &led_wps;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,115200";
19 };
20
21 flash@1f000000 {
22 compatible = "cfi-flash";
23 reg = <0x1f000000 0x800000>;
24 bank-width = <2>;
25 device-width = <2>;
26
27 partitions {
28 compatible = "fixed-partitions";
29 #address-cells = <1>;
30 #size-cells = <1>;
31
32 partition@0 {
33 label = "u-boot";
34 reg = <0x0 0x30000>;
35 read-only;
36 };
37
38 partition@30000 {
39 label = "u-boot-env";
40 reg = <0x30000 0x10000>;
41 read-only;
42 };
43
44 factory: partition@40000 {
45 label = "factory";
46 reg = <0x40000 0x10000>;
47 read-only;
48
49 nvmem-layout {
50 compatible = "fixed-layout";
51 #address-cells = <1>;
52 #size-cells = <1>;
53
54 eeprom_factory_0: eeprom@0 {
55 reg = <0x0 0x200>;
56 };
57
58 macaddr_factory_28: macaddr@28 {
59 reg = <0x28 0x6>;
60 };
61 };
62 };
63
64 partition@50000 {
65 compatible = "denx,uimage";
66 label = "firmware";
67 reg = <0x50000 0x7b0000>;
68 };
69 };
70 };
71
72 leds {
73 compatible = "gpio-leds";
74
75 usb {
76 label = "blue:usb";
77 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
78 trigger-sources = <&otg_port1>;
79 linux,default-trigger = "usbport";
80 };
81
82 led_wps: wps {
83 label = "blue:wps";
84 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
85 };
86 };
87
88 keys {
89 compatible = "gpio-keys-polled";
90 poll-interval = <20>;
91
92 reset {
93 label = "reset";
94 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
95 linux,code = <KEY_RESTART>;
96 };
97
98 wps {
99 label = "wps";
100 gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
101 linux,code = <KEY_WPS_BUTTON>;
102 };
103 };
104 };
105
106 &state_default {
107 gpio {
108 groups = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
109 function = "gpio";
110 };
111 };
112
113 &ethernet {
114 nvmem-cells = <&macaddr_factory_28>;
115 nvmem-cell-names = "mac-address";
116 };
117
118 &esw {
119 mediatek,portmap = <0x3e>;
120 };
121
122 &wmac {
123 nvmem-cells = <&eeprom_factory_0>;
124 nvmem-cell-names = "eeprom";
125 };
126
127 &otg {
128 status = "okay";
129 };