5b3bcbe63ab8f46e07d656922e62b79d454c1796
[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
8 / {
9 compatible = "tplink,tl-wr841n-v14", "mediatek,mt7628an-soc";
10 model = "TP-Link TL-WR841N v14";
11
12 aliases {
13 led-boot = &led_wlan;
14 led-failsafe = &led_wlan;
15 led-upgrade = &led_wlan;
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 leds {
33 compatible = "gpio-leds";
34
35 lan {
36 label = "green:lan";
37 gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
38 };
39
40 wan_green {
41 label = "green:wan";
42 gpios = <&gpio 40 GPIO_ACTIVE_LOW>;
43 };
44
45 led_wlan: wlan {
46 label = "green:wlan";
47 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
48 linux,default-trigger = "phy0tpt";
49 };
50
51 wan_orange {
52 label = "orange:wan";
53 gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
54 };
55 };
56 };
57
58 &spi0 {
59 status = "okay";
60
61 flash@0 {
62 compatible = "jedec,spi-nor";
63 reg = <0>;
64 spi-max-frequency = <10000000>;
65
66 partitions {
67 compatible = "fixed-partitions";
68 #address-cells = <1>;
69 #size-cells = <1>;
70
71 partition@0 {
72 label = "boot";
73 reg = <0x0 0x10000>;
74 read-only;
75 };
76
77 partition@10000 {
78 compatible = "tplink,firmware";
79 label = "firmware";
80 reg = <0x10000 0x3e0000>;
81 };
82
83 factory: partition@3f0000 {
84 label = "factory";
85 reg = <0x3f0000 0x10000>;
86 read-only;
87
88 nvmem-layout {
89 compatible = "fixed-layout";
90 #address-cells = <1>;
91 #size-cells = <1>;
92
93 eeprom_factory_0: eeprom@0 {
94 reg = <0x0 0x400>;
95 };
96
97 macaddr_factory_f100: macaddr@f100 {
98 reg = <0xf100 0x6>;
99 };
100 };
101 };
102 };
103 };
104 };
105
106 &ehci {
107 status = "disabled";
108 };
109
110 &ohci {
111 status = "disabled";
112 };
113
114 &wmac {
115 status = "okay";
116
117 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_f100>;
118 nvmem-cell-names = "eeprom", "mac-address";
119 };
120
121 &ethernet {
122 nvmem-cells = <&macaddr_factory_f100>;
123 nvmem-cell-names = "mac-address";
124 };
125
126 &esw {
127 mediatek,portmap = <0x3e>;
128 };
129
130 &state_default {
131 gpio {
132 groups = "p4led_an", "p3led_an", "p2led_an", "p1led_an", "p0led_an", "wdt";
133 function = "gpio";
134 };
135 };
136
137 &gpio {
138 led_wlan_enable {
139 gpio-hog;
140 gpios = <43 GPIO_ACTIVE_HIGH>;
141 output-high;
142 };
143 };