Initializing 88E1111S was a big problem for me, since I could not get the detailed datasheet/user's manual for the same. Once I got the handle it was a simple matter. So, let me explain the steps. This procedure is for 88E1111S with ID of 0x01410cc (88E1111-BAB1 is written on the chip).
Register | Address |
#define MIIM_CONTROL | 0x00 |
#define MIIM_STATUS | 0x01 |
#define MIIM_ANAR | 0x04 |
#define MIIM_GBIT_CONTROL | 0x09 |
The initialization code is as follows:
/* Reset the chip */
write_phy_reg(MIIM_CONTROL, 0x9140);
/* Wait for Reset over */
while(read_phy_reg(MIIM_CONTROL) & 0x8000);
/* Marvel 88E1111S sequence */
write_phy_reg(0x1d, 0x1f);
write_phy_reg(0x1e, 0x200c);
write_phy_reg(0x1d, 0x05);
write_phy_reg(0x1e, 0x0);
write_phy_reg(0x1e, 0x100);
/* Enable the 88e1111 internal RX/TX clock delay */
write_phy_reg(0x14, 0x0cd2);
/* Set the Gigabit control register and
Autonegotiation Advertisement register */
write_phy_reg(MIIM_GBIT_CONTROL, 0xe00);
write_phy_reg(MIIM_ANAR, 0x1e1);
/* Reset Again */
write_phy_reg(MIIM_CONTROL, 0x9140);
/* Check for the link to come up */
while((status = read_phy_reg(MIIM_CONTROL)) & 0x0004);
/* Now, initialization is over. You can parse the status Register to know the Speed and Duplex */
Ping me if you still have problem.
1 comment:
http://lazarenko.me/posts/10/
Post a Comment