ramips: convert to new LED color/function format where possible
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_phicomm_k2p.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5 #include <dt-bindings/leds/common.h>
6
7 / {
8 compatible = "phicomm,k2p", "mediatek,mt7621-soc";
9 model = "Phicomm K2P";
10
11 aliases {
12 led-boot = &led_blue;
13 led-failsafe = &led_blue;
14 led-running = &led_blue;
15 led-upgrade = &led_blue;
16 };
17
18 leds {
19 compatible = "gpio-leds";
20
21 stat_r {
22 function = LED_FUNCTION_STATUS;
23 color = <LED_COLOR_ID_RED>;
24 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
25 };
26
27 stat_y {
28 function = LED_FUNCTION_STATUS;
29 color = <LED_COLOR_ID_YELLOW>;
30 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
31 };
32
33 led_blue: stat_b {
34 function = LED_FUNCTION_STATUS;
35 color = <LED_COLOR_ID_BLUE>;
36 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
37 };
38 };
39
40 keys {
41 compatible = "gpio-keys";
42
43 reset {
44 label = "reset";
45 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
46 linux,code = <KEY_RESTART>;
47 };
48 };
49 };
50
51 &spi0 {
52 status = "okay";
53
54 flash@0 {
55 compatible = "jedec,spi-nor";
56 reg = <0>;
57 spi-max-frequency = <50000000>;
58
59 partitions {
60 compatible = "fixed-partitions";
61 #address-cells = <1>;
62 #size-cells = <1>;
63
64 partition@0 {
65 label = "u-boot";
66 reg = <0x0 0x30000>;
67 read-only;
68 };
69
70 partition@30000 {
71 label = "u-boot-env";
72 reg = <0x30000 0x10000>;
73 read-only;
74 };
75
76 factory: partition@40000 {
77 label = "factory";
78 reg = <0x40000 0x10000>;
79 read-only;
80
81 nvmem-layout {
82 compatible = "fixed-layout";
83 #address-cells = <1>;
84 #size-cells = <1>;
85
86 eeprom_factory_0: eeprom@0 {
87 reg = <0x0 0x4da8>;
88 };
89
90 macaddr_factory_4: macaddr@4 {
91 reg = <0x4 0x6>;
92 };
93
94 macaddr_factory_e000: macaddr@e000 {
95 reg = <0xe000 0x6>;
96 };
97
98 macaddr_factory_e006: macaddr@e006 {
99 reg = <0xe006 0x6>;
100 };
101 };
102 };
103
104 partition@50000 {
105 label = "permanent_config";
106 reg = <0x50000 0x50000>;
107 read-only;
108 };
109
110 partition@a0000 {
111 compatible = "denx,uimage";
112 label = "firmware";
113 reg = <0xa0000 0xf60000>;
114 };
115 };
116 };
117 };
118
119 &pcie {
120 status = "okay";
121 };
122
123 &pcie0 {
124 wifi@0,0 {
125 compatible = "mediatek,mt76";
126 reg = <0x0000 0 0 0 0>;
127
128 /* 5 GHz (phy1) does not take the address from calibration data,
129 but setting it manually here works */
130 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>;
131 nvmem-cell-names = "eeprom", "mac-address";
132 };
133 };
134
135 &gmac0 {
136 nvmem-cells = <&macaddr_factory_e000>;
137 nvmem-cell-names = "mac-address";
138 };
139
140 &gmac1 {
141 status = "okay";
142 label = "wan";
143 phy-handle = <&ethphy4>;
144
145 nvmem-cells = <&macaddr_factory_e006>;
146 nvmem-cell-names = "mac-address";
147 };
148
149 &mdio {
150 ethphy4: ethernet-phy@4 {
151 reg = <4>;
152 };
153 };
154
155 &switch0 {
156 ports {
157 port@0 {
158 status = "okay";
159 label = "lan1";
160 };
161
162 port@1 {
163 status = "okay";
164 label = "lan2";
165 };
166
167 port@2 {
168 status = "okay";
169 label = "lan3";
170 };
171
172 port@3 {
173 status = "okay";
174 label = "lan4";
175 };
176 };
177 };
178
179 &state_default {
180 gpio {
181 groups = "i2c", "jtag";
182 function = "gpio";
183 };
184 };