ath79: improve support for D-Link DIR-8x9 A1 series
[openwrt/openwrt.git] / target / linux / ath79 / dts / ar9331_8dev_carambola2.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar9331.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 model = "8devices Carambola2";
10 compatible = "8dev,carambola2", "qca,ar9331";
11
12 aliases {
13 label-mac-device = &wmac;
14 };
15
16 leds {
17 compatible = "gpio-leds";
18
19 wlan {
20 label = "green:wlan";
21 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
22 linux,default-trigger = "phy0tpt";
23 };
24
25 eth0 {
26 label = "orange:eth0";
27 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
28 };
29
30 eth1 {
31 label = "orange:eth1";
32 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
33 };
34 };
35
36 keys {
37 compatible = "gpio-keys";
38
39 wps {
40 label = "wps";
41 linux,code = <KEY_WPS_BUTTON>;
42 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
43 };
44 };
45 };
46
47 &ref {
48 clock-frequency = <40000000>;
49 };
50
51 &usb {
52 dr_mode = "host";
53 status = "okay";
54 };
55
56 &usb_phy {
57 status = "okay";
58 };
59
60 &spi {
61 status = "okay";
62
63 flash@0 {
64 compatible = "jedec,spi-nor";
65 spi-max-frequency = <50000000>;
66 reg = <0>;
67
68 partitions {
69 compatible = "fixed-partitions";
70 #address-cells = <1>;
71 #size-cells = <1>;
72
73 uboot: partition@0 {
74 label = "u-boot";
75 reg = <0x000000 0x040000>;
76 read-only;
77 };
78
79 partition@40000 {
80 label = "u-boot-env";
81 reg = <0x040000 0x010000>;
82 read-only;
83 };
84
85 partition@50000 {
86 compatible = "denx,uimage";
87 label = "firmware";
88 reg = <0x50000 0xfa0000>;
89 };
90
91 art: partition@ff0000 {
92 label = "art";
93 reg = <0xff0000 0x010000>;
94 read-only;
95 };
96 };
97 };
98 };
99
100 &mdio0 {
101 status = "okay";
102 };
103
104 &eth0 {
105 status = "okay";
106 nvmem-cells = <&macaddr_art_0>;
107 nvmem-cell-names = "mac-address";
108
109 gmac-config {
110 device = <&gmac>;
111
112 switch-phy-addr-swap = <1>;
113 switch-phy-swap = <1>;
114 };
115 };
116
117 &eth1 {
118 status = "okay";
119 nvmem-cells = <&macaddr_art_6>;
120 nvmem-cell-names = "mac-address";
121 };
122
123 &wmac {
124 status = "okay";
125 mtd-cal-data = <&art 0x1000>;
126 };
127
128 &art {
129 compatible = "nvmem-cells";
130 #address-cells = <1>;
131 #size-cells = <1>;
132
133 macaddr_art_0: macaddr@0 {
134 reg = <0x0 0x6>;
135 };
136
137 macaddr_art_6: macaddr@6 {
138 reg = <0x6 0x6>;
139 };
140 };