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.

DM368 stuck/hang when accessing NAND flash after dhcp

Some devices get stuck/hang when we access NAND flash after we have run dhcp (in u-boot).

Commands:
UBOOT> dhcp
UBOOT> nand erase clean
<stuck/hang>

We debug and found out it has something with Ethernet RX teardown.

Register commands:
#Teardown RX Ethernet (sequence from dhcp command)
UBOOT> mw.l 01d07018 0
UBOOT> md.l 01d07660 1
01d07660: fffffffc
UBOOT> mw.l 01d07660 fffffffc
UBOOT> mw.l 01d07660 0
# Access EMIF (NAND Flash)
UBOOT> md.b 04000010 1
04000010:
<stuck/hang, no chip select>

  • Hi Tore,

    We are having the same issue, I have found that there are a few people with the same issue but have not found a solution yet...

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/t/93682

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/p/240361/969398#969398

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/t/280955
  • Solution may be to only run Ethernet RX teardown, when receiver is enabled.
    This worked on two of my Device, which previously always failed.

    diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
    index 4134a96..2400588 100644
    --- a/drivers/net/davinci_emac.c
    +++ b/drivers/net/davinci_emac.c
    @@ -590,8 +590,12 @@ static void davinci_eth_close(struct eth_device *dev)
    {
    debug_emac("+ emac_close\n");

    - davinci_eth_ch_teardown(EMAC_CH_TX); /* TX Channel teardown */
    - davinci_eth_ch_teardown(EMAC_CH_RX); /* RX Channel teardown */
    + /* TX Channel teardown only when enabled */
    + if (readl(&adap_emac->TXCONTROL) & 0x1)
    + davinci_eth_ch_teardown(EMAC_CH_TX);
    + /* RX Channel teardown only when enabled */
    + if (readl(&adap_emac->RXCONTROL) & 0x1)
    + davinci_eth_ch_teardown(EMAC_CH_RX);

    /* Reset EMAC module and disable interrupts in wrapper */
    writel(1, &adap_emac->SOFTRESET);
  • Hi Tore,

    This solutions seems to be working on our boards as well. Thank you.

    Pierre