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