Texas Instruments TMS320DM646x Example 4. EMAC Control Module Initialization Code, Architecture

Models: TMS320DM646x

1 135
Download 135 pages 29.86 Kb
Page 53
Image 53
Example 4. EMAC Control Module Initialization Code

www.ti.com

Architecture

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;

SPRUEQ6–December 2007

Ethernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO)

53

Submit Documentation Feedback

Page 53
Image 53
Texas Instruments TMS320DM646x manual Example 4. EMAC Control Module Initialization Code, Architecture