From: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] debug uart: don't print before initialization
Date: Wed, 10 Oct 2018 15:28:07 +0200 [thread overview]
Message-ID: <fa7d01d3-d433-60ca-dc14-028e572b4afc@gmail.com> (raw)
In-Reply-To: <CAAh8qsyOR9x2rE4aeUsDmuvUZ3gH2cgo45aR1H25CHvtpdZ-Ow@mail.gmail.com>
+ Marek (as he commented on the original patch
http://patchwork.ozlabs.org/patch/955765/)
On 09.10.2018 07:06, Simon Goldschmidt wrote:
> On Tue, Oct 9, 2018 at 5:41 AM Simon Glass <sjg@chromium.org> wrote:
>> Hi,
>>
>> On 7 October 2018 at 11:52, Simon Goldschmidt
>> <simon.k.r.goldschmidt@gmail.com> wrote:
>>> At least on socfpga gen5, _debug_uart_putc() can be called
>>> before debug_uart_init(), which leaves us stuck in an
>>> infinite loop in the ns16550 debug uart driver.
>> Can you fix that? That is a bug.
> I already posted a patch for that but it was rejected:
> http://patchwork.ozlabs.org/patch/955765/
I'd have to add I still thing that that patch is good to fix this:
It checks that the baudrate divisor is set, which effectively is
an 'enable' bit for this hardware.
There were comments about the style (we can talk about that)
and Marek rejected it because he wanted a generic solution.
But honestly, given your idea that some platforms init the debug
uart before setting up gd, I don't think I can find a solution for
this.
So I'd really like to get my original patch applied (see above).
Simon
>
> As patman automatically choses the CC addresses, you weren't
> on the CC list back then, since that patch covered different filfes.
>
>
> Simon
>
>>> Since this prevents debugging startup problems instead
>>> of helping, let's add a field to 'gd' that prevents
>>> calling the _debug_uart_putc() until debug_uart_init()
>>> has been called.
>>>
>>> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
>>> ---
>>>
>>> include/asm-generic/global_data.h | 3 +++
>>> include/debug_uart.h | 19 ++++++++++++++-----
>>> 2 files changed, 17 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
>>> index c83fc01b76..9de7f48476 100644
>>> --- a/include/asm-generic/global_data.h
>>> +++ b/include/asm-generic/global_data.h
>>> @@ -122,6 +122,9 @@ typedef struct global_data {
>>> struct list_head log_head; /* List of struct log_device */
>>> int log_fmt; /* Mask containing log format info */
>>> #endif
>>> +#ifdef CONFIG_DEBUG_UART
>>> + int debug_uart_initialized; /* No print before debug_uart_init */
>>> +#endif
>> There is no requirement that gd be set up before the debug UART is
>> running. It certainly isn't on the few platforms I know about.
>>
>> Regards,
>> Simon
next prev parent reply other threads:[~2018-10-10 13:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-07 17:52 [U-Boot] [PATCH] debug uart: don't print before initialization Simon Goldschmidt
2018-10-09 3:40 ` Simon Glass
2018-10-09 5:06 ` Simon Goldschmidt
2018-10-10 13:28 ` Simon Goldschmidt [this message]
2018-10-10 20:03 ` Simon Glass
2018-10-10 20:16 ` Simon Goldschmidt
2018-10-17 20:02 ` Simon Goldschmidt
2018-10-19 3:25 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fa7d01d3-d433-60ca-dc14-028e572b4afc@gmail.com \
--to=simon.k.r.goldschmidt@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox