From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] ns16550: tegra: Specify debugging serial port at boot.
Date: Thu, 08 Mar 2012 14:43:49 -0700 [thread overview]
Message-ID: <4F592815.9000006@wwwdotorg.org> (raw)
In-Reply-To: <20120308212957.DE1CC202D69@gemini.denx.de>
On 03/08/2012 02:29 PM, Wolfgang Denk wrote:
> Dear Stephen,
>
> In message <4F590B25.8090503@wwwdotorg.org> you wrote:
>>
>>> I don't like to see such highly architecture specific stuff in common
>>> code, especially if it's such a dirty hack like this.
>>
>> Are there any hooks where we can do the same thing in SoC-specific code?
>
> Not without additional trickery, but I think this is actually a good
> thing.
>
> The method implemented here is but a dirty hack, and should not be
> used.
>
>> The point of this information is to enable the kernel's earlyprintk
>> support, which runs well before the device tree, or other mechanisms,
>> are available.
>
> Sorry, but I don't buy that this is the only possible way to do that.
> Or how comes only tegra2 would need that, while all other SoCs and
> architectures can do without it?
First, OMAP does something very similar; the kernel low-level debug code
looks at UART1's scratch pad register, and derives which UART to use
based on the value stored there. If none of the expected values is
found, it appears to default to UART1.
On Tegra, the UART registers can't be read unless the UART is clocked
and not in reset. So, the Tegra code looks at each UART in the system,
and finds one that's in that state. To cater for the scenario where
multiple UARTs are clocked-and-not-reset, the code also checks whether
the UART scratch register contains 'D' ("D"ebug) so it's sure it picked
the correct one.
So, at leasst OMAP has set precedent here. There may be others; I didn't
check.
Some other SoCs may have only 1 UART and not need to auto-select.
Some other SoCs with multiple UARTs may designate a single specific UART
as the debug port rather than the board designer apparently randomly
picking which one to use. In either of those cases, the kernel's
low-level debug code can simply hard-code the UART address and do
without the hand-shaking.
next prev parent reply other threads:[~2012-03-08 21:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-06 22:51 [U-Boot] [PATCH] ns16550: tegra: Specify debugging serial port at boot Stephen Warren
2012-01-10 1:26 ` Doug Anderson
2012-03-08 18:08 ` [U-Boot] " Stephen Warren
2012-03-08 18:39 ` Wolfgang Denk
2012-03-08 19:40 ` Stephen Warren
2012-03-08 21:29 ` Wolfgang Denk
2012-03-08 21:43 ` Stephen Warren [this message]
2012-03-08 23:26 ` Graeme Russ
2012-03-13 20:12 ` Stephen Warren
2012-03-13 21:23 ` Graeme Russ
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=4F592815.9000006@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--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