ramips: add support for Ubiquiti USW-Flex
[openwrt/staging/mkresin.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 &switch0 {
65 ports {
66 port@0 {
67 status = "okay";
68 label = "lan1";
69 };
70
71 port@1 {
72 status = "okay";
73 label = "lan2";
74 };
75
76 port@2 {
77 status = "okay";
78 label = "lan3";
79 };
80
81 port@3 {
82 status = "okay";
83 label = "lan4";
84 };
85
86 port@4 {
87 status = "okay";
88 label = "lan5";
89 };
90 };
91 };
92
93 &state_default {
94 gpio {
95 groups = "i2c", "uart2", "uart3", "jtag";
96 function = "gpio";
97 };
98 };
99
100 &spi0 {
101 status = "okay";
102
103 flash@0 {
104 compatible = "jedec,spi-nor";
105 reg = <0>;
106 spi-max-frequency = <30000000>;
107
108 partitions {
109 compatible = "fixed-partitions";
110 #address-cells = <1>;
111 #size-cells = <1>;
112
113 partition@0 {
114 label = "u-boot";
115 reg = <0x0 0x60000>;
116 read-only;
117 };
118
119 partition@60000 {
120 label = "u-boot-env";
121 reg = <0x60000 0x10000>;
122 };
123
124 partition@70000 {
125 label = "factory";
126 reg = <0x70000 0x10000>;
127 read-only;
128 };
129
130 part_eeprom: partition@80000 {
131 compatible = "nvmem-cells";
132
133 #address-cells = <1>;
134 #size-cells = <1>;
135
136 label = "eeprom";
137 reg = <0x80000 0x10000>;
138 read-only;
139
140 macaddr_eeprom: macaddr@0 {
141 reg = <0x0 0x6>;
142 };
143 };
144
145 partition@90000 {
146 label = "bs";
147 reg = <0x90000 0x10000>;
148 };
149
150 partition@a0000 {
151 label = "cfg";
152 reg = <0xa0000 0x100000>;
153 read-only;
154 };
155
156 partition@1a0000 {
157 compatible = "denx,fit";
158 label = "firmware";
159 reg = <0x1a0000 0x730000>;
160 };
161
162 partition@8d0000 {
163 label = "kernel1";
164 reg = <0x8d0000 0x730000>;
165 };
166 };
167 };
168 };
169
170 &xhci {
171 status = "disabled";
172 };