ath79: ja76pf2: use nvmem cells to specify MAC addresses
[openwrt/openwrt.git] / target / linux / ath79 / dts / ar7161_jjplus_ja76pf2.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar7100.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/mtd/partitions/uimage.h>
8
9 / {
10 model = "jjPlus JA76PF2";
11 compatible = "jjplus,ja76pf2", "qca,ar7161";
12
13 memory@0 {
14 device_type = "memory";
15 reg = <0x0 0x4000000>;
16 };
17
18 chosen {
19 bootargs = "console=ttyS0,115200n8";
20 };
21
22 aliases {
23 led-boot = &led_d2;
24 led-failsafe = &led_d2;
25 led-running = &led_d2;
26 led-upgrade = &led_d2;
27 };
28
29 extosc: ref {
30 compatible = "fixed-clock";
31 #clock-cells = <0>;
32 clock-output-names = "ref";
33 clock-frequency = <40000000>;
34 };
35
36 i2c {
37 compatible = "i2c-gpio";
38 sda-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
39 scl-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
40 #address-cells = <1>;
41 #size-cells = <0>;
42
43 sensor@48 {
44 compatible = "microchip,tcn75";
45 reg = <0x48>;
46 };
47 };
48
49 leds {
50 compatible = "gpio-leds";
51
52 led_d2: d2 {
53 label = "green:d2";
54 gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
55 };
56
57 d3 {
58 label = "green:d3";
59 gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
60 };
61
62 d4 {
63 label = "green:d4";
64 gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
65 };
66 };
67
68 keys {
69 compatible = "gpio-keys";
70
71 sw1 {
72 label = "sw1";
73 linux,code = <KEY_RESTART>;
74 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
75 debounce-interval = <60>;
76 };
77
78 sw2 {
79 label = "sw2";
80 linux,code = <KEY_WPS_BUTTON>;
81 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
82 debounce-interval = <60>;
83 };
84 };
85 };
86
87 &mdio0 {
88 status = "okay";
89
90 phy0: ethernet-phy@0 {
91 reg = <0>;
92 phy-mode = "rgmii";
93 };
94
95 phy4: ethernet-phy@4 {
96 reg = <4>;
97 phy-mode = "rgmii";
98 };
99 };
100
101 &eth0 {
102 status = "okay";
103
104 nvmem-cells = <&macaddr_lan>;
105 nvmem-cell-names = "mac-address";
106 phy-handle = <&phy0>;
107 };
108
109 &eth1 {
110 status = "okay";
111
112 nvmem-cells = <&macaddr_wan>;
113 nvmem-cell-names = "mac-address";
114 phy-handle = <&phy4>;
115 };
116
117 &pcie0 {
118 status = "okay";
119 };
120
121 &spi {
122 status = "okay";
123
124 flash@0 {
125 compatible = "jedec,spi-nor";
126 reg = <0>;
127 spi-max-frequency = <25000000>;
128
129 partitions {
130 compatible = "fixed-partitions";
131 #address-cells = <1>;
132 #size-cells = <1>;
133
134 partition@0 {
135 label = "RedBoot";
136 reg = <0x000000 0x040000>;
137 read-only;
138 };
139
140 partition@40000 {
141 label = "loader";
142 reg = <0x040000 0x020000>;
143 };
144
145 partition@60000 {
146 label = "firmware";
147 reg = <0x060000 0xf80000>;
148 compatible = "openwrt,uimage", "denx,uimage";
149 openwrt,ih-magic = <IH_MAGIC_OKLI>;
150 };
151
152 partition@fe0000 {
153 label = "FIS directory";
154 reg = <0xfe0000 0x00f000>;
155 read-only;
156 };
157
158 partition@fef000 {
159 label = "RedBoot config";
160 reg = <0xfef000 0x001000>;
161 read-only;
162 };
163
164 partition@ff0000 {
165 label = "Atheros Board Data";
166 reg = <0xff0000 0x10000>;
167 read-only;
168 compatible = "nvmem-cells";
169 #address-cells = <1>;
170 #size-cells = <1>;
171
172 macaddr_wan: macaddr@1000 {
173 reg = <0x1000 0x6>;
174 };
175
176 macaddr_lan: macaddr@1006 {
177 reg = <0x1006 0x6>;
178 };
179 };
180 };
181 };
182 };