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