ramips: Use dts alias based status led
[oweals/openwrt.git] / target / linux / ramips / dts / HPM.dts
1 /dts-v1/;
2
3 #include "rt3883.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9         compatible = "omnima,hpm", "ralink,rt3883-soc";
10         model = "Omnima HPM";
11
12         aliases {
13                 led-status = &led_status;
14         };
15
16         chosen {
17                 bootargs = "console=ttyS0,115200";
18         };
19
20         gpio-keys-polled {
21                 compatible = "gpio-keys-polled";
22                 #address-cells = <1>;
23                 #size-cells = <0>;
24                 poll-interval = <100>;
25
26                 reset {
27                         label = "reset";
28                         gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
29                         linux,code = <KEY_RESTART>;
30                 };
31         };
32
33         gpio-leds {
34                 compatible = "gpio-leds";
35
36                 power {
37                         label = "hpm:orange:power";
38                         gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
39                 };
40
41                 led_status: status {
42                         label = "hpm:green:status";
43                         gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
44                 };
45
46                 eth {
47                         label = "hpm:green:eth";
48                         gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
49                 };
50
51                 eth2 {
52                         label = "hpm:red:eth";
53                         gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
54                 };
55
56                 wifi {
57                         label = "hpm:green:wifi";
58                         gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
59                 };
60
61                 wifi2 {
62                         label = "hpm:red:wifi";
63                         gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
64                 };
65         };
66
67         gpio_export {
68                 compatible = "gpio-export";
69                 #size-cells = <0>;
70                 /* gpio 12 and 13 handle the OC input */
71
72                 usb0 {
73                         gpio-export,name = "usb0";
74                         gpio-export,output = <1>;
75                         gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
76                 };
77
78                 usb1 {
79                         gpio-export,name = "usb1";
80                         gpio-export,output = <1>;
81                         gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
82                 };
83         };
84 };
85
86 &spi0 {
87         status = "okay";
88
89         m25p80@0 {
90                 compatible = "jedec,spi-nor";
91                 spi-max-frequency = <25000000>;
92                 reg = <0>;
93                 #address-cells = <1>;
94                 #size-cells = <1>;
95
96                 partition@0 {
97                         reg = <0x0 0x0030000>;
98                         label = "u-boot";
99                         read-only;
100                 };
101
102                 partition@30000 {
103                         reg = <0x00030000 0x00010000>;
104                         label = "config";
105                         read-only;
106                 };
107
108                 factory: partition@40000 {
109                         reg = <0x00040000 0x00010000>;
110                         label = "factory";
111                         read-only;
112                 };
113
114                 partition@50000 {
115                         reg = <0x00050000 0x00fb0000>;
116                         label = "firmware";
117                 };
118         };
119 };
120
121 &pinctrl {
122         state_default: pinctrl0 {
123                 gpio {
124                         ralink,group = "i2c", "jtag", "uartf";
125                         ralink,function = "gpio";
126                 };
127         };
128 };
129
130 &ethernet {
131         phy-handle = <&phy0>;
132         phy-mode = "rgmii";
133         mtd-mac-address = <&factory 0x28>;
134
135         mdio-bus {
136                 status = "okay";
137
138                 phy0: ethernet-phy@4 {
139                         reg = <4>;
140                 };
141         };
142 };
143
144 &wmac {
145         ralink,mtd-eeprom = <&factory 0>;
146 };
147
148 &ehci {
149         status = "okay";
150 };
151
152 &ohci {
153         status = "okay";
154 };