1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /* Copyright (c) 2021, Dirk Buchwalder <buchwalder@posteo.de> */
6 #include "ipq8074.dtsi"
7 #include "ipq8074-hk-cpu.dtsi"
8 #include "ipq8074-ess.dtsi"
9 #include <dt-bindings/gpio/gpio.h>
10 #include <dt-bindings/input/input.h>
11 #include <dt-bindings/leds/common.h>
15 compatible = "qnap,301w", "qcom,ipq8074";
18 serial0 = &blsp1_uart5;
20 * Aliases as required by u-boot
21 * to patch MAC addresses
23 led-boot = &led_system_red;
24 led-failsafe = &led_system_red;
25 led-running = &led_pwr_green;
26 led-upgrade = &led_system_red;
33 label-mac-device = &dp1;
37 stdout-path = "serial0:115200n8";
41 compatible = "gpio-keys";
42 pinctrl-0 = <&button_pins>;
43 pinctrl-names = "default";
47 gpios = <&tlmm 57 GPIO_ACTIVE_LOW>;
48 linux,code = <KEY_WPS_BUTTON>;
53 gpios = <&tlmm 67 GPIO_ACTIVE_LOW>;
54 linux,code = <KEY_RESTART>;
59 compatible = "gpio-leds";
60 pinctrl-0 = <&leds_pins>;
61 pinctrl-names = "default";
63 led_system_green: led-system-green {
64 gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>;
65 color = <LED_COLOR_ID_GREEN>;
68 led_system_red: led-system-red {
69 gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
70 color = <LED_COLOR_ID_RED>;
73 led_pwr_green: led-pwr-green {
74 gpios = <&tlmm 4 GPIO_ACTIVE_HIGH>;
75 color = <LED_COLOR_ID_GREEN>;
79 gpios = <&tlmm 42 GPIO_ACTIVE_HIGH>;
80 color = <LED_COLOR_ID_GREEN>;
84 gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>;
85 color = <LED_COLOR_ID_GREEN>;
89 gpios = <&tlmm 7 GPIO_ACTIVE_HIGH>;
90 color = <LED_COLOR_ID_AMBER>;
94 gpios = <&tlmm 8 GPIO_ACTIVE_HIGH>;
95 color = <LED_COLOR_ID_GREEN>;
99 gpios = <&tlmm 11 GPIO_ACTIVE_HIGH>;
100 color = <LED_COLOR_ID_AMBER>;
104 gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
105 color = <LED_COLOR_ID_GREEN>;
109 gpios = <&tlmm 13 GPIO_ACTIVE_HIGH>;
110 color = <LED_COLOR_ID_AMBER>;
114 gpios = <&tlmm 14 GPIO_ACTIVE_HIGH>;
115 color = <LED_COLOR_ID_GREEN>;
119 gpios = <&tlmm 15 GPIO_ACTIVE_HIGH>;
120 color = <LED_COLOR_ID_AMBER>;
124 gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>;
125 color = <LED_COLOR_ID_GREEN>;
129 gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>;
130 color = <LED_COLOR_ID_AMBER>;
134 gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>;
135 color = <LED_COLOR_ID_GREEN>;
139 gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
140 color = <LED_COLOR_ID_AMBER>;
147 mdio_pins: mdio-state {
151 drive-strength = <8>;
158 drive-strength = <8>;
163 button_pins: button-state {
167 drive-strength = <8>;
174 drive-strength = <8>;
179 leds_pins: leds-state {
180 pins = "gpio1", "gpio3", "gpio4", "gpio6", "gpio7", "gpio8",
181 "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio42",
182 "gpio51", "gpio52", "gpio54", "gpio56";
184 drive-strength = <8>;
233 &blsp1_spi1 { /* BLSP1 QUP1 */
234 pinctrl-0 = <&spi_0_pins>;
235 pinctrl-names = "default";
240 #address-cells = <1>;
243 compatible = "jedec,spi-nor";
244 spi-max-frequency = <50000000>;
247 compatible = "fixed-partitions";
248 #address-cells = <1>;
259 reg = <0x50000 0x10000>;
265 reg = <0x60000 0x180000>;
271 reg = <0x1e0000 0x10000>;
277 reg = <0x1f0000 0x10000>;
283 reg = <0x200000 0x40000>;
289 reg = <0x240000 0x10000>;
294 label = "0:appsblenv";
295 reg = <0x250000 0x20000>;
300 reg = <0x250000 0x100000>;
306 reg = <0x370000 0x40000>;
311 label = "0:ethphyfw1";
312 reg = <0x3b0000 0x80000>;
314 compatible = "nvmem-cells";
315 #address-cells = <1>;
318 aqr0_fw: firmware@0 {
324 label = "0:ethphyfw2";
325 reg = <0x430000 0x80000>;
327 compatible = "nvmem-cells";
328 #address-cells = <1>;
331 aqr1_fw: firmware@0 {
338 reg = <0x4b0000 0x350000>;
347 pinctrl-0 = <&mdio_pins>;
348 pinctrl-names = "default";
349 reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
351 aqr113c_0: ethernet-phy@0 {
352 compatible ="ethernet-phy-ieee802.3-c45";
354 reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
355 firmware-name = "marvell/AQR-G4_v5.4.C-AQR_CIG_WF-1945_0x0_ID44778_VER1630.cld";
356 nvmem-cell-names = "firmware";
357 nvmem-cells = <&aqr0_fw>;
360 aqr113c_8: ethernet-phy@8 {
361 compatible ="ethernet-phy-ieee802.3-c45";
363 reset-gpios = <&tlmm 59 GPIO_ACTIVE_LOW>;
364 firmware-name = "marvell/AQR-G4_v5.4.C-AQR_CIG_WF-1945_0x8_ID44776_VER1630.cld";
365 nvmem-cell-names = "firmware";
366 nvmem-cells = <&aqr1_fw>;
369 ethernet-phy-package@16 {
370 #address-cells = <1>;
372 compatible = "qcom,qca8075-package";
375 qcom,package-mode = "qsgmii";
377 qca8075_16: ethernet-phy@16 {
378 compatible = "ethernet-phy-ieee802.3-c22";
382 qca8075_17: ethernet-phy@17 {
383 compatible = "ethernet-phy-ieee802.3-c22";
387 qca8075_18: ethernet-phy@18 {
388 compatible = "ethernet-phy-ieee802.3-c22";
392 qca8075_19: ethernet-phy@19 {
393 compatible = "ethernet-phy-ieee802.3-c22";
402 /* According to the stock dts from the QNAP gpl drop
403 * the emmc has a problem with the hs400 > hs200 speed switch.
404 * Therefore remove the mmc-hs400-1_8v property
406 /delete-property/ mmc-hs400-1_8v;
409 vqmmc-supply = <&l11>;
415 switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT6)>; /* lan port bitmap */
416 switch_wan_bmp = <ESS_PORT5>; /* wan port bitmap */
417 malibu_first_phy_addr = <16>; /* PHY addr of the first malibu PHY */
418 switch_mac_mode = <MAC_MODE_QSGMII>; /* mac mode for uniphy instance0*/
419 switch_mac_mode1 = <MAC_MODE_USXGMII>; /* mac mode for uniphy instance1*/
420 switch_mac_mode2 = <MAC_MODE_USXGMII>; /* mac mode for uniphy instance2*/
442 compatible = "ethernet-phy-ieee802.3-c45";
443 ethernet-phy-ieee802.3-c45;
448 compatible = "ethernet-phy-ieee802.3-c45";
449 ethernet-phy-ieee802.3-c45;
461 phy-handle = <&qca8075_16>;
468 phy-handle = <&qca8075_17>;
475 phy-handle = <&qca8075_18>;
482 phy-handle = <&qca8075_19>;
489 phy-handle = <&aqr113c_8>;
495 phy-handle = <&aqr113c_0>;
502 qcom,ath11k-calibration-variant = "QNAP-301w";