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.

Sitara Linux SDK7.0 AM335x Uboot ethernet not working

Other Parts Discussed in Thread: AM3359

Hello,

I am working on a custom board with AM3359, eMMC and KSZ9021 PHY. Beacuse I have no source to boot my board (eMMC is empty) I am running uboot-spl and uboot via JTAG to start uboot and boot the board from ethernet. I am using the latest (at this moment) TI Linux SDK 7.00.00.00 and u-boot-2013.10-ti2013.12.01.

I was able to run that PHY on my board under StarterWare, which I used for trimming skew parameters of PHY and to test communication. The register skew values I found are written (and checked) to PHY in function board_eth_init(bd_t *bis) in /board/ti/am335x/board.c .

The problem is that under u-boot ethernet does not work, I compiled U-boot with debug and I receive messages:

U-Boot# dhcp
Trying cpsw
link up on port 0, speed 100, full duplex
BOOTP broadcast 1
DHCPHandler: got packet: (src=59787, dst=1900, len=133) state: 3
Filtering pkt = -1
DHCPHandler: got packet: (src=59786, dst=1900, len=133) state: 3
Filtering pkt = -1
DHCPHandler: got packet: (src=5353, dst=5353, len=95) state: 3
Filtering pkt = -1
DHCPHandler: got packet: (src=5353, dst=5353, len=95) state: 3
Filtering pkt = -1
DHCPHandler: got packet: (src=5353, dst=5353, len=409) state: 3
Filtering pkt = -1
DHCPHandler: got packet: (src=5353, dst=5353, len=95) state: 3
Filtering pkt = -1
DHCPHandler: got packet: (src=5353, dst=5353, len=95) state: 3
Filtering pkt = -1
BOOTP broadcast 2
DHCPHandler: got packet: (src=59787, dst=1900, len=133) state: 3
Filtering pkt = -1
DHCPHandler: got packet: (src=59786, dst=1900, len=133) state: 3
Filtering pkt = -1

after 10 tries I see the following messages:

Retry count exceeded; starting again
Initial value for argc=3
Final value for argc=3
Trying usb_ether
<== devctl 80
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC c4:ed:ba:7b:ea:2e
HOST MAC de:ad:be:af:00:00
rndis_register: configNr = 0
rndis_set_param_dev: configNr = 0
rndis_set_param_vendor: configNr = 0
rndis_set_param_medium: configNr = 0, 0 0
RNDIS ready
gadget D+ pullup on
ERROR: The remote end did not respond in time.
at ether.c:2388/usb_eth_init()
FAIL
Initial value for argc=3
Final value for argc=3
Trying cpsw
link up on port 0, speed 100, full duplex
BOOTP broadcast 1
DHCPHandler: got packet: (src=61449, dst=1900, len=133) state: 3
Filtering pkt = -1

The problem is that I can't see any signals, either rx or tx, on RGMII bus, while RX_CLK=25MHz, TX_CLK=10MHz.

Any hint, please?

Best Regards,

Kamil

  • Hi Kamil,

    Please follow the procedure described here: http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User's_Guide#CPSW_Ethernet_2

    Your SYSBOOT pins must be configured for EMAC boot.

  • So far I had option SYSBOOT[4:0] = 11001b -> Boot Sequence: SPI0, MMC0, EMAC1, UART0.

    I changed it accoriding to Your suggestion to SYSBOOT[4:0] = 01001b -> Boot Sequence: EMAC1, XIP, NAND,MMC0

    This is slightly different than mode suggested  in http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User's_Guide#CPSW_Ethernet_2 but I am not sure if this could be a problem but for me changing to this mode is just changing one resistor (I do not have onboard switches). Unfortunately switching to this mode did not help. 

    As I understood your hint in this way some rom eth configuration procedures are executed before u-boot is started? Could You explain this a bit more? Is there any way to find out if these procedures were truly executed via jtag?

  • You don't need JTAG at all. You can boot directly from Ethernet. Besides the wiki above see the AM335X Technical Reference Manual Rev. J, section 26.1.8.4.

  • I am afraid that booting my board using just the rom procedures will not work, because my PHY must be set to certaind skew values to talk with am335x - this I ensure in uboot-spl. Am I right?

    Anyway, I tried to boot and listen for bootp packets (according to 26.1.8.4 of TRM) but nothing happened - there are no packets detected outside of the board, however the data on TX and RX RGMII are present - I did not check it correctly last time. I am still investigating.

  • Isn't is matter of different TX and RX clocks. While output clock from PHY has proper frequency: 125MHz (1Gb), 25MHz (100Mb) the TX clock from am335x has 50MHz (1Gb) and 10MHz (100Mb) - so exactly 2.5 times lower. I am using AM3359-720MHz and 25MHz crystal (am335x_evm.h was modified to use 25MHz instead of default 24MHz) - can problem be caused by wrong frequency setting in PLL?

  • Finally I found the solution. The reason was failed I2C connection to voltage controller TPS. UBoot-spl during board initialization in function am3xx_spl_board_init(void) is trying to find TPS to properly setup PLL and voltages. When this fails the function exits without notification. PLL is then in its default state and EMAC clock is wrong. This was the reason why uboot was able to receive packets (correct RXCLK) but unable to send bootp (incorrect TXCLK).