[U-Boot] [PATCH v2 1/4] ns16550: Add function to drain serial output

Simon Glass sjg at chromium.org
Sat Mar 10 20:27:44 CET 2012


Hi Wolfgang,

On Sat, Mar 10, 2012 at 12:19 AM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Simon Glass,
>
> In message <1331325178-14634-1-git-send-email-sjg at chromium.org> you wrote:
>> Sometimes we want to be sure that the output FIFO has fully drained (e.g.
>> because we are about to reset or the port or reset the board). Add a
>
> Seems there is one unintentional "or".

Yes, will fix.

>
>> function for this.
>>
>> Signed-off-by: Simon Glass <sjg at chromium.org>
>> ---
>> Changes in v2:
>> - Add function to drain the ns16550's FIFO
>>
>>  drivers/serial/ns16550.c |   11 +++++++++++
>>  include/ns16550.h        |    3 +++
>>  2 files changed, 14 insertions(+), 0 deletions(-)
>
> I dislike this.  This is mostly dead code, enabled for eveybody where
> it just increases the memory footprint for no use.
>
> Also I do not understand why it would be needed at all.  We did not
> have such a requirement for any system before, so I feel you must be
> doing something wrong, or at least very exotic.

I put a fully explanation in the previous patch. Let me just add here
that I see a 100ms delay in the reset code to allow serial output to
flush, so there is at least in practice a need for this sort of thing.
For most archs the extra code will be removed by the linker.

You may also recall a discussion about a platform where the SPI flash
and console uart were muxed, and we had to flush the console uart
before switching to SPI. I feel that draining the FIFO could/should be
a useful function.

Regards,
Simon

>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> Extreme feminine beauty is always disturbing.
>        -- Spock, "The Cloud Minders", stardate 5818.4


More information about the U-Boot mailing list