This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3352: ETH registers configuration in U-boot

Part Number: AM3352
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

  • Hi,

    Which TI SDK are you using?

    To answer your question about configuring ETH registers for both u-boot and Linux are or should independent of each other. U-Boot concerning peripheral setup is intended to be stateless meaning that once u-boot is consumed by Linux will reconfigure the ethernet interface.  Please note there are some things concerning state that is inherited by Linux such as power, some clocks and DDR settings.

    Best Regards,

    Schuyler

  • Hi,

    Schuyler Patton said:
    Which TI SDK are you using?


    I use the AM335x Linux SDK - 06_03_00_106.

    Schuyler Patton said:
    U-Boot concerning peripheral setup is intended to be stateless meaning that once u-boot is consumed by Linux will reconfigure the ethernet interface.

    There is the /board/{company}{board}/board.c file, in which we do the whole board porting.
    Which functions do I have to expand (or add) to configure ETH (DP83822I) registers?
    The goal is to properly configure ETH on both U-boot and Linux.

    I've already found that if I expand the int ft_board_setup(void *fdt, bd_t *bd) function, as shown in the original post, I get ETH working in Linux but not in U-boot.

    The PIN muxing and other .dts configurations are correct because I can easily get ETH working properly in U-boot by configuring its registers manually, using "mii write" command.
    Regards
    Adam
  • Hi,

    Can anyone help with this issue?

    Regards
    Adam