ramips: convert to new LED color/function format where possible
[openwrt/staging/jow.git] / target / linux / ramips / dts / rt3052_fon_fonera-20n.dts
1 #include "rt3050.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5 #include <dt-bindings/leds/common.h>
6
7 / {
8 compatible = "fon,fonera-20n", "ralink,rt3052-soc";
9 model = "La Fonera 2.0N";
10
11 aliases {
12 led-boot = &led_power;
13 led-failsafe = &led_power;
14 led-running = &led_power;
15 led-upgrade = &led_power;
16 };
17
18 flash@1f000000 {
19 compatible = "cfi-flash";
20 reg = <0x1f000000 0x800000>;
21 bank-width = <2>;
22 device-width = <2>;
23
24 partitions {
25 compatible = "fixed-partitions";
26 #address-cells = <1>;
27 #size-cells = <1>;
28
29 partition@0 {
30 label = "u-boot";
31 reg = <0x0 0x30000>;
32 read-only;
33 };
34
35 partition@30000 {
36 label = "u-boot-env";
37 reg = <0x30000 0x10000>;
38 read-only;
39 };
40
41 factory: partition@40000 {
42 label = "factory";
43 reg = <0x40000 0x10000>;
44 read-only;
45
46 nvmem-layout {
47 compatible = "fixed-layout";
48 #address-cells = <1>;
49 #size-cells = <1>;
50
51 eeprom_factory_0: eeprom@0 {
52 reg = <0x0 0x200>;
53 };
54
55 macaddr_factory_28: macaddr@28 {
56 reg = <0x28 0x6>;
57 };
58 };
59 };
60
61 partition@50000 {
62 compatible = "denx,uimage";
63 label = "firmware";
64 reg = <0x50000 0x7b0000>;
65 };
66 };
67 };
68
69 leds {
70 compatible = "gpio-leds";
71
72 wifi {
73 label = "orange:wifi";
74 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
75 };
76
77 led_power: power {
78 function = LED_FUNCTION_POWER;
79 color = <LED_COLOR_ID_GREEN>;
80 gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
81 };
82
83 usb {
84 function = LED_FUNCTION_USB;
85 color = <LED_COLOR_ID_ORANGE>;
86 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
87 trigger-sources = <&otg_port1>;
88 linux,default-trigger = "usbport";
89 };
90 };
91
92 keys {
93 compatible = "gpio-keys-polled";
94 poll-interval = <20>;
95
96 reset {
97 label = "reset";
98 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
99 linux,code = <KEY_RESTART>;
100 };
101
102 switch {
103 label = "switch";
104 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
105 linux,code = <KEY_RFKILL>;
106 linux,input-type = <EV_SW>;
107 };
108 };
109 };
110
111 &state_default {
112 gpio {
113 groups = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
114 function = "gpio";
115 };
116 };
117
118 &ethernet {
119 nvmem-cells = <&macaddr_factory_28>;
120 nvmem-cell-names = "mac-address";
121 };
122
123 &esw {
124 #address-cells = <1>;
125 #size-cells = <0>;
126
127 mediatek,portmap = <0x2f>;
128
129 port@0 {
130 compatible = "swconfig,port";
131 reg = <0>;
132 swconfig,segment = "lan";
133 swconfig,portmap = <0 4>;
134 };
135
136 port@1 {
137 compatible = "swconfig,port";
138 reg = <1>;
139 swconfig,segment = "lan";
140 swconfig,portmap = <1 3>;
141 };
142
143 port@2 {
144 compatible = "swconfig,port";
145 reg = <2>;
146 swconfig,segment = "lan";
147 swconfig,portmap = <2 2>;
148 };
149
150 port@3 {
151 compatible = "swconfig,port";
152 reg = <3>;
153 swconfig,segment = "lan";
154 swconfig,portmap = <3 1>;
155 };
156
157 port@4 {
158 compatible = "swconfig,port";
159 reg = <4>;
160 swconfig,segment = "wan";
161 swconfig,portmap = <4 0>;
162 };
163 };
164
165 &wmac {
166 nvmem-cells = <&eeprom_factory_0>;
167 nvmem-cell-names = "eeprom";
168 };
169
170 &otg {
171 status = "okay";
172 };