ramips: mt7621: convert to nvmem-layout
[openwrt/staging/nbd.git] / target / linux / ramips / dts / mt7621_ubnt_usw-flex.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 model = "Ubiquiti UniFi Switch Flex";
8 compatible = "ubnt,usw-flex", "mediatek,mt7621-soc";
9
10 aliases {
11 led-boot = &led_white;
12 led-failsafe = &led_white;
13 led-running = &led_blue;
14 led-upgrade = &led_blue;
15 label-mac-device = &gmac0;
16 };
17
18 chosen {
19 bootargs-override = "console=ttyS0,115200";
20 };
21
22 keys {
23 compatible = "gpio-keys";
24
25 reset {
26 label = "reset";
27 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
28 linux,code = <KEY_RESTART>;
29 };
30 };
31
32 leds {
33 compatible = "gpio-leds";
34
35 led_blue: status_blue {
36 label = "blue:status";
37 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
38 };
39
40 led_white: status_white {
41 label = "white:status";
42 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
43 };
44 };
45
46 i2c-gpio {
47 compatible = "i2c-gpio";
48
49 sda-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
50 scl-gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
51
52 i2c-gpio,delay-us = <50>;
53
54 /* Microsemi PD69104B1 PSE controller */
55 };
56 };
57
58 &gmac0 {
59 nvmem-cells = <&macaddr_eeprom>;
60 nvmem-cell-names = "mac-address";
61 label = "dsa";
62 };
63
64 &gmac1 {
65 status = "okay";
66 label = "lan1";
67 phy-handle = <&ethphy4>;
68
69 nvmem-cells = <&macaddr_eeprom>;
70 nvmem-cell-names = "mac-address";
71 };
72
73 &mdio {
74 ethphy4: ethernet-phy@4 {
75 reg = <4>;
76 };
77 };
78
79 &switch0 {
80 ports {
81 port@0 {
82 status = "okay";
83 label = "lan5";
84 };
85
86 port@1 {
87 status = "okay";
88 label = "lan4";
89 };
90
91 port@2 {
92 status = "okay";
93 label = "lan3";
94 };
95
96 port@3 {
97 status = "okay";
98 label = "lan2";
99 };
100 };
101 };
102
103 &state_default {
104 gpio {
105 groups = "i2c", "uart2", "uart3", "jtag";
106 function = "gpio";
107 };
108 };
109
110 &spi0 {
111 status = "okay";
112
113 flash@0 {
114 compatible = "jedec,spi-nor";
115 reg = <0>;
116 spi-max-frequency = <30000000>;
117
118 partitions {
119 compatible = "fixed-partitions";
120 #address-cells = <1>;
121 #size-cells = <1>;
122
123 partition@0 {
124 label = "u-boot";
125 reg = <0x0 0x60000>;
126 read-only;
127 };
128
129 partition@60000 {
130 label = "u-boot-env";
131 reg = <0x60000 0x10000>;
132 };
133
134 partition@70000 {
135 label = "factory";
136 reg = <0x70000 0x10000>;
137 read-only;
138 };
139
140 part_eeprom: partition@80000 {
141 label = "eeprom";
142 reg = <0x80000 0x10000>;
143 read-only;
144
145 nvmem-layout {
146 compatible = "fixed-layout";
147 #address-cells = <1>;
148 #size-cells = <1>;
149
150 macaddr_eeprom: macaddr@0 {
151 reg = <0x0 0x6>;
152 };
153 };
154 };
155
156 partition@90000 {
157 label = "bs";
158 reg = <0x90000 0x10000>;
159 };
160
161 partition@a0000 {
162 label = "cfg";
163 reg = <0xa0000 0x100000>;
164 read-only;
165 };
166
167 partition@1a0000 {
168 /* Combine kernel0 / kernel1 */
169 compatible = "denx,fit";
170 label = "firmware";
171 reg = <0x1a0000 0xe60000>;
172 };
173 };
174 };
175 };
176
177 &xhci {
178 status = "disabled";
179 };