# Texas Instruments CPSWG for AM6x and Jacinto 7 - emllCPSWG The parameters to the CPSWG Real-time Ethernet Driver are setup-specific. The function `CreateLinkParmsFromCmdLineCPSWG()` in [`EcSelectLinkLayer.cpp`](_downloads/bf62c71a4a7e317930818b9da4a9815c/EcSelectLinkLayer.cpp) demonstrates how to initialize the Real-time Ethernet Driver instance. ### struct EC_T_LINK_PARMS_CPSWG ### 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_CPSWG. ### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwPhyAddr PHY address ### [EC_T_PHYINTERFACE](emll_init.html.md#_CPPv417EC_T_PHYINTERFACE) ePhyInterface PHY interface type ### [EC_T_BOOL](toc_api.html.md#_CPPv49EC_T_BOOL) bMaster EC_TRUE: Initialize MAC ### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTxDmaDesCnt Transmit DMA descriptor buffer count. Maximum 500. ### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwRxDmaDesCnt Receive DMA descriptor buffer count. Maximum 500. ### [EC_T_BOOL](toc_api.html.md#_CPPv49EC_T_BOOL) bNotUseDmaBuffers EC_FALSE: Use buffers from DMA for receive (default), EC_TRUE: use buffers from heap for receive. EcLinkAllocSendFrame is not supported if bNotUseDmaBuffers = EC_TRUE. ### enum EC_T_CPSWG_TYPE *Values:* ### enumerator eCPSWG_AM654X TI AM654x ### enumerator eCPSWG_TDA4X TI TDA4x (Jacinto 7) ### enumerator eCPSWG_AM64X TI AM64x ### enumerator eCPSWG_AM62X TI AM62x ## CPSWG usage under Linux The unbind feature of the am65-cpsw-nuss Linux driver isn’t supported and the atemsys kernel module must be assigned as driver for the platform device. So the `"ethernet/am654-cpsw-nuss"` device tree node must be modified, by changing `compatible = "atemsys";` and adding `atemsys-Ident = "CPSWG";` and `atemsys-Instance = <0x1>;`, also remove or comment out `dma-coherent;`. ```dts ethernet@46000000 { compatible = "atemsys"; atemsys-Ident = "CPSWG"; atemsys-Instance = <0x1>; ... #dma-coherent; ... ``` So the `"ethernet/am642-cpsw-nuss"` device tree node must be modified likewise. Second port of am642-cpsw-nuss is not supported. ```dts ethernet@8000000 { compatible = "atemsys"; atemsys-Ident = "CPSWG"; atemsys-Instance = <0x1>; ... #dma-coherent; ... ``` Currently following Linux versions are supported: - ti-processor-sdk-linux-rt-am65xx-evm-07_01_00_18 (tested on AM65 IDK) - ti-processor-sdk-linux-rt-am65xx-evm-08.06.00.47 (tested on AM65 IDK) - ti-processor-sdk-linux-rt-j7-evm-08_06_01_02 (tested on SK-TDA4VM) - ti-processor-sdk-linux-rt-j7-evm-08_06_01_02 (tested on SK-TDA4VM) - ti-processor-sdk-linux-edgeai-j721e-evm-09_01_00_06 (tested on SK-TDA4VM) - ti-processor-sdk-linux-rt-am64xx-evm-08.02.00.14 (tested on TMDS64GPEVM) - ti-processor-sdk-linux-rt-am64xx-evm-09.02.00.08 (tested on TMDS64GPEVM) - SolidRun ti_am64x_build/20240221 microsd-debian-bookworm-sr1 (tested on AM64 HummingBoard-T) - toradex_ti-linux-6.1.y Linux/arm64 6.1.46 Kernel (tested on Toradex Verdin AM62)