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