ath79: ar: convert to nvmem-layout
[openwrt/openwrt.git] / target / linux / ath79 / dts / ar9344_openmesh_om5p-an.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar9344.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "openmesh,om5p-an", "qca,ar9344";
10 model = "OpenMesh OM5P-AN";
11
12 chosen {
13 /delete-property/ bootargs;
14 };
15
16 aliases {
17 led-boot = &led_power_blue;
18 led-failsafe = &led_power_blue;
19 led-running = &led_power_blue;
20 led-upgrade = &led_power_blue;
21 label-mac-device = &eth0;
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 label = "reset";
29 linux,code = <KEY_RESTART>;
30 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
31 };
32 };
33
34 leds {
35 compatible = "gpio-leds";
36
37 pinctrl-names = "default";
38 pinctrl-0 = <&led_lan_wan_blue_pin>;
39
40 led_power_blue: power_blue {
41 label = "blue:power";
42 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
43 default-state = "on";
44 };
45
46 wan_blue {
47 label = "blue:wan";
48 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
49 };
50
51 lan_blue {
52 label = "blue:lan";
53 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
54 };
55
56 wifi_green {
57 label = "green:wifi";
58 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
59 linux,default-trigger = "phy0tpt";
60 };
61
62 wifi_yellow {
63 label = "yellow:wifi";
64 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
65 };
66
67 wifi_red {
68 label = "red:wifi";
69 gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
70 };
71 };
72
73 i2c {
74 compatible = "i2c-gpio";
75 gpios = <&gpio 21 GPIO_ACTIVE_HIGH /* sda */
76 &gpio 20 GPIO_ACTIVE_HIGH /* scl */
77 >;
78 #address-cells = <1>;
79 #size-cells = <0>;
80
81 i2c-gpio,scl-open-drain;
82 i2c-gpio,sda-open-drain;
83
84 tmp423a@4c {
85 compatible = "ti,tmp423";
86 reg = <0x4c>;
87 };
88 };
89
90 watchdog {
91 compatible = "linux,wdt-gpio";
92 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
93 hw_algo = "toggle";
94 /* hw_margin_ms is actually 300s but driver limits it to 60s */
95 hw_margin_ms = <60000>;
96 always-running;
97 };
98 };
99
100 &ref {
101 clock-frequency = <40000000>;
102 };
103
104 &pinmux {
105 led_lan_wan_blue_pin: pinmux_lan_wan_blue_pin {
106 pinctrl-single,bits = <0xc 0x0 0xffff0000>;
107 };
108 };
109
110 &spi {
111 status = "okay";
112
113 flash@0 {
114 compatible = "jedec,spi-nor";
115 reg = <0>;
116 spi-max-frequency = <40000000>;
117
118 /* partitions are passed via bootloader */
119 partitions {
120 compatible = "fixed-partitions";
121 #address-cells = <1>;
122 #size-cells = <1>;
123
124 partition@0 {
125 label = "u-boot";
126 reg = <0x000000 0x040000>;
127 read-only;
128 };
129
130 partition@40000 {
131 label = "u-boot-env";
132 reg = <0x040000 0x010000>;
133 };
134
135 partition@50000 {
136 label = "custom";
137 reg = <0x050000 0x060000>;
138 read-only;
139 };
140
141 partition@b0000 {
142 label = "inactive";
143 reg = <0x0b0000 0x7a0000>;
144 };
145
146 partition@850000 {
147 label = "inactive2";
148 reg = <0x850000 0x7a0000>;
149 };
150
151 partition@ff0000 {
152 label = "ART";
153 reg = <0xff0000 0x010000>;
154 read-only;
155
156 nvmem-layout {
157 compatible = "fixed-layout";
158 #address-cells = <1>;
159 #size-cells = <1>;
160
161 macaddr_art_0: macaddr@0 {
162 reg = <0x0 0x6>;
163 };
164
165 calibration_art_1000: calibration@1000 {
166 reg = <0x1000 0x440>;
167 };
168
169 calibration_art_5000: calibration@5000 {
170 reg = <0x5000 0x440>;
171 };
172 };
173 };
174 };
175 };
176 };
177
178 &mdio0 {
179 status = "okay";
180
181 phy7: ethernet-phy@7 {
182 reg = <7>;
183 eee-broken-100tx;
184 eee-broken-1000t;
185 };
186 };
187
188 &eth0 {
189 status = "okay";
190
191 pll-data = <0x02000000 0x00000101 0x00001313>;
192
193 nvmem-cells = <&macaddr_art_0>;
194 nvmem-cell-names = "mac-address";
195
196 phy-mode = "rgmii-id";
197 phy-handle = <&phy7>;
198
199 gmac-config {
200 device = <&gmac>;
201 rgmii-gmac0 = <1>;
202 rxd-delay = <2>;
203 rxdv-delay = <2>;
204 switch-phy-swap = <1>;
205 };
206 };
207
208 &eth1 {
209 status = "okay";
210
211 nvmem-cells = <&macaddr_art_0>;
212 nvmem-cell-names = "mac-address";
213 mac-address-increment = <1>;
214 };
215
216 &wmac {
217 status = "okay";
218
219 nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>;
220 nvmem-cell-names = "mac-address", "calibration";
221 mac-address-increment = <2>;
222 };
223
224 &pcie {
225 status = "okay";
226
227 wifi@0,0 {
228 compatible = "pci168c,0030";
229 reg = <0x0000 0 0 0 0>;
230 nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
231 nvmem-cell-names = "mac-address", "calibration";
232 mac-address-increment = <16>;
233 };
234 };