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.

PROCESSOR-SDK-AM335X: U-Boot: Need to set CONFIG_NETCONSOLE_BUFFER_SIZE < 281

Part Number: PROCESSOR-SDK-AM335X

We use netconsole to access the U-Boot console. When using the default CONFIG_NETCONSOLE_BUFFER_SIZE of 512, we get missing characters in TX direction for long prints, e.g. using "printenv" command. The problem is gone when we set CONFIG_NETCONSOLE_BUFFER_SIZE to a value smaller than 281.

Why is this change necessary?

We use https://git.ti.com/cgit/ti-u-boot/ti-u-boot/commit/?h=ti-u-boot-2019.01&id=1c82bfdc413edc72bb79b08827e194bc064c4ef6

  • Appying the following change also fixes the garbled netconsole output:

    diff --git a/drivers/net/ti/cpsw.c b/drivers/net/ti/cpsw.c
    index a25a07af94..050f8e6441 100644
    --- a/drivers/net/ti/cpsw.c
    +++ b/drivers/net/ti/cpsw.c
    @@ -793,7 +793,7 @@ static void _cpsw_halt(struct cpsw_priv *priv)
     
     static int _cpsw_send(struct cpsw_priv *priv, void *packet, int length)
     {
    -       int timeout;
    +       int timeout, ret;
     
            flush_dcache_range((unsigned long)packet,
                               (unsigned long)packet + ALIGN(length, PKTALIGN));
    @@ -804,7 +804,10 @@ static int _cpsw_send(struct cpsw_priv *priv, void *packet, int length)
                    return -ETIMEDOUT;
            }
     
    -       return cpdma_submit(priv, &priv->tx_chan, packet, length);
    +       ret = cpdma_submit(priv, &priv->tx_chan, packet, length);
    +       udelay(2000);
    +
    +       return ret;
     }
     
     static int _cpsw_recv(struct cpsw_priv *priv, uchar **pkt)

  • Hi Christoph,

    the fact that you can make it work by simply adding a delay into the TX path sounds like something isn't quite working with the handshake mechanism somewhere along the path the data is flowing. The networking drivers are heavily exercised and I'd be surprised if a simple console output would overwhelm them, so perhaps the issue is somewhere higher up the stack.

    As another data point, can you please try the current upstream U-Boot "master" branch to see if you can re-create this issue there? AM335x is pretty much fully supported. You can get the code from here: https://gitlab.denx.de/u-boot/u-boot  This will be a good data point to decide whether we need to investigate this further as an issue or we can possibly resolve it with doing some selective back-porting of patches.

    Regards, Andreas

  • Hi Andreas,

    we are working on a custom design with a lot of changes on top of the U-Boot version I mentioned. Would it be possible to test netconsole on your side with the latest U-Boot?

    Best regards,

    Christoph

  • Christoph Kloecker said:
    we are working on a custom design with a lot of changes on top of the U-Boot version I mentioned. Would it be possible to test netconsole on your side with the latest U-Boot?

    Understood about the challenges here. Let me see if I can re-create and have a closer look at this, but I won't be able to do that until early next week.

    Regards, Andreas

  • Christoph,

    I just got a chance to experiment with this feature a bit, and I can also see corruption in the net console output when printing large texts such as the environment. This happens with both the U-Boot 2019.01 version that is part of our current SDK, as well as with today's upstream HEAD commit. Tested using a BeagleBone black and using the U-Boot included console tool on the host side.

    For now I'd suggest you use the workaround you found by decreasing CONFIG_NETCONSOLE_BUFFER_SIZE. I'm going to file this as an issue in our internal tracker for us to circle back to and look at closer but this is not something that can happen right away (it is also not an officially supported/regression tested feature of our SDK atm).

    Regards, Andreas