# Texas Instruments CPSW - emllCPSW The parameters to the Real-time Ethernet Driver CPSW are setup-specific. The function `CreateLinkParmsFromCmdLineCPSW()` in [`EcSelectLinkLayer.cpp`](_downloads/bf62c71a4a7e317930818b9da4a9815c/EcSelectLinkLayer.cpp) demonstrates how to initialize the Real-time Ethernet Driver instance. ### struct EC_T_LINK_PARMS_CPSW ### Public Members ### [EC_T_LINK_PARMS](emll_init.html.md#_CPPv415EC_T_LINK_PARMS) linkParms Common link parameters. Signature must be set to EC_LINK_PARMS_SIGNATURE_CPSW. ### [EC_T_CPSW_TYPE](#_CPPv414EC_T_CPSW_TYPE) eCpswType CPSW type ### [EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) dwPhyAddr PHY address ### [EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) dwPortPrio 0 (lowest), 1 (highest) ### [EC_T_BOOL](api.html.md#_CPPv49EC_T_BOOL) bMaster EC_TRUE: Initialize MAC ### [EC_T_BOOL](api.html.md#_CPPv49EC_T_BOOL) bPhyRestartAutoNegotiation EC_TRUE: Restart auto negotiation on initialization ### [EC_T_PHYINTERFACE](emll_init.html.md#_CPPv417EC_T_PHYINTERFACE) ePhyInterface PHY connection type ### [EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) dwRxInterrupt Receive interrupt number (IRQ) ### [EC_T_BOOL](api.html.md#_CPPv49EC_T_BOOL) bNotUseDmaBuffers Use buffers from DMA (EC_FALSE) or from heap for receive. AllocSend is not supported, when EC_TRUE. EcLinkAllocSendFrame is not supported if bNotUseDmaBuffers = EC_TRUE. ### [EC_T_BOOL](api.html.md#_CPPv49EC_T_BOOL) bNoPhyAccess Don’t use MDIO to set up the PHY ### [EC_T_BOOL](api.html.md#_CPPv49EC_T_BOOL) bAleBypass Enable bAleBypass, similar to promiscuous mode ### [EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) dwExtendRxFrameLength Receive longer Rx Frames ### enum EC_T_CPSW_TYPE *Values:* ### enumerator eCPSW_AM33XX TI AM33xx (e.g. Beaglebone) ### enumerator eCPSW_AM387X TI DM814x/AM387x (e.g. Mistral/TI 814X/387X BASE EVM) ### enumerator eCPSW_AM437X TI AM437x ### enumerator eCPSW_AM57X TI AM57x ## CPSW usage under Linux Due to the lacking unbind-feature of the CPSW driver, the target’s Kernel must not load the CPSW driver when starting. If the CPSW was built as a module, it can be renamed or removed to ensure it never gets loaded. If it was compiled into the Kernel, the Kernel needs to be recompiled without it. It is possible to use one CPSW port for Linux kernel (TCP/IP) and another CPSW port for EC-Simulator. To do this, the CPSW kernel driver must be patched. Currently following Linux versions are supported: - linux-4.1.6 from TI Linux SDK 2.0 - linux-4.4.4-rt11 from Lenze - linux-3.10.93-rt101 from Canon #### NOTE A patch for other Linux versions can also be created on request. The patch needs: - Linux kernel with enabled CPSW driver. - Patch applied to Linux kernel. - EC_ETHERNET_PORT defined according to target in cpsw.c and davinci_mdio.c files. - Kernel must be rebuilt and installed After that Linux will have only 1 Ethernet device, another can be used by EC-Simulator. #### NOTE EtherCAT® ports should be used as “slave” since “master” is the Linux driver.