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