treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / arm64 / boot / dts / marvell / armada-8040-clearfog-gt-8k.dts
blobbd881497b8729c7f6f6b304454dfbb12a91752a3
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3  * Copyright (C) 2018 SolidRun ltd.
4  * Based on Marvell MACCHIATOBin board
5  *
6  * Device Tree file for SolidRun's ClearFog GT 8K
7  */
9 #include "armada-8040.dtsi"
11 #include <dt-bindings/input/input.h>
12 #include <dt-bindings/gpio/gpio.h>
14 / {
15         model = "SolidRun ClearFog GT 8K";
16         compatible = "solidrun,clearfog-gt-8k", "marvell,armada8040",
17                         "marvell,armada-ap806-quad", "marvell,armada-ap806";
19         chosen {
20                 stdout-path = "serial0:115200n8";
21         };
23         memory@00000000 {
24                 device_type = "memory";
25                 reg = <0x0 0x0 0x0 0x80000000>;
26         };
28         aliases {
29                 ethernet0 = &cp1_eth1;
30                 ethernet1 = &cp0_eth0;
31                 ethernet2 = &cp1_eth2;
32         };
34         v_3_3: regulator-3-3v {
35                 compatible = "regulator-fixed";
36                 regulator-name = "v_3_3";
37                 regulator-min-microvolt = <3300000>;
38                 regulator-max-microvolt = <3300000>;
39                 regulator-always-on;
40                 status = "okay";
41         };
43         v_5v0_usb3_hst_vbus: regulator-usb3-vbus0 {
44                 compatible = "regulator-fixed";
45                 gpio = <&cp0_gpio2 15 GPIO_ACTIVE_LOW>;
46                 pinctrl-names = "default";
47                 pinctrl-0 = <&cp0_xhci_vbus_pins>;
48                 regulator-name = "v_5v0_usb3_hst_vbus";
49                 regulator-min-microvolt = <5000000>;
50                 regulator-max-microvolt = <5000000>;
51                 status = "okay";
52         };
54         sfp_cp0_eth0: sfp-cp0-eth0 {
55                 compatible = "sff,sfp";
56                 i2c-bus = <&cp0_i2c1>;
57                 mod-def0-gpio = <&cp0_gpio2 17 GPIO_ACTIVE_LOW>;
58                 tx-disable-gpio = <&cp1_gpio1 29 GPIO_ACTIVE_HIGH>;
59                 pinctrl-names = "default";
60                 pinctrl-0 = <&cp0_sfp_present_pins &cp1_sfp_tx_disable_pins>;
61                 maximum-power-milliwatt = <2000>;
62         };
64         leds {
65                 compatible = "gpio-leds";
66                 pinctrl-0 = <&cp0_led0_pins
67                              &cp0_led1_pins>;
68                 pinctrl-names = "default";
69                 /* No designated function for these LEDs at the moment */
70                 led0 {
71                         label = "clearfog-gt-8k:green:led0";
72                         gpios = <&cp0_gpio2 8 GPIO_ACTIVE_LOW>;
73                         default-state = "on";
74                 };
75                 led1 {
76                         label = "clearfog-gt-8k:green:led1";
77                         gpios = <&cp0_gpio2 9 GPIO_ACTIVE_LOW>;
78                         default-state = "on";
79                 };
80         };
82         keys {
83                 compatible = "gpio-keys";
84                 pinctrl-0 = <&cp0_gpio_reset_pins &cp1_wps_button_pins>;
85                 pinctrl-names = "default";
87                 button_0 {
88                         /* The rear button */
89                         label = "Rear Button";
90                         gpios = <&cp0_gpio2 7 GPIO_ACTIVE_LOW>;
91                         linux,can-disable;
92                         linux,code = <BTN_0>;
93                 };
95                 button_1 {
96                         /* The wps button */
97                         label = "WPS Button";
98                         gpios = <&cp1_gpio1 30 GPIO_ACTIVE_LOW>;
99                         linux,can-disable;
100                         linux,code = <KEY_WPS_BUTTON>;
101                 };
102         };
105 &uart0 {
106         status = "okay";
107         pinctrl-0 = <&uart0_pins>;
108         pinctrl-names = "default";
111 &ap_sdhci0 {
112         bus-width = <8>;
113         no-1-8-v;
114         no-sd;
115         no-sdio;
116         non-removable;
117         status = "okay";
118         vqmmc-supply = <&v_3_3>;
121 &cp0_i2c0 {
122         clock-frequency = <100000>;
123         pinctrl-names = "default";
124         pinctrl-0 = <&cp0_i2c0_pins>;
125         status = "okay";
128 &cp0_i2c1 {
129         clock-frequency = <100000>;
130         pinctrl-names = "default";
131         pinctrl-0 = <&cp0_i2c1_pins>;
132         status = "okay";
135 &cp0_pinctrl {
136         /*
137          * MPP Bus:
138          * [0-31] = 0xff: Keep default CP0_shared_pins:
139          * [11] CLKOUT_MPP_11 (out)
140          * [23] LINK_RD_IN_CP2CP (in)
141          * [25] CLKOUT_MPP_25 (out)
142          * [29] AVS_FB_IN_CP2CP (in)
143          * [32, 33, 34] pci0/1/2 reset
144          * [35-38] CP0 I2C1 and I2C0
145          * [39] GPIO reset button
146          * [40,41] LED0 and LED1
147          * [43] 1512 phy reset
148          * [47] USB VBUS EN (active low)
149          * [48] FAN PWM
150          * [49] SFP+ present signal
151          * [50] TPM interrupt
152          * [51] WLAN0 disable
153          * [52] WLAN1 disable
154          * [53] LTE disable
155          * [54] NFC reset
156          * [55] Micro SD card detect
157          * [56-61] Micro SD
158          */
160         cp0_pci0_reset_pins: pci0-reset-pins {
161                 marvell,pins = "mpp32";
162                 marvell,function = "gpio";
163         };
165         cp0_pci1_reset_pins: pci1-reset-pins {
166                 marvell,pins = "mpp33";
167                 marvell,function = "gpio";
168         };
170         cp0_pci2_reset_pins: pci2-reset-pins {
171                 marvell,pins = "mpp34";
172                 marvell,function = "gpio";
173         };
175         cp0_i2c1_pins: i2c1-pins {
176                 marvell,pins = "mpp35", "mpp36";
177                 marvell,function = "i2c1";
178         };
180         cp0_i2c0_pins: i2c0-pins {
181                 marvell,pins = "mpp37", "mpp38";
182                 marvell,function = "i2c0";
183         };
185         cp0_gpio_reset_pins: gpio-reset-pins {
186                 marvell,pins = "mpp39";
187                 marvell,function = "gpio";
188         };
190         cp0_led0_pins: led0-pins {
191                 marvell,pins = "mpp40";
192                 marvell,function = "gpio";
193         };
195         cp0_led1_pins: led1-pins {
196                 marvell,pins = "mpp41";
197                 marvell,function = "gpio";
198         };
200         cp0_copper_eth_phy_reset: copper-eth-phy-reset {
201                 marvell,pins = "mpp43";
202                 marvell,function = "gpio";
203         };
205         cp0_xhci_vbus_pins: xhci0-vbus-pins {
206                 marvell,pins = "mpp47";
207                 marvell,function = "gpio";
208         };
210         cp0_fan_pwm_pins: fan-pwm-pins {
211                 marvell,pins = "mpp48";
212                 marvell,function = "gpio";
213         };
215         cp0_sfp_present_pins: sfp-present-pins {
216                 marvell,pins = "mpp49";
217                 marvell,function = "gpio";
218         };
220         cp0_tpm_irq_pins: tpm-irq-pins {
221                 marvell,pins = "mpp50";
222                 marvell,function = "gpio";
223         };
225         cp0_wlan_disable_pins: wlan-disable-pins {
226                 marvell,pins = "mpp51";
227                 marvell,function = "gpio";
228         };
230         cp0_sdhci_pins: sdhci-pins {
231                 marvell,pins = "mpp55", "mpp56", "mpp57", "mpp58", "mpp59",
232                                "mpp60", "mpp61";
233                 marvell,function = "sdio";
234         };
237 &cp0_pcie0 {
238         pinctrl-names = "default";
239         pinctrl-0 = <&cp0_pci0_reset_pins &cp0_wlan_disable_pins>;
240         reset-gpios = <&cp0_gpio2 0 GPIO_ACTIVE_LOW>;
241         phys = <&cp0_comphy0 0>;
242         phy-names = "cp0-pcie0-x1-phy";
243         status = "okay";
246 &cp0_gpio2 {
247         sata_reset {
248                 gpio-hog;
249                 gpios = <1 GPIO_ACTIVE_HIGH>;
250                 output-high;
251         };
253         lte_reset {
254                 gpio-hog;
255                 gpios = <2 GPIO_ACTIVE_LOW>;
256                 output-low;
257         };
259         wlan_disable {
260                 gpio-hog;
261                 gpios = <19 GPIO_ACTIVE_LOW>;
262                 output-low;
263         };
265         lte_disable {
266                 gpio-hog;
267                 gpios = <21 GPIO_ACTIVE_LOW>;
268                 output-low;
269         };
272 &cp0_ethernet {
273         status = "okay";
276 /* SFP */
277 &cp0_eth0 {
278         status = "okay";
279         phy-mode = "10gbase-kr";
280         managed = "in-band-status";
281         phys = <&cp0_comphy2 0>;
282         sfp = <&sfp_cp0_eth0>;
285 &cp0_sdhci0 {
286         broken-cd;
287         bus-width = <4>;
288         pinctrl-names = "default";
289         pinctrl-0 = <&cp0_sdhci_pins>;
290         status = "okay";
291         vqmmc-supply = <&v_3_3>;
294 &cp0_usb3_1 {
295         status = "okay";
298 &cp1_pinctrl {
299         /*
300          * MPP Bus:
301          * [0-5] TDM
302          * [6]   VHV Enable
303          * [7]   CP1 SPI0 CSn1 (FXS)
304          * [8]   CP1 SPI0 CSn0 (TPM)
305          * [9.11]CP1 SPI0 MOSI/MISO/CLK
306          * [13]  CP1 SPI1 MISO (TDM and SPI ROM shared)
307          * [14]  CP1 SPI1 CS0n (64Mb SPI ROM)
308          * [15]  CP1 SPI1 MOSI (TDM and SPI ROM shared)
309          * [16]  CP1 SPI1 CLK (TDM and SPI ROM shared)
310          * [24]  Topaz switch reset
311          * [26]  Buzzer
312          * [27]  CP1 SMI MDIO
313          * [28]  CP1 SMI MDC
314          * [29]  CP0 10G SFP TX Disable
315          * [30]  WPS button
316          * [31]  Front panel button
317          */
319         cp1_spi1_pins: spi1-pins {
320                 marvell,pins = "mpp13", "mpp14", "mpp15", "mpp16";
321                 marvell,function = "spi1";
322         };
324         cp1_switch_reset_pins: switch-reset-pins {
325                 marvell,pins = "mpp24";
326                 marvell,function = "gpio";
327         };
329         cp1_ge_mdio_pins: ge-mdio-pins {
330                 marvell,pins = "mpp27", "mpp28";
331                 marvell,function = "ge";
332         };
334         cp1_sfp_tx_disable_pins: sfp-tx-disable-pins {
335                 marvell,pins = "mpp29";
336                 marvell,function = "gpio";
337         };
339         cp1_wps_button_pins: wps-button-pins {
340                 marvell,pins = "mpp30";
341                 marvell,function = "gpio";
342         };
345 &cp1_sata0 {
346         pinctrl-0 = <&cp0_pci1_reset_pins>;
347         status = "okay";
349         sata-port@1 {
350                 phys = <&cp1_comphy0 1>;
351                 phy-names = "cp1-sata0-1-phy";
352         };
355 &cp1_mdio {
356         pinctrl-names = "default";
357         pinctrl-0 = <&cp1_ge_mdio_pins>;
358         status = "okay";
360         ge_phy: ethernet-phy@0 {
361                 /* LED0 - GB link
362                  * LED1 - on: link, blink: activity
363                  */
364                 marvell,reg-init = <3 16 0 0x1017>;
365                 reg = <0>;
366                 pinctrl-names = "default";
367                 pinctrl-0 = <&cp0_copper_eth_phy_reset>;
368                 reset-gpios = <&cp0_gpio2 11 GPIO_ACTIVE_LOW>;
369                 reset-assert-us = <10000>;
370         };
372         switch0: switch0@4 {
373                 compatible = "marvell,mv88e6085";
374                 reg = <4>;
375                 pinctrl-names = "default";
376                 pinctrl-0 = <&cp1_switch_reset_pins>;
377                 reset-gpios = <&cp1_gpio1 24 GPIO_ACTIVE_LOW>;
379                 ports {
380                         #address-cells = <1>;
381                         #size-cells = <0>;
383                         port@1 {
384                                 reg = <1>;
385                                 label = "lan2";
386                                 phy-handle = <&switch0phy0>;
387                         };
389                         port@2 {
390                                 reg = <2>;
391                                 label = "lan1";
392                                 phy-handle = <&switch0phy1>;
393                         };
395                         port@3 {
396                                 reg = <3>;
397                                 label = "lan4";
398                                 phy-handle = <&switch0phy2>;
399                         };
401                         port@4 {
402                                 reg = <4>;
403                                 label = "lan3";
404                                 phy-handle = <&switch0phy3>;
405                         };
407                         port@5 {
408                                 reg = <5>;
409                                 label = "cpu";
410                                 ethernet = <&cp1_eth2>;
411                         };
412                 };
414                 mdio {
415                         #address-cells = <1>;
416                         #size-cells = <0>;
418                         switch0phy0: switch0phy0@11 {
419                                 reg = <0x11>;
420                         };
422                         switch0phy1: switch0phy1@12 {
423                                 reg = <0x12>;
424                         };
426                         switch0phy2: switch0phy2@13 {
427                                 reg = <0x13>;
428                         };
430                         switch0phy3: switch0phy3@14 {
431                                 reg = <0x14>;
432                         };
433                 };
434         };
437 &cp1_ethernet {
438         status = "okay";
441 /* 1G copper */
442 &cp1_eth1 {
443         status = "okay";
444         phy-mode = "sgmii";
445         phy = <&ge_phy>;
446         phys = <&cp1_comphy3 1>;
449 /* Switch uplink */
450 &cp1_eth2 {
451         status = "okay";
452         phy-mode = "2500base-x";
453         phys = <&cp1_comphy5 2>;
454         fixed-link {
455                 speed = <2500>;
456                 full-duplex;
457         };
460 &cp1_spi1 {
461         pinctrl-names = "default";
462         pinctrl-0 = <&cp1_spi1_pins>;
463         status = "okay";
465         spi-flash@0 {
466                 compatible = "st,w25q32";
467                 spi-max-frequency = <50000000>;
468                 reg = <0>;
469         };
472 &cp1_comphy2 {
473         cp1_usbh0_con: connector {
474                 compatible = "usb-a-connector";
475                 phy-supply = <&v_5v0_usb3_hst_vbus>;
476         };
479 &cp1_usb3_0 {
480         phys = <&cp1_comphy2 0>;
481         phy-names = "cp1-usb3h0-comphy";
482         status = "okay";