From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [RFC PATCH] ARM: layerscape: zero-index DEBUG_LAYERSCAPE_UART_PORT
Date: Fri, 27 Sep 2019 08:50:01 +0200 [thread overview]
Message-ID: <20190927065001.hhnlvojb7bqb7rt4@pengutronix.de> (raw)
In-Reply-To: <20190923161508.9163-1-a.fatoum@pengutronix.de>
On Mon, Sep 23, 2019 at 06:15:08PM +0200, Ahmad Fatoum wrote:
> The layerscape features four UART ports termed UART{1-4} in the
> reference manual.
> In the upstream device tree they have the phandles &duart{0-3}.
>
> Currently, barebox follows the numbering used in the reference manual
> for the DEBUG_LL port, because that's what the <soc/fsl/immap_lsch2.h>
> header does as well.
>
> It's arguable however that the DEBUG_LL port should be 0-indexed,
> because users are most likely to look in the board device tree for the
> chosen stdout-path and that one's phandle is zero-indexed.
>
> One notable example of a target with one-indexed DEBUG_LL port is the
> i.MX, but there the uart port phandles are one-indexed, so there's no
> discrepancy between DEBUG_LL and /chosen/stdout-path like it's the
> case with the Layerscape.
>
> Fix the discrepancy by zero-indexing the layerscape UART.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> I guess it can be argued that either way is the correct one.
Indeed ;)
> But I'd say from the viewpoint of a barebox developer, changing it to
> zero indexed makes the most sense.
If you could argue that it was inconsistent before and you make it
consistent now, then I would say go for it. Unfortunately it's
inconsistent now and still inconsistent with your patch, so changing
it IMO doesn't improve anything.
> help
> Select the UART port number used for early debugging here. Port
> - numbers start counting from 1.
> + numbers start counting from 0.
Actually I don't care much, so I may be convinced. What I do care about
though is that it's documented, and fortunately in this case it is ;)
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2019-09-27 6:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-23 16:15 Ahmad Fatoum
2019-09-27 6:50 ` Sascha Hauer [this message]
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=20190927065001.hhnlvojb7bqb7rt4@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.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