* Re: [PATCH] sh-sci: Extend sh-sci driver with early console V2
2009-12-14 10:24 [PATCH] sh-sci: Extend sh-sci driver with early console V2 Magnus Damm
@ 2009-12-15 3:37 ` Paul Mundt
2010-04-11 7:40 ` Shin-ichiro KAWASAKI
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Paul Mundt @ 2009-12-15 3:37 UTC (permalink / raw)
To: linux-sh
On Mon, Dec 14, 2009 at 07:24:42PM +0900, Magnus Damm wrote:
> This is V2 of early serial console support for the sh-sci
> driver. The early serial console is using early platform
> devices and "earlyprintk". To use this feature the early
> platform devices must be broken out to one device per port
> and the desired port should be selected on the kernel command
> line like: "earlyprintk=sh-sci.N[,baudrate][,keep]"
On Mon, Dec 14, 2009 at 09:29:40PM +0900, Magnus Damm wrote:
> These patches break out the scif serial port platform data into
> one platform device per port.
>
> With these patches and the early serial support in place it is
> possible to select the early serial console port with the kernel
> command line. For example, to enable early serial console on KFR2R09,
> simply add the following to the kernel command line:
>
> "earlyprintk=sh-sci.1,115200".
On Mon, Dec 14, 2009 at 09:52:53PM +0900, Magnus Damm wrote:
> Now when the sh-sci driver can do early serial output,
> get rid of the old duplicated code. This patch is V2 and
> removes support for "earlyprintk=serial" together with
> the following kconfig options:
> CONFIG_EARLY_SCIF_CONSOLE
> CONFIG_EARLY_SCIF_CONSOLE_PORT
> CONFIG_EARLY_PRINTK
>
> With this patch applied "earlyprintk=" support is always
> built-in the SuperH kernel. For this to work the serial
> driver must have early platform support and in the case
> of sh-sci the serial console needs to be enabled:
> CONFIG_SERIAL_SH_SCI_CONSOLE=y
>
> So after enabling the SuperH SCI console kconfig option
> you also need to point out port using the kernel command
> line: "earlyprintk=sh-sci.N[,baudrate][,keep]"
>
> Remember that clocks may be disabled by the boot loader
> so you may have to do some board specific static clock
> setup before earlyprintk will work on your platform.
Applied, thanks.
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] sh-sci: Extend sh-sci driver with early console V2
2009-12-14 10:24 [PATCH] sh-sci: Extend sh-sci driver with early console V2 Magnus Damm
2009-12-15 3:37 ` Paul Mundt
@ 2010-04-11 7:40 ` Shin-ichiro KAWASAKI
2010-04-21 8:30 ` Magnus Damm
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Shin-ichiro KAWASAKI @ 2010-04-11 7:40 UTC (permalink / raw)
To: linux-sh
Hello Magnus,
I'm in trouble with qemu-sh serial console. Don't you have any
guide on this trouble?
With the patch, qemu-sh serial console doesn't work.
The emulated device is r2d+.
- no earlyprintk option
... Qemu carshes with assertion. No kernel boot log printed.
I guess it touches sh-sci.0 registers, which qemu doesn't support.
- earlyprintk=sh-sci.1
... Qemu boots up with kernel boot log output,
but the log message stops with
"turn off boot console early_ttySC0' message.
No login prompt appears.
- earlyprintk=sh-sci.1,115200,keep
... The message "turn off boots up ..." disappears, but no
login prompt appears.
Best Regards,
Shin-ichiro KAWASAKI
(2009/12/14 19:24), Magnus Damm wrote:
> From: Magnus Damm<damm@opensource.se>
>
> This is V2 of early serial console support for the sh-sci
> driver. The early serial console is using early platform
> devices and "earlyprintk". To use this feature the early
> platform devices must be broken out to one device per port
> and the desired port should be selected on the kernel command
> line like: "earlyprintk=sh-sci.N[,baudrate][,keep]"
>
> Signed-off-by: Magnus Damm<damm@opensource.se>
> ---
>
> Depends on "Driver Core: Early platform driver buffer"
>
> Changes since V1:
> - Removed #ifdefs, only CONFIG_SERIAL_SH_SCI_CONSOLE now left
>
> Platform device patches apply on top of this, a cleanup patch
> that removes the old duplicated serial port code will follow.
>
> arch/sh/kernel/early_printk.c | 10 -------
> arch/sh/kernel/setup.c | 3 ++
> drivers/serial/sh-sci.c | 54 ++++++++++++++++++++++++++++++++++-------
> 3 files changed, 49 insertions(+), 18 deletions(-)
>
> --- 0001/arch/sh/kernel/early_printk.c
> +++ work/arch/sh/kernel/early_printk.c 2009-12-14 15:57:25.000000000 +0900
> @@ -191,15 +191,7 @@ static void scif_sercon_init(char *s)
> * Setup a default console, if more than one is compiled in, rely on the
> * earlyprintk= parsing to give priority.
> */
> -static struct console *early_console > -#ifdef CONFIG_SH_STANDARD_BIOS
> - &bios_console
> -#elif defined(CONFIG_EARLY_SCIF_CONSOLE)
> - &scif_console
> -#else
> - NULL
> -#endif
> - ;
> +static struct console *early_console;
>
> static int __init setup_early_printk(char *buf)
> {
> --- 0001/arch/sh/kernel/setup.c
> +++ work/arch/sh/kernel/setup.c 2009-12-14 15:58:45.000000000 +0900
> @@ -423,6 +423,9 @@ void __init setup_arch(char **cmdline_p)
>
> plat_early_device_setup();
>
> + /* Let earlyprintk output early console messages */
> + early_platform_driver_probe("earlyprintk", 1, 1);
> +
> sh_mv_setup();
>
> /*
> --- 0001/drivers/serial/sh-sci.c
> +++ work/drivers/serial/sh-sci.c 2009-12-14 15:57:25.000000000 +0900
> @@ -1043,10 +1043,14 @@ static void __devinit sci_init_single(st
> sci_port->port.iotype = UPIO_MEM;
> sci_port->port.line = index;
> sci_port->port.fifosize = 1;
> - sci_port->iclk = p->clk ? clk_get(&dev->dev, p->clk) : NULL;
> - sci_port->dclk = clk_get(&dev->dev, "peripheral_clk");
> - sci_port->enable = sci_clk_enable;
> - sci_port->disable = sci_clk_disable;
> +
> + if (dev) {
> + sci_port->iclk = p->clk ? clk_get(&dev->dev, p->clk) : NULL;
> + sci_port->dclk = clk_get(&dev->dev, "peripheral_clk");
> + sci_port->enable = sci_clk_enable;
> + sci_port->disable = sci_clk_disable;
> + sci_port->port.dev =&dev->dev;
> + }
>
> sci_port->break_timer.data = (unsigned long)sci_port;
> sci_port->break_timer.function = sci_break_timer;
> @@ -1057,7 +1061,6 @@ static void __devinit sci_init_single(st
>
> sci_port->port.irq = p->irqs[SCIx_TXI_IRQ];
> sci_port->port.flags = p->flags;
> - sci_port->port.dev =&dev->dev;
> sci_port->type = sci_port->port.type = p->type;
>
> memcpy(&sci_port->irqs,&p->irqs, sizeof(p->irqs));
> @@ -1101,7 +1104,7 @@ static void serial_console_write(struct
> sci_port->disable(port);
> }
>
> -static int __init serial_console_setup(struct console *co, char *options)
> +static int __devinit serial_console_setup(struct console *co, char *options)
> {
> struct sci_port *sci_port;
> struct uart_port *port;
> @@ -1119,9 +1122,14 @@ static int __init serial_console_setup(s
> if (co->index>= SCI_NPORTS)
> co->index = 0;
>
> - sci_port =&sci_ports[co->index];
> - port =&sci_port->port;
> - co->data = port;
> + if (co->data) {
> + port = co->data;
> + sci_port = to_sci_port(port);
> + } else {
> + sci_port =&sci_ports[co->index];
> + port =&sci_port->port;
> + co->data = port;
> + }
>
> /*
> * Also need to check port->type, we don't actually have any
> @@ -1165,6 +1173,15 @@ static int __init sci_console_init(void)
> return 0;
> }
> console_initcall(sci_console_init);
> +
> +static struct sci_port early_serial_port;
> +static struct console early_serial_console = {
> + .name = "early_ttySC",
> + .write = serial_console_write,
> + .flags = CON_PRINTBUFFER,
> +};
> +static char early_serial_buf[32];
> +
> #endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */
>
> #if defined(CONFIG_SERIAL_SH_SCI_CONSOLE)
> @@ -1250,6 +1267,21 @@ static int __devinit sci_probe(struct pl
> struct sh_sci_priv *priv;
> int i, ret = -EINVAL;
>
> +#ifdef CONFIG_SERIAL_SH_SCI_CONSOLE
> + if (is_early_platform_device(dev)) {
> + if (dev->id = -1)
> + return -ENOTSUPP;
> + early_serial_console.index = dev->id;
> + early_serial_console.data =&early_serial_port.port;
> + sci_init_single(NULL,&early_serial_port, dev->id, p);
> + serial_console_setup(&early_serial_console, early_serial_buf);
> + if (!strstr(early_serial_buf, "keep"))
> + early_serial_console.flags |= CON_BOOT;
> + register_console(&early_serial_console);
> + return 0;
> + }
> +#endif
> +
> priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> if (!priv)
> return -ENOMEM;
> @@ -1349,6 +1381,10 @@ static void __exit sci_exit(void)
> uart_unregister_driver(&sci_uart_driver);
> }
>
> +#ifdef CONFIG_SERIAL_SH_SCI_CONSOLE
> +early_platform_init_buffer("earlyprintk",&sci_driver,
> + early_serial_buf, ARRAY_SIZE(early_serial_buf));
> +#endif
> module_init(sci_init);
> module_exit(sci_exit);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] sh-sci: Extend sh-sci driver with early console V2
2009-12-14 10:24 [PATCH] sh-sci: Extend sh-sci driver with early console V2 Magnus Damm
2009-12-15 3:37 ` Paul Mundt
2010-04-11 7:40 ` Shin-ichiro KAWASAKI
@ 2010-04-21 8:30 ` Magnus Damm
2010-04-22 5:54 ` Alexandre Courbot
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Magnus Damm @ 2010-04-21 8:30 UTC (permalink / raw)
To: linux-sh
Hey Kawasaki-san,
2010/4/11 Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>:
> Hello Magnus,
>
> I'm in trouble with qemu-sh serial console. Don't you have any
> guide on this trouble?
Yes, I think the defconfig is missing one thing. Please try setting
CONFIG_SERIAL_SH_SCI_NR_UARTS=2. See below.
> With the patch, qemu-sh serial console doesn't work.
> The emulated device is r2d+.
>
> - no earlyprintk option
> ... Qemu carshes with assertion. No kernel boot log printed.
> I guess it touches sh-sci.0 registers, which qemu doesn't support.
Hm, I'm not sure why this happens. Did you update the kernel command
line to use ttySC1?
This commit in linux-2.6 git may be useful:
cd5f107628ab89c5dec5ad923f1c27f4cba41972
> - earlyprintk=sh-sci.1
> ... Qemu boots up with kernel boot log output,
> but the log message stops with
> "turn off boot console early_ttySC0' message.
> No login prompt appears.
> - earlyprintk=sh-sci.1,115200,keep
> ... The message "turn off boots up ..." disappears, but no
> login prompt appears.
I think this is because CONFIG_SERIAL_SH_SCI_NR_UARTS is set to 1. Or
perhaps is your user space still using ttySC0 instead of ttySC1?
Does updating CONFIG_SERIAL_SH_SCI_NR_UARTS to 2 solve your issue?
Thanks for the report and sorry about the breakage.
/ magnus
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] sh-sci: Extend sh-sci driver with early console V2
2009-12-14 10:24 [PATCH] sh-sci: Extend sh-sci driver with early console V2 Magnus Damm
` (2 preceding siblings ...)
2010-04-21 8:30 ` Magnus Damm
@ 2010-04-22 5:54 ` Alexandre Courbot
2010-04-22 6:11 ` Magnus Damm
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Alexandre Courbot @ 2010-04-22 5:54 UTC (permalink / raw)
To: linux-sh
[-- Attachment #1: Type: text/plain, Size: 1182 bytes --]
Hello everybody,
> > I'm in trouble with qemu-sh serial console. Don't you have any
> > guide on this trouble?
>
> Yes, I think the defconfig is missing one thing. Please try setting
> CONFIG_SERIAL_SH_SCI_NR_UARTS=2. See below.
Indeed, I ran into the same problem as Kawasaki-san and got it fixed
by setting CONFIG_SERIAL_SH_SCI_NR_UARTS to 2 instead of 1. With this
value, I am able to boot correctly by using the "earlyprintk=sh-sci.1
console=ttySC1" kernel parameters. FYI, my qemu command-line is:
qemu-system-sh4 -M r2d -kernel arch/sh/boot/zImage -serial null
-serial stdio -append "earlyprintk=sh-sci.1 console=ttySC1"
Also, the r2dplus configuration file sets
CONFIG_SERIAL_SH_SCI_NR_UARTS to 1 currently - here is a patch that
fixes that. It is possible that other targets need this.
We are also trying to get the latest Linux to run on the SH2007
platform, and since the new serial driver boot fails during SCIF
intialization. I have attached a boot log of what is sent to the
serial line. The output gets cut right in the middle of displaying
status for sh-sci.1. Any clue on that issue would be greatly
appreciated.
Thanks,
Alex.
[-- Attachment #2: sh2007-bootlog.txt --]
[-- Type: text/plain, Size: 4639 bytes --]
SH IPL+g version 1.30 Jun 21 2007, Copyright (C) 2001-2007 Free Software Foundation, Inc.
This software comes with ABSOLUTELY NO WARRANTY; for details type `w'.
This is free software, and you are welcome to redistribute it under
certain conditions; type `l' for details.
128Mbyte memory
PCI: Starting intialization.
pci device 00: VID=0x1033 DID=0x0035
Initializing uPD720101 USB Interface
DSW[1..8]=0001 1110
Booting from network!
SMSC LAN911x Driver (v1.12)
LAN9118(rev:1) at 0xb0800000 ADDR: 00:10:0c:00:50:f2
Searching for server (BOOTP/DHCP)...
IP Address: 192.168.1.100
Server: 192.168.1.1, Gateway 192.168.1.1
Kernel to load: "/nfs/sh2007/boot/vmlinuz.sh2007"
HOSTNAME: sh2007-mitake
ROOT PATH: /nfs/sh2007
Loading Kernel: /nfs/sh2007/boot/vmlinuz.sh2007 at 0x88210000 .........................................................a
done
Setting GDB trap vector to 80000100
Linux version 2.6.34-rc2 (mitake@mitakei7) (gcc version 4.4.3 (Debian 4.4.3-3) ) #238 Thu Apr 15 17:31:45 JST 2010
Boot params:
... MOUNT_ROOT_RDONLY - 00000000
... RAMDISK_FLAGS - 00000000
... ORIG_ROOT_DEV - 00000000
... LOADER_TYPE - 00000000
... INITRD_START - 00000000
... INITRD_SIZE - 00000000
bootconsole [bios0] enabled
Booting machvec: sh2007
Node 0: start_pfn = 0x8000, low = 0x10000
Zone PFN ranges:
Normal 0x00008000 -> 0x00010000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00008000 -> 0x00010000
SH-2007 Setup...done.
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: console=ttySC1,115200 ip=dhcp root=/dev/nfs rw nfsroot=/nfs/sh2007,rsize=1024,wsize=1024 earlyprins
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
PVR=10200a00 CVR=73440010 PRR=00000920
I-cache : n_ways=4 n_sets=256 way_incr=8192
I-cache : entry_mask=0x00001fe0 alias_mask=0x00001000 n_aliases=2
D-cache : n_ways=4 n_sets=256 way_incr=8192
D-cache : entry_mask=0x00001fe0 alias_mask=0x00001000 n_aliases=2
Memory: 123392k/131072k available (3918k kernel code, 2323k data, 184k init)
virtual kernel memory layout:
fixmap : 0xdfff7000 - 0xdffff000 ( 32 kB)
vmalloc : 0xc0000000 - 0xdfff5000 ( 511 MB)
lowmem : 0x88000000 - 0x90000000 ( 128 MB) (cached)
: 0xa0000000 - 0xc0000000 ( 512 MB) (uncached)
.init : 0x8861a000 - 0x88648000 ( 184 kB)
.data : 0x883d49e8 - 0x886199a0 (2323 kB)
.text : 0x88001000 - 0x883d49e8 (3918 kB)
Hierarchical RCU implementation.
NR_IRQS:256 nr_irqs:256
Console: colour dummy device 80x25
sh_tmu.0: used for clock events
sh_tmu.0: used for periodic clock events
sh_tmu.1: used as clock source
Calibrating delay loop (skipped)... 600.00 BogoMIPS PRESET (lpj=3000000)
Mount-cache hash table entries: 512
CPU: SH7780
NET: Registered protocol family 16
Performance Events: SH-4A support registered
HW Breakpoints: SH-4A UBC support registered
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
DMA: Registering sh_dmac handler (12 channels).
DMA: Registering DMA API.
Switching to clocksource sh_tmu.1
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
platform sh_tmu.0: used for oneshot clock events
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
SH2007 PIO Driver v0.1
audit: initializing netlink socket (disabled)
type=2000 audit(946684800.170:1): initialized
msgmni has been set to 241
alg: No test for cipher_null (cipher_null-generic)
alg: No test for ecb(cipher_null) (ecb-cipher_null)
alg: No test for digest_null (digest_null-generic)
alg: No test for compress_null (compress_null-generic)
alg: No test for fcrypt (fcrypt-generic)
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 8 ports, IRQ sharing enabled
SuperH SCI(F) driver initialized
sh-sci.0: ttySC0 at MMIO 0xffe00000 (irq = 40) is a scif
sh-sci.1: ttySC1 at MMIO 0x
[-- Attachment #3: 0001-SH-Fixed-number-of-UARTs-in-r2dplus-config.patch --]
[-- Type: text/x-patch, Size: 824 bytes --]
From 18885a76e31aaccbaf78c43b42cdaf9031b3c13f Mon Sep 17 00:00:00 2001
From: Alexandre Courbot <gnurou@gmail.com>
Date: Mon, 19 Apr 2010 16:29:21 +0900
Subject: [PATCH] [SH] Fixed number of UARTs in r2dplus config
---
arch/sh/configs/rts7751r2dplus_defconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/sh/configs/rts7751r2dplus_defconfig b/arch/sh/configs/rts7751r2dplus_defconfig
index a8d538f..6d511d0 100644
--- a/arch/sh/configs/rts7751r2dplus_defconfig
+++ b/arch/sh/configs/rts7751r2dplus_defconfig
@@ -963,7 +963,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
#
# CONFIG_SERIAL_MAX3100 is not set
CONFIG_SERIAL_SH_SCI=y
-CONFIG_SERIAL_SH_SCI_NR_UARTS=1
+CONFIG_SERIAL_SH_SCI_NR_UARTS=2
CONFIG_SERIAL_SH_SCI_CONSOLE=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
--
1.7.0.5
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH] sh-sci: Extend sh-sci driver with early console V2
2009-12-14 10:24 [PATCH] sh-sci: Extend sh-sci driver with early console V2 Magnus Damm
` (3 preceding siblings ...)
2010-04-22 5:54 ` Alexandre Courbot
@ 2010-04-22 6:11 ` Magnus Damm
2010-04-22 6:22 ` Alexandre Courbot
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Magnus Damm @ 2010-04-22 6:11 UTC (permalink / raw)
To: linux-sh
Hi Alexandre,
On Thu, Apr 22, 2010 at 2:54 PM, Alexandre Courbot
<alex@dcl.info.waseda.ac.jp> wrote:
> Hello everybody,
>
>> > I'm in trouble with qemu-sh serial console. Don't you have any
>> > guide on this trouble?
>>
>> Yes, I think the defconfig is missing one thing. Please try setting
>> CONFIG_SERIAL_SH_SCI_NR_UARTS=2. See below.
>
> Indeed, I ran into the same problem as Kawasaki-san and got it fixed
> by setting CONFIG_SERIAL_SH_SCI_NR_UARTS to 2 instead of 1. With this
> value, I am able to boot correctly by using the "earlyprintk=sh-sci.1
> console=ttySC1" kernel parameters. FYI, my qemu command-line is:
>
> qemu-system-sh4 -M r2d -kernel arch/sh/boot/zImage -serial null
> -serial stdio -append "earlyprintk=sh-sci.1 console=ttySC1"
Thanks for sharing this information.
> Also, the r2dplus configuration file sets
> CONFIG_SERIAL_SH_SCI_NR_UARTS to 1 currently - here is a patch that
> fixes that. It is possible that other targets need this.
Cool, thanks. It's very similar to the patch I just posted. =)
> We are also trying to get the latest Linux to run on the SH2007
> platform, and since the new serial driver boot fails during SCIF
> intialization. I have attached a boot log of what is sent to the
> serial line. The output gets cut right in the middle of displaying
> status for sh-sci.1. Any clue on that issue would be greatly
> appreciated.
Is the SH2007 board based on sh7780? Perhaps it's a clock issue.
Cheers,
/ magnus
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] sh-sci: Extend sh-sci driver with early console V2
2009-12-14 10:24 [PATCH] sh-sci: Extend sh-sci driver with early console V2 Magnus Damm
` (4 preceding siblings ...)
2010-04-22 6:11 ` Magnus Damm
@ 2010-04-22 6:22 ` Alexandre Courbot
2010-04-22 6:30 ` Paul Mundt
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Alexandre Courbot @ 2010-04-22 6:22 UTC (permalink / raw)
To: linux-sh
>> Also, the r2dplus configuration file sets
>> CONFIG_SERIAL_SH_SCI_NR_UARTS to 1 currently - here is a patch that
>> fixes that. It is possible that other targets need this.
>
> Cool, thanks. It's very similar to the patch I just posted. =)
Indeed. :p
>> We are also trying to get the latest Linux to run on the SH2007
>> platform, and since the new serial driver boot fails during SCIF
>> intialization. I have attached a boot log of what is sent to the
>> serial line. The output gets cut right in the middle of displaying
>> status for sh-sci.1. Any clue on that issue would be greatly
>> appreciated.
>
> Is the SH2007 board based on sh7780? Perhaps it's a clock issue.
It's a 7780 indeed. I'm not a specialist of the SH platform (still
learning), but I'll try to look at this from a clock perspective. FYI,
the early printk is done through the bios.
Thanks!
Alex.
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] sh-sci: Extend sh-sci driver with early console V2
2009-12-14 10:24 [PATCH] sh-sci: Extend sh-sci driver with early console V2 Magnus Damm
` (5 preceding siblings ...)
2010-04-22 6:22 ` Alexandre Courbot
@ 2010-04-22 6:30 ` Paul Mundt
2010-04-22 7:09 ` Magnus Damm
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Paul Mundt @ 2010-04-22 6:30 UTC (permalink / raw)
To: linux-sh
On Thu, Apr 22, 2010 at 03:22:06PM +0900, Alexandre Courbot wrote:
> >> We are also trying to get the latest Linux to run on the SH2007
> >> platform, and since the new serial driver boot fails during SCIF
> >> intialization. I have attached a boot log of what is sent to the
> >> serial line. The output gets cut right in the middle of displaying
> >> status for sh-sci.1. Any clue on that issue would be greatly
> >> appreciated.
> >
> > Is the SH2007 board based on sh7780? Perhaps it's a clock issue.
>
> It's a 7780 indeed. I'm not a specialist of the SH platform (still
> learning), but I'll try to look at this from a clock perspective. FYI,
> the early printk is done through the bios.
Your command line is word wrapped so it's not apparent what options you
are using. One noticeable difference for sh-bios users in sh-sci is the
detach callback via sh_bios_gdb_detach(), you might want to try
commenting this out to make sure you're not trapping in to some bogus
location. If the sh-bios earlyprintk is working for you then you might
also try the 'keep' option to prevent the serial console from taking
control away from it.
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] sh-sci: Extend sh-sci driver with early console V2
2009-12-14 10:24 [PATCH] sh-sci: Extend sh-sci driver with early console V2 Magnus Damm
` (6 preceding siblings ...)
2010-04-22 6:30 ` Paul Mundt
@ 2010-04-22 7:09 ` Magnus Damm
2010-04-23 6:25 ` Alexandre Courbot
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Magnus Damm @ 2010-04-22 7:09 UTC (permalink / raw)
To: linux-sh
On Thu, Apr 22, 2010 at 3:22 PM, Alexandre Courbot
<alex@dcl.info.waseda.ac.jp> wrote:
>>> We are also trying to get the latest Linux to run on the SH2007
>>> platform, and since the new serial driver boot fails during SCIF
>>> intialization. I have attached a boot log of what is sent to the
>>> serial line. The output gets cut right in the middle of displaying
>>> status for sh-sci.1. Any clue on that issue would be greatly
>>> appreciated.
>>
>> Is the SH2007 board based on sh7780? Perhaps it's a clock issue.
>
> It's a 7780 indeed. I'm not a specialist of the SH platform (still
> learning), but I'll try to look at this from a clock perspective. FYI,
> the early printk is done through the bios.
Does the kernel commandline option "earlyprintk=sh-sci.1,115200" work?
/ magnus
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] sh-sci: Extend sh-sci driver with early console V2
2009-12-14 10:24 [PATCH] sh-sci: Extend sh-sci driver with early console V2 Magnus Damm
` (7 preceding siblings ...)
2010-04-22 7:09 ` Magnus Damm
@ 2010-04-23 6:25 ` Alexandre Courbot
2010-04-23 7:26 ` Paul Mundt
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Alexandre Courbot @ 2010-04-23 6:25 UTC (permalink / raw)
To: linux-sh
Hello,
> Does the kernel commandline option "earlyprintk=sh-sci.1,115200" work?
It does not - nothing gets displayed at all by the kernel.
> Your command line is word wrapped so it's not apparent what options you
> are using.
Sorry - the options I were using on sh2007 to get the log I attached
previously are
"earlyprintk=bios console=ttySC1,115200"
> One noticeable difference for sh-bios users in sh-sci is the
> detach callback via sh_bios_gdb_detach(), you might want to try
> commenting this out to make sure you're not trapping in to some bogus
> location.
> If the sh-bios earlyprintk is working for you then you might
> also try the 'keep' option to prevent the serial console from taking
> control away from it.
Indeed, that workarounds the problem, but then I stop getting feedback
from the kernel starting from when init is supposed to start:
VFS: Mounted root (nfs filesystem) on device 0:12.
Freeing unused kernel memory: 184k freed
However, by monitoring the network activity (I use a NFS root FS), I
can see that the init script executes normally as all the boot time
invoked binaries and libraries are sent through the network. Therefore
the kernel is starting normally, but it seems it just lacks a console
that uses the same device as the kernel earlyprintk. Any idea about
how I could create such an entry in /dev/ ? (major/minor numbers?)
Still, it would be nice to get the SCIF to work on that platform. I'm
willing to investigate the problem (may be clock-related indeed), but
could someone provide me some guidance about where in the driver I
should look at?
Thanks again, looks like I'm close to having a working kernel again!
Alex.
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] sh-sci: Extend sh-sci driver with early console V2
2009-12-14 10:24 [PATCH] sh-sci: Extend sh-sci driver with early console V2 Magnus Damm
` (8 preceding siblings ...)
2010-04-23 6:25 ` Alexandre Courbot
@ 2010-04-23 7:26 ` Paul Mundt
2010-04-23 11:16 ` Alexandre Courbot
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Paul Mundt @ 2010-04-23 7:26 UTC (permalink / raw)
To: linux-sh
On Fri, Apr 23, 2010 at 03:25:12PM +0900, Alexandre Courbot wrote:
> > One noticeable difference for sh-bios users in sh-sci is the
> > detach callback via sh_bios_gdb_detach(), you might want to try
> > commenting this out to make sure you're not trapping in to some bogus
> > location.
>
> > If the sh-bios earlyprintk is working for you then you might
> > also try the 'keep' option to prevent the serial console from taking
> > control away from it.
>
> Indeed, that workarounds the problem, but then I stop getting feedback
> from the kernel starting from when init is supposed to start:
>
> VFS: Mounted root (nfs filesystem) on device 0:12.
> Freeing unused kernel memory: 184k freed
>
That would be because the early consoles themselves are only meant for
debugging aids, and have no input methods of their own. With no backing
device userspace will also fail to bind /dev/console, so this is the
expected behaviour.
> Still, it would be nice to get the SCIF to work on that platform. I'm
> willing to investigate the problem (may be clock-related indeed), but
> could someone provide me some guidance about where in the driver I
> should look at?
>
I've dusted off the SH7780 Highlander to see if there were any immediate
issues with the clock or serial code that would have broken the CPU, but
that all worked out of the box.
> Thanks again, looks like I'm close to having a working kernel again!
The obvious remaining question would be are you sure that your serial
port is really on ttySC1? Most of the SH7780 boards placed the console on
ttySC0 by default, so make sure that you aren't just being bitten by a
bogus defconfig setting.
If you have board support patches that you've applied to the kernel then
you might also want to try backing those off and simply booting with the
default machvec with SH7780 support enabled. Given that the serial port
is an SoC property you shouldn't have any difficulty getting a console
even if you have no other board support built in.
You may also want to disable sh-bios support in the off chance that this
is clobbering something it shouldn't be (note that sh-bios support itself
is almost never tested these days, and in the past it has always been a
source of inconsistency).
If all else fails then we'll simply have to debug the init path, but I
suspect you're being bitten by something completely unrelated given that
none of the other SH7780's exhibit any sort of difficulty.
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] sh-sci: Extend sh-sci driver with early console V2
2009-12-14 10:24 [PATCH] sh-sci: Extend sh-sci driver with early console V2 Magnus Damm
` (9 preceding siblings ...)
2010-04-23 7:26 ` Paul Mundt
@ 2010-04-23 11:16 ` Alexandre Courbot
2010-04-25 12:30 ` Shin-ichiro KAWASAKI
2010-04-26 7:03 ` Paul Mundt
12 siblings, 0 replies; 14+ messages in thread
From: Alexandre Courbot @ 2010-04-23 11:16 UTC (permalink / raw)
To: linux-sh
> The obvious remaining question would be are you sure that your serial
> port is really on ttySC1? Most of the SH7780 boards placed the console on
> ttySC0 by default, so make sure that you aren't just being bitten by a
> bogus defconfig setting.
Yes, I checked this too, and with older versions of the kernel I was
also using ttySC1.
> If you have board support patches that you've applied to the kernel then
> you might also want to try backing those off and simply booting with the
> default machvec with SH7780 support enabled. Given that the serial port
> is an SoC property you shouldn't have any difficulty getting a console
> even if you have no other board support built in.
Just tried with the latest official branch, and unfortunately no luck.
earlyprintk=bios,keep performs the same as our branch with respect to
the SCI.
> You may also want to disable sh-bios support in the off chance that this
> is clobbering something it shouldn't be (note that sh-bios support itself
> is almost never tested these days, and in the past it has always been a
> source of inconsistency).
Did that too, did not help with "earlyprintk=sh-sci.1" or
"earlyprintk=sh-sci.0" at all. :( Nothing is displayed, but the NFS
activity testifies that the kernel boots.
> If all else fails then we'll simply have to debug the init path, but I
> suspect you're being bitten by something completely unrelated given that
> none of the other SH7780's exhibit any sort of difficulty.
Indeed, this looks very strange to me too. Sorry for being clueless,
but I'm rather new to kernel programming and debugging - what would
you recommend me to try next?
Thanks,
Alex.
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] sh-sci: Extend sh-sci driver with early console V2
2009-12-14 10:24 [PATCH] sh-sci: Extend sh-sci driver with early console V2 Magnus Damm
` (10 preceding siblings ...)
2010-04-23 11:16 ` Alexandre Courbot
@ 2010-04-25 12:30 ` Shin-ichiro KAWASAKI
2010-04-26 7:03 ` Paul Mundt
12 siblings, 0 replies; 14+ messages in thread
From: Shin-ichiro KAWASAKI @ 2010-04-25 12:30 UTC (permalink / raw)
To: linux-sh
Hi, Magnus-san, and Alex-san,
Thank you very much for your guides.
Setting "CONFIG_SERIAL_SH_SCI_NR_UARTS=2" solved my problem fully.
I find no qemu crash, and happy to see login prompt again.
I tried out these two option with real R2D+ boards and recent sh-2.6 git.
CONFIG_SERIAL_SH_SCI_NR_UARTS=1 ... no serial output
CONFIG_SERIAL_SH_SCI_NR_UARTS=2 ... kernel boot log printed in serial output
I hope the patch applied soon :)
Best Regards,
Shin-ichiro KAWASAKI
(2010/04/21 17:30), Magnus Damm wrote:
> Hey Kawasaki-san,
>
> 2010/4/11 Shin-ichiro KAWASAKI<kawasaki@juno.dti.ne.jp>:
>> Hello Magnus,
>>
>> I'm in trouble with qemu-sh serial console. Don't you have any
>> guide on this trouble?
>
> Yes, I think the defconfig is missing one thing. Please try setting
> CONFIG_SERIAL_SH_SCI_NR_UARTS=2. See below.
>
>> With the patch, qemu-sh serial console doesn't work.
>> The emulated device is r2d+.
>>
>> - no earlyprintk option
>> ... Qemu carshes with assertion. No kernel boot log printed.
>> I guess it touches sh-sci.0 registers, which qemu doesn't support.
>
> Hm, I'm not sure why this happens. Did you update the kernel command
> line to use ttySC1?
>
> This commit in linux-2.6 git may be useful:
>
> cd5f107628ab89c5dec5ad923f1c27f4cba41972
>
>> - earlyprintk=sh-sci.1
>> ... Qemu boots up with kernel boot log output,
>> but the log message stops with
>> "turn off boot console early_ttySC0' message.
>> No login prompt appears.
>> - earlyprintk=sh-sci.1,115200,keep
>> ... The message "turn off boots up ..." disappears, but no
>> login prompt appears.
>
> I think this is because CONFIG_SERIAL_SH_SCI_NR_UARTS is set to 1. Or
> perhaps is your user space still using ttySC0 instead of ttySC1?
>
> Does updating CONFIG_SERIAL_SH_SCI_NR_UARTS to 2 solve your issue?
>
> Thanks for the report and sorry about the breakage.
>
> / magnus
>
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] sh-sci: Extend sh-sci driver with early console V2
2009-12-14 10:24 [PATCH] sh-sci: Extend sh-sci driver with early console V2 Magnus Damm
` (11 preceding siblings ...)
2010-04-25 12:30 ` Shin-ichiro KAWASAKI
@ 2010-04-26 7:03 ` Paul Mundt
12 siblings, 0 replies; 14+ messages in thread
From: Paul Mundt @ 2010-04-26 7:03 UTC (permalink / raw)
To: linux-sh
On Sun, Apr 25, 2010 at 09:30:09PM +0900, Shin-ichiro KAWASAKI wrote:
> Hi, Magnus-san, and Alex-san,
>
> Thank you very much for your guides.
> Setting "CONFIG_SERIAL_SH_SCI_NR_UARTS=2" solved my problem fully.
> I find no qemu crash, and happy to see login prompt again.
>
> I tried out these two option with real R2D+ boards and recent sh-2.6 git.
> CONFIG_SERIAL_SH_SCI_NR_UARTS=1 ... no serial output
> CONFIG_SERIAL_SH_SCI_NR_UARTS=2 ... kernel boot log printed in serial
> output
>
> I hope the patch applied soon :)
>
It's queued for 2.6.34 now, thanks for testing.
^ permalink raw reply [flat|nested] 14+ messages in thread