Texas Instruments TMS320C6000 Design Manual
Texas Instruments TMS320C6000 Design Manual

Texas Instruments TMS320C6000 Design Manual

Network developer's kit ndk support package ethernet driver
Hide thumbs Also See for TMS320C6000:

Advertisement

TMS320C6000 Network Developer's Kit
(NDK) Support Package Ethernet
Driver Design Guide
Literature Number: SPRUFP2
January 2009

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C6000 and is the answer not in the manual?

Questions and answers

Summary of Contents for Texas Instruments TMS320C6000

  • Page 1 TMS320C6000 Network Developer's Kit (NDK) Support Package Ethernet Driver Design Guide Literature Number: SPRUFP2 January 2009...
  • Page 2 TI product or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements. Following are URLs where you can obtain information on other Texas Instruments products and application solutions:...
  • Page 3 Many of these documents can be found on the Internet at http://www.ti.com. ❏ SPRU189 - TMS320C6000 CPU and Instruction Set Reference Guide. Describes the CPU architecture, pipeline, instruction set, and interrupts for the TMS320C6000 DSPs.
  • Page 4 Code Composer Studio to enable you to create and build simple projects. ❏ SPRU523 - TMS320C6000 Network Developer's Kit (NDK) Software User's Guide. Describes how to use the NDK libraries, how to develop networking applications on TMS320C6000 platforms, and ways to tune the NDK to fit a particular software environment.
  • Page 5: Table Of Contents

    Contents Architecture Overview ............1-1 This chapter provides an overview of the terminology and components involved in the Network De- veloper's Kit Support Package (NSP) Ethernet driver.
  • Page 6 Contents Generic EMAC/MDIO CSL Layer ..........4-1 This chapter describes the EMAC/MDIO CSL layer interface.
  • Page 7: Architecture Overview

    Chapter 1 Architecture Overview This chapter provides an overview of the terminology and components involved in the Network Developer's Kit Support Package (NSP) Ethernet driver. It also describes the architecture of such drivers. Topic Page 1.1 Acronyms ..........1–2 1.2 Ethernet Driver Architecture .
  • Page 8: Acronyms

    Acronyms Acronyms The following acronyms are used in this document: Table 1–1 Acronyms Acronym Description Application Programming Interface Buffer Descriptor Chip Support Library Digital Signal Processor EMAC Ethernet Medium Access Protocol Low Level Packet Driver MDIO Management Data Input/Output Interface Network Developer's Kit NIMU Network Interface Management Unit...
  • Page 9: Ethernet Driver Architecture

    Ethernet Driver Architecture Ethernet Driver Architecture The following diagram shows the architecture of the Ethernet driver design in the NDK 2.0 Support Package (NSP). NDK Core Stack NIMU NDK Core Layer NIMU-specific layer Ethernet mini-driver NSP Ethernet Driver Generic EMAC/MDIO Chip Support Library (CSL) Software Hardware...
  • Page 10 Ethernet Driver Architecture The NIMU-specific layer in previous versions of the NDK was generic enough to be ported to different platforms with ease. However, the mini- driver was not easily portable and had to be rewritten from scratch every time it had to be ported to a new platform. This led to different flavors of the Ethernet device drivers for different platforms—thus increasing the development, maintenance, and debugging effort.
  • Page 11: Generic Emac/Mdio Chip Support Library

    Ethernet Driver Architecture For the most part, the mini-driver invokes CSL APIs for setup, Tx, and interrupt service operations. The CSL layer, however, can also invoke the mini-driver layer. The CSL layer can invoke the mini-driver registered callback functions (set up during EMAC_open) for updating statistics and reporting errors.
  • Page 12: Flow Charts

    Flow Charts Flow Charts The transmission path for Ethernet packets is as follows: User Application send/sendto socket API NDK Stack Processing (L4 – TCP/UDP/RAW and IP) Return Allocate Packet, Copy Data Buf f er; Add headers and if needed f ragment packets Return NIMUSendPacket Any more pending...
  • Page 13 Flow Charts The receive path for Ethernet packets is as follows: NetScheduler (wait f or any HWI (Eth / Serial) / Timer ev ents using SEM) Any Pending Ethernet Stack Rx Ev ent Set Ev ents? (Post SEM to indicate Eth HWI) Notif y Stack of pending Rx Ev ent Y es NIMUPacketServ ice...
  • Page 14: Background

    Reference Guide (SPRU524) and the TMS320C6000 Network Developer's Kit (NDK) Software User's Guide (SPRU523). To write device drivers, you must be familiar with NETCTRL. The description given in the TMS320C6000 Network Developer's Kit (NDK) Software User's Guide (SPRU523) is more appropriate for device driver work. 1.4.2...
  • Page 15: Ndk Interrupt Manager

    Support Package (NSP) for any C64x+ device for an illustration of interrupt configuration using NDK Interrupt Manager APIs. The NDK Interrupt Manager, along with its related API and data structures, are described in the TMS320C6000 Network Developer's Kit (NDK) Software Programmer's Reference Guide (SPRU524). 1.4.5...
  • Page 16: Api Overview

    API Overview backing off any odd byte header size, and adding it to the header padding specified to the stack. For Ethernet and peer-to-peer protocol (PPP), the only requirement is that the Ethernet or PPP packet not start on an odd byte boundary.
  • Page 17 API Overview The following table groups the APIs defined by each of the Ethernet driver layers under one of these five categories. Table 1-2. API Mapping between the Ethernet driver layers API Category NIMU Layer Mini-Driver Layer CSL Layer Initialization EmacInit HwPktInit --none--...
  • Page 18 1-12...
  • Page 19: Nimu Layer

    Chapter 2 NIMU Layer This chapter describes Network Interface Management Unit (NIMU) layer API. Topic Page 2.1 Overview of the NIMU Layer ....... . 2–2 2.2 NIMU APIs .
  • Page 20: Overview Of The Nimu Layer

    NIMU layer for further management. 4) Finally, implement all the callback functions as per the NIMU architecture guidelines and the API descriptions described in "Network Interface Management Unit" section of the TMS320C6000 Network Developer's Kit (NDK) Software Programmer's Reference Guide (SPRU524).
  • Page 21: Ethernet Mini-Driver Layer

    Chapter 3 Ethernet Mini-Driver Layer This chapter describes Ethernet mini-driver layer interface. Topic Page 3.1 Overview..........3–2 3.2 Data Structures .
  • Page 22: Overview

    Overview Overview The Ethernet mini-driver layer in the new driver architecture is responsible for setting up the EMAC subsystem configuration. It exposes various APIs to the NIMU layer through which the NDK stack can configure, control, transmit, and receive packets using the Ethernet controller.
  • Page 23 Data Structures For example, the physical index can be used to hold the EMAC channel number on which packets using this device should be transmitted, and the mini-driver can be changed to use this info when transmitting the packet. ❏ hEther. This field is no longer being used after the switch to NIMU style drivers in NDK 2.0.
  • Page 24: Ethernet Mini-Driver Apis

    Ethernet Mini-Driver APIs called when a new packet is queued for transmission. This flag is maintained by the mini-driver. ❏ PBMQ_tx. Transmit pending queue. The transmit pending queue holds all the packets waiting to be sent on the Ethernet device. The mini-driver pulls PBM packet buffers off this queue in its HwPktTxNext() function and posts them to the Ethernet MAC for transmit.
  • Page 25: Hwpktinit - Initialize Packet Driver Environment

    Ethernet Mini-Driver APIs 3.3.1 HwPktInit — Initialize Packet Driver Environment Syntax uint HwPktInit(); Parameters None Return Value The number of Ethernet devices initialized. 0 indicates an error. All other positive values are considered success. Description This function is called to initialize the mini-driver environment and enumerate the number of devices in the system.
  • Page 26: Hwpktsetrx - Configure The Ethernet Receive Filter Settings

    Ethernet Mini-Driver APIs 3.3.4 HwPktSetRx — Configure the Ethernet Receive Filter Settings Syntax void HwPktSetRx( PDINFO *pi ); Parameters pi - Pointer to Ethernet device instance structure. Return Value None Description This function is called when the values contained in the PDINFO instance structure for the Rx filter or multicast list are altered.
  • Page 27: Hwpktpoll - Mini-Driver Polling Function

    Configuration Variables 3.3.7 _HwPktPoll — Mini-Driver Polling Function Syntax void _HwPktPoll( PDINFO *pi, uint fTimerTick ); Parameters pi - Pointer to Ethernet packet device instance structure. fTimerTick - Flag indicating whether this function has been called because the 100 ms timer expired or if it was called by some other function randomly.
  • Page 28 Configuration Variables This constant can be fine-tuned during performance tuning to suit the application’s needs. For example, increasing this constant helps in cases where the NDK stack or application is transmitting packets at a faster rate than the EMAC hardware. In this case, the packets are buffered up here at the mini-driver and get transmitted at the next suitable opportunity.
  • Page 29: Generic Emac/Mdio Csl Layer

    Chapter 4 Generic EMAC/MDIO CSL Layer This chapter describes the EMAC/MDIO CSL layer interface. Topic Page 4.1 Overview..........4–2 4.2 CSL Data Structures .
  • Page 30: Csl Data Structures

    Overview Overview The EMAC/MDIO CSL layer defines data structures and APIs that enable the driver to configure the EMAC hardware and send and receive packets. This CSL layer is fairly generic and can be ported easily across different platforms so long as the EMAC hardware specification don't vary a lot. For example, the CSL for an EMAC with switch capabilities would be very different from the CSL for an EMAC with support for a single PHY.
  • Page 31: Callback Functions

    Callback Functions As described in Section 1.5, the APIs exposed by this layer can be conveniently grouped according to their functionality into the following categories: 1) Initialization. EMAC_open 2) Shutdown. EMAC_close 3) Configuration. EMAC_setReceiveFilter, EMAC_getReceiveFilter, EMAC_setMulticast, EMAC_getStatus, EMAC_getStatistics, EMAC_enumerate 4) Transmit. EMAC_sendPacket, EMAC_TxServiceCheck (Tx ISR) 5) Receive.
  • Page 32: Pfcbfreepacket

    Callback Functions 4.4.2 pfcbFreePacket This function is called by the CSL layer to free the memory allocated for an EMAC packet (of type "EMAC_Pkt") and any buffers held within it. This function is typically called during EMAC close, when an error occurs, or during a Transmit complete interrupt handling for cleaning up the associated buffers.
  • Page 33 Index acronyms 1-2 EMAC 1-2 add_header function 2-2 EMAC APIs 1-5 alignment 1-9 EMAC/MDIO CSL layer 4-1 APIs 1-2 architecture overview 1-3 CSL layer 1-11, 4-2 description 1-5 mini-driver 1-11, 3-4 EMAC_close function 4-2 NIMU layer 1-11, 2-2 EMAC_enumerate function 4-2 overview 1-10 EMAC_getReceiveFilter function 4-2 architecture 1-3...
  • Page 34 Index HwPktOpen function 3-4, 3-5 NETCTRL module 1-8 _HwPktPoll function 3-4, 3-7 NETIF_DEVICE structure 2-2 HwPktSetRx function 3-4, 3-6 Network Control Module 1-8 HwPktShutdown function 3-4 Network Developer's Kit 1-2 HwPktTxNext function 3-4, 3-6 Network Interface Management Unit 1-2 NIMU 1-2 NIMU layer 2-1 APIs 1-11, 2-2 architecture overview 1-3...
  • Page 35 Index Rx 1-2 STATPEND interrupt 4-4 packet flow 1-7 STKEVENT object 1-8 STKEVENT_signal function 3-3 stop function 2-2 sample code 2-2 semaphore object 3-3 send function 2-2 transmission path 1-6 Serial Gigabit Media Independent Interface 1-2 transmit APIs 1-10 SGMII 1-2 tuning 3-8 SGMII APIs 1-5 Tx 1-2...
  • Page 36 Index--4...

Table of Contents