ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / rt5350_dlink_dir-320-b1.dts
1 #include "rt5350.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 = "dlink,dir-320-b1", "ralink,rt5350-soc";
9 model = "D-Link DIR-320 B1";
10
11 aliases {
12 led-boot = &led_status;
13 led-failsafe = &led_status;
14 led-running = &led_status;
15 led-upgrade = &led_status;
16 };
17
18 leds {
19 compatible = "gpio-leds";
20
21 led_status: status {
22 function = LED_FUNCTION_STATUS;
23 color = <LED_COLOR_ID_GREEN>;
24 gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
25 };
26
27 usb {
28 function = LED_FUNCTION_USB;
29 color = <LED_COLOR_ID_GREEN>;
30 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
31 };
32
33 wps {
34 function = LED_FUNCTION_WPS;
35 color = <LED_COLOR_ID_GREEN>;
36 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
37 };
38 };
39
40 keys {
41 compatible = "gpio-keys-polled";
42 poll-interval = <20>;
43
44 reset {
45 label = "reset";
46 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
47 linux,code = <KEY_RESTART>;
48 };
49
50 wps {
51 label = "wps";
52 gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
53 linux,code = <KEY_WPS_BUTTON>;
54 };
55 };
56
57 gpio_export {
58 compatible = "gpio-export";
59 #size-cells = <0>;
60
61 usb {
62 gpio-export,name = "usb";
63 gpio-export,output = <1>;
64 gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
65 };
66
67 root_hub {
68 gpio-export,name = "root_hub";
69 gpio-export,output = <1>;
70 gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
71 };
72 };
73 };
74
75 &spi0 {
76 status = "okay";
77
78 flash@0 {
79 compatible = "jedec,spi-nor";
80 reg = <0>;
81 spi-max-frequency = <10000000>;
82
83 partitions {
84 compatible = "fixed-partitions";
85 #address-cells = <1>;
86 #size-cells = <1>;
87
88 partition@0 {
89 label = "u-boot";
90 reg = <0x0 0x30000>;
91 read-only;
92 };
93
94 partition@30000 {
95 label = "u-boot-env";
96 reg = <0x30000 0x10000>;
97 read-only;
98 };
99
100 factory: partition@40000 {
101 label = "factory";
102 reg = <0x40000 0x10000>;
103 read-only;
104
105 nvmem-layout {
106 compatible = "fixed-layout";
107 #address-cells = <1>;
108 #size-cells = <1>;
109
110 eeprom_factory_0: eeprom@0 {
111 reg = <0x0 0x200>;
112 };
113
114 macaddr_factory_4: macaddr@4 {
115 reg = <0x4 0x6>;
116 };
117 };
118 };
119
120 partition@50000 {
121 compatible = "denx,uimage";
122 label = "firmware";
123 reg = <0x50000 0x7b0000>;
124 };
125 };
126 };
127 };
128
129 &state_default {
130 gpio {
131 groups = "i2c", "jtag", "uartf";
132 function = "gpio";
133 };
134 };
135
136 &ethernet {
137 nvmem-cells = <&macaddr_factory_4>;
138 nvmem-cell-names = "mac-address";
139 };
140
141 &esw {
142 mediatek,portmap = <0x2f>;
143 mediatek,led_polarity = <0x17>;
144 };
145
146 &wmac {
147 nvmem-cells = <&eeprom_factory_0>;
148 nvmem-cell-names = "eeprom";
149 };