1*c66ec88fSEmmanuel VadotThis document describes the device tree bindings associated with the 2*c66ec88fSEmmanuel Vadotkeystone network coprocessor(NetCP) driver support. 3*c66ec88fSEmmanuel Vadot 4*c66ec88fSEmmanuel VadotThe network coprocessor (NetCP) is a hardware accelerator that processes 5*c66ec88fSEmmanuel VadotEthernet packets. NetCP has a gigabit Ethernet (GbE) subsystem with a ethernet 6*c66ec88fSEmmanuel Vadotswitch sub-module to send and receive packets. NetCP also includes a packet 7*c66ec88fSEmmanuel Vadotaccelerator (PA) module to perform packet classification operations such as 8*c66ec88fSEmmanuel Vadotheader matching, and packet modification operations such as checksum 9*c66ec88fSEmmanuel Vadotgeneration. NetCP can also optionally include a Security Accelerator (SA) 10*c66ec88fSEmmanuel Vadotcapable of performing IPSec operations on ingress/egress packets. 11*c66ec88fSEmmanuel Vadot 12*c66ec88fSEmmanuel VadotKeystone II SoC's also have a 10 Gigabit Ethernet Subsystem (XGbE) which 13*c66ec88fSEmmanuel Vadotincludes a 3-port Ethernet switch sub-module capable of 10Gb/s and 1Gb/s rates 14*c66ec88fSEmmanuel Vadotper Ethernet port. 15*c66ec88fSEmmanuel Vadot 16*c66ec88fSEmmanuel VadotKeystone NetCP driver has a plug-in module architecture where each of the NetCP 17*c66ec88fSEmmanuel Vadotsub-modules exist as a loadable kernel module which plug in to the netcp core. 18*c66ec88fSEmmanuel VadotThese sub-modules are represented as "netcp-devices" in the dts bindings. It is 19*c66ec88fSEmmanuel Vadotmandatory to have the ethernet switch sub-module for the ethernet interface to 20*c66ec88fSEmmanuel Vadotbe operational. Any other sub-module like the PA is optional. 21*c66ec88fSEmmanuel Vadot 22*c66ec88fSEmmanuel VadotNetCP Ethernet SubSystem Layout: 23*c66ec88fSEmmanuel Vadot 24*c66ec88fSEmmanuel Vadot----------------------------- 25*c66ec88fSEmmanuel Vadot NetCP subsystem(10G or 1G) 26*c66ec88fSEmmanuel Vadot----------------------------- 27*c66ec88fSEmmanuel Vadot | 28*c66ec88fSEmmanuel Vadot |-> NetCP Devices -> | 29*c66ec88fSEmmanuel Vadot | |-> GBE/XGBE Switch 30*c66ec88fSEmmanuel Vadot | | 31*c66ec88fSEmmanuel Vadot | |-> Packet Accelerator 32*c66ec88fSEmmanuel Vadot | | 33*c66ec88fSEmmanuel Vadot | |-> Security Accelerator 34*c66ec88fSEmmanuel Vadot | 35*c66ec88fSEmmanuel Vadot | 36*c66ec88fSEmmanuel Vadot | 37*c66ec88fSEmmanuel Vadot |-> NetCP Interfaces -> | 38*c66ec88fSEmmanuel Vadot |-> Ethernet Port 0 39*c66ec88fSEmmanuel Vadot | 40*c66ec88fSEmmanuel Vadot |-> Ethernet Port 1 41*c66ec88fSEmmanuel Vadot | 42*c66ec88fSEmmanuel Vadot |-> Ethernet Port 2 43*c66ec88fSEmmanuel Vadot | 44*c66ec88fSEmmanuel Vadot |-> Ethernet Port 3 45*c66ec88fSEmmanuel Vadot 46*c66ec88fSEmmanuel Vadot 47*c66ec88fSEmmanuel VadotNetCP subsystem properties: 48*c66ec88fSEmmanuel VadotRequired properties: 49*c66ec88fSEmmanuel Vadot- compatible: Should be "ti,netcp-1.0" 50*c66ec88fSEmmanuel Vadot- clocks: phandle to the reference clocks for the subsystem. 51*c66ec88fSEmmanuel Vadot- dma-id: Navigator packet dma instance id. 52*c66ec88fSEmmanuel Vadot- ranges: address range of NetCP (includes, Ethernet SS, PA and SA) 53*c66ec88fSEmmanuel Vadot 54*c66ec88fSEmmanuel VadotOptional properties: 55*c66ec88fSEmmanuel Vadot- reg: register location and the size for the following register 56*c66ec88fSEmmanuel Vadot regions in the specified order. 57*c66ec88fSEmmanuel Vadot - Efuse MAC address register 58*c66ec88fSEmmanuel Vadot- dma-coherent: Present if dma operations are coherent 59*c66ec88fSEmmanuel Vadot- big-endian: Keystone devices can be operated in a mode where the DSP is in 60*c66ec88fSEmmanuel Vadot the big endian mode. In such cases enable this option. This 61*c66ec88fSEmmanuel Vadot option should also be enabled if the ARM is operated in 62*c66ec88fSEmmanuel Vadot big endian mode with the DSP in little endian. 63*c66ec88fSEmmanuel Vadot 64*c66ec88fSEmmanuel VadotNetCP device properties: Device specification for NetCP sub-modules. 65*c66ec88fSEmmanuel Vadot1Gb/10Gb (gbe/xgbe) ethernet switch sub-module specifications. 66*c66ec88fSEmmanuel VadotRequired properties: 67*c66ec88fSEmmanuel Vadot- label: Must be "netcp-gbe" for 1Gb & "netcp-xgbe" for 10Gb. 68*c66ec88fSEmmanuel Vadot- compatible: Must be one of below:- 69*c66ec88fSEmmanuel Vadot "ti,netcp-gbe" for 1GbE on NetCP 1.4 70*c66ec88fSEmmanuel Vadot "ti,netcp-gbe-5" for 1GbE N NetCP 1.5 (N=5) 71*c66ec88fSEmmanuel Vadot "ti,netcp-gbe-9" for 1GbE N NetCP 1.5 (N=9) 72*c66ec88fSEmmanuel Vadot "ti,netcp-gbe-2" for 1GbE N NetCP 1.5 (N=2) 73*c66ec88fSEmmanuel Vadot "ti,netcp-xgbe" for 10 GbE 74*c66ec88fSEmmanuel Vadot 75*c66ec88fSEmmanuel Vadot- reg: register location and the size for the following register 76*c66ec88fSEmmanuel Vadot regions in the specified order. 77*c66ec88fSEmmanuel Vadot - switch subsystem registers 78*c66ec88fSEmmanuel Vadot - sgmii port3/4 module registers (only for NetCP 1.4) 79*c66ec88fSEmmanuel Vadot - switch module registers 80*c66ec88fSEmmanuel Vadot - serdes registers (only for 10G) 81*c66ec88fSEmmanuel Vadot 82*c66ec88fSEmmanuel Vadot NetCP 1.4 ethss, here is the order 83*c66ec88fSEmmanuel Vadot index #0 - switch subsystem registers 84*c66ec88fSEmmanuel Vadot index #1 - sgmii port3/4 module registers 85*c66ec88fSEmmanuel Vadot index #2 - switch module registers 86*c66ec88fSEmmanuel Vadot 87*c66ec88fSEmmanuel Vadot NetCP 1.5 ethss 9 port, 5 port and 2 port 88*c66ec88fSEmmanuel Vadot index #0 - switch subsystem registers 89*c66ec88fSEmmanuel Vadot index #1 - switch module registers 90*c66ec88fSEmmanuel Vadot index #2 - serdes registers 91*c66ec88fSEmmanuel Vadot 92*c66ec88fSEmmanuel Vadot- tx-channel: the navigator packet dma channel name for tx. 93*c66ec88fSEmmanuel Vadot- tx-queue: the navigator queue number associated with the tx dma channel. 94*c66ec88fSEmmanuel Vadot- interfaces: specification for each of the switch port to be registered as a 95*c66ec88fSEmmanuel Vadot network interface in the stack. 96*c66ec88fSEmmanuel Vadot-- slave-port: Switch port number, 0 based numbering. 97*c66ec88fSEmmanuel Vadot-- link-interface: type of link interface, supported options are 98*c66ec88fSEmmanuel Vadot - mac<->mac auto negotiate mode: 0 99*c66ec88fSEmmanuel Vadot - mac<->phy mode: 1 100*c66ec88fSEmmanuel Vadot - mac<->mac forced mode: 2 101*c66ec88fSEmmanuel Vadot - mac<->fiber mode: 3 102*c66ec88fSEmmanuel Vadot - mac<->phy mode with no mdio: 4 103*c66ec88fSEmmanuel Vadot - 10Gb mac<->phy mode : 10 104*c66ec88fSEmmanuel Vadot - 10Gb mac<->mac forced mode : 11 105*c66ec88fSEmmanuel Vadot----phy-handle: phandle to PHY device 106*c66ec88fSEmmanuel Vadot 107*c66ec88fSEmmanuel Vadot- cpts: sub-node time synchronization (CPTS) submodule configuration 108*c66ec88fSEmmanuel Vadot-- clocks: CPTS reference clock. Should point on cpts-refclk-mux clock. 109*c66ec88fSEmmanuel Vadot-- clock-names: should be "cpts" 110*c66ec88fSEmmanuel Vadot-- cpts-refclk-mux: multiplexer clock definition sub-node for CPTS reference (RFTCLK) clock 111*c66ec88fSEmmanuel Vadot--- #clock-cells: should be 0 112*c66ec88fSEmmanuel Vadot--- clocks: list of CPTS reference (RFTCLK) clock's parents as defined in Data manual 113*c66ec88fSEmmanuel Vadot--- ti,mux-tbl: array of multiplexer indexes as defined in Data manual 114*c66ec88fSEmmanuel Vadot--- assigned-clocks: should point on cpts-refclk-mux clock 115*c66ec88fSEmmanuel Vadot--- assigned-clock-parents: should point on required RFTCLK clock parent to be selected 116*c66ec88fSEmmanuel Vadot-- cpts_clock_mult: (optional) Numerator to convert input clock ticks 117*c66ec88fSEmmanuel Vadot into nanoseconds 118*c66ec88fSEmmanuel Vadot-- cpts_clock_shift: (optional) Denominator to convert input clock ticks into 119*c66ec88fSEmmanuel Vadot nanoseconds. 120*c66ec88fSEmmanuel Vadot Mult and shift will be calculated basing on CPTS 121*c66ec88fSEmmanuel Vadot rftclk frequency if both cpts_clock_shift and 122*c66ec88fSEmmanuel Vadot cpts_clock_mult properties are not provided. 123*c66ec88fSEmmanuel Vadot 124*c66ec88fSEmmanuel VadotOptional properties: 125*c66ec88fSEmmanuel Vadot- enable-ale: NetCP driver keeps the address learning feature in the ethernet 126*c66ec88fSEmmanuel Vadot switch module disabled. This attribute is to enable the address 127*c66ec88fSEmmanuel Vadot learning. 128*c66ec88fSEmmanuel Vadot- secondary-slave-ports: specification for each of the switch port not be 129*c66ec88fSEmmanuel Vadot registered as a network interface. NetCP driver 130*c66ec88fSEmmanuel Vadot will only initialize these ports and attach PHY 131*c66ec88fSEmmanuel Vadot driver to them if needed. 132*c66ec88fSEmmanuel Vadot 133*c66ec88fSEmmanuel VadotNetCP interface properties: Interface specification for NetCP sub-modules. 134*c66ec88fSEmmanuel VadotRequired properties: 135*c66ec88fSEmmanuel Vadot- rx-channel: the navigator packet dma channel name for rx. 136*c66ec88fSEmmanuel Vadot- rx-queue: the navigator queue number associated with rx dma channel. 137*c66ec88fSEmmanuel Vadot- rx-pool: specifies the number of descriptors to be used & the region-id 138*c66ec88fSEmmanuel Vadot for creating the rx descriptor pool. 139*c66ec88fSEmmanuel Vadot- tx-pool: specifies the number of descriptors to be used & the region-id 140*c66ec88fSEmmanuel Vadot for creating the tx descriptor pool. 141*c66ec88fSEmmanuel Vadot- rx-queue-depth: number of descriptors in each of the free descriptor 142*c66ec88fSEmmanuel Vadot queue (FDQ) for the pktdma Rx flow. There can be at 143*c66ec88fSEmmanuel Vadot present a maximum of 4 queues per Rx flow. 144*c66ec88fSEmmanuel Vadot- rx-buffer-size: the buffer size for each of the Rx flow FDQ. 145*c66ec88fSEmmanuel Vadot- tx-completion-queue: the navigator queue number where the descriptors are 146*c66ec88fSEmmanuel Vadot recycled after Tx DMA completion. 147*c66ec88fSEmmanuel Vadot 148*c66ec88fSEmmanuel VadotOptional properties: 149*c66ec88fSEmmanuel Vadot- efuse-mac: If this is 1, then the MAC address for the interface is 150*c66ec88fSEmmanuel Vadot obtained from the device efuse mac address register. 151*c66ec88fSEmmanuel Vadot If this is 2, the two DWORDs occupied by the MAC address 152*c66ec88fSEmmanuel Vadot are swapped. The netcp driver will swap the two DWORDs 153*c66ec88fSEmmanuel Vadot back to the proper order when this property is set to 2 154*c66ec88fSEmmanuel Vadot when it obtains the mac address from efuse. 155*c66ec88fSEmmanuel Vadot- "netcp-device label": phandle to the device specification for each of NetCP 156*c66ec88fSEmmanuel Vadot sub-module attached to this interface. 157*c66ec88fSEmmanuel Vadot 158*c66ec88fSEmmanuel VadotThe MAC address will be determined using the optional properties defined in 159*c66ec88fSEmmanuel Vadotethernet.txt and only if efuse-mac is set to 0. If all of the optional MAC 160*c66ec88fSEmmanuel Vadotaddress properties are not present, then the driver will use a random MAC 161*c66ec88fSEmmanuel Vadotaddress. 162*c66ec88fSEmmanuel Vadot 163*c66ec88fSEmmanuel VadotExample binding: 164*c66ec88fSEmmanuel Vadot 165*c66ec88fSEmmanuel Vadotnetcp: netcp@2000000 { 166*c66ec88fSEmmanuel Vadot reg = <0x2620110 0x8>; 167*c66ec88fSEmmanuel Vadot reg-names = "efuse"; 168*c66ec88fSEmmanuel Vadot compatible = "ti,netcp-1.0"; 169*c66ec88fSEmmanuel Vadot #address-cells = <1>; 170*c66ec88fSEmmanuel Vadot #size-cells = <1>; 171*c66ec88fSEmmanuel Vadot ranges = <0 0x2000000 0xfffff>; 172*c66ec88fSEmmanuel Vadot clocks = <&papllclk>, <&clkcpgmac>, <&chipclk12>; 173*c66ec88fSEmmanuel Vadot dma-coherent; 174*c66ec88fSEmmanuel Vadot /* big-endian; */ 175*c66ec88fSEmmanuel Vadot dma-id = <0>; 176*c66ec88fSEmmanuel Vadot 177*c66ec88fSEmmanuel Vadot netcp-devices { 178*c66ec88fSEmmanuel Vadot #address-cells = <1>; 179*c66ec88fSEmmanuel Vadot #size-cells = <1>; 180*c66ec88fSEmmanuel Vadot ranges; 181*c66ec88fSEmmanuel Vadot gbe@90000 { 182*c66ec88fSEmmanuel Vadot label = "netcp-gbe"; 183*c66ec88fSEmmanuel Vadot reg = <0x90000 0x300>, <0x90400 0x400>, <0x90800 0x700>; 184*c66ec88fSEmmanuel Vadot /* enable-ale; */ 185*c66ec88fSEmmanuel Vadot tx-queue = <648>; 186*c66ec88fSEmmanuel Vadot tx-channel = <8>; 187*c66ec88fSEmmanuel Vadot 188*c66ec88fSEmmanuel Vadot cpts { 189*c66ec88fSEmmanuel Vadot clocks = <&cpts_refclk_mux>; 190*c66ec88fSEmmanuel Vadot clock-names = "cpts"; 191*c66ec88fSEmmanuel Vadot 192*c66ec88fSEmmanuel Vadot cpts_refclk_mux: cpts-refclk-mux { 193*c66ec88fSEmmanuel Vadot #clock-cells = <0>; 194*c66ec88fSEmmanuel Vadot clocks = <&chipclk12>, <&chipclk13>, 195*c66ec88fSEmmanuel Vadot <&timi0>, <&timi1>, 196*c66ec88fSEmmanuel Vadot <&tsipclka>, <&tsrefclk>, 197*c66ec88fSEmmanuel Vadot <&tsipclkb>; 198*c66ec88fSEmmanuel Vadot ti,mux-tbl = <0x0>, <0x1>, <0x2>, 199*c66ec88fSEmmanuel Vadot <0x3>, <0x4>, <0x8>, <0xC>; 200*c66ec88fSEmmanuel Vadot assigned-clocks = <&cpts_refclk_mux>; 201*c66ec88fSEmmanuel Vadot assigned-clock-parents = <&chipclk12>; 202*c66ec88fSEmmanuel Vadot }; 203*c66ec88fSEmmanuel Vadot }; 204*c66ec88fSEmmanuel Vadot 205*c66ec88fSEmmanuel Vadot interfaces { 206*c66ec88fSEmmanuel Vadot gbe0: interface-0 { 207*c66ec88fSEmmanuel Vadot slave-port = <0>; 208*c66ec88fSEmmanuel Vadot link-interface = <4>; 209*c66ec88fSEmmanuel Vadot }; 210*c66ec88fSEmmanuel Vadot gbe1: interface-1 { 211*c66ec88fSEmmanuel Vadot slave-port = <1>; 212*c66ec88fSEmmanuel Vadot link-interface = <4>; 213*c66ec88fSEmmanuel Vadot }; 214*c66ec88fSEmmanuel Vadot }; 215*c66ec88fSEmmanuel Vadot 216*c66ec88fSEmmanuel Vadot secondary-slave-ports { 217*c66ec88fSEmmanuel Vadot port-2 { 218*c66ec88fSEmmanuel Vadot slave-port = <2>; 219*c66ec88fSEmmanuel Vadot link-interface = <2>; 220*c66ec88fSEmmanuel Vadot }; 221*c66ec88fSEmmanuel Vadot port-3 { 222*c66ec88fSEmmanuel Vadot slave-port = <3>; 223*c66ec88fSEmmanuel Vadot link-interface = <2>; 224*c66ec88fSEmmanuel Vadot }; 225*c66ec88fSEmmanuel Vadot }; 226*c66ec88fSEmmanuel Vadot }; 227*c66ec88fSEmmanuel Vadot }; 228*c66ec88fSEmmanuel Vadot 229*c66ec88fSEmmanuel Vadot netcp-interfaces { 230*c66ec88fSEmmanuel Vadot interface-0 { 231*c66ec88fSEmmanuel Vadot rx-channel = <22>; 232*c66ec88fSEmmanuel Vadot rx-pool = <1024 12>; 233*c66ec88fSEmmanuel Vadot tx-pool = <1024 12>; 234*c66ec88fSEmmanuel Vadot rx-queue-depth = <128 128 0 0>; 235*c66ec88fSEmmanuel Vadot rx-buffer-size = <1518 4096 0 0>; 236*c66ec88fSEmmanuel Vadot rx-queue = <8704>; 237*c66ec88fSEmmanuel Vadot tx-completion-queue = <8706>; 238*c66ec88fSEmmanuel Vadot efuse-mac = <1>; 239*c66ec88fSEmmanuel Vadot netcp-gbe = <&gbe0>; 240*c66ec88fSEmmanuel Vadot 241*c66ec88fSEmmanuel Vadot }; 242*c66ec88fSEmmanuel Vadot interface-1 { 243*c66ec88fSEmmanuel Vadot rx-channel = <23>; 244*c66ec88fSEmmanuel Vadot rx-pool = <1024 12>; 245*c66ec88fSEmmanuel Vadot tx-pool = <1024 12>; 246*c66ec88fSEmmanuel Vadot rx-queue-depth = <128 128 0 0>; 247*c66ec88fSEmmanuel Vadot rx-buffer-size = <1518 4096 0 0>; 248*c66ec88fSEmmanuel Vadot rx-queue = <8705>; 249*c66ec88fSEmmanuel Vadot tx-completion-queue = <8707>; 250*c66ec88fSEmmanuel Vadot efuse-mac = <0>; 251*c66ec88fSEmmanuel Vadot local-mac-address = [02 18 31 7e 3e 6f]; 252*c66ec88fSEmmanuel Vadot netcp-gbe = <&gbe1>; 253*c66ec88fSEmmanuel Vadot }; 254*c66ec88fSEmmanuel Vadot }; 255*c66ec88fSEmmanuel Vadot}; 256*c66ec88fSEmmanuel Vadot 257*c66ec88fSEmmanuel VadotCPTS board configuration - select external CPTS RFTCLK: 258*c66ec88fSEmmanuel Vadot 259*c66ec88fSEmmanuel Vadot&tsrefclk{ 260*c66ec88fSEmmanuel Vadot clock-frequency = <500000000>; 261*c66ec88fSEmmanuel Vadot}; 262*c66ec88fSEmmanuel Vadot 263*c66ec88fSEmmanuel Vadot&cpts_refclk_mux { 264*c66ec88fSEmmanuel Vadot assigned-clock-parents = <&tsrefclk>; 265*c66ec88fSEmmanuel Vadot}; 266