078b76a50b4587ff0a1dad5e88b28eb6a2fc6296
[openwrt/openwrt.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 = <50000000>;
54
55 partitions {
56 compatible = "fixed-partitions";
57 #address-cells = <1>;
58 #size-cells = <1>;
59
60 partition@0 {
61 label = "u-boot";
62 reg = <0x0 0x30000>;
63 read-only;
64 };
65
66 partition@30000 {
67 label = "u-boot-env";
68 reg = <0x30000 0x10000>;
69 read-only;
70 };
71
72 factory: partition@40000 {
73 label = "factory";
74 reg = <0x40000 0x10000>;
75 read-only;
76 };
77
78 partition@50000 {
79 label = "permanent_config";
80 reg = <0x50000 0x50000>;
81 read-only;
82 };
83
84 partition@a0000 {
85 compatible = "denx,uimage";
86 label = "firmware";
87 reg = <0xa0000 0xf60000>;
88 };
89 };
90 };
91 };
92
93 &pcie {
94 status = "okay";
95 };
96
97 &pcie0 {
98 wifi@0,0 {
99 compatible = "mediatek,mt76";
100 reg = <0x0000 0 0 0 0>;
101 mediatek,mtd-eeprom = <&factory 0x0>;
102
103 /* 5 GHz (phy1) does not take the address from calibration data,
104 but setting it manually here works */
105 nvmem-cells = <&macaddr_factory_4>;
106 nvmem-cell-names = "mac-address";
107 };
108 };
109
110 &gmac0 {
111 nvmem-cells = <&macaddr_factory_e000>;
112 nvmem-cell-names = "mac-address";
113 };
114
115 &switch0 {
116 ports {
117 port@0 {
118 status = "okay";
119 label = "lan1";
120 };
121
122 port@1 {
123 status = "okay";
124 label = "lan2";
125 };
126
127 port@2 {
128 status = "okay";
129 label = "lan3";
130 };
131
132 port@3 {
133 status = "okay";
134 label = "lan4";
135 };
136
137 port@4 {
138 status = "okay";
139 label = "wan";
140 nvmem-cells = <&macaddr_factory_e006>;
141 nvmem-cell-names = "mac-address";
142 };
143 };
144 };
145
146 &state_default {
147 gpio {
148 groups = "i2c", "jtag";
149 function = "gpio";
150 };
151 };
152
153 &factory {
154 compatible = "nvmem-cells";
155 #address-cells = <1>;
156 #size-cells = <1>;
157
158 macaddr_factory_4: macaddr@4 {
159 reg = <0x4 0x6>;
160 };
161
162 macaddr_factory_e000: macaddr@e000 {
163 reg = <0xe000 0x6>;
164 };
165
166 macaddr_factory_e006: macaddr@e006 {
167 reg = <0xe006 0x6>;
168 };
169 };