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