[coreboot-gerrit] Change in coreboot[master]: acpi: remove CBMEM_ID_ACPI_GNVS_PTR entry

Joel Kitching (Code Review) gerrit at coreboot.org
Fri Aug 17 13:08:48 CEST 2018


Joel Kitching has uploaded this change for review. ( https://review.coreboot.org/28189


Change subject: acpi: remove CBMEM_ID_ACPI_GNVS_PTR entry
......................................................................

acpi: remove CBMEM_ID_ACPI_GNVS_PTR entry

Since we can retrieve the address of ACPI GNVS directly
from CBMEM_ID_ACPI_GNVS, there is no need to store and
update a pointer separately.

Signed-off-by: Joel Kitching <kitching at google.com>
Change-Id: I59f3d0547a4a724e66617c791ad82c9f504cadea
---
M src/arch/x86/acpi.c
M src/arch/x86/acpi_s3.c
M src/arch/x86/include/arch/acpi.h
M src/commonlib/include/commonlib/cbmem_id.h
M src/soc/amd/stoneyridge/acpi.c
M src/soc/intel/baytrail/southcluster.c
M src/soc/intel/braswell/acpi.c
M src/soc/intel/broadwell/lpc.c
M src/soc/intel/common/block/acpi/acpi.c
M src/soc/intel/denverton_ns/acpi.c
M src/soc/intel/fsp_baytrail/acpi.c
M src/soc/intel/skylake/acpi.c
M src/southbridge/intel/fsp_rangeley/lpc.c
M src/southbridge/intel/lynxpoint/lpc.c
14 files changed, 4 insertions(+), 25 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/28189/1

diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c
index 8d7579d..78eeaa7 100644
--- a/src/arch/x86/acpi.c
+++ b/src/arch/x86/acpi.c
@@ -1252,13 +1252,6 @@
 	return wake_vec;
 }
 
-void acpi_save_gnvs(u32 gnvs_address)
-{
-	u32 *gnvs = cbmem_add(CBMEM_ID_ACPI_GNVS_PTR, sizeof(*gnvs));
-	if (gnvs)
-		*gnvs = gnvs_address;
-}
-
 __weak int acpi_get_gpe(int gpe)
 {
 	return -1; /* implemented by SOC */
diff --git a/src/arch/x86/acpi_s3.c b/src/arch/x86/acpi_s3.c
index f6ed108..28e8f89 100644
--- a/src/arch/x86/acpi_s3.c
+++ b/src/arch/x86/acpi_s3.c
@@ -226,13 +226,13 @@
 void acpi_resume(void *wake_vec)
 {
 	if (IS_ENABLED(CONFIG_HAVE_SMI_HANDLER)) {
-		u32 *gnvs_address = cbmem_find(CBMEM_ID_ACPI_GNVS_PTR);
+		u32 *gnvs_address = cbmem_find(CBMEM_ID_ACPI_GNVS);
 
 		/* Restore GNVS pointer in SMM if found */
-		if (gnvs_address && *gnvs_address) {
+		if (gnvs_address) {
 			printk(BIOS_DEBUG, "Restore GNVS pointer to 0x%08x\n",
-			       *gnvs_address);
-			smm_setup_structures((void *)*gnvs_address, NULL, NULL);
+			       (u32)gnvs_address);
+			smm_setup_structures((void *)gnvs_address, NULL, NULL);
 		}
 	}
 
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index 1811965..40fbd54 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -771,8 +771,6 @@
 unsigned long acpi_create_hest_error_source(acpi_hest_t *hest,
 	acpi_hest_esd_t *esd, u16 type, void *data, u16 len);
 
-void acpi_save_gnvs(u32 gnvs_address);
-
 /* For ACPI S3 support. */
 void acpi_fail_wakeup(void);
 void acpi_resume(void *wake_vec);
diff --git a/src/commonlib/include/commonlib/cbmem_id.h b/src/commonlib/include/commonlib/cbmem_id.h
index 287de1d..042ea6e 100644
--- a/src/commonlib/include/commonlib/cbmem_id.h
+++ b/src/commonlib/include/commonlib/cbmem_id.h
@@ -19,7 +19,6 @@
 
 #define CBMEM_ID_ACPI		0x41435049
 #define CBMEM_ID_ACPI_GNVS	0x474e5653
-#define CBMEM_ID_ACPI_GNVS_PTR	0x474e5650
 #define CBMEM_ID_AFTER_CAR	0xc4787a93
 #define CBMEM_ID_AGESA_RUNTIME	0x41474553
 #define CBMEM_ID_AMDMCT_MEMINFO 0x494D454E
@@ -81,7 +80,6 @@
 #define CBMEM_ID_TO_NAME_TABLE				 \
 	{ CBMEM_ID_ACPI,		"ACPI       " }, \
 	{ CBMEM_ID_ACPI_GNVS,		"ACPI GNVS  " }, \
-	{ CBMEM_ID_ACPI_GNVS_PTR,	"GNVS PTR   " }, \
 	{ CBMEM_ID_AGESA_RUNTIME,	"AGESA RSVD " }, \
 	{ CBMEM_ID_AFTER_CAR,		"AFTER CAR  " }, \
 	{ CBMEM_ID_AMDMCT_MEMINFO,	"AMDMEM INFO" }, \
diff --git a/src/soc/amd/stoneyridge/acpi.c b/src/soc/amd/stoneyridge/acpi.c
index 466b545..7b4f07b 100644
--- a/src/soc/amd/stoneyridge/acpi.c
+++ b/src/soc/amd/stoneyridge/acpi.c
@@ -293,7 +293,6 @@
 
 	if (gnvs) {
 		acpi_create_gnvs(gnvs);
-		acpi_save_gnvs((uintptr_t)gnvs);
 
 		/* Add it to DSDT */
 		acpigen_write_scope("\\");
diff --git a/src/soc/intel/baytrail/southcluster.c b/src/soc/intel/baytrail/southcluster.c
index 8dd8986..83f4227 100644
--- a/src/soc/intel/baytrail/southcluster.c
+++ b/src/soc/intel/baytrail/southcluster.c
@@ -509,7 +509,6 @@
 
 	if (gnvs) {
 		acpi_create_gnvs(gnvs);
-		acpi_save_gnvs((unsigned long)gnvs);
 		/* And tell SMI about it */
 		smm_setup_structures(gnvs, NULL, NULL);
 
diff --git a/src/soc/intel/braswell/acpi.c b/src/soc/intel/braswell/acpi.c
index 91d4925..ebca9fa 100644
--- a/src/soc/intel/braswell/acpi.c
+++ b/src/soc/intel/braswell/acpi.c
@@ -542,7 +542,6 @@
 			gnvs->cid1 = wifi_regulatory_domain();
 		else
 			gnvs->cid1 = WRDD_DEFAULT_REGULATORY_DOMAIN;
-		acpi_save_gnvs((unsigned long)gnvs);
 		/* And tell SMI about it */
 		smm_setup_structures(gnvs, NULL, NULL);
 
diff --git a/src/soc/intel/broadwell/lpc.c b/src/soc/intel/broadwell/lpc.c
index c13c92a..ff7ff81 100644
--- a/src/soc/intel/broadwell/lpc.c
+++ b/src/soc/intel/broadwell/lpc.c
@@ -607,7 +607,6 @@
 
 	if (gnvs) {
 		acpi_create_gnvs(gnvs);
-		acpi_save_gnvs((unsigned long)gnvs);
 		/* And tell SMI about it */
 		smm_setup_structures(gnvs, NULL, NULL);
 
diff --git a/src/soc/intel/common/block/acpi/acpi.c b/src/soc/intel/common/block/acpi/acpi.c
index 01a4928..17ee85c 100644
--- a/src/soc/intel/common/block/acpi/acpi.c
+++ b/src/soc/intel/common/block/acpi/acpi.c
@@ -237,7 +237,6 @@
 
 	if (gnvs) {
 		acpi_create_gnvs(gnvs);
-		acpi_save_gnvs((uintptr_t) gnvs);
 		/* And tell SMI about it */
 		smm_setup_structures(gnvs, NULL, NULL);
 
diff --git a/src/soc/intel/denverton_ns/acpi.c b/src/soc/intel/denverton_ns/acpi.c
index 640dc79..07278c5 100644
--- a/src/soc/intel/denverton_ns/acpi.c
+++ b/src/soc/intel/denverton_ns/acpi.c
@@ -319,7 +319,6 @@
 
 	if (gnvs) {
 		acpi_create_gnvs(gnvs);
-		acpi_save_gnvs((unsigned long)gnvs);
 		/* And tell SMI about it */
 		smm_setup_structures(gnvs, NULL, NULL);
 
diff --git a/src/soc/intel/fsp_baytrail/acpi.c b/src/soc/intel/fsp_baytrail/acpi.c
index 7ce1b35..748b6cf 100644
--- a/src/soc/intel/fsp_baytrail/acpi.c
+++ b/src/soc/intel/fsp_baytrail/acpi.c
@@ -594,7 +594,6 @@
 
 	if (gnvs) {
 		acpi_create_gnvs(gnvs);
-		acpi_save_gnvs((unsigned long)gnvs);
 		/* And tell SMI about it */
 		smm_setup_structures(gnvs, NULL, NULL);
 
diff --git a/src/soc/intel/skylake/acpi.c b/src/soc/intel/skylake/acpi.c
index 5bed118..06c4ede 100644
--- a/src/soc/intel/skylake/acpi.c
+++ b/src/soc/intel/skylake/acpi.c
@@ -668,7 +668,6 @@
 	if (gnvs) {
 		acpi_create_gnvs(gnvs);
 		acpi_mainboard_gnvs(gnvs);
-		acpi_save_gnvs((unsigned long)gnvs);
 		/* And tell SMI about it */
 		smm_setup_structures(gnvs, NULL, NULL);
 
diff --git a/src/southbridge/intel/fsp_rangeley/lpc.c b/src/southbridge/intel/fsp_rangeley/lpc.c
index a8b8757..88cc73f 100644
--- a/src/southbridge/intel/fsp_rangeley/lpc.c
+++ b/src/southbridge/intel/fsp_rangeley/lpc.c
@@ -434,7 +434,6 @@
 	if (gnvs) {
 		memset(gnvs, 0, sizeof(*gnvs));
 		acpi_create_gnvs(gnvs);
-		acpi_save_gnvs((unsigned long)gnvs);
 #if IS_ENABLED(CONFIG_HAVE_SMI_HANDLER)
 		/* And tell SMI about it */
 		smm_setup_structures(gnvs, NULL, NULL);
diff --git a/src/southbridge/intel/lynxpoint/lpc.c b/src/southbridge/intel/lynxpoint/lpc.c
index 9d686de..8f695cd 100644
--- a/src/southbridge/intel/lynxpoint/lpc.c
+++ b/src/southbridge/intel/lynxpoint/lpc.c
@@ -779,7 +779,6 @@
 		gnvs->ndid = gfx->ndid;
 		memcpy(gnvs->did, gfx->did, sizeof(gnvs->did));
 
-		acpi_save_gnvs((unsigned long)gnvs);
 		/* And tell SMI about it */
 		smm_setup_structures(gnvs, NULL, NULL);
 

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I59f3d0547a4a724e66617c791ad82c9f504cadea
Gerrit-Change-Number: 28189
Gerrit-PatchSet: 1
Gerrit-Owner: Joel Kitching <kitching at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180817/5cd549dc/attachment-0001.html>


More information about the coreboot-gerrit mailing list