[coreboot-gerrit] Change in ...coreboot[master]: elog: make elog's SMM handler code follow everything else

Patrick Georgi (Code Review) gerrit at coreboot.org
Mon Dec 3 16:14:39 CET 2018


Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30022


Change subject: elog: make elog's SMM handler code follow everything else
......................................................................

elog: make elog's SMM handler code follow everything else

Instead of ELOG_GSMI_APM_CNT use APM_CNT_ELOG_GSMI and define it in
cpu/x86/smm.h

Change-Id: I3a3e2f823c91b475d1e15b8c20e9cf5f3fd9de83
Signed-off-by: Patrick Georgi <pgeorgi at google.com>
---
M src/include/cpu/x86/smm.h
M src/include/elog.h
M src/soc/amd/stoneyridge/smihandler.c
M src/soc/intel/baytrail/smihandler.c
M src/soc/intel/braswell/smihandler.c
M src/soc/intel/broadwell/smihandler.c
M src/soc/intel/common/block/smm/smihandler.c
M src/soc/intel/fsp_baytrail/smihandler.c
M src/southbridge/intel/common/smihandler.c
M src/southbridge/intel/ibexpeak/smihandler.c
M src/southbridge/intel/lynxpoint/smihandler.c
11 files changed, 19 insertions(+), 21 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/30022/1

diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h
index 379b512..857ab35 100644
--- a/src/include/cpu/x86/smm.h
+++ b/src/include/cpu/x86/smm.h
@@ -473,6 +473,7 @@
 #define APM_CNT_GNVS_UPDATE	0xea
 #define APM_CNT_FINALIZE	0xcb
 #define APM_CNT_LEGACY		0xcc
+#define APM_CNT_ELOG_GSMI	0xef
 #define APM_STS		0xb3
 
 /* SMI handler function prototypes */
diff --git a/src/include/elog.h b/src/include/elog.h
index 8aecf2c..31891e0 100644
--- a/src/include/elog.h
+++ b/src/include/elog.h
@@ -16,9 +16,6 @@
 #ifndef ELOG_H_
 #define ELOG_H_
 
-/* SMI command code for GSMI event logging */
-#define ELOG_GSMI_APM_CNT                 0xEF
-
 #define MAX_EVENT_SIZE                    0x7F
 
 /* End of log */
diff --git a/src/soc/amd/stoneyridge/smihandler.c b/src/soc/amd/stoneyridge/smihandler.c
index a5e66a8..a662bc5d 100644
--- a/src/soc/amd/stoneyridge/smihandler.c
+++ b/src/soc/amd/stoneyridge/smihandler.c
@@ -72,7 +72,7 @@
 	amd64_smm_state_save_area_t *io_smi;
 	u32 reg_ebx;
 
-	io_smi = find_save_state(ELOG_GSMI_APM_CNT);
+	io_smi = find_save_state(APM_CNT_ELOG_GSMI);
 	if (!io_smi)
 		return;
 	/* Command and return value in EAX */
@@ -101,7 +101,7 @@
 		reg32 &= ~(1 << 0);	/* clear SCI_EN */
 		acpi_write32(MMIO_ACPI_PM1_CNT_BLK, reg32);
 		break;
-	case ELOG_GSMI_APM_CNT:
+	case APM_CNT_ELOG_GSMI:
 		if (IS_ENABLED(CONFIG_ELOG_GSMI))
 			southbridge_smi_gsmi();
 		break;
diff --git a/src/soc/intel/baytrail/smihandler.c b/src/soc/intel/baytrail/smihandler.c
index c222739..3f8727d 100644
--- a/src/soc/intel/baytrail/smihandler.c
+++ b/src/soc/intel/baytrail/smihandler.c
@@ -214,7 +214,7 @@
 	u32 *ret, *param;
 	uint8_t sub_command;
 	em64t100_smm_state_save_area_t *io_smi =
-		smi_apmc_find_state_save(ELOG_GSMI_APM_CNT);
+		smi_apmc_find_state_save(APM_CNT_ELOG_GSMI);
 
 	if (!io_smi)
 		return;
@@ -347,7 +347,7 @@
 		}
 		break;
 #if IS_ENABLED(CONFIG_ELOG_GSMI)
-	case ELOG_GSMI_APM_CNT:
+	case APM_CNT_ELOG_GSMI:
 		southbridge_smi_gsmi();
 		break;
 #endif
diff --git a/src/soc/intel/braswell/smihandler.c b/src/soc/intel/braswell/smihandler.c
index edbb766..a4d2d88 100644
--- a/src/soc/intel/braswell/smihandler.c
+++ b/src/soc/intel/braswell/smihandler.c
@@ -263,7 +263,7 @@
 	u32 *ret, *param;
 	uint8_t sub_command;
 	em64t100_smm_state_save_area_t *io_smi =
-		smi_apmc_find_state_save(ELOG_GSMI_APM_CNT);
+		smi_apmc_find_state_save(APM_CNT_ELOG_GSMI);
 
 	if (!io_smi)
 		return;
@@ -344,7 +344,7 @@
 		}
 		break;
 #if IS_ENABLED(CONFIG_ELOG_GSMI)
-	case ELOG_GSMI_APM_CNT:
+	case APM_CNT_ELOG_GSMI:
 		southbridge_smi_gsmi();
 		break;
 #endif
diff --git a/src/soc/intel/broadwell/smihandler.c b/src/soc/intel/broadwell/smihandler.c
index 24f6a3d..64a315d 100644
--- a/src/soc/intel/broadwell/smihandler.c
+++ b/src/soc/intel/broadwell/smihandler.c
@@ -300,7 +300,7 @@
 	u32 *ret, *param;
 	u8 sub_command;
 	em64t101_smm_state_save_area_t *io_smi =
-		smi_apmc_find_state_save(ELOG_GSMI_APM_CNT);
+		smi_apmc_find_state_save(APM_CNT_ELOG_GSMI);
 
 	if (!io_smi)
 		return;
@@ -374,7 +374,7 @@
 		}
 		break;
 #if IS_ENABLED(CONFIG_ELOG_GSMI)
-	case ELOG_GSMI_APM_CNT:
+	case APM_CNT_ELOG_GSMI:
 		southbridge_smi_gsmi();
 		break;
 #endif
diff --git a/src/soc/intel/common/block/smm/smihandler.c b/src/soc/intel/common/block/smm/smihandler.c
index 0832bb5..093c50e 100644
--- a/src/soc/intel/common/block/smm/smihandler.c
+++ b/src/soc/intel/common/block/smm/smihandler.c
@@ -279,7 +279,7 @@
 	void *io_smi = NULL;
 	uint32_t reg_ebx;
 
-	io_smi = find_save_state(save_state_ops, ELOG_GSMI_APM_CNT);
+	io_smi = find_save_state(save_state_ops, APM_CNT_ELOG_GSMI);
 	if (!io_smi)
 		return;
 	/* Command and return value in EAX */
@@ -387,7 +387,7 @@
 			printk(BIOS_DEBUG, "SMI#: Setting GNVS to %p\n", gnvs);
 		}
 		break;
-	case ELOG_GSMI_APM_CNT:
+	case APM_CNT_ELOG_GSMI:
 		if (IS_ENABLED(CONFIG_ELOG_GSMI))
 			southbridge_smi_gsmi(save_state_ops);
 		break;
diff --git a/src/soc/intel/fsp_baytrail/smihandler.c b/src/soc/intel/fsp_baytrail/smihandler.c
index 48c828b..e8021ce 100644
--- a/src/soc/intel/fsp_baytrail/smihandler.c
+++ b/src/soc/intel/fsp_baytrail/smihandler.c
@@ -212,7 +212,7 @@
 	u32 *ret, *param;
 	uint8_t sub_command;
 	em64t100_smm_state_save_area_t *io_smi =
-		smi_apmc_find_state_save(ELOG_GSMI_APM_CNT);
+		smi_apmc_find_state_save(APM_CNT_ELOG_GSMI);
 
 	if (!io_smi)
 		return;
@@ -274,7 +274,7 @@
 		}
 		break;
 #if IS_ENABLED(CONFIG_ELOG_GSMI)
-	case ELOG_GSMI_APM_CNT:
+	case APM_CNT_ELOG_GSMI:
 		southbridge_smi_gsmi();
 		break;
 #endif
diff --git a/src/southbridge/intel/common/smihandler.c b/src/southbridge/intel/common/smihandler.c
index 0ad400c..6347ad6 100644
--- a/src/southbridge/intel/common/smihandler.c
+++ b/src/southbridge/intel/common/smihandler.c
@@ -249,7 +249,7 @@
 	u32 *ret, *param;
 	u8 sub_command;
 	em64t101_smm_state_save_area_t *io_smi =
-		smi_apmc_find_state_save(ELOG_GSMI_APM_CNT);
+		smi_apmc_find_state_save(APM_CNT_ELOG_GSMI);
 
 	if (!io_smi)
 		return;
@@ -316,7 +316,7 @@
 		mainboard_finalized = 1;
 		break;
 #if IS_ENABLED(CONFIG_ELOG_GSMI)
-	case ELOG_GSMI_APM_CNT:
+	case APM_CNT_ELOG_GSMI:
 		southbridge_smi_gsmi();
 		break;
 #endif
diff --git a/src/southbridge/intel/ibexpeak/smihandler.c b/src/southbridge/intel/ibexpeak/smihandler.c
index b70273c..e510f19 100644
--- a/src/southbridge/intel/ibexpeak/smihandler.c
+++ b/src/southbridge/intel/ibexpeak/smihandler.c
@@ -537,7 +537,7 @@
 	u32 *ret, *param;
 	u8 sub_command;
 	em64t101_smm_state_save_area_t *io_smi =
-		smi_apmc_find_state_save(ELOG_GSMI_APM_CNT);
+		smi_apmc_find_state_save(APM_CNT_ELOG_GSMI);
 
 	if (!io_smi)
 		return;
@@ -604,7 +604,7 @@
 		}
 		break;
 #if IS_ENABLED(CONFIG_ELOG_GSMI)
-	case ELOG_GSMI_APM_CNT:
+	case APM_CNT_ELOG_GSMI:
 		southbridge_smi_gsmi();
 		break;
 #endif
diff --git a/src/southbridge/intel/lynxpoint/smihandler.c b/src/southbridge/intel/lynxpoint/smihandler.c
index a3965d0..72298f3 100644
--- a/src/southbridge/intel/lynxpoint/smihandler.c
+++ b/src/southbridge/intel/lynxpoint/smihandler.c
@@ -253,7 +253,7 @@
 	u32 *ret, *param;
 	u8 sub_command;
 	em64t101_smm_state_save_area_t *io_smi =
-		smi_apmc_find_state_save(ELOG_GSMI_APM_CNT);
+		smi_apmc_find_state_save(APM_CNT_ELOG_GSMI);
 
 	if (!io_smi)
 		return;
@@ -333,7 +333,7 @@
 		usb_xhci_route_all();
 		break;
 #if IS_ENABLED(CONFIG_ELOG_GSMI)
-	case ELOG_GSMI_APM_CNT:
+	case APM_CNT_ELOG_GSMI:
 		southbridge_smi_gsmi();
 		break;
 #endif

-- 
To view, visit https://review.coreboot.org/c/coreboot/+/30022
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3a3e2f823c91b475d1e15b8c20e9cf5f3fd9de83
Gerrit-Change-Number: 30022
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi at google.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181203/0578a32c/attachment.html>


More information about the coreboot-gerrit mailing list