From 7c256405c35a0609dc03441f3fc698d9d578a3d6 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Tue, 13 Jan 2015 13:07:48 -0800 Subject: ipq806x: initialize UART even when console is not enabled The ipq806x UART is based on the same universal serial port which can be also configured as i2c or SPI. Configuring it is not a trivial task, so in case the kernel wants to use earlyprintk() the port needs to be configured by the firmware. Invoking uart_init() when the console is not enabled causes include file collisions, which would require changes to more than 100 files. Leaving this to another day, rearranging the ipq806x driver to be able to invoke UART initialization function even when serial console is not configured. Also add a check to avoid initialization if UART has been already set up. BRANCH=storm BUG=chrome-os-partner:35364 TEST=verified that storm console is still fully operational when enabled, and that the kernel boots fine to the serial console login prompt even if the firmware console is disabled. Change-Id: Ibbbab875449f2ac2f0d6c504c18faf0da8251ffa Signed-off-by: Patrick Georgi Original-Commit-Id: c512d6c1d0c0868137d1213ea84cd4bca58872db Original-Change-Id: I421acba3edf398d960b5058f15d1abb80ebc7660 Original-Signed-off-by: Vadim Bendebury Original-Reviewed-on: https://chromium-review.googlesource.com/240516 Original-Reviewed-by: David Hendricks Reviewed-on: http://review.coreboot.org/9794 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/soc/qualcomm/ipq806x/soc.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/soc/qualcomm/ipq806x/soc.c') diff --git a/src/soc/qualcomm/ipq806x/soc.c b/src/soc/qualcomm/ipq806x/soc.c index 1d63cacf60..2170ae0d7b 100644 --- a/src/soc/qualcomm/ipq806x/soc.c +++ b/src/soc/qualcomm/ipq806x/soc.c @@ -22,6 +22,7 @@ #include #include #include +#include #define RESERVED_SIZE_KB (0x01500000 / KiB) @@ -35,6 +36,12 @@ static void soc_read_resources(device_t dev) static void soc_init(device_t dev) { + /* + * Do this in case console is not enabled: kernel's earlyprintk() + * should work no matter what the firmware console configuration is. + */ + ipq806x_uart_init(); + printk(BIOS_INFO, "CPU: Qualcomm 8064\n"); } -- cgit v1.2.3