ramips: express diag led handling via devicetree
[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                 poll-interval = <100>;
23
24                 reset {
25                         label = "reset";
26                         gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
27                         linux,code = <KEY_RESTART>;
28                 };
29         };
30
31         gpio-leds {
32                 compatible = "gpio-leds";
33
34                 power {
35                         label = "hpm:orange:power";
36                         gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
37                         default-state = "on";
38                 };
39
40                 led_status: status {
41                         label = "hpm:green:status";
42                         gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
43                         default-state = "on";
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
94                 partitions {
95                         compatible = "fixed-partitions";
96                         #address-cells = <1>;
97                         #size-cells = <1>;
98
99                         partition@0 {
100                                 reg = <0x0 0x0030000>;
101                                 label = "u-boot";
102                                 read-only;
103                         };
104
105                         partition@30000 {
106                                 reg = <0x00030000 0x00010000>;
107                                 label = "config";
108                                 read-only;
109                         };
110
111                         factory: partition@40000 {
112                                 reg = <0x00040000 0x00010000>;
113                                 label = "factory";
114                                 read-only;
115                         };
116
117                         partition@50000 {
118                                 reg = <0x00050000 0x00fb0000>;
119                                 label = "firmware";
120                         };
121                 };
122         };
123 };
124
125 &pinctrl {
126         state_default: pinctrl0 {
127                 gpio {
128                         ralink,group = "i2c", "jtag", "uartf";
129                         ralink,function = "gpio";
130                 };
131         };
132 };
133
134 &ethernet {
135         phy-handle = <&phy0>;
136         phy-mode = "rgmii";
137         mtd-mac-address = <&factory 0x28>;
138
139         mdio-bus {
140                 status = "okay";
141
142                 phy0: ethernet-phy@4 {
143                         reg = <4>;
144                 };
145         };
146 };
147
148 &wmac {
149         ralink,mtd-eeprom = <&factory 0>;
150 };
151
152 &ehci {
153         status = "okay";
154 };
155
156 &ohci {
157         status = "okay";
158 };