linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Salter <msalter@redhat.com>
To: Jon Masters <jcm@redhat.com>, Duc Dang <dhdang@apm.com>
Cc: Aleksey Makarov <aleksey.makarov@linaro.org>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	linux-acpi@vger.kernel.org, linux-serial@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Russell King <linux@arm.linux.org.uk>,
	Peter Hurley <peter@hurleysoftware.com>,
	Graeme Gregory <graeme.gregory@linaro.org>,
	Len Brown <lenb@kernel.org>
Subject: Re: [PATCH] SPCR: check bit width for the 16550 UART
Date: Wed, 07 Dec 2016 10:23:19 -0500	[thread overview]
Message-ID: <1481124199.4751.50.camel@redhat.com> (raw)
In-Reply-To: <53421849-d031-77e1-9edb-53c9d673d462@redhat.com>

On Tue, 2016-12-06 at 01:34 -0500, Jon Masters wrote:
> On 12/05/2016 10:55 PM, Duc Dang wrote:
> > 
> > On Mon, Dec 5, 2016 at 6:27 PM, Jon Masters <jcm@redhat.com> wrote:
> > > 
> > > Hi Duc, all,
> > > 
> > > So after regenerating the initrd override (I must have fat fingered)
> > > it is now detecting the correct bit width on boot (attached dmesg log).
> > > 
> > > HOWEVER while the console does come up, the use of "earlycon" on the
> > > command line (with no parameters) doesn't result in the early SPCR
> > > console coming up correctly. I see some garbled characters that
> > > suggest the baud (or register access width) is off somewhere.
> > My bad that I did not catch this in the morning. Yes, earlycon does
> > not seems to work as expected. I can see that earlycon parameters
> > seems to be correct, but the bootconsole message does not come out
> > (the following is from 'dmesg')
> > 
> > [    0.000000] ACPI: SPCR: console: uart,mmio32,0x1c020000,115200
> > [    0.000000] earlycon: uart0 at MMIO32 0x000000001c020000 (options '115200')
> > [    0.000000] bootconsole [uart0] enabled
> The difference appears to be in the baud rate. When I explicitly specify
> "earlycon=uart8250,mmio32,0x1c021000" no baud is set. When booting with
> the SPCR, the baud is set to 9600 in my case or 115200 in yours. But we
> both know that the base clock on the X-Gene UART is weird. Maybe
> somehow we can explain this through the lack of setting a baud.

BTW, this behavior is same with devicetree.
If you specify a baudrate with earlycon=, the driver tries to set that
baudrate and if you have an 8250 with some non-standard baud clock, then
it will fail. Perhaps SPCR shouldn't pass baud option to setup_earlycon().
Then again, setup_earlycon() has this comment:

 *	setup_earlycon - match and register earlycon console
 *	@buf:	earlycon param string
 *
 *	Registers the earlycon console matching the earlycon specified
 *	in the param string @buf. Acceptable param strings are of the form
 *	   <name>,io|mmio|mmio32|mmio32be,<addr>,<options>
 *	   <name>,0x<addr>,<options>
 *	   <name>,<options>
 *	   <name>
 *
 *	Only for the third form does the earlycon setup() method receive the
 *	<options> string in the 'options' parameter; all other forms set
 *	the parameter to NULL.

That part about the 3rd form doesn't seem to be true. I don't see where
options gets set to NULL for forms other than the third.

> 
> I am pondering some more currently. If it's X-Gene specific, let's add
> that to the quirk (and to perhaps a more APM specific SPCR subtype).
> 
> Jon.
> 

  parent reply	other threads:[~2016-12-07 15:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05 13:05 [PATCH] SPCR: check bit width for the 16550 UART Aleksey Makarov
2016-12-05 18:51 ` Duc Dang
2016-12-05 23:27   ` Jon Masters
2016-12-05 23:52     ` Duc Dang
2016-12-06  0:03       ` Jon Masters
2016-12-06  0:05       ` Jon Masters
2016-12-06  0:31       ` Duc Dang
2016-12-06  2:27         ` Jon Masters
2016-12-06  3:55           ` Duc Dang
2016-12-06  6:34             ` Jon Masters
2016-12-06  6:53               ` Jon Masters
2016-12-06  7:13                 ` Jon Masters
2016-12-06  8:40                   ` Aleksey Makarov
2016-12-07 15:23               ` Mark Salter [this message]
2016-12-13  6:20                 ` Jon Masters
2017-04-30 21:39                   ` Jon Masters

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=1481124199.4751.50.camel@redhat.com \
    --to=msalter@redhat.com \
    --cc=aleksey.makarov@linaro.org \
    --cc=dhdang@apm.com \
    --cc=graeme.gregory@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jcm@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=peter@hurleysoftware.com \
    --cc=rjw@rjwysocki.net \
    /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).