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