ath79: ar: convert to nvmem-layout
[openwrt/staging/jow.git] / target / linux / ath79 / dts / ar9344_teltonika_rut9xx.dtsi
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 = "teltonika,rut9xx", "qca,ar9344";
10
11 aliases {
12 serial1 = &hs_uart;
13 label-mac-device = &eth1;
14 };
15
16 i2c0: i2c {
17 compatible = "i2c-gpio";
18 scl-gpios = <&gpio 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
19 sda-gpios = <&gpio 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
20 #address-cells = <1>;
21 #size-cells = <0>;
22
23 hwmon@4d {
24 compatible = "microchip,mcp3221";
25 reg = <0x4d>;
26 };
27 };
28
29 keys {
30 compatible = "gpio-keys";
31
32 reset {
33 label = "reset";
34 linux,code = <KEY_RESTART>;
35 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
36 debounce-interval = <60>;
37 };
38 };
39 };
40
41 &ref {
42 clock-frequency = <40000000>;
43 };
44
45 &hs_uart {
46 status = "okay";
47
48 pinctrl-names = "default";
49 pinctrl-0 = <&pmx_uart2>;
50
51 rts-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
52 rs485-rts-active-low;
53 linux,rs485-enabled-at-boot-time;
54 };
55
56 &spi {
57 status = "okay";
58
59 pinctrl-names = "default";
60 pinctrl-0 = <&pmx_spi>;
61
62 flash@0 {
63 compatible = "jedec,spi-nor";
64 reg = <0>;
65 spi-max-frequency = <25000000>;
66
67 partitions {
68 compatible = "fixed-partitions";
69 #address-cells = <1>;
70 #size-cells = <1>;
71
72 partition@0 {
73 label = "u-boot";
74 reg = <0x0 0x20000>;
75 read-only;
76 };
77
78 config: partition@20000 {
79 label = "config";
80 reg = <0x20000 0x10000>;
81 read-only;
82
83 nvmem-layout {
84 compatible = "fixed-layout";
85 #address-cells = <1>;
86 #size-cells = <1>;
87
88 macaddr_config_0: macaddr@0 {
89 reg = <0x0 0x6>;
90 };
91 };
92 };
93
94 art: partition@30000 {
95 label = "art";
96 reg = <0x30000 0x10000>;
97 read-only;
98 };
99
100 partition@40000 {
101 label = "firmware";
102 reg = <0x40000 0xf30000>;
103 compatible = "tplink,firmware";
104 };
105
106 partition@f70000 {
107 label = "event-log";
108 reg = <0xf70000 0x90000>;
109 read-only;
110 };
111 };
112 };
113
114 microsd@1 {
115 status = "disabled";
116
117 compatible = "mmc-spi-slot";
118 spi-max-frequency = <25000000>;
119 reg = <1>;
120 voltage-ranges = <3200 3400>;
121 broken-cd;
122 };
123 };
124
125 &usb {
126 status = "okay";
127 };
128
129 &hub_port {
130 #address-cells = <1>;
131 #size-cells = <0>;
132
133 port@1 {
134 compatible = "usb-a-connector";
135 reg = <1>;
136 };
137
138 port@3 {
139 label = "RS-232 serial adapter";
140 reg = <3>;
141 };
142
143 port@4 {
144 label = "internal wwan modem";
145 reg = <4>;
146 };
147 };
148
149 &usb_phy {
150 status = "okay";
151 };
152
153 &wmac {
154 status = "okay";
155
156 mtd-cal-data = <&art 0x1000>;
157 nvmem-cells = <&macaddr_config_0>;
158 nvmem-cell-names = "mac-address";
159 mac-address-increment = <2>;
160 };
161
162 &pinmux {
163 pmx_spi: spi {
164 // SPI_CS1 on GPIO 3
165 pinctrl-single,bits = <0x0 0x07000000 0xff000000>;
166 };
167
168 pmx_leds_switch: leds_switch {
169 // switch port LEDs on GPIO 1, GPIO 13, GPIO 14 and GPIO 22
170 pinctrl-single,bits = <0x00 0x00002d00 0x0000ff00>,
171 <0x0c 0x002c2b00 0x00ffff00>,
172 <0x14 0x002a0000 0x00ff0000>;
173 };
174
175 pmx_uart2: uart2 {
176 // UART1_DTR on GPIO 0, UART1_RD on GPIO 11, UART1_TD on GPIO 18
177 pinctrl-single,bits = <0x00 0x00000000 0x000000ff>,
178 <0x10 0x004f0000 0x00ff0000>,
179 <0x3c 0x000b0000 0x00ff0000>;
180 };
181 };