summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDoug Anderson <dianders@chromium.org>2011-09-22 13:16:57 -0700
committerDoug Anderson <dianders@chromium.org>2011-09-23 15:56:08 -0700
commit16581e0aab24f8457e7ec803e35659b06b1ab9f9 (patch)
tree2b5a440a05bd4d3e89c49caae8501648d2145f18 /drivers
parenta5049abf85217d6da4bb725d59ddfe018beea6b3 (diff)
CHROMIUM: arm: Specify debugging serial port at boot.
This works together with a kernel change that looks at the scratchpad register to determine which of the many UARTs it should use for early printing: <http://gerrit.chromium.org/gerrit/8148>. While it is unfortunate to need to pass this information in a second way (it's already in the device tree), this does allow the very early boot code (decompressing stub and early assembly code) to print to the right port. At the moment, I'm adding this to the UART init function. Alternatively, we could add a more complex patch to key off of the 'console' setting. BUG=chromium-os:19656 TEST=See <http://gerrit.chromium.org/gerrit/8148> Change-Id: Iea374625f22b9fa64cf22820dfd530eca1c38bb0 Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-on: http://gerrit.chromium.org/gerrit/8156
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/ns16550.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 04217de3db..8b45106a53 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -69,6 +69,12 @@ void NS16550_init (NS16550_t com_port, int baud_divisor)
serial_out(baud_divisor & 0xff, &com_port->dll);
serial_out((baud_divisor >> 8) & 0xff, &com_port->dlm);
serial_out(UART_LCRVAL, &com_port->lcr);
+
+ /*
+ * Put a 'D' in the scratchpad to let the kernel know which UART
+ * for earlyprintk [D]ebugging.
+ */
+ serial_out('D', &com_port->spr);
#if defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)
#if defined(CONFIG_APTIX)
serial_out(3, &com_port->mdr1); /* /13 mode so Aptix 6MHz can hit 115200 */