c6c6fbd9068ee79d71d2bb52d2635954cebf2bc8
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7628an_tplink_tl-wr841n-v14.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7628an.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 = "tplink,tl-wr841n-v14", "mediatek,mt7628an-soc";
11 model = "TP-Link TL-WR841N v14";
12
13 aliases {
14 led-boot = &led_wlan;
15 led-failsafe = &led_wlan;
16 led-upgrade = &led_wlan;
17 };
18
19 chosen {
20 bootargs = "console=ttyS0,115200";
21 };
22
23 keys {
24 compatible = "gpio-keys";
25
26 reset {
27 label = "reset";
28 gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
29 linux,code = <KEY_RESTART>;
30 };
31 };
32
33 leds {
34 compatible = "gpio-leds";
35
36 lan {
37 function = LED_FUNCTION_LAN;
38 color = <LED_COLOR_ID_GREEN>;
39 gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
40 };
41
42 wan_green {
43 function = LED_FUNCTION_WAN;
44 color = <LED_COLOR_ID_GREEN>;
45 gpios = <&gpio 40 GPIO_ACTIVE_LOW>;
46 };
47
48 led_wlan: wlan {
49 function = LED_FUNCTION_WLAN;
50 color = <LED_COLOR_ID_GREEN>;
51 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
52 linux,default-trigger = "phy0tpt";
53 };
54
55 wan_orange {
56 function = LED_FUNCTION_WAN;
57 color = <LED_COLOR_ID_ORANGE>;
58 gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
59 };
60 };
61 };
62
63 &spi0 {
64 status = "okay";
65
66 flash@0 {
67 compatible = "jedec,spi-nor";
68 reg = <0>;
69 spi-max-frequency = <10000000>;
70
71 partitions {
72 compatible = "fixed-partitions";
73 #address-cells = <1>;
74 #size-cells = <1>;
75
76 partition@0 {
77 label = "boot";
78 reg = <0x0 0x10000>;
79 read-only;
80 };
81
82 partition@10000 {
83 compatible = "tplink,firmware";
84 label = "firmware";
85 reg = <0x10000 0x3e0000>;
86 };
87
88 partition@3f0000 {
89 label = "factory";
90 reg = <0x3f0000 0x10000>;
91 read-only;
92
93 nvmem-layout {
94 compatible = "fixed-layout";
95 #address-cells = <1>;
96 #size-cells = <1>;
97
98 eeprom_factory_0: eeprom@0 {
99 reg = <0x0 0x400>;
100 };
101
102 macaddr_factory_f100: macaddr@f100 {
103 reg = <0xf100 0x6>;
104 };
105 };
106 };
107 };
108 };
109 };
110
111 &ehci {
112 status = "disabled";
113 };
114
115 &ohci {
116 status = "disabled";
117 };
118
119 &wmac {
120 status = "okay";
121
122 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_f100>;
123 nvmem-cell-names = "eeprom", "mac-address";
124 };
125
126 &ethernet {
127 nvmem-cells = <&macaddr_factory_f100>;
128 nvmem-cell-names = "mac-address";
129 };
130
131 &esw {
132 mediatek,portmap = <0x3e>;
133 };
134
135 &state_default {
136 gpio {
137 groups = "p4led_an", "p3led_an", "p2led_an", "p1led_an", "p0led_an", "wdt";
138 function = "gpio";
139 };
140 };
141
142 &gpio {
143 led_wlan_enable {
144 gpio-hog;
145 gpios = <43 GPIO_ACTIVE_HIGH>;
146 output-high;
147 };
148 };