ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7628an_tplink_tl-wr840n-v5.dts
1 #include "mt7628an.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5 #include <dt-bindings/leds/common.h>
6
7 / {
8 compatible = "tplink,tl-wr840n-v5", "mediatek,mt7628an-soc";
9 model = "TP-Link TL-WR840N v5";
10
11 aliases {
12 led-boot = &led_power_green;
13 led-failsafe = &led_power_green;
14 led-running = &led_power_green;
15 led-upgrade = &led_power_green;
16 };
17
18 chosen {
19 bootargs = "console=ttyS0,115200";
20 };
21
22 keys {
23 compatible = "gpio-keys";
24
25 reset {
26 label = "reset";
27 gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
28 linux,code = <KEY_RESTART>;
29 };
30 };
31
32 /* LED used is dual-color,dual lead LED */
33 leds {
34 compatible = "gpio-leds";
35
36 led_power_green: power {
37 function = LED_FUNCTION_POWER;
38 color = <LED_COLOR_ID_GREEN>;
39 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
40 };
41
42 orange {
43 function = LED_FUNCTION_POWER;
44 color = <LED_COLOR_ID_ORANGE>;
45 gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
46 };
47 };
48 };
49
50 &spi0 {
51 status = "okay";
52
53 flash@0 {
54 compatible = "jedec,spi-nor";
55 reg = <0>;
56 spi-max-frequency = <10000000>;
57
58 partitions {
59 compatible = "fixed-partitions";
60 #address-cells = <1>;
61 #size-cells = <1>;
62
63 partition@0 {
64 label = "boot";
65 reg = <0x0 0x20000>;
66 read-only;
67 };
68
69 partition@20000 {
70 compatible = "tplink,firmware";
71 label = "firmware";
72 reg = <0x20000 0x3d0000>;
73 };
74
75 factory: partition@3f0000 {
76 label = "factory";
77 reg = <0x3f0000 0x10000>;
78 read-only;
79
80 nvmem-layout {
81 compatible = "fixed-layout";
82 #address-cells = <1>;
83 #size-cells = <1>;
84
85 eeprom_factory_0: eeprom@0 {
86 reg = <0x0 0x400>;
87 };
88
89 macaddr_factory_f100: macaddr@f100 {
90 reg = <0xf100 0x6>;
91 };
92 };
93 };
94 };
95 };
96 };
97
98 &ehci {
99 status = "disabled";
100 };
101
102 &ohci {
103 status = "disabled";
104 };
105
106 &wmac {
107 status = "okay";
108
109 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_f100>;
110 nvmem-cell-names = "eeprom", "mac-address";
111 };
112
113 &ethernet {
114 nvmem-cells = <&macaddr_factory_f100>;
115 nvmem-cell-names = "mac-address";
116 };
117
118 &esw {
119 mediatek,portmap = <0x3e>;
120 };
121
122 &state_default {
123 gpio {
124 groups = "p0led_an", "p2led_an", "perst";
125 function = "gpio";
126 };
127 };