ramips: fix flash layout for TP-Link TL-WR841N v14
[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 /dts-v1/;
3
4 #include "mt7628an.dtsi"
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.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 led-wlan = &led_wlan;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200";
23 };
24
25 keys {
26 compatible = "gpio-keys";
27
28 reset {
29 label = "reset";
30 gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RESTART>;
32 };
33 };
34
35 leds {
36 compatible = "gpio-leds";
37
38 lan {
39 label = "tl-wr841n-v14:green:lan";
40 gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
41 };
42
43 wan_green {
44 label = "tl-wr841n-v14:green:wan";
45 gpios = <&gpio 40 GPIO_ACTIVE_LOW>;
46 };
47
48 led_wlan: wlan {
49 label = "tl-wr841n-v14:green:wlan";
50 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
51 linux,default-trigger = "phy0tpt";
52 };
53
54 wan_orange {
55 label = "tl-wr841n-v14:orange:wan";
56 gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
57 };
58 };
59 };
60
61 &spi0 {
62 status = "okay";
63
64 flash@0 {
65 compatible = "jedec,spi-nor";
66 reg = <0>;
67 spi-max-frequency = <10000000>;
68 m25p,chunked-io = <32>;
69
70 partitions {
71 compatible = "fixed-partitions";
72 #address-cells = <1>;
73 #size-cells = <1>;
74
75 partition@0 {
76 label = "boot";
77 reg = <0x0 0x10000>;
78 read-only;
79 };
80
81 partition@10000 {
82 compatible = "tplink,firmware";
83 label = "firmware";
84 reg = <0x10000 0x3d0000>;
85 };
86
87 partition@3e0000 {
88 label = "config";
89 reg = <0x3e0000 0x10000>;
90 read-only;
91 };
92
93 factory: partition@3f0000 {
94 label = "factory";
95 reg = <0x3f0000 0x10000>;
96 read-only;
97 };
98 };
99 };
100 };
101
102 &ehci {
103 status = "disabled";
104 };
105
106 &ohci {
107 status = "disabled";
108 };
109
110 &wmac {
111 status = "okay";
112
113 mtd-mac-address = <&factory 0xf100>;
114 };
115
116 &ethernet {
117 mtd-mac-address = <&factory 0xf100>;
118 };
119
120 &esw {
121 mediatek,portmap = <0x3e>;
122 };
123
124 &state_default {
125 gpio {
126 groups = "p4led_an", "p3led_an", "p2led_an", "p1led_an", "p0led_an", "wdt";
127 function = "gpio";
128 };
129 };
130
131 &gpio {
132 led_wlan_enable {
133 gpio-hog;
134 gpios = <43 GPIO_ACTIVE_HIGH>;
135 output-high;
136 };
137 };