ramips: convert to new LED color/function format where possible
[openwrt/staging/jow.git] / target / linux / ramips / dts / rt5350_zyxel_keenetic-4g-b.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later
2
3 #include "rt5350.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 = "zyxel,keenetic-4g-b", "ralink,rt5350-soc";
11 model = "ZyXEL Keenetic 4G Rev.B";
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 = <&gpio0 9 GPIO_ACTIVE_LOW>;
27 };
28
29 usb {
30 function = LED_FUNCTION_USB;
31 color = <LED_COLOR_ID_GREEN>;
32 gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
33 };
34
35 reserved {
36 label = "green:reserved";
37 gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
38 };
39
40 internet {
41 label = "green:internet";
42 gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
43 };
44
45 wlan {
46 function = LED_FUNCTION_WLAN;
47 color = <LED_COLOR_ID_GREEN>;
48 gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
49 };
50
51 };
52
53 keys {
54 compatible = "gpio-keys";
55
56 wps {
57 label = "wps";
58 gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
59 linux,code = <KEY_WPS_BUTTON>;
60 };
61
62 reset {
63 label = "reset";
64 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
65 linux,code = <KEY_RESTART>;
66 };
67 };
68 };
69
70 &spi0 {
71 status = "okay";
72
73 flash@0 {
74 compatible = "jedec,spi-nor";
75 reg = <0>;
76 spi-max-frequency = <30000000>;
77
78 partitions {
79 compatible = "fixed-partitions";
80 #address-cells = <1>;
81 #size-cells = <1>;
82
83 partition@0 {
84 label = "u-boot";
85 reg = <0x0 0x30000>;
86 read-only;
87 };
88
89 partition@30000 {
90 label = "u-boot-env";
91 reg = <0x30000 0x10000>;
92 read-only;
93 };
94
95 factory: partition@40000 {
96 label = "factory";
97 reg = <0x40000 0x10000>;
98 read-only;
99
100 nvmem-layout {
101 compatible = "fixed-layout";
102 #address-cells = <1>;
103 #size-cells = <1>;
104
105 eeprom_factory_0: eeprom@0 {
106 reg = <0x0 0x200>;
107 };
108
109 macaddr_factory_28: macaddr@28 {
110 reg = <0x28 0x6>;
111 };
112 };
113 };
114
115 partition@50000 {
116 compatible = "denx,uimage";
117 label = "firmware";
118 reg = <0x50000 0x7b0000>;
119 };
120 };
121 };
122 };
123
124 &state_default {
125 gpio {
126 groups = "uartf";
127 function = "gpio";
128 };
129 };
130
131 &ethernet {
132 nvmem-cells = <&macaddr_factory_28>;
133 nvmem-cell-names = "mac-address";
134 };
135
136 &esw {
137 mediatek,portmap = <0x2f>;
138 mediatek,led_polarity = <0x17>;
139 };
140
141 &wmac {
142 ralink,led-polarity = <1>;
143 nvmem-cells = <&eeprom_factory_0>;
144 nvmem-cell-names = "eeprom";
145 };