ath79: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ath79 / dts / qca9557_buffalo_bhr-4grv2.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "qca955x.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 compatible = "buffalo,bhr-4grv2", "qca,qca9557";
11 model = "Buffalo BHR-4GRV2";
12
13 aliases {
14 led-boot = &led_power;
15 led-failsafe = &led_power;
16 led-running = &led_power;
17 led-upgrade = &led_power;
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 led_power: power {
24 function = LED_FUNCTION_POWER;
25 color = <LED_COLOR_ID_GREEN>;
26 gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
27 default-state = "on";
28 };
29
30 diag {
31 label = "orange:diag";
32 gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
33 };
34
35 vpn_orange {
36 label = "orange:vpn";
37 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
38 };
39
40 vpn_green {
41 label = "green:vpn";
42 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
43 };
44 };
45
46 keys {
47 compatible = "gpio-keys";
48
49 reset {
50 label = "reset";
51 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
52 linux,code = <KEY_RESTART>;
53 debounce-interval = <60>;
54 };
55
56 eco {
57 label = "eco";
58 gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
59 linux,code = <BTN_0>;
60 linux,input-type = <EV_SW>;
61 debounce-interval = <60>;
62 };
63 };
64 };
65
66 &spi {
67 status = "okay";
68
69 flash@0 {
70 compatible = "jedec,spi-nor";
71 reg = <0>;
72 spi-max-frequency = <25000000>;
73
74 partitions {
75 compatible = "fixed-partitions";
76 #address-cells = <1>;
77 #size-cells = <1>;
78
79 partition@0 {
80 label = "u-boot";
81 reg = <0x000000 0x040000>;
82 read-only;
83 };
84
85 partition@40000 {
86 label = "u-boot-env";
87 reg = <0x040000 0x010000>;
88 };
89
90 partition@50000 {
91 compatible = "denx,uimage";
92 label = "firmware";
93 reg = <0x050000 0xfa0000>;
94 };
95
96 art: partition@ff0000 {
97 label = "art";
98 reg = <0xff0000 0x010000>;
99 read-only;
100
101 nvmem-layout {
102 compatible = "fixed-layout";
103 #address-cells = <1>;
104 #size-cells = <1>;
105
106 macaddr_art_0: macaddr@0 {
107 reg = <0x0 0x6>;
108 };
109
110 macaddr_art_6: macaddr@6 {
111 reg = <0x6 0x6>;
112 };
113 };
114 };
115 };
116 };
117 };
118
119 &mdio0 {
120 status = "okay";
121
122 phy0: ethernet-phy@0 {
123 reg = <0>;
124
125 qca,ar8327-initvals = <
126 0x04 0x80080080 /* PORT0 PAD MODE CTRL */
127 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
128 0x7c 0x0000007e /* PORT0_STATUS */
129 0x94 0x0000007e /* PORT6 STATUS */
130 >;
131 };
132 };
133
134 &eth0 {
135 status = "okay";
136
137 nvmem-cells = <&macaddr_art_0>;
138 nvmem-cell-names = "mac-address";
139 phy-handle = <&phy0>;
140 pll-data = <0x56000000 0x00000101 0x00001616>;
141 };
142
143 &eth1 {
144 status = "okay";
145
146 nvmem-cells = <&macaddr_art_6>;
147 nvmem-cell-names = "mac-address";
148 pll-data = <0x03000101 0x00000101 0x00001616>;
149
150 fixed-link {
151 speed = <1000>;
152 full-duplex;
153 };
154 };