[U-Boot] [PATCH 17/19] serial: Support an early UART for debugging

Simon Glass sjg at chromium.org
Wed Dec 17 05:46:53 CET 2014


Hi Masahiro,

On 15 December 2014 at 21:38, Masahiro Yamada <yamada.m at jp.panasonic.com> wrote:
> Hi Simon,
>
>
>
> On Mon, 15 Dec 2014 07:19:52 -0700
> Simon Glass <sjg at chromium.org> wrote:
>
>> This came up in a discussion on the mailing list here:
>>
>> https://patchwork.ozlabs.org/patch/384613/
>>
>> My concerns at the time were:
>> - it doesn't need to be written in assembler
>
> Assembler can guarantee that stack is not used.

So can C if written correctly, at least on PowerPC, ARM and a few other archs.

>
>
>> - it doesn't need to be ARM-specific
>
> OK.
>
>> This patch provides a possible alternative. It works by allowing any serial
>> driver to export one init function and provide a putc() function. These
>> can be used to output debug data before the real serial driver is available.
>>
>> This implementation does not depend on driver model,
>
> OK.
>
>> and it is possible for
>> it to operate without a stack on some architectures (e.g. PowerPC, ARM).
>
> It depends on the optimization option -O2 / -Os.

OK, fair enough.

>
> In 18/19, you add "static inline" to calc_divisor().
>
> "static inline" does not force-inline the code,
> but still leaves it to the compiler decision.
> (Marek Vasut also mentioned this in commit 4425e62856)

Sure, I understand.

For me this implementation works on ARM and PowerPC, and can be
applied for any UART in U-Boot. We don't need to write assembler in
each UART for each architecture we support. That's my point.

I'm not suggesting we drop the assembler version, just that we have
another option. Of course if a particular UART driver wants to include
assembler it can.

Regards,
Simon


More information about the U-Boot mailing list