5.6. Texas Instruments CPSW - emllCPSW

The parameters to the CPSW Link Layer are setup-specific. The function CreateLinkParmsFromCmdLineCPSW() in EcSelectLinkLayer.cpp demonstrates how to initialize the Link Layer instance.

Public Members

Common link parameters. Signature must be set to EC_LINK_PARMS_SIGNATURE_CPSW

CPSW type

PHY address

0 (lowest), 1 (highest)

EC_TRUE: Initialize MAC

EC_TRUE: Restart auto negotiation on initialization

PHY connection type

Receive interrupt number (IRQ)

Use buffers from DMA (EC_FALSE) or from heap for receive. AllocSend is not supported, when EC_TRUE



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

5.6.1. CPSW usage under Linux

Due to 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-Master. 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


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-Master.


EtherCAT ports should be used as “slave” since “master” is the Linux driver.