Software Operation
2. Write to the GO, WRITE, REGADR, PHYADR, and DATA bits in MDIOUSERACCESSn corresponding
to the PHY and PHY register you want to write.
3. The write operation to the PHY is scheduled and completed by the MDIO module. Completion of the
write operation can be determined by polling the GO bit in MDIOUSERACCESSn for a 0.
4. Completion of the operation sets the corresponding USERINTRAW bit (0 or 1) in the MDIO user
command complete interrupt register (MDIOUSERINTRAW) corresponding to USERACCESSn used. If
interrupts have been enabled on this bit using the MDIO user command complete interrupt mask set
register (MDIOUSERINTMASKSET), then the bit is also set in the MDIO user command complete interrupt
register (MDIOUSERINTMASKED) and an interrupt is triggered on the CPU.
14.4.5 Reading Data from a PHY Register
The MDIO module includes a user access register (MDIOUSERACCESSn) to directly access a specified
PHY device. To read a PHY register, perform the following:
1. Check to ensure that the GO bit in the MDIO user access register (MDIOUSERACCESSn) is cleared.
2. Write to the GO, REGADR, and PHYADR bits in MDIOUSERACCESSn corresponding to the PHY and
PHY register you want to read.
3. The read data value is available in the DATA bits in MDIOUSERACCESSn after the module completes
the read operation on the serial bus. Completion of the read operation can be determined by polling the
GO and ACK bits in MDIOUSERACCESSn. After the GO bit has cleared, the ACK bit is set on a
successful read.
4. Completion of the operation sets the corresponding USERINTRAW bit (0 or 1) in the MDIO user
command complete interrupt register (MDIOUSERINTRAW) corresponding to USERACCESSn used. If
interrupts have been enabled on this bit using the MDIO user command complete interrupt mask set
register (MDIOUSERINTMASKSET), then the bit is also set in the MDIO user command complete interrupt
register (MDIOUSERINTMASKED) and an interrupt is triggered on the CPU.
14.4.6 Initialization and Configuration of CPSW
To configure the 3PSW Ethernet Subsystem for operation the host must perform the following:
•
Select the Interface (GMII/RGMII/MII) Mode in the Control Module.
•
Configure pads (PIN muxing) as per the Interface Selected using the appropriate pin muxing conf_xxx
registers in the Control Module.
•
Enable the 3PSW Ethernet Subsystem Clocks. See
and
to enable the
appropriate clocks.
•
Configure the PRCM Registers CM_PER_CPSW_CLKSTCTRL and CM_PER_CPSW_CLKSTCTRL to
enable power and clocks to the 3PSW Ethernet Subsystem. See
for register details.
•
Apply soft reset to 3PSW Subsytem, CPSW_3G, CPGMAC_SL1/2, and CPDMA (see the soft reset
registers in the following sections).
•
Initialize the HDPs (Header Description Pointer) and CPs (Completion Pointer) to NULL
•
Configure the Interrupts (see
).
•
Configure the CPSW_3G Control register.
•
Configure the Statistics Port Enable register
•
Configure the ALE. (See
.)
•
Configure the MDIO.
•
Configure the CPDMA receive DMA controller.
•
Configure the CPDMA transmit DMA controller.
•
Configure the CPPI Tx and Rx Descriptors.
•
Configure CPGMAC_SL1 and CPGMAC_SL2 as per the desired mode of operations.
•
Start up RX and TX DMA (write to HDP of Rx and Tx).
•
Wait for the completion of the transfer (HDP cleared to zero).
1239
SPRUH73H – October 2011 – Revised April 2013
Ethernet Subsystem
Copyright © 2011–2013, Texas Instruments Incorporated