Hi,
On our custom board we have accidentally omitted to strap RX_DV to mode 3 to provide the RMII master clock on RD3/GPIO3 so I trying to force it through the registers by setting "RMII Master Mode Reference Clock: 50-MHz" and "Clock reference according to bits[14:12]" in IOCTRL1 as well as "RMII Mode" in RCSR.
I have read various threads about this and attempted to follow the advice given but in my case I end up with a 138Mhz sine wave on RD3/GPIO3.
If I map "MAC IF Clock" I get the same result if I map "XI Clock" or "Internal Reference Clock: 25-MHz" I get 25Mhz.
If I map to COL/GPIO2, which has an unconnected test point on our board, then I also get the same results.
The procedure I am following is:
Software reset the PHY, Power off the IEEE part, set the registers, issue a digital reset and power up the Phy. The output is show below.
Any ideas as to what I am doing wrong?
Kind regards,
Andy
PHY sanity check read ID registers:
PHY_IDR1 (Register 0x02) = 0x2000 should be 0x2000
PHY_IDR2 (Register 0x03) = 0xA240 should be 0xA240
Starting values
-----------------------
PHY_MBCR (Register 0x00) = 0x3000
PHY_BMSR (Register 0x01) = 0x7849
PHY_IDR1 (Register 0x02) = 0x2000 should be 0x2000
PHY_IDR2 (Register 0x03) = 0xA240 should be 0xA240
PHY_ANAR (Register 0x04) = 0x00A1
PHY_CR1 (Register 0x09) = 0x0000
PHY_CR2 (Register 0x0A) = 0x0100
PHY_CR3 (Register 0x0B) = 0x1000
PHY_STS (Register 0x10) = 0x0002
PHY_SCR (Register 0x11) = 0x0108
PHY_MISR1 (Register 0x12) = 0x0000
PHY_MISR1 (Register 0x13) = 0x0800
PHY_RCSR (Register 0x17) = 0x0041
PHY_CR (Register 0x19) = 0x8001
PHY_IOCTRL1 (Register 0x0462) = 0x0001
PHY_IOCTRL2 (Register 0x0463) = 0x0000
PHY_SOR1 (Register 0x0467) = 0x0F4C
PHY_SOR2 (Register 0x0468) = 0x0000
-----------------------
Reset Phy
PHY_RCR (Register 0x1F) = 0x0000
Set bit 15
PHY_RCR (Register 0x1F) = 0x8000
Wait for reset clear
PHY_RCR (Register 0x1F) = 0x0000
Power down Phy
PHY_MBCR (Register 0x00) = 0x3000
Set bit 11
PHY_MBCR (Register 0x00) = 0x3800
After reset and power down
-----------------------
PHY_MBCR (Register 0x00) = 0x3800
PHY_BMSR (Register 0x01) = 0x7849
PHY_IDR1 (Register 0x02) = 0x2000 should be 0x2000
PHY_IDR2 (Register 0x03) = 0xA240 should be 0xA240
PHY_ANAR (Register 0x04) = 0x00A1
PHY_CR1 (Register 0x09) = 0x0000
PHY_CR2 (Register 0x0A) = 0x0100
PHY_CR3 (Register 0x0B) = 0x1000
PHY_STS (Register 0x10) = 0x0002
PHY_SCR (Register 0x11) = 0x0108
PHY_MISR1 (Register 0x12) = 0x0000
PHY_MISR1 (Register 0x13) = 0x0000
PHY_RCSR (Register 0x17) = 0x0041
PHY_CR (Register 0x19) = 0x8001
PHY_IOCTRL1 (Register 0x0462) = 0x0001
PHY_IOCTRL2 (Register 0x0463) = 0x0000
PHY_SOR1 (Register 0x0467) = 0x0F4C
PHY_SOR2 (Register 0x0468) = 0x0000
-----------------------
Set RMII mode
PHY_RCSR (Register 0x17) = 0x0041
Force RMII, set bit 5
PHY_RCSR (Register 0x17) = 0x0061
Change RXD3/GPIO3 assignment
PHY_IOCTRL1 (Register 0x0462) = 0x0001
Force RXD3/GPIO to 0x4301
PHY_IOCTRL1 (Register 0x0462) = 0x4301
Digital reset PHY
PHY_RCR (Register 0x1F) = 0x4000
wait for reset to clear
PHY_RCR (Register 0x1F) = 0x0000
Power up PHY
PHY_MBCR (Register 0x00) = 0x3800
PHY_MBCR (Register 0x00) = 0x3000
Final values
-----------------------
PHY_MBCR (Register 0x00) = 0x3000
PHY_BMSR (Register 0x01) = 0x7849
PHY_IDR1 (Register 0x02) = 0x2000 should be 0x2000
PHY_IDR2 (Register 0x03) = 0xA240 should be 0xA240
PHY_ANAR (Register 0x04) = 0x00A1
PHY_CR1 (Register 0x09) = 0x0000
PHY_CR2 (Register 0x0A) = 0x0100
PHY_CR3 (Register 0x0B) = 0x1000
PHY_STS (Register 0x10) = 0x0002
PHY_SCR (Register 0x11) = 0x0108
PHY_MISR1 (Register 0x12) = 0x0000
PHY_MISR1 (Register 0x13) = 0x0000
PHY_RCSR (Register 0x17) = 0x0061
PHY_CR (Register 0x19) = 0x8001
PHY_IOCTRL1 (Register 0x0462) = 0x4301
PHY_IOCTRL2 (Register 0x0463) = 0x0000
PHY_SOR1 (Register 0x0467) = 0x0F4C
PHY_SOR2 (Register 0x0468) = 0x0000
-----------------------
Initialise PHY complete