summaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block/include/intelblocks
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@chromium.org>2017-08-04 16:12:19 -0700
committerFurquan Shaikh <furquan@google.com>2017-08-10 16:25:05 +0000
commita8198eb9ad1daea7b88ffa1d995907783a7c13c3 (patch)
tree2519bfef060373e47aca2e80e2d24d0e5cd54d57 /src/soc/intel/common/block/include/intelblocks
parent3b90b5f1299053e87e718501f6c9be50dd343686 (diff)
soc/intel/common/uart: Add support for enabling UART debug controller on resume
It has been observed on a number of platforms (baytrail, kaby lake) that if serial console is not enabled in coreboot, but is enabled in kernel (v4.4), then on resume kernel hangs. In order to fix this, add support for enabling UART debug port controller on resume. In order to decide whether UART debug port controller should be enabled in ramstage, following things are checked in given order: 1. If coreboot has serial console enabled, there is no need to re-initialize the controller. 2. This special action is taken only for UART debug port controller. 3. If boot is not S3 resume, then initialization is skipped. 4. Callback into SoC to check if it wants to initialize the controller. If all the above conditions are met, then UART debug port controller is initialized and taken out of reset. BUG=b:64030366 TEST=Verified with the entire patchset series that: 1. If coreboot does not have serial console enabled, but Linux kernel has console enabled, then on resume, coreboot initializes UART debug port controller. 2. If coreboot and Linux do not have serial console enabled, then coreboot does not initialize UART debug port controller. 3. If coreboot has serial console enabled, there is no change in behavior. Change-Id: Ic936ac2a787fdc83935103c3ce4ed8f124a97a89 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/20835 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/soc/intel/common/block/include/intelblocks')
-rw-r--r--src/soc/intel/common/block/include/intelblocks/uart.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/include/intelblocks/uart.h b/src/soc/intel/common/block/include/intelblocks/uart.h
index 9ec5004e08..78feb3e246 100644
--- a/src/soc/intel/common/block/include/intelblocks/uart.h
+++ b/src/soc/intel/common/block/include/intelblocks/uart.h
@@ -18,6 +18,7 @@
#include <arch/io.h>
#include <device/device.h>
+#include <stdint.h>
/*
* Common routine to initialize UART controller PCI config space, take it out of
@@ -25,7 +26,44 @@
*/
void uart_common_init(device_t dev, uintptr_t baseaddr);
+/*
+ * Check if UART debug controller is initialized
+ * Returns:
+ * true = If debug controller PCI config space is initialized and device is
+ * out of reset
+ * false = otherwise
+ */
+bool uart_debug_controller_is_initialized(void);
+
+/*
+ * Check if dev corresponds to UART debug port controller.
+ *
+ * Returns:
+ * true: UART dev is debug port
+ * false: otherwise
+ */
+bool uart_is_debug_controller(struct device *dev);
+
+/**************************** SoC callbacks ***********************************/
void pch_uart_read_resources(struct device *dev);
+/*
+ * Check if UART debug port controller needs to be initialized on resume.
+ *
+ * Returns:
+ * true = when SoC wants common code to do the UART debug port initialization
+ * false = otherwise
+ */
+bool pch_uart_init_debug_controller_on_resume(void);
+
+/*
+ * Get UART debug controller device structure
+ *
+ * Returns:
+ * Pointer to device structure = If device has a UART debug controller.
+ * NULL = otherwise
+ */
+device_t pch_uart_get_debug_controller(void);
+
#endif /* SOC_INTEL_COMMON_BLOCK_UART_H */