ath79: update WA/XC devices UBNT_VERSION to 8.7.4
[openwrt/staging/wigyori.git] / target / linux / ath79 / dts / qca9558_mikrotik_routerboard-96x.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "qca955x.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 aliases {
10 led-boot = &led_user;
11 led-failsafe = &led_user;
12 led-upgrade = &led_user;
13 serial0 = &uart;
14 };
15
16 leds {
17 compatible = "gpio-leds";
18
19 led_user: user {
20 label = "green:user";
21 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
22 };
23 };
24
25 keys {
26 compatible = "gpio-keys";
27
28 reset {
29 label = "reset";
30 linux,code = <KEY_RESTART>;
31 gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
32 debounce-interval = <60>;
33 };
34 };
35
36 gpio-export {
37 compatible = "gpio-export";
38
39 buzzer {
40 /* Beeper requires PWM for frequency selection */
41 gpio-export,name = "buzzer";
42 gpio-export,output = <0>;
43 gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
44 };
45
46 usb_power {
47 gpio-export,name = "usb-power";
48 gpio-export,output = <0>;
49 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
50 };
51 };
52
53 i2c: i2c {
54 compatible = "i2c-gpio";
55
56 sda-gpios = <&gpio 18 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
57 scl-gpios = <&gpio 19 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
58 i2c-gpio,delay-us = <5>;
59 i2c-gpio,timeout-ms = <1>;
60 };
61
62 sfp1: sfp {
63 compatible = "sff,sfp";
64
65 i2c-bus = <&i2c>;
66 maximum-power-milliwatt = <1000>;
67 los-gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
68 mod-def0-gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
69 tx-disable-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
70 // Toggling GPIO16 actually enables/disables the transmitter,
71 // but the SFP driver does not seem to be using it.
72 };
73 };
74
75 &spi {
76 status = "okay";
77
78 flash@0 {
79 compatible = "jedec,spi-nor";
80 reg = <0>;
81 spi-max-frequency = <40000000>;
82
83 partitions {
84 compatible = "fixed-partitions";
85 #address-cells = <1>;
86 #size-cells = <1>;
87
88 partition@0 {
89 label = "RouterBoot";
90 reg = <0x0 0x20000>;
91 compatible = "mikrotik,routerboot-partitions";
92 #address-cells = <1>;
93 #size-cells = <1>;
94
95 partition@0 {
96 label = "bootloader1";
97 reg = <0x0 0x0>;
98 read-only;
99 };
100
101 hard_config {
102 read-only;
103 };
104
105 bios {
106 size = <0x1000>;
107 read-only;
108 };
109
110 partition@10000 {
111 label = "bootloader2";
112 reg = <0x10000 0x0>;
113 read-only;
114 };
115
116 soft_config {
117 };
118 };
119
120 partition@20000 {
121 compatible = "mikrotik,minor";
122 label = "firmware";
123 reg = <0x020000 0xfe0000>;
124 };
125 };
126 };
127 };
128
129 &mdio0 {
130 status = "okay";
131
132 phy0: ethernet-phy@0 {
133 reg = <0>;
134
135 qca,ar8327-initvals = <
136 /* PAD0_MODE from vendor firmware
137 * RGMII_EN, TX/RXCLK_DELAY_EN, TXCLK_DELAY_SEL=1
138 */
139 0x04 0x07400000 /* PAD0_MODE */
140 0x50 0xc737c737 /* LED_CTRL0 */
141 0x54 0x00000000 /* LED_CTRL1 */
142 0x58 0x00000000 /* LED_CTRL2 */
143 0x5c 0x0030c300 /* LED_CTRL3 */
144 0x7c 0x0000007e /* PORT0_STATUS */
145 >;
146 };
147 };
148
149 &eth0 {
150 status = "okay";
151
152 phy-handle = <&phy0>;
153 /* gigabit pll-data from vendor firmware
154 * TX_INVERT, TX_DELAY=3, GIGE, OFFSET_PHASE
155 */
156 pll-data = <0x8f000000 0x00000101 0x00001616>;
157
158 gmac-config {
159 device = <&gmac>;
160 rgmii-enabled = <1>;
161 };
162 };
163
164 &mdio1 {
165 status = "okay";
166
167 phy_sfp: ethernet-phy@0 {
168 reg = <0>;
169 phy-mode = "sgmii";
170 sfp = <&sfp1>;
171 };
172 };
173
174 &eth1 {
175 status = "okay";
176
177 phy-handle = <&phy_sfp>;
178 pll-data = <0x03000000 0x00000101 0x00001616>;
179 qca955x-sgmii-fixup;
180
181 gmac-config {
182 device = <&gmac>;
183 };
184
185 fixed-link {
186 speed = <1000>;
187 full-duplex;
188 };
189 };
190
191 &usb0 {
192 status = "okay";
193 };
194
195 &usb_phy0 {
196 status = "okay";
197 };