[Skiboot] [PATCH 01/17] op_display: make platform function rather than "FSP" specific

Stewart Smith stewart at linux.ibm.com
Tue Jun 18 17:29:09 AEST 2019


We have an implementation for non-FSP systems now, and we shouldn't be
calling that from code in an fsp/ directory, so move op_display() to a
platform function.

Signed-off-by: Stewart Smith <stewart at linux.ibm.com>
---
 core/platform.c                | 6 ++++++
 hw/fsp/fsp-op-panel.c          | 6 ++----
 include/fsp.h                  | 2 ++
 include/platform.h             | 8 ++++++++
 platforms/astbmc/barreleye.c   | 1 +
 platforms/astbmc/firestone.c   | 1 +
 platforms/astbmc/garrison.c    | 1 +
 platforms/astbmc/habanero.c    | 1 +
 platforms/astbmc/p8dnu.c       | 1 +
 platforms/astbmc/p8dtu.c       | 2 ++
 platforms/astbmc/p9dsu.c       | 1 +
 platforms/astbmc/palmetto.c    | 1 +
 platforms/astbmc/romulus.c     | 1 +
 platforms/astbmc/talos.c       | 1 +
 platforms/astbmc/vesnin.c      | 1 +
 platforms/astbmc/witherspoon.c | 1 +
 platforms/astbmc/zaius.c       | 1 +
 platforms/ibm-fsp/firenze.c    | 1 +
 platforms/ibm-fsp/zz.c         | 1 +
 19 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/core/platform.c b/core/platform.c
index afa00adf7157..efcf63d7719e 100644
--- a/core/platform.c
+++ b/core/platform.c
@@ -295,3 +295,9 @@ int wait_for_resource_loaded(enum resource_id id, uint32_t idx)
 	      id, idx, waited);
 	return r;
 }
+
+void op_display(enum op_severity sev, enum op_module mod, uint16_t code)
+{
+	if (platform.op_display)
+		platform.op_display(sev, mod, code);
+}
diff --git a/hw/fsp/fsp-op-panel.c b/hw/fsp/fsp-op-panel.c
index 6477e73c1c4d..530871f8eb35 100644
--- a/hw/fsp/fsp-op-panel.c
+++ b/hw/fsp/fsp-op-panel.c
@@ -49,16 +49,14 @@ static void fsp_op_display_fatal(uint32_t w0, uint32_t w1)
 	fsp_fatal_msg(&op_msg);
 }
 
-void op_display(enum op_severity sev, enum op_module mod, uint16_t code)
+void fsp_op_display(enum op_severity sev, enum op_module mod, uint16_t code)
 {
 	struct fsp_msg *op_msg;
 	uint32_t w0;
 	uint32_t w1;
 
-	if (!fsp_present()) {
-		op_display_lpc(sev, mod, code);
+	if (!fsp_present())
 		return;
-	}
 
 	w0 = sev << 16 | mod;
 
diff --git a/include/fsp.h b/include/fsp.h
index cfa51afbc7c4..0df7f93f9ff5 100644
--- a/include/fsp.h
+++ b/include/fsp.h
@@ -853,4 +853,6 @@ extern void fsp_chiptod_init(void);
 /* Terminate immediate */
 extern void __attribute__((noreturn)) ibm_fsp_terminate(const char *msg);
 
+void fsp_op_display(enum op_severity sev, enum op_module mod, uint16_t code);
+
 #endif /* __FSP_H */
diff --git a/include/platform.h b/include/platform.h
index 4f8627a3a680..9a77586a9cbf 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -237,6 +237,14 @@ struct platform {
 	 * SEEPROM update routine
 	 */
 	void		(*seeprom_update)(void);
+
+	/*
+	 * Operator Panel display
+	 * Physical FSP op panel or LPC port 80h
+	 * or any other "get boot status out to the user" thing.
+	 */
+	void (*op_display)(enum op_severity sev, enum op_module mod,
+			   uint16_t code);
 };
 
 extern struct platform __platforms_start;
diff --git a/platforms/astbmc/barreleye.c b/platforms/astbmc/barreleye.c
index 554aacf12105..6cc55370acae 100644
--- a/platforms/astbmc/barreleye.c
+++ b/platforms/astbmc/barreleye.c
@@ -172,4 +172,5 @@ DECLARE_PLATFORM(barreleye) = {
 	.resource_loaded	= flash_resource_loaded,
 	.exit			= ipmi_wdt_final_reset,
 	.terminate		= ipmi_terminate,
+	.op_display		= op_display_lpc,
 };
diff --git a/platforms/astbmc/firestone.c b/platforms/astbmc/firestone.c
index 28719e300fb0..29ee377c2df6 100644
--- a/platforms/astbmc/firestone.c
+++ b/platforms/astbmc/firestone.c
@@ -159,4 +159,5 @@ DECLARE_PLATFORM(firestone) = {
 	.resource_loaded	= flash_resource_loaded,
 	.exit			= ipmi_wdt_final_reset,
 	.terminate		= ipmi_terminate,
+	.op_display		= op_display_lpc,
 };
diff --git a/platforms/astbmc/garrison.c b/platforms/astbmc/garrison.c
index ddd33721ccfd..b931057dc740 100644
--- a/platforms/astbmc/garrison.c
+++ b/platforms/astbmc/garrison.c
@@ -306,4 +306,5 @@ DECLARE_PLATFORM(garrison) = {
 	.exit			= ipmi_wdt_final_reset,
 	.terminate		= ipmi_terminate,
 	.seeprom_update		= astbmc_seeprom_update,
+	.op_display		= op_display_lpc,
 };
diff --git a/platforms/astbmc/habanero.c b/platforms/astbmc/habanero.c
index ab010278a711..068c31545820 100644
--- a/platforms/astbmc/habanero.c
+++ b/platforms/astbmc/habanero.c
@@ -150,4 +150,5 @@ DECLARE_PLATFORM(habanero) = {
 	.exit			= ipmi_wdt_final_reset,
 	.terminate		= ipmi_terminate,
 	.seeprom_update		= astbmc_seeprom_update,
+	.op_display		= op_display_lpc,
 };
diff --git a/platforms/astbmc/p8dnu.c b/platforms/astbmc/p8dnu.c
index 391aa7a8b814..8d7d16be341e 100644
--- a/platforms/astbmc/p8dnu.c
+++ b/platforms/astbmc/p8dnu.c
@@ -362,4 +362,5 @@ DECLARE_PLATFORM(p8dnu) = {
 	.exit			= ipmi_wdt_final_reset,
 	.terminate		= ipmi_terminate,
 	.seeprom_update		= astbmc_seeprom_update,
+	.op_display		= op_display_lpc,
 };
diff --git a/platforms/astbmc/p8dtu.c b/platforms/astbmc/p8dtu.c
index 6f66dc22e8e7..f4a0c7fb97a5 100644
--- a/platforms/astbmc/p8dtu.c
+++ b/platforms/astbmc/p8dtu.c
@@ -263,6 +263,7 @@ DECLARE_PLATFORM(p8dtu1u) = {
 	.exit			= ipmi_wdt_final_reset,
 	.terminate		= ipmi_terminate,
 	.seeprom_update		= astbmc_seeprom_update,
+	.op_display		= op_display_lpc,
 };
 
 DECLARE_PLATFORM(p8dtu2u) = {
@@ -281,5 +282,6 @@ DECLARE_PLATFORM(p8dtu2u) = {
 	.exit			= ipmi_wdt_final_reset,
 	.terminate		= ipmi_terminate,
 	.seeprom_update		= astbmc_seeprom_update,
+	.op_display		= op_display_lpc,
 };
 
diff --git a/platforms/astbmc/p9dsu.c b/platforms/astbmc/p9dsu.c
index eeb8fd76284d..72645ec1c615 100644
--- a/platforms/astbmc/p9dsu.c
+++ b/platforms/astbmc/p9dsu.c
@@ -732,4 +732,5 @@ DECLARE_PLATFORM(p9dsu1u) = {
 	.elog_commit		= ipmi_elog_commit,
 	.exit			= ipmi_wdt_final_reset,
 	.terminate		= ipmi_terminate,
+	.op_display		= op_display_lpc,
 };
diff --git a/platforms/astbmc/palmetto.c b/platforms/astbmc/palmetto.c
index 29739c03b771..9136d15e9908 100644
--- a/platforms/astbmc/palmetto.c
+++ b/platforms/astbmc/palmetto.c
@@ -133,4 +133,5 @@ DECLARE_PLATFORM(palmetto) = {
 	.resource_loaded	= flash_resource_loaded,
 	.exit			= ipmi_wdt_final_reset,
 	.terminate		= ipmi_terminate,
+	.op_display		= op_display_lpc,
 };
diff --git a/platforms/astbmc/romulus.c b/platforms/astbmc/romulus.c
index 7bb07cce5363..3e4003a772e2 100644
--- a/platforms/astbmc/romulus.c
+++ b/platforms/astbmc/romulus.c
@@ -82,4 +82,5 @@ DECLARE_PLATFORM(romulus) = {
 	.elog_commit		= ipmi_elog_commit,
 	.exit			= astbmc_exit,
 	.terminate		= ipmi_terminate,
+	.op_display		= op_display_lpc,
 };
diff --git a/platforms/astbmc/talos.c b/platforms/astbmc/talos.c
index 0dea87ef23b5..f4cbb769be0f 100644
--- a/platforms/astbmc/talos.c
+++ b/platforms/astbmc/talos.c
@@ -83,4 +83,5 @@ DECLARE_PLATFORM(talos) = {
 	.elog_commit		= ipmi_elog_commit,
 	.exit			= astbmc_exit,
 	.terminate		= ipmi_terminate,
+	.op_display		= op_display_lpc,
 };
diff --git a/platforms/astbmc/vesnin.c b/platforms/astbmc/vesnin.c
index 47e98e7198c4..8ec1ebc62566 100644
--- a/platforms/astbmc/vesnin.c
+++ b/platforms/astbmc/vesnin.c
@@ -352,4 +352,5 @@ DECLARE_PLATFORM(vesnin) = {
 	.resource_loaded	= flash_resource_loaded,
 	.exit			= ipmi_wdt_final_reset,
 	.terminate		= ipmi_terminate,
+	.op_display		= op_display_lpc,
 };
diff --git a/platforms/astbmc/witherspoon.c b/platforms/astbmc/witherspoon.c
index 52971ecfd6b6..dd53b4f72247 100644
--- a/platforms/astbmc/witherspoon.c
+++ b/platforms/astbmc/witherspoon.c
@@ -512,4 +512,5 @@ DECLARE_PLATFORM(witherspoon) = {
 	.pci_get_slot_info	= dt_slot_get_slot_info,
 	.ocapi                  = &witherspoon_ocapi,
 	.npu2_device_detect	= witherspoon_npu2_device_detect,
+	.op_display		= op_display_lpc,
 };
diff --git a/platforms/astbmc/zaius.c b/platforms/astbmc/zaius.c
index 23a40725ccf8..ae8ca4bb885f 100644
--- a/platforms/astbmc/zaius.c
+++ b/platforms/astbmc/zaius.c
@@ -269,4 +269,5 @@ DECLARE_PLATFORM(zaius) = {
 	.terminate		= ipmi_terminate,
 	.ocapi			= &zaius_ocapi,
 	.npu2_device_detect	= npu2_i2c_presence_detect,
+	.op_display		= op_display_lpc,
 };
diff --git a/platforms/ibm-fsp/firenze.c b/platforms/ibm-fsp/firenze.c
index dc705466acb5..8f6a3921b2f6 100644
--- a/platforms/ibm-fsp/firenze.c
+++ b/platforms/ibm-fsp/firenze.c
@@ -226,4 +226,5 @@ DECLARE_PLATFORM(firenze) = {
 	.resource_loaded	= fsp_resource_loaded,
 	.sensor_read		= ibm_fsp_sensor_read,
 	.terminate		= ibm_fsp_terminate,
+	.op_display		= fsp_op_display,
 };
diff --git a/platforms/ibm-fsp/zz.c b/platforms/ibm-fsp/zz.c
index 705906a041d5..09599f85e842 100644
--- a/platforms/ibm-fsp/zz.c
+++ b/platforms/ibm-fsp/zz.c
@@ -90,4 +90,5 @@ DECLARE_PLATFORM(zz) = {
 	.terminate		= ibm_fsp_terminate,
 	.ocapi			= &zz_ocapi,
 	.npu2_device_detect	= npu2_i2c_presence_detect,
+	.op_display		= fsp_op_display,
 };
-- 
2.21.0



More information about the Skiboot mailing list