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