Texas Instruments TMS320DM36X manual Example 4. Emac Control Module Initialization Code

Models: TMS320DM36X

1 134
Download 134 pages 23.68 Kb
Page 52
Image 52

Architecture

www.ti.com

Example 4. EMAC Control Module Initialization Code

 

 

 

Uint32 tmpval ;

 

/* Disable all the EMAC/MDIO interrupts in the control module */

 

EmacControlRegs->CONTROL.C_RX_EN = 0;

 

EmacControlRegs->CONTROL.C_TX_EN = 0;

 

EmacControlRegs->CONTROL.C_RX_THRESH_EN = 0;

 

EmacControlRegs->CONTROL.C_MISC_EN = 0;

 

/* Wait about 100 cycles */

 

for( I=0; i<5; I++ )

 

tmpval = ECTL_REGS->EWCTL ;

 

#ifdef INTT_PACING

 

/* Set the control related to pacing of TX and RX interrupts */

 

EmacControlRegs->INTR_COUNT->C_RX_IMAX = 0x4; // 4 RX intt/ms

 

EmacControlRegs->INTR_COUNT->C_TX_IMAX = 0x4; // 4 TX intt/ms

 

EmacControlRegs->INT_CONTROL = 0x30000; //bit16,bit17 for enabling TX and Rx intt pacing.

 

EmacControlRegs->INT_CONTROL = 0x258; // 600 clocks of 150MHz in 4us time

 

#endif

 

/* Initialize MDIO and EMAC Module */

 

[Discussed later in this document]

 

/* Enable all the EMAC/MDIO interrupts in the control module */

 

EmacControlRegs->CONTROL.C_RX_EN = 0xff;

 

EmacControlRegs->CONTROL.C_TX_EN = 0xff;

 

EmacControlRegs->CONTROL.C_RX_THRESH_EN = 0xff;

 

EmacControlRegs->CONTROL.C_MISC_EN = 0xf;

 

 

 

52 Ethernet Media Access Controller (EMAC)/Management Data Input/Output SPRUFI5B –March 2009 –Revised December 2010

(MDIO)

Submit Documentation Feedback

 

© 2009–2010, Texas Instruments Incorporated

Page 52
Image 52
Texas Instruments TMS320DM36X manual Example 4. Emac Control Module Initialization Code