Other Parts Discussed in Thread: DP83822I,
Hi,
I use AM3352 along with DP83822I on my custom board.
The ETH uses an RMII in master mode.
To configure DP83822I I have to set registers via MDIO
mii write 1 0d 1f
mii write 1 0e 462
mii write 1 0d 401f
mii write 1 0e 4300
mii write 1 17 61
mii write 1 1f 4000
I've modified the ft_board_setup function as follows:
int ft_board_setup(void *fdt, bd_t *bd) {
(...)
devname = miiphy_get_current_dev();
// configure RMII Master mode
// write 0x4300 to 0x462 extended register
miiphy_write(devname, 0x1, 0x0d, 0x1f);
miiphy_write(devname, 0x1, 0x0e, 0x462);
miiphy_write(devname, 0x1, 0x0d, 0x401f);
miiphy_write(devname, 0x1, 0x0e, 0x4300);
// write 0x61 to 0x17 register
miiphy_write(devname, 0x1, 0x17, 0x61);
// PHY reset
miiphy_write(devname, 0x1, 0x1f, 0x4000);
(...)
}
I have a configuration where I can correctly boot to Linux and use this ETH interface.
Unfortunately, I'm not able to get ETH working correctly in u-boot.
This particular function is invoked, when the board boots to Linux. Therefore, I don't have ETH configured when I boot to U-boot.
If I set registers manually in U-boot, ETH starts working correctly.
Question:
Where is the right place to configure ETH registers to be set in both u-boot and Linux?
Where can I find an example of such a configuration?
In some projects, I've seen the following function:
int board_eth_init(bd_t *bis){}
but it seems not working in TI's file structure.
Regards
Adam