devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ondřej Jirman" <megi@xff.cz>
To: Javier Martinez Canillas <javierm@redhat.com>
Cc: "Heiko Stübner" <heiko@sntech.de>,
	linux-kernel@vger.kernel.org,
	"Peter Robinson" <pbrobinson@gmail.com>,
	"Caleb Connolly" <kc@postmarketos.org>,
	"Jarrah Gosbell" <kernel@undef.tools>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Martijn Braam" <martijn@brixit.nl>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Tom Fitzhenry" <tom@tom-fitzhenry.me.uk>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org
Subject: Re: [PATCH] arm64: dts: rockchip: Change serial baud rate for Pinephone Pro to 1.5 MB
Date: Tue, 4 Apr 2023 17:40:17 +0200	[thread overview]
Message-ID: <20230404154017.7n6rcgqyv3edfahd@core> (raw)
In-Reply-To: <87r0szd9q2.fsf@minerva.mail-host-address-is-not-set>

On Tue, Apr 04, 2023 at 04:04:53PM +0200, Javier Martinez Canillas wrote:
> Ondřej Jirman <megi@xff.cz> writes:
> 
> > On Tue, Apr 04, 2023 at 09:51:11AM +0200, Heiko Stübner wrote:
> >> Hi,
> >> 
> >> Am Montag, 3. April 2023, 19:59:37 CEST schrieb Javier Martinez Canillas:
> >> > This baud rate is set for the device by mainline u-boot and is also what
> >> > is set in the Pinebook Pro Device Tree, which is a device similar to the
> >> > PinePhone Pro but with a different form factor.
> >> > 
> >> > Otherwise, the baud rate of the firmware and Linux don't match by default
> >> > and a 'console=ttyS2,1500000n8' kernel command line parameter is required
> >> > to have proper output for both.
> >> 
> >> The interesting question is always if this will break someone else's setup.
> >> I've never really understood the strange setting of 1.5MBps, but on the
> >> other hand it _is_ a reality on most boards.
> >
> > Normal users of the phone probably run with UART console disabled, because
> > UART is muxed with audio jack output and to enable it they have to add
> > console=ttyS2 to the kernel command line and flip a physical switch inside
> > the phone.
> >
> > Fortunately, not sepcifying stdout-path baud rate in the options part
> > of the string, will make the serial driver probe for the baud rate from
> > the previous boot stage and make the user happy by keeping whatever was
> > already set in the bootloader.
> >
> 
> As mentioned in the first email of this thread, I tried that but it didn't
> work for me. Either using stdout-path = "serial2"; or stdout-path = &uart2;
> gives me no serial output with console=ttyS2, I needed to specify the baud
> rate explicitly (i.e: console=ttyS2,1500000n8).
> 
> >   https://elixir.bootlin.com/linux/latest/source/drivers/tty/serial/8250/8250_port.c#L3496
> >
> 
> Is that helper really used by the serial driver in the PinePhone Pro?
> (drivers/tty/serial/8250/8250_dw.c), I was meaning to dig why just ttyS2
> was not working but decided that could be a follow-up patch.

It's called by univ8250_console_setup in 8250_core.c But looking at it again,
this may only be used to match console=uart.

  https://elixir.bootlin.com/linux/latest/source/drivers/tty/serial/8250/8250_core.c#L638

Bummer.

> Since chaging to 1.5 MBps seemed to have merits on its own, decided to
> post this patch anyways in the meantime.
> 
> > So we can make the kernel just keep the baudrate setup from the previous
> > boot stage by:
> >
> > 	stdout-path = "serial2";
> >
> 
> Did it work for you? Maybe I'm doing something silly but as mentioned it
> didn't work for me with upstream u-boot.

I was just eyeballing the code. I didn't test it.

kind regards,
	o.

> > regards,
> > 	o.
> >
> 
> -- 
> Best regards,
> 
> Javier Martinez Canillas
> Core Platforms
> Red Hat
> 

  reply	other threads:[~2023-04-04 15:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03 17:59 [PATCH] arm64: dts: rockchip: Change serial baud rate for Pinephone Pro to 1.5 MB Javier Martinez Canillas
2023-04-04  7:51 ` Heiko Stübner
2023-04-04  8:08   ` Javier Martinez Canillas
2023-04-04  8:13   ` Jarrah
2023-04-04  8:18     ` Peter Robinson
2023-04-04  8:25       ` Javier Martinez Canillas
2023-04-04  8:24     ` Javier Martinez Canillas
2023-04-04  8:38       ` Peter Robinson
2023-04-04  8:46         ` Javier Martinez Canillas
2023-04-04 11:31   ` Martijn Braam
2023-04-04 11:42     ` Javier Martinez Canillas
2023-04-04 12:02       ` Ondřej Jirman
2023-04-04 12:36   ` Ondřej Jirman
2023-04-04 14:04     ` Javier Martinez Canillas
2023-04-04 15:40       ` Ondřej Jirman [this message]
2023-04-04 12:52   ` Peter Geis
2023-04-04 16:55     ` Heiko Stübner
2023-04-18 12:11       ` Javier Martinez Canillas
2023-04-18 14:26         ` Heiko Stübner
2023-07-21 23:06           ` Javier Martinez Canillas
2023-07-28 18:59             ` Heiko Stuebner
2023-07-28 19:55               ` Maya Matuszczyk
2023-07-28 23:05                 ` Javier Martinez Canillas
2023-07-28 20:10               ` Ondřej Jirman

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=20230404154017.7n6rcgqyv3edfahd@core \
    --to=megi@xff.cz \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=javierm@redhat.com \
    --cc=kc@postmarketos.org \
    --cc=kernel@undef.tools \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=martijn@brixit.nl \
    --cc=pbrobinson@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=tom@tom-fitzhenry.me.uk \
    /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).