ramips: mt7621: convert MT7915 EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / rt5350_poray_x5.dts
1 #include "rt5350.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "poray,x5", "ralink,rt5350-soc";
8 model = "Poray X5";
9
10 aliases {
11 led-boot = &led_power;
12 led-failsafe = &led_power;
13 led-running = &led_power;
14 led-upgrade = &led_power;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 led_power: power {
21 label = "green:power";
22 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
23 };
24
25 20 {
26 label = "green:20";
27 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
28 };
29
30 50 {
31 label = "green:50";
32 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
33 };
34
35 80 {
36 label = "green:80";
37 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
38 };
39 };
40
41 keys {
42 compatible = "gpio-keys-polled";
43 poll-interval = <20>;
44
45 bat {
46 label = "bat";
47 gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
48 linux,code = <KEY_WPS_BUTTON>;
49 };
50
51 reset {
52 label = "reset";
53 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
54 linux,code = <KEY_RESTART>;
55 };
56
57 mode {
58 label = "mode";
59 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
60 linux,code = <BTN_0>;
61 linux,input-type = <EV_SW>;
62 };
63 };
64
65 gpio_export {
66 compatible = "gpio-export";
67 #size-cells = <0>;
68
69 usb-mode {
70 gpio-export,name = "usb-mode";
71 gpio-export,output = <0>;
72 gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
73 };
74 };
75 };
76
77 &spi0 {
78 status = "okay";
79
80 flash@0 {
81 compatible = "jedec,spi-nor";
82 reg = <0>;
83 spi-max-frequency = <10000000>;
84
85 partitions {
86 compatible = "fixed-partitions";
87 #address-cells = <1>;
88 #size-cells = <1>;
89
90 partition@0 {
91 label = "u-boot";
92 reg = <0x0 0x30000>;
93 read-only;
94 };
95
96 partition@30000 {
97 label = "u-boot-env";
98 reg = <0x30000 0x10000>;
99 read-only;
100 };
101
102 factory: partition@40000 {
103 label = "factory";
104 reg = <0x40000 0x10000>;
105 read-only;
106
107 nvmem-layout {
108 compatible = "fixed-layout";
109 #address-cells = <1>;
110 #size-cells = <1>;
111
112 eeprom_factory_0: eeprom@0 {
113 reg = <0x0 0x200>;
114 };
115
116 macaddr_factory_4: macaddr@4 {
117 reg = <0x4 0x6>;
118 };
119 };
120 };
121
122 partition@50000 {
123 compatible = "denx,uimage";
124 label = "firmware";
125 reg = <0x50000 0x7b0000>;
126 };
127 };
128 };
129 };
130
131 &state_default {
132 gpio {
133 groups = "i2c", "jtag", "uartf";
134 function = "gpio";
135 };
136 };
137
138 &ethernet {
139 nvmem-cells = <&macaddr_factory_4>;
140 nvmem-cell-names = "mac-address";
141 };
142
143 &esw {
144 mediatek,portmap = <0x2f>;
145 mediatek,led_polarity = <1>;
146 };
147
148 &wmac {
149 ralink,led-polarity = <1>;
150 nvmem-cells = <&eeprom_factory_0>;
151 nvmem-cell-names = "eeprom";
152 };