ramips: mt7621: convert to nvmem-layout
[openwrt/staging/hauke.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 nvmem-layout {
78 compatible = "fixed-layout";
79 #address-cells = <1>;
80 #size-cells = <1>;
81
82 eeprom_factory_0: eeprom@0 {
83 reg = <0x0 0x4da8>;
84 };
85
86 macaddr_factory_4: macaddr@4 {
87 reg = <0x4 0x6>;
88 };
89
90 macaddr_factory_e000: macaddr@e000 {
91 reg = <0xe000 0x6>;
92 };
93
94 macaddr_factory_e006: macaddr@e006 {
95 reg = <0xe006 0x6>;
96 };
97 };
98 };
99
100 partition@50000 {
101 label = "permanent_config";
102 reg = <0x50000 0x50000>;
103 read-only;
104 };
105
106 partition@a0000 {
107 compatible = "denx,uimage";
108 label = "firmware";
109 reg = <0xa0000 0xf60000>;
110 };
111 };
112 };
113 };
114
115 &pcie {
116 status = "okay";
117 };
118
119 &pcie0 {
120 wifi@0,0 {
121 compatible = "mediatek,mt76";
122 reg = <0x0000 0 0 0 0>;
123
124 /* 5 GHz (phy1) does not take the address from calibration data,
125 but setting it manually here works */
126 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>;
127 nvmem-cell-names = "eeprom", "mac-address";
128 };
129 };
130
131 &gmac0 {
132 nvmem-cells = <&macaddr_factory_e000>;
133 nvmem-cell-names = "mac-address";
134 };
135
136 &gmac1 {
137 status = "okay";
138 label = "wan";
139 phy-handle = <&ethphy4>;
140
141 nvmem-cells = <&macaddr_factory_e006>;
142 nvmem-cell-names = "mac-address";
143 };
144
145 &mdio {
146 ethphy4: ethernet-phy@4 {
147 reg = <4>;
148 };
149 };
150
151 &switch0 {
152 ports {
153 port@0 {
154 status = "okay";
155 label = "lan1";
156 };
157
158 port@1 {
159 status = "okay";
160 label = "lan2";
161 };
162
163 port@2 {
164 status = "okay";
165 label = "lan3";
166 };
167
168 port@3 {
169 status = "okay";
170 label = "lan4";
171 };
172 };
173 };
174
175 &state_default {
176 gpio {
177 groups = "i2c", "jtag";
178 function = "gpio";
179 };
180 };