67df5c0127c8a4ab27f53f5e502795cc17bfe2a6
[openwrt/staging/stintel.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 compatible = "nvmem-cells";
85 label = "factory";
86 reg = <0x3f0000 0x10000>;
87 #address-cells = <1>;
88 #size-cells = <1>;
89 read-only;
90
91 eeprom_factory_0: eeprom@0 {
92 reg = <0x0 0x400>;
93 };
94
95 macaddr_factory_f100: macaddr@f100 {
96 reg = <0xf100 0x6>;
97 };
98 };
99 };
100 };
101 };
102
103 &ehci {
104 status = "disabled";
105 };
106
107 &ohci {
108 status = "disabled";
109 };
110
111 &wmac {
112 status = "okay";
113
114 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_f100>;
115 nvmem-cell-names = "eeprom", "mac-address";
116 };
117
118 &ethernet {
119 nvmem-cells = <&macaddr_factory_f100>;
120 nvmem-cell-names = "mac-address";
121 };
122
123 &esw {
124 mediatek,portmap = <0x3e>;
125 };
126
127 &state_default {
128 gpio {
129 groups = "p4led_an", "p3led_an", "p2led_an", "p1led_an", "p0led_an", "wdt";
130 function = "gpio";
131 };
132 };
133
134 &gpio {
135 led_wlan_enable {
136 gpio-hog;
137 gpios = <43 GPIO_ACTIVE_HIGH>;
138 output-high;
139 };
140 };