Texas Instruments TMS320C645x DSP 사용자 설명서

다운로드
페이지 148
www.ti.com
2.15 Initialization
2.15.1
Enabling the EMAC/MDIO Peripheral
2.15.2
EMAC Control Module Initialization
EMAC Functional Architecture
When the device is powered on, the EMAC peripheral is disabled. Prior to EMAC-specific initialization, the
EMAC must be enabled; otherwise its registers cannot be written, and the reads will all return a value of
zero. The interface to be used (MII, RMII, GMII, or RGMII) is automatically selected at power-on reset,
based on the state of the MACSEL configuration pins.
EMAC/MDIO is enabled through the chip level module state control register 0 (MDCTL0) and module
status register 0 (MDSTAT0). For detailed information on the programming sequence, see the
device-specific data manual. This sequence will enable the EMAC peripheral, and the register values are
reset to default. Module-specific initialization may proceed.
The EMAC control module is used for global interrupt enable, and to pace back-to-back interrupts using
an interrupt re-trigger count based on the peripheral clock (CPUclk/6). There is also an 8K block of RAM
local to the EMAC that holds packet buffer descriptors.
Note that although the EMAC control module and the EMAC module have slightly different functions, in
practice, the type of maintenance performed on the EMAC control module is more commonly conducted
from the EMAC module software (as opposed to the MDIO module).
The initialization of the EMAC control module consists of two parts:
1. Configuration of the interrupt on the DSP.
2. Initialization of the EMAC control module:
Setting the interrupt pace count (using EWINTTCNT)
Initializing the EMAC and MDIO modules
Enabling interrupts in the EMAC control module (using EWCTL)
See
to view example code used to perform the actions associated with the second part of the
EMAC control module initialization when using the register-level CSL.
Use the system’s interrupt controller to map the EMAC interrupts to one of the CPU’s interrupts. Once the
interrupt is mapped to a CPU interrupt, general masking and unmasking of the interrupt (to control
reentrancy) should be done at the chip level by manipulating the interrupt enable mask. The EMAC control
module control register (EWCTL) should only enable and disable interrupts from within the EMAC interrupt
service routine (ISR), as disabling and re-enabling the interrupt in EWCTL also resets the interrupt pace
counter.
SPRU975B – August 2006
Ethernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO)
57