[U-Boot] [PATCH] spi: Tegra2: Seaboard: fix UART corruption during SPI transactions

Simon Glass sjg at chromium.org
Sat May 12 02:16:44 CEST 2012


Hi Tom,

On Fri, May 11, 2012 at 1:14 PM, jimmzhang <jimmzhang at nvidia.com> wrote:

> On Wed, 2012-05-09 at 10:34 -0700, Tom Warren wrote:
> > Simon Glass's proposal to fix this on Seaboard was NAK'd, so I
> > removed his NS16550 references and added a small delay before
> > SPI/UART muxing. Tested on my Seaboard with large SPI reads/writes
> > and saw no corruption (crc's matched) and no spurious comm chars.\
>

I'm afraid this version does not work fully for me. The problem is I think
that the UART gets zero bytes in it from when the SPI was active. This
causes the next command to be ignored. So for example:

Tegra2 (SeaBoard) # echo fred
fred
Tegra2 (SeaBoard) # echo edmund
edmund
Tegra2 (SeaBoard) # saveenv
Saving Environment to SPI Flash...
Erasing SPI flash...Writing to SPI flash...done
Tegra2 (SeaBoard) # echo blackadder

^^^^ this command does nothing!

Tegra2 (SeaBoard) # echo blackadder
blackadder
Tegra2 (SeaBoard) #

This is the reason why my original patch cleaned out the UART before
reading further characters. If that logic really in impossible to have in
U-Boot then the only option is (after a SPI operation) to read UART output
using tstc() and getc() until there is nothing more. Ick.

That said, this is an improvement, since it allows SPI to work. So I am
going to ack it so we can hopefully get it in there.

Acked-by: Simon Glass <sjg at chromium.org>



> >
> > Signed-off-by: Tom Warren <twarren at nvidia.com>
>
> Tested-by: Jimmy Zhang <jimmzhang at nvidia.com>
>
>
>
>
> -----------------------------------------------------------------------------------
> This email message is for the sole use of the intended recipient(s) and
> may contain
> confidential information.  Any unauthorized review, use, disclosure or
> distribution
> is prohibited.  If you are not the intended recipient, please contact the
> sender by
> reply email and destroy all copies of the original message.
>
> -----------------------------------------------------------------------------------
>

Regards,
Simon


More information about the U-Boot mailing list