From: Thierry Reding <thierry.reding@gmail.com>
To: Rob Herring <robh@kernel.org>
Cc: Jon Hunter <jonathanh@nvidia.com>,
devicetree@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH 2/3] dt-bindings: serial: tegra-tcu: Document "reg" property
Date: Mon, 29 Mar 2021 09:23:59 +0200 [thread overview]
Message-ID: <YGGAj0ClZejBN/gy@orome.fritz.box> (raw)
In-Reply-To: <20210327184925.GA367052@robh.at.kernel.org>
[-- Attachment #1: Type: text/plain, Size: 2788 bytes --]
On Sat, Mar 27, 2021 at 12:49:25PM -0600, Rob Herring wrote:
> On Fri, Mar 26, 2021 at 06:46:40PM +0100, Thierry Reding wrote:
> > From: Thierry Reding <treding@nvidia.com>
> >
> > In order to support early console support with the Tegra TCU, add an
> > optional "reg" property that points to the TX mailbox.
>
> This will mean the same address in in DT twice which we try to avoid,
> right? I guess it's fine, we could drop it if we ever enforce that. I'm
> sure there's worse abuses with duplicates than this.
It doesn't end up being the exact same address, but it'll be an address
that is part of the I/O memory region defined by the HSP block that
provides the mailbox. In practice this isn't going to cause a problem
because by the time the mailbox address is being used, the early console
will have been replaced by the proper TCU console. But yeah, I'm not
particularly thrilled by this, either.
I had spent a bit of time trying to code up a setup function that would
parse the necessary information from DT, but this unfortunately required
a bunch of ->setup() callbacks to be changed because we don't currently
pass in the FDT node offset, which we'd need in order for this to work.
An additional negative side-effect is that we'd need to duplicate a
bunch of logic to determine the offset to add onto the HSP base address
and that's something that depends on the particular configuration of the
HSP instance, which means lots of hard-coded conditionals.
All of that added up and at some point this slight abuse seemed like the
lesser evil.
> > Signed-off-by: Thierry Reding <treding@nvidia.com>
> > ---
> > .../devicetree/bindings/serial/nvidia,tegra194-tcu.yaml | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/serial/nvidia,tegra194-tcu.yaml b/Documentation/devicetree/bindings/serial/nvidia,tegra194-tcu.yaml
> > index 0a321658ccb5..8c9ed7cfaa52 100644
> > --- a/Documentation/devicetree/bindings/serial/nvidia,tegra194-tcu.yaml
> > +++ b/Documentation/devicetree/bindings/serial/nvidia,tegra194-tcu.yaml
> > @@ -24,6 +24,9 @@ properties:
> > compatible:
> > const: nvidia,tegra194-tcu
> >
> > + reg:
> > + maxItems: 1
> > +
> > mbox-names:
> > items:
> > - const: rx
> > @@ -48,8 +51,9 @@ examples:
> > - |
> > #include <dt-bindings/mailbox/tegra186-hsp.h>
> >
> > - tcu: tcu {
> > + tcu: tcu@c168000 {
>
> While you're here:
>
> serial@...
Okay, will do. It's not a very traditional serial port, so that might
perhaps be confusing, but we're using it like a serial port, so for all
intents and purposes this really is a serial port, so renaming makes
sense, I think.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-03-29 7:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-26 17:46 [PATCH 0/3] arm64: tegra: Add earlycon support on Tegra194 Thierry Reding
2021-03-26 17:46 ` [PATCH 1/3] dt-bindings: serial: tegra-tcu: Convert to json-schema Thierry Reding
2021-03-27 18:41 ` Rob Herring
2021-03-26 17:46 ` [PATCH 2/3] dt-bindings: serial: tegra-tcu: Document "reg" property Thierry Reding
2021-03-27 18:49 ` Rob Herring
2021-03-29 7:23 ` Thierry Reding [this message]
2021-03-29 7:26 ` Thierry Reding
2021-03-26 17:46 ` [PATCH 3/3] arm64: tegra: Add "reg" property for TCU on Tegra194 Thierry Reding
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=YGGAj0ClZejBN/gy@orome.fritz.box \
--to=thierry.reding@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=jonathanh@nvidia.com \
--cc=linux-tegra@vger.kernel.org \
--cc=robh@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).