1*1c510c7dSJosua Mayer// SPDX-License-Identifier: GPL-2.0+ 2*1c510c7dSJosua Mayer/* 3*1c510c7dSJosua Mayer * Copyright (C) 2024 Josua Mayer <josua@solid-run.com> 4*1c510c7dSJosua Mayer * 5*1c510c7dSJosua Mayer * DTS for SolidRun CN9130 Clearfog Pro. 6*1c510c7dSJosua Mayer * 7*1c510c7dSJosua Mayer */ 8*1c510c7dSJosua Mayer 9*1c510c7dSJosua Mayer/dts-v1/; 10*1c510c7dSJosua Mayer 11*1c510c7dSJosua Mayer#include <dt-bindings/input/input.h> 12*1c510c7dSJosua Mayer#include <dt-bindings/leds/common.h> 13*1c510c7dSJosua Mayer 14*1c510c7dSJosua Mayer#include "cn9130.dtsi" 15*1c510c7dSJosua Mayer#include "cn9130-sr-som.dtsi" 16*1c510c7dSJosua Mayer#include "cn9130-cf.dtsi" 17*1c510c7dSJosua Mayer 18*1c510c7dSJosua Mayer/ { 19*1c510c7dSJosua Mayer model = "SolidRun CN9130 Clearfog Pro"; 20*1c510c7dSJosua Mayer compatible = "solidrun,cn9130-clearfog-pro", 21*1c510c7dSJosua Mayer "solidrun,cn9130-sr-som", "marvell,cn9130"; 22*1c510c7dSJosua Mayer 23*1c510c7dSJosua Mayer gpio-keys { 24*1c510c7dSJosua Mayer compatible = "gpio-keys"; 25*1c510c7dSJosua Mayer pinctrl-0 = <&rear_button_pins>; 26*1c510c7dSJosua Mayer pinctrl-names = "default"; 27*1c510c7dSJosua Mayer 28*1c510c7dSJosua Mayer button-0 { 29*1c510c7dSJosua Mayer /* The rear SW3 button */ 30*1c510c7dSJosua Mayer label = "Rear Button"; 31*1c510c7dSJosua Mayer gpios = <&cp0_gpio2 0 GPIO_ACTIVE_LOW>; 32*1c510c7dSJosua Mayer linux,can-disable; 33*1c510c7dSJosua Mayer linux,code = <BTN_0>; 34*1c510c7dSJosua Mayer }; 35*1c510c7dSJosua Mayer }; 36*1c510c7dSJosua Mayer}; 37*1c510c7dSJosua Mayer 38*1c510c7dSJosua Mayer/* SRDS #3 - SGMII 1GE to L2 switch */ 39*1c510c7dSJosua Mayer&cp0_eth1 { 40*1c510c7dSJosua Mayer phys = <&cp0_comphy3 1>; 41*1c510c7dSJosua Mayer phy-mode = "sgmii"; 42*1c510c7dSJosua Mayer status = "okay"; 43*1c510c7dSJosua Mayer 44*1c510c7dSJosua Mayer fixed-link { 45*1c510c7dSJosua Mayer speed = <1000>; 46*1c510c7dSJosua Mayer full-duplex; 47*1c510c7dSJosua Mayer }; 48*1c510c7dSJosua Mayer}; 49*1c510c7dSJosua Mayer 50*1c510c7dSJosua Mayer&cp0_eth2_phy { 51*1c510c7dSJosua Mayer /* 52*1c510c7dSJosua Mayer * Configure LEDs default behaviour similar to switch ports: 53*1c510c7dSJosua Mayer * - LED[0]: link/activity: On/blink (green) 54*1c510c7dSJosua Mayer * - LED[1]: link is 100/1000Mbps: On (red) 55*1c510c7dSJosua Mayer * - LED[2]: high impedance (floating) 56*1c510c7dSJosua Mayer * 57*1c510c7dSJosua Mayer * Switch port defaults: 58*1c510c7dSJosua Mayer * - LED0: link/activity: On/blink (green) 59*1c510c7dSJosua Mayer * - LED1: link is 1000Mbps: On (red) 60*1c510c7dSJosua Mayer * 61*1c510c7dSJosua Mayer * Identical configuration is impossible with hardware offload. 62*1c510c7dSJosua Mayer */ 63*1c510c7dSJosua Mayer marvell,reg-init = <3 16 0xf000 0x0a61>; 64*1c510c7dSJosua Mayer 65*1c510c7dSJosua Mayer leds { 66*1c510c7dSJosua Mayer #address-cells = <1>; 67*1c510c7dSJosua Mayer #size-cells = <0>; 68*1c510c7dSJosua Mayer 69*1c510c7dSJosua Mayer led@0 { 70*1c510c7dSJosua Mayer reg = <0>; 71*1c510c7dSJosua Mayer color = <LED_COLOR_ID_GREEN>; 72*1c510c7dSJosua Mayer function = LED_FUNCTION_WAN; 73*1c510c7dSJosua Mayer label = "LED2"; 74*1c510c7dSJosua Mayer default-state = "keep"; 75*1c510c7dSJosua Mayer }; 76*1c510c7dSJosua Mayer 77*1c510c7dSJosua Mayer led@1 { 78*1c510c7dSJosua Mayer reg = <1>; 79*1c510c7dSJosua Mayer color = <LED_COLOR_ID_RED>; 80*1c510c7dSJosua Mayer function = LED_FUNCTION_WAN; 81*1c510c7dSJosua Mayer label = "LED1"; 82*1c510c7dSJosua Mayer default-state = "keep"; 83*1c510c7dSJosua Mayer }; 84*1c510c7dSJosua Mayer }; 85*1c510c7dSJosua Mayer}; 86*1c510c7dSJosua Mayer 87*1c510c7dSJosua Mayer&cp0_mdio { 88*1c510c7dSJosua Mayer ethernet-switch@4 { 89*1c510c7dSJosua Mayer compatible = "marvell,mv88e6085"; 90*1c510c7dSJosua Mayer reg = <4>; 91*1c510c7dSJosua Mayer pinctrl-0 = <&dsa_clk_pins &dsa_pins>; 92*1c510c7dSJosua Mayer pinctrl-names = "default"; 93*1c510c7dSJosua Mayer reset-gpios = <&cp0_gpio1 27 GPIO_ACTIVE_LOW>; 94*1c510c7dSJosua Mayer interrupt-parent = <&cp0_gpio1>; 95*1c510c7dSJosua Mayer interrupts = <29 IRQ_TYPE_EDGE_FALLING>; 96*1c510c7dSJosua Mayer 97*1c510c7dSJosua Mayer ethernet-ports { 98*1c510c7dSJosua Mayer #address-cells = <1>; 99*1c510c7dSJosua Mayer #size-cells = <0>; 100*1c510c7dSJosua Mayer 101*1c510c7dSJosua Mayer ethernet-port@0 { 102*1c510c7dSJosua Mayer reg = <0>; 103*1c510c7dSJosua Mayer label = "lan5"; 104*1c510c7dSJosua Mayer phy = <&switch0phy0>; 105*1c510c7dSJosua Mayer 106*1c510c7dSJosua Mayer leds { 107*1c510c7dSJosua Mayer #address-cells = <1>; 108*1c510c7dSJosua Mayer #size-cells = <0>; 109*1c510c7dSJosua Mayer 110*1c510c7dSJosua Mayer led@0 { 111*1c510c7dSJosua Mayer reg = <0>; 112*1c510c7dSJosua Mayer color = <LED_COLOR_ID_GREEN>; 113*1c510c7dSJosua Mayer function = LED_FUNCTION_LAN; 114*1c510c7dSJosua Mayer label = "LED12"; 115*1c510c7dSJosua Mayer default-state = "keep"; 116*1c510c7dSJosua Mayer }; 117*1c510c7dSJosua Mayer 118*1c510c7dSJosua Mayer led@1 { 119*1c510c7dSJosua Mayer reg = <1>; 120*1c510c7dSJosua Mayer color = <LED_COLOR_ID_RED>; 121*1c510c7dSJosua Mayer function = LED_FUNCTION_LAN; 122*1c510c7dSJosua Mayer label = "LED11"; 123*1c510c7dSJosua Mayer default-state = "keep"; 124*1c510c7dSJosua Mayer }; 125*1c510c7dSJosua Mayer }; 126*1c510c7dSJosua Mayer }; 127*1c510c7dSJosua Mayer 128*1c510c7dSJosua Mayer ethernet-port@1 { 129*1c510c7dSJosua Mayer reg = <1>; 130*1c510c7dSJosua Mayer label = "lan4"; 131*1c510c7dSJosua Mayer phy = <&switch0phy1>; 132*1c510c7dSJosua Mayer 133*1c510c7dSJosua Mayer leds { 134*1c510c7dSJosua Mayer #address-cells = <1>; 135*1c510c7dSJosua Mayer #size-cells = <0>; 136*1c510c7dSJosua Mayer 137*1c510c7dSJosua Mayer led@0 { 138*1c510c7dSJosua Mayer reg = <0>; 139*1c510c7dSJosua Mayer color = <LED_COLOR_ID_GREEN>; 140*1c510c7dSJosua Mayer function = LED_FUNCTION_LAN; 141*1c510c7dSJosua Mayer label = "LED10"; 142*1c510c7dSJosua Mayer default-state = "keep"; 143*1c510c7dSJosua Mayer }; 144*1c510c7dSJosua Mayer 145*1c510c7dSJosua Mayer led@1 { 146*1c510c7dSJosua Mayer reg = <1>; 147*1c510c7dSJosua Mayer color = <LED_COLOR_ID_RED>; 148*1c510c7dSJosua Mayer function = LED_FUNCTION_LAN; 149*1c510c7dSJosua Mayer label = "LED9"; 150*1c510c7dSJosua Mayer default-state = "keep"; 151*1c510c7dSJosua Mayer }; 152*1c510c7dSJosua Mayer }; 153*1c510c7dSJosua Mayer }; 154*1c510c7dSJosua Mayer 155*1c510c7dSJosua Mayer ethernet-port@2 { 156*1c510c7dSJosua Mayer reg = <2>; 157*1c510c7dSJosua Mayer label = "lan3"; 158*1c510c7dSJosua Mayer phy = <&switch0phy2>; 159*1c510c7dSJosua Mayer 160*1c510c7dSJosua Mayer leds { 161*1c510c7dSJosua Mayer #address-cells = <1>; 162*1c510c7dSJosua Mayer #size-cells = <0>; 163*1c510c7dSJosua Mayer 164*1c510c7dSJosua Mayer led@0 { 165*1c510c7dSJosua Mayer reg = <0>; 166*1c510c7dSJosua Mayer color = <LED_COLOR_ID_GREEN>; 167*1c510c7dSJosua Mayer function = LED_FUNCTION_LAN; 168*1c510c7dSJosua Mayer label = "LED8"; 169*1c510c7dSJosua Mayer default-state = "keep"; 170*1c510c7dSJosua Mayer }; 171*1c510c7dSJosua Mayer 172*1c510c7dSJosua Mayer led@1 { 173*1c510c7dSJosua Mayer reg = <1>; 174*1c510c7dSJosua Mayer color = <LED_COLOR_ID_RED>; 175*1c510c7dSJosua Mayer function = LED_FUNCTION_LAN; 176*1c510c7dSJosua Mayer label = "LED7"; 177*1c510c7dSJosua Mayer default-state = "keep"; 178*1c510c7dSJosua Mayer }; 179*1c510c7dSJosua Mayer }; 180*1c510c7dSJosua Mayer }; 181*1c510c7dSJosua Mayer 182*1c510c7dSJosua Mayer ethernet-port@3 { 183*1c510c7dSJosua Mayer reg = <3>; 184*1c510c7dSJosua Mayer label = "lan2"; 185*1c510c7dSJosua Mayer phy = <&switch0phy3>; 186*1c510c7dSJosua Mayer 187*1c510c7dSJosua Mayer leds { 188*1c510c7dSJosua Mayer #address-cells = <1>; 189*1c510c7dSJosua Mayer #size-cells = <0>; 190*1c510c7dSJosua Mayer 191*1c510c7dSJosua Mayer led@0 { 192*1c510c7dSJosua Mayer reg = <0>; 193*1c510c7dSJosua Mayer color = <LED_COLOR_ID_GREEN>; 194*1c510c7dSJosua Mayer function = LED_FUNCTION_LAN; 195*1c510c7dSJosua Mayer label = "LED6"; 196*1c510c7dSJosua Mayer default-state = "keep"; 197*1c510c7dSJosua Mayer }; 198*1c510c7dSJosua Mayer 199*1c510c7dSJosua Mayer led@1 { 200*1c510c7dSJosua Mayer reg = <1>; 201*1c510c7dSJosua Mayer color = <LED_COLOR_ID_RED>; 202*1c510c7dSJosua Mayer function = LED_FUNCTION_LAN; 203*1c510c7dSJosua Mayer label = "LED5"; 204*1c510c7dSJosua Mayer default-state = "keep"; 205*1c510c7dSJosua Mayer }; 206*1c510c7dSJosua Mayer }; 207*1c510c7dSJosua Mayer }; 208*1c510c7dSJosua Mayer 209*1c510c7dSJosua Mayer ethernet-port@4 { 210*1c510c7dSJosua Mayer reg = <4>; 211*1c510c7dSJosua Mayer label = "lan1"; 212*1c510c7dSJosua Mayer phy = <&switch0phy4>; 213*1c510c7dSJosua Mayer 214*1c510c7dSJosua Mayer leds { 215*1c510c7dSJosua Mayer #address-cells = <1>; 216*1c510c7dSJosua Mayer #size-cells = <0>; 217*1c510c7dSJosua Mayer 218*1c510c7dSJosua Mayer led@0 { 219*1c510c7dSJosua Mayer reg = <0>; 220*1c510c7dSJosua Mayer color = <LED_COLOR_ID_GREEN>; 221*1c510c7dSJosua Mayer function = LED_FUNCTION_LAN; 222*1c510c7dSJosua Mayer label = "LED4"; 223*1c510c7dSJosua Mayer default-state = "keep"; 224*1c510c7dSJosua Mayer }; 225*1c510c7dSJosua Mayer 226*1c510c7dSJosua Mayer led@1 { 227*1c510c7dSJosua Mayer reg = <1>; 228*1c510c7dSJosua Mayer color = <LED_COLOR_ID_RED>; 229*1c510c7dSJosua Mayer function = LED_FUNCTION_LAN; 230*1c510c7dSJosua Mayer label = "LED3"; 231*1c510c7dSJosua Mayer default-state = "keep"; 232*1c510c7dSJosua Mayer }; 233*1c510c7dSJosua Mayer }; 234*1c510c7dSJosua Mayer }; 235*1c510c7dSJosua Mayer 236*1c510c7dSJosua Mayer ethernet-port@5 { 237*1c510c7dSJosua Mayer reg = <5>; 238*1c510c7dSJosua Mayer label = "cpu"; 239*1c510c7dSJosua Mayer ethernet = <&cp0_eth1>; 240*1c510c7dSJosua Mayer phy-mode = "sgmii"; 241*1c510c7dSJosua Mayer 242*1c510c7dSJosua Mayer fixed-link { 243*1c510c7dSJosua Mayer speed = <1000>; 244*1c510c7dSJosua Mayer full-duplex; 245*1c510c7dSJosua Mayer }; 246*1c510c7dSJosua Mayer }; 247*1c510c7dSJosua Mayer 248*1c510c7dSJosua Mayer ethernet-port@6 { 249*1c510c7dSJosua Mayer reg = <6>; 250*1c510c7dSJosua Mayer label = "lan6"; 251*1c510c7dSJosua Mayer phy-mode = "rgmii"; 252*1c510c7dSJosua Mayer 253*1c510c7dSJosua Mayer /* 254*1c510c7dSJosua Mayer * Because of mdio address conflict the 255*1c510c7dSJosua Mayer * external phy is not readable. 256*1c510c7dSJosua Mayer * Force a fixed link instead. 257*1c510c7dSJosua Mayer */ 258*1c510c7dSJosua Mayer fixed-link { 259*1c510c7dSJosua Mayer speed = <1000>; 260*1c510c7dSJosua Mayer full-duplex; 261*1c510c7dSJosua Mayer }; 262*1c510c7dSJosua Mayer }; 263*1c510c7dSJosua Mayer }; 264*1c510c7dSJosua Mayer 265*1c510c7dSJosua Mayer mdio { 266*1c510c7dSJosua Mayer #address-cells = <1>; 267*1c510c7dSJosua Mayer #size-cells = <0>; 268*1c510c7dSJosua Mayer 269*1c510c7dSJosua Mayer switch0phy0: ethernet-phy@0 { 270*1c510c7dSJosua Mayer reg = <0x0>; 271*1c510c7dSJosua Mayer }; 272*1c510c7dSJosua Mayer 273*1c510c7dSJosua Mayer switch0phy1: ethernet-phy@1 { 274*1c510c7dSJosua Mayer reg = <0x1>; 275*1c510c7dSJosua Mayer /* 276*1c510c7dSJosua Mayer * Indirectly configure default behaviour 277*1c510c7dSJosua Mayer * for port lan6 leds behind external phy. 278*1c510c7dSJosua Mayer * Internal PHYs are not using page 3, 279*1c510c7dSJosua Mayer * therefore writing to it is safe. 280*1c510c7dSJosua Mayer */ 281*1c510c7dSJosua Mayer marvell,reg-init = <3 16 0xf000 0x0a61>; 282*1c510c7dSJosua Mayer }; 283*1c510c7dSJosua Mayer 284*1c510c7dSJosua Mayer switch0phy2: ethernet-phy@2 { 285*1c510c7dSJosua Mayer reg = <0x2>; 286*1c510c7dSJosua Mayer }; 287*1c510c7dSJosua Mayer 288*1c510c7dSJosua Mayer switch0phy3: ethernet-phy@3 { 289*1c510c7dSJosua Mayer reg = <0x3>; 290*1c510c7dSJosua Mayer }; 291*1c510c7dSJosua Mayer 292*1c510c7dSJosua Mayer switch0phy4: ethernet-phy@4 { 293*1c510c7dSJosua Mayer reg = <0x4>; 294*1c510c7dSJosua Mayer }; 295*1c510c7dSJosua Mayer }; 296*1c510c7dSJosua Mayer 297*1c510c7dSJosua Mayer /* 298*1c510c7dSJosua Mayer * There is an external phy on the switch mdio bus. 299*1c510c7dSJosua Mayer * Because its mdio address collides with internal phys, 300*1c510c7dSJosua Mayer * it is not readable. 301*1c510c7dSJosua Mayer * 302*1c510c7dSJosua Mayer * mdio-external { 303*1c510c7dSJosua Mayer * compatible = "marvell,mv88e6xxx-mdio-external"; 304*1c510c7dSJosua Mayer * #address-cells = <1>; 305*1c510c7dSJosua Mayer * #size-cells = <0>; 306*1c510c7dSJosua Mayer * 307*1c510c7dSJosua Mayer * ethernet-phy@1 { 308*1c510c7dSJosua Mayer * reg = <0x1>; 309*1c510c7dSJosua Mayer * }; 310*1c510c7dSJosua Mayer * }; 311*1c510c7dSJosua Mayer */ 312*1c510c7dSJosua Mayer }; 313*1c510c7dSJosua Mayer}; 314*1c510c7dSJosua Mayer 315*1c510c7dSJosua Mayer/* SRDS #4 - miniPCIe (CON2) */ 316*1c510c7dSJosua Mayer&cp0_pcie1 { 317*1c510c7dSJosua Mayer num-lanes = <1>; 318*1c510c7dSJosua Mayer phys = <&cp0_comphy4 1>; 319*1c510c7dSJosua Mayer /* dw-pcie inverts internally */ 320*1c510c7dSJosua Mayer reset-gpios = <&expander0 2 GPIO_ACTIVE_HIGH>; 321*1c510c7dSJosua Mayer status = "okay"; 322*1c510c7dSJosua Mayer}; 323*1c510c7dSJosua Mayer 324*1c510c7dSJosua Mayer&cp0_pinctrl { 325*1c510c7dSJosua Mayer dsa_clk_pins: cp0-dsa-clk-pins { 326*1c510c7dSJosua Mayer marvell,pins = "mpp40"; 327*1c510c7dSJosua Mayer marvell,function = "synce1"; 328*1c510c7dSJosua Mayer }; 329*1c510c7dSJosua Mayer 330*1c510c7dSJosua Mayer dsa_pins: cp0-dsa-pins { 331*1c510c7dSJosua Mayer marvell,pins = "mpp27", "mpp29"; 332*1c510c7dSJosua Mayer marvell,function = "gpio"; 333*1c510c7dSJosua Mayer }; 334*1c510c7dSJosua Mayer 335*1c510c7dSJosua Mayer rear_button_pins: cp0-rear-button-pins { 336*1c510c7dSJosua Mayer marvell,pins = "mpp32"; 337*1c510c7dSJosua Mayer marvell,function = "gpio"; 338*1c510c7dSJosua Mayer }; 339*1c510c7dSJosua Mayer 340*1c510c7dSJosua Mayer cp0_spi1_cs1_pins: cp0-spi1-cs1-pins { 341*1c510c7dSJosua Mayer marvell,pins = "mpp12"; 342*1c510c7dSJosua Mayer marvell,function = "spi1"; 343*1c510c7dSJosua Mayer }; 344*1c510c7dSJosua Mayer}; 345*1c510c7dSJosua Mayer 346*1c510c7dSJosua Mayer&cp0_spi1 { 347*1c510c7dSJosua Mayer /* add pin for chip-select 1 on mikrobus */ 348*1c510c7dSJosua Mayer pinctrl-0 = <&cp0_spi1_pins &cp0_spi1_cs1_pins>; 349*1c510c7dSJosua Mayer}; 350*1c510c7dSJosua Mayer 351*1c510c7dSJosua Mayer/* USB-2.0 Host on Type-A connector */ 352*1c510c7dSJosua Mayer&cp0_usb3_1 { 353*1c510c7dSJosua Mayer phys = <&cp0_utmi1>; 354*1c510c7dSJosua Mayer phy-names = "utmi"; 355*1c510c7dSJosua Mayer dr_mode = "host"; 356*1c510c7dSJosua Mayer status = "okay"; 357*1c510c7dSJosua Mayer}; 358*1c510c7dSJosua Mayer 359*1c510c7dSJosua Mayer&expander0 { 360*1c510c7dSJosua Mayer /* CON2 */ 361*1c510c7dSJosua Mayer pcie1-0-clkreq-hog { 362*1c510c7dSJosua Mayer gpio-hog; 363*1c510c7dSJosua Mayer gpios = <4 GPIO_ACTIVE_LOW>; 364*1c510c7dSJosua Mayer input; 365*1c510c7dSJosua Mayer line-name = "pcie1.0-clkreq"; 366*1c510c7dSJosua Mayer }; 367*1c510c7dSJosua Mayer 368*1c510c7dSJosua Mayer /* CON2 */ 369*1c510c7dSJosua Mayer pcie1-0-w-disable-hog { 370*1c510c7dSJosua Mayer gpio-hog; 371*1c510c7dSJosua Mayer gpios = <7 GPIO_ACTIVE_LOW>; 372*1c510c7dSJosua Mayer output-low; 373*1c510c7dSJosua Mayer line-name = "pcie1.0-w-disable"; 374*1c510c7dSJosua Mayer }; 375*1c510c7dSJosua Mayer}; 376