Download S5N8947

Transcript
CONTROLLING S5N8947 MODULES
S5N8947
1. Reset and configure PHY device
The station management operation is used to control PHY. The PHY has many control and status registers. MAC
can control PHY, and it can read the PHY status. PHY has a unique address, and there is many addresses for
PHY internal control and status registers.
The operation of read, and write to the station management register is described in below.
MII Station Management Read Operation
STEP 1. Specify the PHY address and a PHY internal register address in the STACON register
STEP 2. Set busy bit in STACON, then a PHY read operation is started.
STEP 3. Check Busy bit in STACON, after read-operation is finished, this bit is cleared.
STEP 4. Read STADATA, the STADATA register has the value of the PHY station register.
MII Station Management Write Operation
STEP 1. Write the station management data to STADATA register.
STEP 2. Specify the PHY address, and a PHY internal register address in STACON.
STEP 3. Set Write, and Busy bit in STACON, then PHY write operation is started.
STEP 4. Check Busy bit in STACON, when the write operation is finished, this bit is cleared.
2. Get unique H/W MAC address
The every MAC has unique H/W address, this is used when filtering incoming message from network. The CAM
is used for filtering incoming message address. In CM47-M66-V1.0 use IIC EEPROM for store MAC H/W
address for system.
3. Setup MAC, BDMA controller
This function is used for setup MAC and BDMA controller register and Interrupt service routine for receive and
transmit.
The each step of MAC initialize function is described in below.
STEP 1 : Disable MAC and BDMA interrupt
Disable MAC Tx, BDMA Rx interrupt to avoid abnormal branch.
STEP 2 : BDMA and MAC interrupt vector setup
Interrupt vector setup for MAC, and BDMA interrupt, after this statement, MAC, and BDMA interrupt can be
used.
STEP 3 : Set the initial condition of BDMA and MAC
Reset the MAC controller and BDMA controller. And set the duplex mode and interface mode to MACCON
register. Ethernet interface can be configured as MII interface or old style 7-wire interface. The 7-wire
interface can be set by MII-OFF bit.
STEP 4 : Set the BDMA Tx/Rx Frame Descriptor
BDMA Frame descriptor is used for control BDMA automatically. The transmit BDMA frame descriptor has
frame buffer pointer, control field, length and status field, and next frame descriptor field, the BDMA receive
frame descriptor is almost same as transmit frame descriptor except control field.
5-44