[coreboot-gerrit] Change in coreboot[master]: soc/intel/common: Allow SoC to enable UART resources

Furquan Shaikh (Code Review) gerrit at coreboot.org
Tue Aug 1 21:22:28 CEST 2017


Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/20851


Change subject: soc/intel/common: Allow SoC to enable UART resources
......................................................................

soc/intel/common: Allow SoC to enable UART resources

This changed provides a callback pch_uart_enable_resources that allows
SoC to enable UART controller if necessary. This is required to
workaround the issue where Linux kernel hangs on resume if serial
console is disabled in coreboot but enabled in kernel.

BUG=b:64030366

Change-Id: Id21447b090d8ed8c44b3b464f49ea12de58fbee2
Signed-off-by: Furquan Shaikh <furquan at chromium.org>
---
M src/soc/intel/common/block/include/intelblocks/uart.h
M src/soc/intel/common/block/uart/uart.c
2 files changed, 13 insertions(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/51/20851/1

diff --git a/src/soc/intel/common/block/include/intelblocks/uart.h b/src/soc/intel/common/block/include/intelblocks/uart.h
index b46edd7..133ef75 100644
--- a/src/soc/intel/common/block/include/intelblocks/uart.h
+++ b/src/soc/intel/common/block/include/intelblocks/uart.h
@@ -23,5 +23,6 @@
 		uint32_t clk_m_val, uint32_t clk_n_val);
 
 void pch_uart_read_resources(struct device *dev);
+void pch_uart_enable_resources(struct device *dev);
 
 #endif	/* SOC_INTEL_COMMON_BLOCK_UART_H */
diff --git a/src/soc/intel/common/block/uart/uart.c b/src/soc/intel/common/block/uart/uart.c
index 632fb95..c6e4011 100644
--- a/src/soc/intel/common/block/uart/uart.c
+++ b/src/soc/intel/common/block/uart/uart.c
@@ -43,10 +43,21 @@
 	pci_dev_read_resources(dev);
 }
 
+__attribute__((weak)) void pch_uart_enable_resources(struct device *dev)
+{
+	/* Default weak implementation - does nothing. */
+}
+
+static void uart_common_enable_resources(struct device *dev)
+{
+	pci_dev_enable_resources(dev);
+	pch_uart_enable_resources(dev);
+}
+
 static struct device_operations device_ops = {
 	.read_resources		= &pch_uart_read_resources,
 	.set_resources		= &pci_dev_set_resources,
-	.enable_resources		= &pci_dev_enable_resources,
+	.enable_resources		= &uart_common_enable_resources,
 };
 
 static const unsigned short pci_device_ids[] = {

-- 
To view, visit https://review.coreboot.org/20851
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id21447b090d8ed8c44b3b464f49ea12de58fbee2
Gerrit-Change-Number: 20851
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170801/6e35848b/attachment.html>


More information about the coreboot-gerrit mailing list