All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Frias <sf84@laposte.net>
To: Peter Hurley <peter@hurleysoftware.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-serial@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	mason <slash.tmp@free.fr>, "Måns Rullgård" <mans@mansr.com>
Subject: Re: [RFC PATCH] always probe UART HW when options are not specified
Date: Mon, 11 Jan 2016 16:07:23 +0100	[thread overview]
Message-ID: <5693C52B.90003@laposte.net> (raw)
In-Reply-To: <56798EC7.1030804@laposte.net>

On 12/22/2015 06:56 PM, Sebastian Frias wrote:
> On 12/21/2015 05:50 PM, Sebastian Frias wrote:
>>> You need to use the format documented in
>>> Documentation/kernel-parameters.text:
>>>
>>>     console=    [KNL] Output console device and options.
>>>
>>>         uart[8250],io,<addr>[,options]
>>>         uart[8250],mmio,<addr>[,options]
>>>         uart[8250],mmio16,<addr>[,options]
>>>         uart[8250],mmio32,<addr>[,options]
>>>         uart[8250],0x<addr>[,options]
>>>             Start an early, polled-mode console on the 8250/16550
>>>             UART at the specified I/O port or MMIO address,
>>>             switching to the matching ttyS device later.
>>>             MMIO inter-register address stride is either 8-bit
>>>             (mmio), 16-bit (mmio16), or 32-bit (mmio32).
>>>             If none of [io|mmio|mmio16|mmio32], <addr> is assumed
>>>             to be equivalent to 'mmio'. 'options' are specified in
>>>             the same format described for ttyS above; if unspecified,
>>>             the h/w is not re-initialized.
>>>
>>> The iotype and the uart address are not options.
>>
>> Do you mean they are mandatory?
>> How do they relate to the keys present on the DT? Because the device is
>> already described in the DT:
>>
>>          uart: serial@10700 {
>>              compatible = "ralink,rt2880-uart";
>>              reg = <0x10700 0x30>;
>>              interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
>>              clock-frequency = <7372800>;
>>              reg-shift = <2>;
>>          };
>>
>> Are we supposed to duplicate such information (ie: addr) in the
>> commandline as well?
>>
>
> By the way, I tried using the following command line
> 'console=uart,mmio32,0x10700,115200n8r mem=256M earlyprintk debug
> ignore_loglevel' but I think I'm still missing something regarding this,
> because it does not work, here's a log of Linux 4.1.13+:
>
>
> 1: [arch/arm/kernel/setup.c:932] setup_arch(): r1 = 0xf34, r2 =
> 0x803b3b50, cmdline ''
> 1: [arch/arm/kernel/devtree.c:195] arch_get_next_mach(): infoBegin
> 0xc024faac, mdesc 0xc024faac
> 1: [arch/arm/kernel/devtree.c:195] arch_get_next_mach(): infoBegin
> 0xc024faac, mdesc 0xc024fb14
> 1: [drivers/of/fdt.c:106] of_fdt_is_compatible(): sigma,tango4 vs
> sigma,vantage-1172
> 1: [arch/arm/kernel/devtree.c:195] arch_get_next_mach(): infoBegin
> 0xc024faac, mdesc 0xc024fb7c
> 1: [drivers/of/fdt.c:749] of_flat_dt_match_machine(): Machine model:
> Sigma Designs SMP8758 Vantage-1172 Rev E1
> 1: [arch/arm/kernel/devtree.c:256] setup_machine_fdt(): about to call
> early_init_dt_scan_nodes
> 1: [drivers/of/fdt.c:1057] early_init_dt_scan_nodes(): bootcmdline ''
> 1: [drivers/of/fdt.c:1062] early_init_dt_scan_nodes(): bootcmdline after
> of_scan_flat_dt 'console=uart,mmio32,0x10700,115200n8r mem=256M
> earlyprintk debug ignore_loglevel'
> 1: [arch/arm/kernel/setup.c:946] setup_arch(): using DT at r2
> 1: [arch/arm/kernel/setup.c:949] setup_arch(): machine name Sigma Tango DT
> 1: [arch/arm/kernel/setup.c:967] setup_arch(): before parse_early_param
> 1: [init/main.c:468] parse_early_param(): bootcmdline
> 'console=uart,mmio32,0x10700,115200n8r mem=256M earlyprintk debug
> ignore_loglevel'
> 1: [init/main.c:473] parse_early_param(): mark
> 1: [init/main.c:428] do_early_param(): enter with: 'console'
> 'uart,mmio32,0x10700,115200n8r'
> 1: [init/main.c:446] do_early_param(): 'earlycon', setup_func 0xc024b868
> 1: [drivers/tty/serial/earlycon.c:214] param_setup_earlycon():
> 'uart,mmio32,0x10700,115200n8r'
> 1: [drivers/tty/serial/earlycon.c:181] setup_earlycon():
> 'uart,mmio32,0x10700,115200n8r'
> 1: [drivers/tty/serial/earlycon.c:132] register_earlycon():
> 'mmio32,0x10700,115200n8r' 'uart'
> 1: [drivers/tty/serial/earlycon.c:86] parse_options():
> 'mmio32,0x10700,115200n8r'
> 1: [drivers/tty/serial/earlycon.c:91] parse_options(): addr 0x00010700,
> options '115200n8r'
> 1: [drivers/tty/serial/earlycon.c:117] parse_options(): Early serial
> console at MMIO32 0x10700 (options '115200n8r')
> 1: [drivers/tty/serial/earlycon.c:138] register_earlycon(): '(null)'
> 1: [drivers/tty/serial/earlycon.c:62] earlycon_map(): paddr 0x00010700
> size 64
>
> As you can see, now that the options are more complete, the match for
> "earlycon" succeeds, but it does not work, the last log is in
> earlycon_map() function.
> When using just "console=uart", the "earlycon" match will fail but a
> match for "earlyprink" will succeed. That one will hook printch() from
> the arch-dependent code to a somewhat simpler 'earlycon'
> (arch/arm/kernel/early_printk.c).
>
> I think the code is the same on mainline.
>
> Also, regarding my previous question about using a HW described in DT
> for earlycon, I noticed there's a of_setup_earlycon() in
> drivers/tty/serial/earlycon.c but that is hooked to
> drivers/of/fdt.c:setup_of_earlycon() which is not called. I do have
> CONFIG_SERIAL_EARLYCON=y.
>
> I also have a similar issue (ie: get blocked right after the call to
> earlycon_map function, log is obviously different from above) if attempt
> to use of_setup_earlycon.
> My DT has roughly:
>
>      aliases {
>          serial0 = &uart;
>      };
>
>      chosen {
>             bootargs = "earlycon console mem=256M earlyprintk debug
> ignore_loglevel";
>             stdout-path = "serial0:115200n8";
>      };
>
>      uart: serial@10700 {
>          compatible = "ralink,rt2880-uart";
>          reg = <0x10700 0x30>;
>          interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
>          clock-frequency = <7372800>;
>          reg-shift = <2>;
>      };
>
>
> and then I hack drivers/tty/serial/8250/8250_early.c by adding:
>
>      OF_EARLYCON_DECLARE(rt2880, "ralink,rt2880-uart",
> early_serial8250_setup);
>
> at the end of the file, trying to mimic commit
> d05f15707bb7659d2b863fafa1a918f286d74a63
>
> I'm still trying to figure out the right bootargs, so that's why both
> "earlycon" and "console" are there. Suggestions welcome.
>

Does anybody has comments or suggestions regarding this thread and the 
issue above?

  reply	other threads:[~2016-01-11 15:07 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5672D18E.8000301@laposte.net>
2015-12-17 15:23 ` [RFC PATCH] always probe UART HW when options are not specified Måns Rullgård
2015-12-17 16:29 ` Peter Hurley
2015-12-17 16:48   ` Sebastian Frias
2015-12-17 17:21     ` Greg Kroah-Hartman
2015-12-17 19:05       ` Sebastian Frias
2015-12-17 17:48     ` Peter Hurley
2015-12-17 18:21       ` Sebastian Frias
2015-12-17 20:09         ` Peter Hurley
2015-12-18 13:53           ` Sebastian Frias
2015-12-18 15:03             ` Peter Hurley
2015-12-21 16:50               ` Sebastian Frias
2015-12-22 17:56                 ` Sebastian Frias
2016-01-11 15:07                   ` Sebastian Frias [this message]
2016-01-11 16:11                     ` Peter Hurley
2016-01-11 17:56                       ` Sebastian Frias
2016-01-11 19:06                         ` Peter Hurley
2016-01-11 19:57                           ` Peter Hurley
2016-01-11 20:21                             ` Peter Hurley
2016-01-12  9:37                           ` Mason
2016-01-12 14:22                             ` Sebastian Frias
2016-01-12 19:47                               ` Peter Hurley
2016-01-12 22:26                                 ` Mason
2016-01-12 22:42                                   ` Peter Hurley
2016-01-13 11:14                                 ` Sebastian Frias
2016-01-13 16:34                                   ` Peter Hurley
2016-01-18 11:52                                     ` Sebastian Frias
2016-01-12 14:14                           ` Sebastian Frias
2016-01-12 21:18                             ` Peter Hurley

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=5693C52B.90003@laposte.net \
    --to=sf84@laposte.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mans@mansr.com \
    --cc=peter@hurleysoftware.com \
    --cc=slash.tmp@free.fr \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.