ebd7d17d03dbee448d7a5e05c540e346ada10900
[oweals/openwrt.git] / target / linux / ramips / dts / X5.dts
1 /dts-v1/;
2
3 #include "rt5350.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9         compatible = "poray,x5", "ralink,rt5350-soc";
10         model = "Poray X5";
11
12         aliases {
13                 led-status = &led_power;
14         };
15
16         gpio-leds {
17                 compatible = "gpio-leds";
18
19                 led_power: power {
20                         label = "x5:green:power";
21                         gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
22                 };
23
24                 20 {
25                         label = "x5:green:20";
26                         gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
27                 };
28
29                 50 {
30                         label = "x5:green:50";
31                         gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
32                 };
33
34                 80 {
35                         label = "x5:green:80";
36                         gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
37                 };
38         };
39
40         gpio-keys-polled {
41                 compatible = "gpio-keys-polled";
42                 poll-interval = <20>;
43
44                 bat {
45                         label = "bat";
46                         gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
47                         linux,code = <KEY_WPS_BUTTON>;
48                 };
49
50                 reset {
51                         label = "reset";
52                         gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
53                         linux,code = <KEY_RESTART>;
54                 };
55
56                 mode {
57                         label = "mode";
58                         gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
59                         linux,code = <BTN_0>;
60                         linux,input-type = <EV_SW>;
61                 };
62         };
63
64         gpio_export {
65                 compatible = "gpio-export";
66                 #size-cells = <0>;
67
68                 usb-mode {
69                         gpio-export,name = "usb-mode";
70                         gpio-export,output = <0>;
71                         gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
72                 };
73         };
74 };
75
76 &spi0 {
77         status = "okay";
78
79         m25p80@0 {
80                 compatible = "jedec,spi-nor";
81                 reg = <0>;
82                 spi-max-frequency = <10000000>;
83
84                 partitions {
85                         compatible = "fixed-partitions";
86                         #address-cells = <1>;
87                         #size-cells = <1>;
88
89                         partition@0 {
90                                 label = "u-boot";
91                                 reg = <0x0 0x30000>;
92                                 read-only;
93                         };
94
95                         partition@30000 {
96                                 label = "u-boot-env";
97                                 reg = <0x30000 0x10000>;
98                                 read-only;
99                         };
100
101                         factory: partition@40000 {
102                                 label = "factory";
103                                 reg = <0x40000 0x10000>;
104                                 read-only;
105                         };
106
107                         partition@50000 {
108                                 label = "firmware";
109                                 reg = <0x50000 0x7b0000>;
110                         };
111                 };
112         };
113 };
114
115 &pinctrl {
116         state_default: pinctrl0 {
117                 gpio {
118                         ralink,group = "i2c", "jtag", "uartf";
119                         ralink,function = "gpio";
120                 };
121         };
122 };
123
124 &ethernet {
125         mtd-mac-address = <&factory 0x4>;
126 };
127
128 &esw {
129         mediatek,portmap = <0x2f>;
130         mediatek,led_polarity = <1>;
131 };
132
133 &wmac {
134         ralink,mtd-eeprom = <&factory 0>;
135         ralink,led-polarity = <1>;
136 };
137
138 &ehci {
139         status = "okay";
140 };
141
142 &ohci {
143         status = "okay";
144 };