1*c66ec88fSEmmanuel VadotMicrochip Ocelot switch driver family 2*c66ec88fSEmmanuel Vadot===================================== 3*c66ec88fSEmmanuel Vadot 4*c66ec88fSEmmanuel VadotFelix 5*c66ec88fSEmmanuel Vadot----- 6*c66ec88fSEmmanuel Vadot 7*c66ec88fSEmmanuel VadotCurrently the switches supported by the felix driver are: 8*c66ec88fSEmmanuel Vadot 9*c66ec88fSEmmanuel Vadot- VSC9959 (Felix) 10*c66ec88fSEmmanuel Vadot- VSC9953 (Seville) 11*c66ec88fSEmmanuel Vadot 12*c66ec88fSEmmanuel VadotThe VSC9959 switch is found in the NXP LS1028A. It is a PCI device, part of the 13*c66ec88fSEmmanuel Vadotlarger ENETC root complex. As a result, the ethernet-switch node is a sub-node 14*c66ec88fSEmmanuel Vadotof the PCIe root complex node and its "reg" property conforms to the parent 15*c66ec88fSEmmanuel Vadotnode bindings: 16*c66ec88fSEmmanuel Vadot 17*c66ec88fSEmmanuel Vadot* reg: Specifies PCIe Device Number and Function Number of the endpoint device, 18*c66ec88fSEmmanuel Vadot in this case for the Ethernet L2Switch it is PF5 (of device 0, bus 0). 19*c66ec88fSEmmanuel Vadot 20*c66ec88fSEmmanuel VadotIt does not require a "compatible" string. 21*c66ec88fSEmmanuel Vadot 22*c66ec88fSEmmanuel VadotThe interrupt line is used to signal availability of PTP TX timestamps and for 23*c66ec88fSEmmanuel VadotTSN frame preemption. 24*c66ec88fSEmmanuel Vadot 25*c66ec88fSEmmanuel VadotFor the external switch ports, depending on board configuration, "phy-mode" and 26*c66ec88fSEmmanuel Vadot"phy-handle" are populated by board specific device tree instances. Ports 4 and 27*c66ec88fSEmmanuel Vadot5 are fixed as internal ports in the NXP LS1028A instantiation. 28*c66ec88fSEmmanuel Vadot 29*c66ec88fSEmmanuel VadotThe CPU port property ("ethernet") configures the feature called "NPI port" in 30*c66ec88fSEmmanuel Vadotthe Ocelot hardware core. The CPU port in Ocelot is a set of queues, which are 31*c66ec88fSEmmanuel Vadotconnected, in the Node Processor Interface (NPI) mode, to an Ethernet port. 32*c66ec88fSEmmanuel VadotBy default, in fsl-ls1028a.dtsi, the NPI port is assigned to the internal 33*c66ec88fSEmmanuel Vadot2.5Gbps port@4, but can be moved to the 1Gbps port@5, depending on the specific 34*c66ec88fSEmmanuel Vadotuse case. Moving the NPI port to an external switch port is hardware possible, 35*c66ec88fSEmmanuel Vadotbut there is no platform support for the Linux system on the LS1028A chip to 36*c66ec88fSEmmanuel Vadotoperate as an entire slave DSA chip. NPI functionality (and therefore DSA 37*c66ec88fSEmmanuel Vadottagging) is supported on a single port at a time. 38*c66ec88fSEmmanuel Vadot 39*c66ec88fSEmmanuel VadotAny port can be disabled (and in fsl-ls1028a.dtsi, they are indeed all disabled 40*c66ec88fSEmmanuel Vadotby default, and should be enabled on a per-board basis). But if any external 41*c66ec88fSEmmanuel Vadotswitch port is enabled at all, the ENETC PF2 (enetc_port2) should be enabled as 42*c66ec88fSEmmanuel Vadotwell, regardless of whether it is configured as the DSA master or not. This is 43*c66ec88fSEmmanuel Vadotbecause the Felix PHYLINK implementation accesses the MAC PCS registers, which 44*c66ec88fSEmmanuel Vadotin hardware truly belong to the ENETC port #2 and not to Felix. 45*c66ec88fSEmmanuel Vadot 46*c66ec88fSEmmanuel VadotSupported PHY interface types (appropriate SerDes protocol setting changes are 47*c66ec88fSEmmanuel Vadotneeded in the RCW binary): 48*c66ec88fSEmmanuel Vadot 49*c66ec88fSEmmanuel Vadot* phy_mode = "internal": on ports 4 and 5 50*c66ec88fSEmmanuel Vadot* phy_mode = "sgmii": on ports 0, 1, 2, 3 51*c66ec88fSEmmanuel Vadot* phy_mode = "qsgmii": on ports 0, 1, 2, 3 52*c66ec88fSEmmanuel Vadot* phy_mode = "usxgmii": on ports 0, 1, 2, 3 53*c66ec88fSEmmanuel Vadot* phy_mode = "2500base-x": on ports 0, 1, 2, 3 54*c66ec88fSEmmanuel Vadot 55*c66ec88fSEmmanuel VadotFor the rest of the device tree binding definitions, which are standard DSA and 56*c66ec88fSEmmanuel VadotPCI, refer to the following documents: 57*c66ec88fSEmmanuel Vadot 58*c66ec88fSEmmanuel VadotDocumentation/devicetree/bindings/net/dsa/dsa.txt 59*c66ec88fSEmmanuel VadotDocumentation/devicetree/bindings/pci/pci.txt 60*c66ec88fSEmmanuel Vadot 61*c66ec88fSEmmanuel VadotExample: 62*c66ec88fSEmmanuel Vadot 63*c66ec88fSEmmanuel Vadot&soc { 64*c66ec88fSEmmanuel Vadot pcie@1f0000000 { /* Integrated Endpoint Root Complex */ 65*c66ec88fSEmmanuel Vadot ethernet-switch@0,5 { 66*c66ec88fSEmmanuel Vadot reg = <0x000500 0 0 0 0>; 67*c66ec88fSEmmanuel Vadot /* IEP INT_B */ 68*c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; 69*c66ec88fSEmmanuel Vadot 70*c66ec88fSEmmanuel Vadot ports { 71*c66ec88fSEmmanuel Vadot #address-cells = <1>; 72*c66ec88fSEmmanuel Vadot #size-cells = <0>; 73*c66ec88fSEmmanuel Vadot 74*c66ec88fSEmmanuel Vadot /* External ports */ 75*c66ec88fSEmmanuel Vadot port@0 { 76*c66ec88fSEmmanuel Vadot reg = <0>; 77*c66ec88fSEmmanuel Vadot label = "swp0"; 78*c66ec88fSEmmanuel Vadot }; 79*c66ec88fSEmmanuel Vadot 80*c66ec88fSEmmanuel Vadot port@1 { 81*c66ec88fSEmmanuel Vadot reg = <1>; 82*c66ec88fSEmmanuel Vadot label = "swp1"; 83*c66ec88fSEmmanuel Vadot }; 84*c66ec88fSEmmanuel Vadot 85*c66ec88fSEmmanuel Vadot port@2 { 86*c66ec88fSEmmanuel Vadot reg = <2>; 87*c66ec88fSEmmanuel Vadot label = "swp2"; 88*c66ec88fSEmmanuel Vadot }; 89*c66ec88fSEmmanuel Vadot 90*c66ec88fSEmmanuel Vadot port@3 { 91*c66ec88fSEmmanuel Vadot reg = <3>; 92*c66ec88fSEmmanuel Vadot label = "swp3"; 93*c66ec88fSEmmanuel Vadot }; 94*c66ec88fSEmmanuel Vadot 95*c66ec88fSEmmanuel Vadot /* Tagging CPU port */ 96*c66ec88fSEmmanuel Vadot port@4 { 97*c66ec88fSEmmanuel Vadot reg = <4>; 98*c66ec88fSEmmanuel Vadot ethernet = <&enetc_port2>; 99*c66ec88fSEmmanuel Vadot phy-mode = "internal"; 100*c66ec88fSEmmanuel Vadot 101*c66ec88fSEmmanuel Vadot fixed-link { 102*c66ec88fSEmmanuel Vadot speed = <2500>; 103*c66ec88fSEmmanuel Vadot full-duplex; 104*c66ec88fSEmmanuel Vadot }; 105*c66ec88fSEmmanuel Vadot }; 106*c66ec88fSEmmanuel Vadot 107*c66ec88fSEmmanuel Vadot /* Non-tagging CPU port */ 108*c66ec88fSEmmanuel Vadot port@5 { 109*c66ec88fSEmmanuel Vadot reg = <5>; 110*c66ec88fSEmmanuel Vadot phy-mode = "internal"; 111*c66ec88fSEmmanuel Vadot status = "disabled"; 112*c66ec88fSEmmanuel Vadot 113*c66ec88fSEmmanuel Vadot fixed-link { 114*c66ec88fSEmmanuel Vadot speed = <1000>; 115*c66ec88fSEmmanuel Vadot full-duplex; 116*c66ec88fSEmmanuel Vadot }; 117*c66ec88fSEmmanuel Vadot }; 118*c66ec88fSEmmanuel Vadot }; 119*c66ec88fSEmmanuel Vadot }; 120*c66ec88fSEmmanuel Vadot }; 121*c66ec88fSEmmanuel Vadot}; 122*c66ec88fSEmmanuel Vadot 123*c66ec88fSEmmanuel VadotThe VSC9953 switch is found inside NXP T1040. It is a platform device with the 124*c66ec88fSEmmanuel Vadotfollowing required properties: 125*c66ec88fSEmmanuel Vadot 126*c66ec88fSEmmanuel Vadot- compatible: 127*c66ec88fSEmmanuel Vadot Must be "mscc,vsc9953-switch". 128*c66ec88fSEmmanuel Vadot 129*c66ec88fSEmmanuel VadotSupported PHY interface types (appropriate SerDes protocol setting changes are 130*c66ec88fSEmmanuel Vadotneeded in the RCW binary): 131*c66ec88fSEmmanuel Vadot 132*c66ec88fSEmmanuel Vadot* phy_mode = "internal": on ports 8 and 9 133*c66ec88fSEmmanuel Vadot* phy_mode = "sgmii": on ports 0, 1, 2, 3, 4, 5, 6, 7 134*c66ec88fSEmmanuel Vadot* phy_mode = "qsgmii": on ports 0, 1, 2, 3, 4, 5, 6, 7 135*c66ec88fSEmmanuel Vadot 136*c66ec88fSEmmanuel VadotExample: 137*c66ec88fSEmmanuel Vadot 138*c66ec88fSEmmanuel Vadot&soc { 139*c66ec88fSEmmanuel Vadot ethernet-switch@800000 { 140*c66ec88fSEmmanuel Vadot #address-cells = <0x1>; 141*c66ec88fSEmmanuel Vadot #size-cells = <0x0>; 142*c66ec88fSEmmanuel Vadot compatible = "mscc,vsc9953-switch"; 143*c66ec88fSEmmanuel Vadot little-endian; 144*c66ec88fSEmmanuel Vadot reg = <0x800000 0x290000>; 145*c66ec88fSEmmanuel Vadot 146*c66ec88fSEmmanuel Vadot ports { 147*c66ec88fSEmmanuel Vadot #address-cells = <0x1>; 148*c66ec88fSEmmanuel Vadot #size-cells = <0x0>; 149*c66ec88fSEmmanuel Vadot 150*c66ec88fSEmmanuel Vadot port@0 { 151*c66ec88fSEmmanuel Vadot reg = <0x0>; 152*c66ec88fSEmmanuel Vadot label = "swp0"; 153*c66ec88fSEmmanuel Vadot }; 154*c66ec88fSEmmanuel Vadot 155*c66ec88fSEmmanuel Vadot port@1 { 156*c66ec88fSEmmanuel Vadot reg = <0x1>; 157*c66ec88fSEmmanuel Vadot label = "swp1"; 158*c66ec88fSEmmanuel Vadot }; 159*c66ec88fSEmmanuel Vadot 160*c66ec88fSEmmanuel Vadot port@2 { 161*c66ec88fSEmmanuel Vadot reg = <0x2>; 162*c66ec88fSEmmanuel Vadot label = "swp2"; 163*c66ec88fSEmmanuel Vadot }; 164*c66ec88fSEmmanuel Vadot 165*c66ec88fSEmmanuel Vadot port@3 { 166*c66ec88fSEmmanuel Vadot reg = <0x3>; 167*c66ec88fSEmmanuel Vadot label = "swp3"; 168*c66ec88fSEmmanuel Vadot }; 169*c66ec88fSEmmanuel Vadot 170*c66ec88fSEmmanuel Vadot port@4 { 171*c66ec88fSEmmanuel Vadot reg = <0x4>; 172*c66ec88fSEmmanuel Vadot label = "swp4"; 173*c66ec88fSEmmanuel Vadot }; 174*c66ec88fSEmmanuel Vadot 175*c66ec88fSEmmanuel Vadot port@5 { 176*c66ec88fSEmmanuel Vadot reg = <0x5>; 177*c66ec88fSEmmanuel Vadot label = "swp5"; 178*c66ec88fSEmmanuel Vadot }; 179*c66ec88fSEmmanuel Vadot 180*c66ec88fSEmmanuel Vadot port@6 { 181*c66ec88fSEmmanuel Vadot reg = <0x6>; 182*c66ec88fSEmmanuel Vadot label = "swp6"; 183*c66ec88fSEmmanuel Vadot }; 184*c66ec88fSEmmanuel Vadot 185*c66ec88fSEmmanuel Vadot port@7 { 186*c66ec88fSEmmanuel Vadot reg = <0x7>; 187*c66ec88fSEmmanuel Vadot label = "swp7"; 188*c66ec88fSEmmanuel Vadot }; 189*c66ec88fSEmmanuel Vadot 190*c66ec88fSEmmanuel Vadot port@8 { 191*c66ec88fSEmmanuel Vadot reg = <0x8>; 192*c66ec88fSEmmanuel Vadot phy-mode = "internal"; 193*c66ec88fSEmmanuel Vadot ethernet = <&enet0>; 194*c66ec88fSEmmanuel Vadot 195*c66ec88fSEmmanuel Vadot fixed-link { 196*c66ec88fSEmmanuel Vadot speed = <2500>; 197*c66ec88fSEmmanuel Vadot full-duplex; 198*c66ec88fSEmmanuel Vadot }; 199*c66ec88fSEmmanuel Vadot }; 200*c66ec88fSEmmanuel Vadot 201*c66ec88fSEmmanuel Vadot port@9 { 202*c66ec88fSEmmanuel Vadot reg = <0x9>; 203*c66ec88fSEmmanuel Vadot phy-mode = "internal"; 204*c66ec88fSEmmanuel Vadot status = "disabled"; 205*c66ec88fSEmmanuel Vadot 206*c66ec88fSEmmanuel Vadot fixed-link { 207*c66ec88fSEmmanuel Vadot speed = <2500>; 208*c66ec88fSEmmanuel Vadot full-duplex; 209*c66ec88fSEmmanuel Vadot }; 210*c66ec88fSEmmanuel Vadot }; 211*c66ec88fSEmmanuel Vadot }; 212*c66ec88fSEmmanuel Vadot }; 213*c66ec88fSEmmanuel Vadot}; 214