Re: [PATCH] Enable console on PCI serial devices

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: n0ano
Date: Tuesday, October 14, 2008 - 4:30 pm

On Tue, Oct 14, 2008 at 03:39:44PM -0700, Yinghai Lu wrote:

Good suggestion.  Here is a much simpler patch that just expands
the early printk to add a clock frequency parameter, e.g. I use:

console=uart8250,io,0xe880,115200,921600

Signed-off-by: Don Dugger <donald.d.dugger@intel.com>

 Documentation/kernel-parameters.txt |    9 ++++++---
 drivers/serial/8250_early.c         |    5 +++++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 2443f5b..95ab44f 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -505,12 +505,15 @@ and is between 256 and 4096 characters. It is defined in the file
 			Documentation/networking/netconsole.txt for an
 			alternative.
 
-		uart[8250],io,<addr>[,options]
-		uart[8250],mmio,<addr>[,options]
+		uart[8250],io,<addr>[,options[,clk]]
+		uart[8250],mmio,<addr>[,options[,clk]]
 			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.  The
-			options are the same as for ttyS, above.
+			"options" are the same as for ttyS, above.  "clk"
+			is the crystal frequency which defaults to 1843200
+			(115200 * 16) but some hardware uses different
+			crystal.
 
                 If the device connected to the port is not a TTY but a braille
                 device, prepend "brl," before the device type, for instance
diff --git a/drivers/serial/8250_early.c b/drivers/serial/8250_early.c
index f279745..edd5803 100644
--- a/drivers/serial/8250_early.c
+++ b/drivers/serial/8250_early.c
@@ -180,6 +180,11 @@ static int __init parse_options(struct early_serial8250_device *device,
 		snprintf(device->options, sizeof(device->options), "%u",
 			device->baud);
 	}
+	options = strchr(options, ',');
+	if (options) {
+		options++;
+		port->uartclk = simple_strtoul(options, NULL, 0) * 16;
+	}
 
 	printk(KERN_INFO "Early serial console at %s 0x%llx (options '%s')\n",
 		mmio ? "MMIO" : "I/O port",
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Enable console on PCI serial devices, donald.d.dugger, (Tue Oct 14, 3:31 pm)
Re: [PATCH] Enable console on PCI serial devices, Yinghai Lu, (Tue Oct 14, 3:39 pm)
Re: [PATCH] Enable console on PCI serial devices, Alan Cox, (Tue Oct 14, 3:53 pm)
Re: [PATCH] Enable console on PCI serial devices, n0ano, (Tue Oct 14, 4:30 pm)
Re: [PATCH] Enable console on PCI serial devices, Paul Bolle, (Wed Oct 15, 2:13 am)
Re: [PATCH] Enable console on PCI serial devices, Paul Bolle, (Thu Oct 16, 3:43 am)
Re: [PATCH] Enable console on PCI serial devices, Yinghai Lu, (Thu Oct 16, 9:23 am)
Re: [PATCH] Enable console on PCI serial devices, Yinghai Lu, (Thu Oct 16, 11:19 am)
Re: [PATCH] Enable console on PCI serial devices, Yinghai Lu, (Thu Oct 16, 11:30 am)
Re: [PATCH] Enable console on PCI serial devices, Bjorn Helgaas, (Thu Oct 16, 4:16 pm)
Re: [PATCH] Enable console on PCI serial devices, Yinghai Lu, (Thu Oct 16, 8:32 pm)
Re: [PATCH] Enable console on PCI serial devices, Alan Cox, (Fri Oct 17, 2:28 am)
Re: [PATCH] Enable console on PCI serial devices, Bjorn Helgaas, (Fri Oct 17, 7:44 am)
Re: [PATCH] Enable console on PCI serial devices, Bjorn Helgaas, (Fri Oct 17, 7:46 am)
Re: [PATCH] Enable console on PCI serial devices, Bjorn Helgaas, (Fri Oct 17, 9:39 am)
Re: [PATCH] Enable console on PCI serial devices, Yinghai Lu, (Fri Oct 17, 10:01 am)
Re: [PATCH] Enable console on PCI serial devices, Lennart Sorensen, (Mon Oct 20, 9:44 am)
Re: [PATCH] Enable console on PCI serial devices, Bjorn Helgaas, (Mon Oct 20, 10:11 am)
Re: [PATCH] Enable console on PCI serial devices, Bjorn Helgaas, (Mon Oct 20, 12:11 pm)
Re: [PATCH] Enable console on PCI serial devices, Bjorn Helgaas, (Tue Oct 21, 3:08 pm)