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