NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

StarterWare CPSW

From Texas Instruments Wiki
Jump to: navigation, search

CPSW

Introduction

The peripheral is compliant to IEEE 802.3 standard, describing the Carrier Sense Multiple Access with Collision Detection (CSMA/CD) Access Method and Physical Layer specifications. CPSW has one host port and two slave ports, each of which are capable of 10/100/1000 Mbps with MII/GMII/RGMII interfaces. The CPSW also has an Address Lookup Engine which processes all received packets to determine which port(s) if any that the packet should the forwarded to. The ALE uses the incoming packet received port number, destination address, source address, length/type, and VLAN information to determine how the packet should be forwarded. The CPSW incorporates an 8kB internal RAM to hold CPDMA buffer descriptors (also known as CPPI RAM). The MDIO module implements the 802.3 serial management interface to interrogate and control up to 32 Ethernet PHYs connected to the device by using a shared two-wire bus. The application shall use the MDIO module to configure the auto negotiation parameters of each PHY attached to the CPSW slave ports, retrieve the negotiation results, and configure required parameters in the CPSW module for correct operation.

The APIs for configuring and using CPSW, MDIO and generic PHYs are exported in /include/cpsw.h, /include/mdio.h and /include/phy.h respectively.


Programming Sequence

  • Give proper settings for enabling CPSW interface at the chip configuration module.
    • Enable the pin multiplexing for CPSW by invoking the API ‘CPSWPinMuxSetup()’
    • According to the EVM settings, determine the MII transfer mode and enable the interface. In case of RGMII, ‘EVMPortRGMIIModeSelect()’ can be used to enable RGMII mode in the chip configuration
  • Reset the CPSW hardware. Each submodule can be reset by calling the APIs ‘CPSWSSReset()’, ‘CPSWCPDMAReset()’ and ‘ CPSWWrReset()’.
  • Initialize the MDIO Module using ‘MDIOInit()’. Enough delay shall be given to ensure the successful completion of the MDIO module initialization before any further access to MDIO.
  • Initialize the ALE logic and clear the entries in the ALE table using ’CPSWALEInit()’
  • Set the port states for each port used inside the ALE by invoking ‘CPSWALEPortStateSet()’
  • Set the ALE table entries for unicast/multicast with the required Ethernet address (MAC address). The MAC address can be read by invoking the API ‘EVMMACAddrGet()’
  • If port statistics need to be enabled, enable using ‘CPSWStatisticsEnable()’
  • Initialize and configure the slave ports
    • Reset the sliver logic (which correspond to slave port), by invoking the API ‘CPSWSlReset()’
    • Set the MAC address for the slave ports using ‘CPSWPortSrcAddrSet()’
    • Auto negotiate with the PHY device connected through the MDIO, if the phy is alive. Respective PHY Auto negotiation API can be used for this.
    • According to the Auto negotiation results from the PHY, set the GMII/MII/RGMII mode and the duplex of transmission for CPSW using ‘CPSWSlTransferModeSet()’.
  • Initialize the TX and RX buffer descriptors in the CPPI RAM, which is local to the CPSW.
  • Enable the transmission and reception at CPDMA using ‘CPSWCPDMATxEnable()’ and CPSWCPDMARxEnable()’
  • Enable the GMII/RGMII interface at CPSW by invoking ‘CPSWSlRGMIIEnable()’ for all the slave ports to be used
  • Enable interrupt generation.
    • Enable the transmission/reception interrupt generation at CPDMA using ’CPSWCPDMATxIntEnable()’ and ‘ CPSWCPDMARxIntEnable()’
    • Enable the transmission/reception interrupt generation at CPSW wrapper module for the required core using ‘CPSWWrCoreIntEnable()’
  • In the receive interrupt handler, the buffer descriptors associated with a received packet can be found using the SOP(Start Of Packet)/EOP(End Of Packet) fields of the buffer descriptor. After the packet is processed, the completion pointer shall be written using ‘CPSWCPDMARxCPWrite()’ to acknowledge the CPDMA. After the receive interrupt handler processes all the received packets, the CPSW shall acknowledge the end of interrupt processing with ‘CPSWCPDMAEndOfIntVectorWrite()’.
  • In the transmit interrupt handler, the buffer descriptors associated with a transmitted packets shall be freed by writing, the completion pointer shall be written using ‘CPSWCPDMATxCPWrite()’ . After the transmit interrupt handler processes all the transmitted packets, the CPSW shall acknowledge the end of interrupt processing with ‘CPSWCPDMAEndOfIntVectorWrite()’.


CPSW Switch Configuration

Device Abstraction Layer (DAL) provides necessary register level API's required for configuration of Switch. CPSW port for lwIP give interface API to configure Switch. It encapsulates the implementation of the functionality. enet_lwip application provides Console interface to configure the CPSW Switch with available configurations.

ALE Configuration

Following ALE configurations are implemented in latest release of StarterWare

  • Add a Multicast or VLAN/Multicast Entry to ALE Table
  • Add a Unicast or VLAN/Unicast Entry to ALE Table
  • Add OUI Entry to ALE Table
  • Add a VLAN Entry to ALE Table
  • Delete a Multicast or VLAN/Multicast Entry in ALE Table
  • Delete Unicast or VLAN/Unicast Entry in ALE Table
  • Delete a VLAN Entry in ALE Table
  • Search for Address of VLAN in ALE Table
  • Search for VLAN in ALE Table
  • Configure Rate Limit for Broadcast/Unicast transmit (RX/TX)*
  • Enable VLAN ID Ingression check*
  • Configure Port State*
  • Configure MAC Authentication Mode*
  • Set Unknown VLAN Info*
  • Clear Untouched ageable ALE table entries
  • Print an ALE Entry
  • Print Valid ALE entries in given range
  • Configure ALEAware


Note: (*)Features not fully tested 

Port Configuration

Following Port configurations are implemented in latest release of StarterWare

  • Configure Port VLAN Parameters
  • Configure ALEAware


<a _fcknotitle="true" href="Category:StarterWare">StarterWare</a>

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article StarterWare CPSW here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article StarterWare CPSW here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article StarterWare CPSW here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article StarterWare CPSW here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article StarterWare CPSW here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article StarterWare CPSW here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article StarterWare CPSW here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article StarterWare CPSW here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article StarterWare CPSW here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity