1*0e8011faSEmmanuel Vadot/* SPDX-License-Identifier: GPL-2.0-only OR MIT */ 2*0e8011faSEmmanuel Vadot/** 3*0e8011faSEmmanuel Vadot * DT Overlay for CPSW9G in QSGMII mode using J7 Quad Port ETH EXP Add-On Ethernet Card with 4*0e8011faSEmmanuel Vadot * J784S4 EVM. The Add-On Ethernet Card has to be connected to ENET Expansion 1 slot on the 5*0e8011faSEmmanuel Vadot * board. 6*0e8011faSEmmanuel Vadot * 7*0e8011faSEmmanuel Vadot * Product Datasheet: https://www.ti.com/lit/ug/spruj74/spruj74.pdf 8*0e8011faSEmmanuel Vadot * 9*0e8011faSEmmanuel Vadot * Link to QSGMII Daughtercard: https://www.ti.com/tool/J721EXENETXPANEVM 10*0e8011faSEmmanuel Vadot * 11*0e8011faSEmmanuel Vadot * Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/ 12*0e8011faSEmmanuel Vadot */ 13*0e8011faSEmmanuel Vadot 14*0e8011faSEmmanuel Vadot/dts-v1/; 15*0e8011faSEmmanuel Vadot/plugin/; 16*0e8011faSEmmanuel Vadot 17*0e8011faSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h> 18*0e8011faSEmmanuel Vadot#include <dt-bindings/phy/phy-cadence.h> 19*0e8011faSEmmanuel Vadot#include <dt-bindings/phy/phy.h> 20*0e8011faSEmmanuel Vadot 21*0e8011faSEmmanuel Vadot#include "k3-pinctrl.h" 22*0e8011faSEmmanuel Vadot#include "k3-serdes.h" 23*0e8011faSEmmanuel Vadot 24*0e8011faSEmmanuel Vadot&{/} { 25*0e8011faSEmmanuel Vadot aliases { 26*0e8011faSEmmanuel Vadot ethernet1 = "/bus@100000/ethernet@c000000/ethernet-ports/port@5"; 27*0e8011faSEmmanuel Vadot ethernet2 = "/bus@100000/ethernet@c000000/ethernet-ports/port@6"; 28*0e8011faSEmmanuel Vadot ethernet3 = "/bus@100000/ethernet@c000000/ethernet-ports/port@7"; 29*0e8011faSEmmanuel Vadot ethernet4 = "/bus@100000/ethernet@c000000/ethernet-ports/port@8"; 30*0e8011faSEmmanuel Vadot ethernet5 = "/bus@100000/ethernet@c200000/ethernet-ports/port@1"; 31*0e8011faSEmmanuel Vadot }; 32*0e8011faSEmmanuel Vadot}; 33*0e8011faSEmmanuel Vadot 34*0e8011faSEmmanuel Vadot&main_cpsw0 { 35*0e8011faSEmmanuel Vadot status = "okay"; 36*0e8011faSEmmanuel Vadot}; 37*0e8011faSEmmanuel Vadot 38*0e8011faSEmmanuel Vadot&main_cpsw0_port5 { 39*0e8011faSEmmanuel Vadot phy-handle = <&cpsw9g_phy1>; 40*0e8011faSEmmanuel Vadot phy-mode = "qsgmii"; 41*0e8011faSEmmanuel Vadot mac-address = [00 00 00 00 00 00]; 42*0e8011faSEmmanuel Vadot phys = <&cpsw0_phy_gmii_sel 5>, <&serdes2_qsgmii_link>; 43*0e8011faSEmmanuel Vadot phy-names = "mac", "serdes"; 44*0e8011faSEmmanuel Vadot status = "okay"; 45*0e8011faSEmmanuel Vadot}; 46*0e8011faSEmmanuel Vadot 47*0e8011faSEmmanuel Vadot&main_cpsw0_port6 { 48*0e8011faSEmmanuel Vadot phy-handle = <&cpsw9g_phy2>; 49*0e8011faSEmmanuel Vadot phy-mode = "qsgmii"; 50*0e8011faSEmmanuel Vadot mac-address = [00 00 00 00 00 00]; 51*0e8011faSEmmanuel Vadot phys = <&cpsw0_phy_gmii_sel 6>, <&serdes2_qsgmii_link>; 52*0e8011faSEmmanuel Vadot phy-names = "mac", "serdes"; 53*0e8011faSEmmanuel Vadot status = "okay"; 54*0e8011faSEmmanuel Vadot}; 55*0e8011faSEmmanuel Vadot 56*0e8011faSEmmanuel Vadot&main_cpsw0_port7 { 57*0e8011faSEmmanuel Vadot phy-handle = <&cpsw9g_phy0>; 58*0e8011faSEmmanuel Vadot phy-mode = "qsgmii"; 59*0e8011faSEmmanuel Vadot mac-address = [00 00 00 00 00 00]; 60*0e8011faSEmmanuel Vadot phys = <&cpsw0_phy_gmii_sel 7>, <&serdes2_qsgmii_link>; 61*0e8011faSEmmanuel Vadot phy-names = "mac", "serdes"; 62*0e8011faSEmmanuel Vadot status = "okay"; 63*0e8011faSEmmanuel Vadot}; 64*0e8011faSEmmanuel Vadot 65*0e8011faSEmmanuel Vadot&main_cpsw0_port8 { 66*0e8011faSEmmanuel Vadot phy-handle = <&cpsw9g_phy3>; 67*0e8011faSEmmanuel Vadot phy-mode = "qsgmii"; 68*0e8011faSEmmanuel Vadot mac-address = [00 00 00 00 00 00]; 69*0e8011faSEmmanuel Vadot phys = <&cpsw0_phy_gmii_sel 8>, <&serdes2_qsgmii_link>; 70*0e8011faSEmmanuel Vadot phy-names = "mac", "serdes"; 71*0e8011faSEmmanuel Vadot status = "okay"; 72*0e8011faSEmmanuel Vadot}; 73*0e8011faSEmmanuel Vadot 74*0e8011faSEmmanuel Vadot&main_cpsw0_mdio { 75*0e8011faSEmmanuel Vadot pinctrl-names = "default"; 76*0e8011faSEmmanuel Vadot pinctrl-0 = <&mdio0_default_pins>; 77*0e8011faSEmmanuel Vadot bus_freq = <1000000>; 78*0e8011faSEmmanuel Vadot reset-gpios = <&exp2 17 GPIO_ACTIVE_LOW>; 79*0e8011faSEmmanuel Vadot reset-post-delay-us = <120000>; 80*0e8011faSEmmanuel Vadot #address-cells = <1>; 81*0e8011faSEmmanuel Vadot #size-cells = <0>; 82*0e8011faSEmmanuel Vadot status = "okay"; 83*0e8011faSEmmanuel Vadot 84*0e8011faSEmmanuel Vadot cpsw9g_phy0: ethernet-phy@16 { 85*0e8011faSEmmanuel Vadot reg = <16>; 86*0e8011faSEmmanuel Vadot }; 87*0e8011faSEmmanuel Vadot cpsw9g_phy1: ethernet-phy@17 { 88*0e8011faSEmmanuel Vadot reg = <17>; 89*0e8011faSEmmanuel Vadot }; 90*0e8011faSEmmanuel Vadot cpsw9g_phy2: ethernet-phy@18 { 91*0e8011faSEmmanuel Vadot reg = <18>; 92*0e8011faSEmmanuel Vadot }; 93*0e8011faSEmmanuel Vadot cpsw9g_phy3: ethernet-phy@19 { 94*0e8011faSEmmanuel Vadot reg = <19>; 95*0e8011faSEmmanuel Vadot }; 96*0e8011faSEmmanuel Vadot}; 97*0e8011faSEmmanuel Vadot 98*0e8011faSEmmanuel Vadot&exp2 { 99*0e8011faSEmmanuel Vadot /* Power-up ENET1 EXPANDER PHY. */ 100*0e8011faSEmmanuel Vadot qsgmii-line-hog { 101*0e8011faSEmmanuel Vadot gpio-hog; 102*0e8011faSEmmanuel Vadot gpios = <16 GPIO_ACTIVE_HIGH>; 103*0e8011faSEmmanuel Vadot output-low; 104*0e8011faSEmmanuel Vadot }; 105*0e8011faSEmmanuel Vadot 106*0e8011faSEmmanuel Vadot /* Toggle MUX2 for MDIO lines */ 107*0e8011faSEmmanuel Vadot mux-sel-hog { 108*0e8011faSEmmanuel Vadot gpio-hog; 109*0e8011faSEmmanuel Vadot gpios = <13 GPIO_ACTIVE_HIGH>, <14 GPIO_ACTIVE_HIGH>, <15 GPIO_ACTIVE_HIGH>; 110*0e8011faSEmmanuel Vadot output-high; 111*0e8011faSEmmanuel Vadot }; 112*0e8011faSEmmanuel Vadot}; 113*0e8011faSEmmanuel Vadot 114*0e8011faSEmmanuel Vadot&main_pmx0 { 115*0e8011faSEmmanuel Vadot mdio0_default_pins: mdio0-default-pins { 116*0e8011faSEmmanuel Vadot pinctrl-single,pins = < 117*0e8011faSEmmanuel Vadot J784S4_IOPAD(0x05c, PIN_INPUT, 4) /* (AC36) MCASP2_AXR0.MDIO1_MDIO */ 118*0e8011faSEmmanuel Vadot J784S4_IOPAD(0x058, PIN_INPUT, 4) /* (AE37) MCASP2_AFSX.MDIO1_MDC */ 119*0e8011faSEmmanuel Vadot >; 120*0e8011faSEmmanuel Vadot }; 121*0e8011faSEmmanuel Vadot}; 122*0e8011faSEmmanuel Vadot 123*0e8011faSEmmanuel Vadot&serdes_ln_ctrl { 124*0e8011faSEmmanuel Vadot idle-states = <J784S4_SERDES0_LANE0_PCIE1_LANE0>, <J784S4_SERDES0_LANE1_PCIE1_LANE1>, 125*0e8011faSEmmanuel Vadot <J784S4_SERDES0_LANE2_IP3_UNUSED>, <J784S4_SERDES0_LANE3_USB>, 126*0e8011faSEmmanuel Vadot <J784S4_SERDES1_LANE0_PCIE0_LANE0>, <J784S4_SERDES1_LANE1_PCIE0_LANE1>, 127*0e8011faSEmmanuel Vadot <J784S4_SERDES1_LANE2_PCIE0_LANE2>, <J784S4_SERDES1_LANE3_PCIE0_LANE3>, 128*0e8011faSEmmanuel Vadot <J784S4_SERDES2_LANE0_QSGMII_LANE5>, <J784S4_SERDES2_LANE1_QSGMII_LANE6>, 129*0e8011faSEmmanuel Vadot <J784S4_SERDES2_LANE2_QSGMII_LANE7>, <J784S4_SERDES2_LANE3_QSGMII_LANE8>; 130*0e8011faSEmmanuel Vadot}; 131*0e8011faSEmmanuel Vadot 132*0e8011faSEmmanuel Vadot&serdes_wiz2 { 133*0e8011faSEmmanuel Vadot status = "okay"; 134*0e8011faSEmmanuel Vadot}; 135*0e8011faSEmmanuel Vadot 136*0e8011faSEmmanuel Vadot&serdes2 { 137*0e8011faSEmmanuel Vadot #address-cells = <1>; 138*0e8011faSEmmanuel Vadot #size-cells = <0>; 139*0e8011faSEmmanuel Vadot status = "okay"; 140*0e8011faSEmmanuel Vadot serdes2_qsgmii_link: phy@0 { 141*0e8011faSEmmanuel Vadot reg = <2>; 142*0e8011faSEmmanuel Vadot cdns,num-lanes = <1>; 143*0e8011faSEmmanuel Vadot #phy-cells = <0>; 144*0e8011faSEmmanuel Vadot cdns,phy-type = <PHY_TYPE_QSGMII>; 145*0e8011faSEmmanuel Vadot resets = <&serdes_wiz2 3>; 146*0e8011faSEmmanuel Vadot }; 147*0e8011faSEmmanuel Vadot}; 148