Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45763 )
Change subject: soc/intel/braswell: Update GNVS using common save state accessors
......................................................................
soc/intel/braswell: Update GNVS using common save state accessors
Change-Id: I5a7ba328968cb5c29a6e7c3e1eda8663c77cd676
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/soc/intel/braswell/smihandler.c
1 file changed, 7 insertions(+), 41 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/45763/1
diff --git a/src/soc/intel/braswell/smihandler.c b/src/soc/intel/braswell/smihandler.c
index 4d3b67e..2af6613 100644
--- a/src/soc/intel/braswell/smihandler.c
+++ b/src/soc/intel/braswell/smihandler.c
@@ -7,7 +7,7 @@
#include <console/console.h>
#include <cpu/x86/cache.h>
#include <cpu/x86/smm.h>
-#include <cpu/intel/em64t100_save_state.h>
+#include <cpu/x86/save_state.h>
#include <device/pci_def.h>
#include <elog.h>
#include <soc/nvs.h>
@@ -184,45 +184,9 @@
}
}
-/*
- * Look for Synchronous IO SMI and use save state from that core in case
- * we are not running on the same core that initiated the IO transaction.
- */
-static em64t100_smm_state_save_area_t *smi_apmc_find_state_save(uint8_t cmd)
-{
- em64t100_smm_state_save_area_t *state;
- int node;
-
- /* Check all nodes looking for the one that issued the IO */
- for (node = 0; node < CONFIG_MAX_CPUS; node++) {
- state = smm_get_save_state(node);
-
- /* Check for Synchronous IO (bit0==1) */
- if (!(state->io_misc_info & (1 << 0)))
- continue;
-
- /* Make sure it was a write (bit4==0) */
- if (state->io_misc_info & (1 << 4))
- continue;
-
- /* Check for APMC IO port */
- if (((state->io_misc_info >> 16) & 0xff) != APM_CNT)
- continue;
-
- /* Check AX against the requested command */
- if ((state->rax & 0xff) != cmd)
- continue;
-
- return state;
- }
-
- return NULL;
-}
-
static void southbridge_smi_apmc(void)
{
uint8_t reg8;
- em64t100_smm_state_save_area_t *state;
/* Emulate B2 register as the FADT / Linux expects it */
@@ -257,10 +221,12 @@
printk(BIOS_DEBUG, "SMI#: SMM structures already initialized!\n");
return;
}
- state = smi_apmc_find_state_save(reg8);
- if (state) {
- /* EBX in the state save contains the GNVS pointer */
- gnvs = (struct global_nvs *)((uint32_t)state->rbx);
+ int node = get_apmc_node(reg8);
+ if (node >= 0) {
+ if (get_save_state_reg(RBX, node, &gnvs, sizeof(gnvs))) {
+ printk(BIOS_ERR, "SMI#: Unable to get GNVS pointer\n");
+ return;
+ }
if (smm_points_to_smram(gnvs, sizeof(*gnvs))) {
printk(BIOS_ERR, "SMI#: ERROR: GNVS overlaps SMM\n");
return;
--
To view, visit https://review.coreboot.org/c/coreboot/+/45763
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I5a7ba328968cb5c29a6e7c3e1eda8663c77cd676
Gerrit-Change-Number: 45763
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45762 )
Change subject: soc/intel/baytrail: Update GNVS using common save state accessors
......................................................................
soc/intel/baytrail: Update GNVS using common save state accessors
Change-Id: Ifbb9506cad9949f723f8a2eb05a95c426742a06e
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/soc/intel/baytrail/smihandler.c
1 file changed, 7 insertions(+), 41 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/45762/1
diff --git a/src/soc/intel/baytrail/smihandler.c b/src/soc/intel/baytrail/smihandler.c
index cf47341..1048a3a 100644
--- a/src/soc/intel/baytrail/smihandler.c
+++ b/src/soc/intel/baytrail/smihandler.c
@@ -6,7 +6,7 @@
#include <console/console.h>
#include <cpu/x86/cache.h>
#include <cpu/x86/smm.h>
-#include <cpu/intel/em64t100_save_state.h>
+#include <cpu/x86/save_state.h>
#include <device/pci_def.h>
#include <elog.h>
#include <halt.h>
@@ -152,41 +152,6 @@
}
/*
- * Look for Synchronous IO SMI and use save state from that core in case
- * we are not running on the same core that initiated the IO transaction.
- */
-static em64t100_smm_state_save_area_t *smi_apmc_find_state_save(uint8_t cmd)
-{
- em64t100_smm_state_save_area_t *state;
- int node;
-
- /* Check all nodes looking for the one that issued the IO */
- for (node = 0; node < CONFIG_MAX_CPUS; node++) {
- state = smm_get_save_state(node);
-
- /* Check for Synchronous IO (bit0==1) */
- if (!(state->io_misc_info & (1 << 0)))
- continue;
-
- /* Make sure it was a write (bit4==0) */
- if (state->io_misc_info & (1 << 4))
- continue;
-
- /* Check for APMC IO port */
- if (((state->io_misc_info >> 16) & 0xff) != APM_CNT)
- continue;
-
- /* Check AX against the requested command */
- if ((state->rax & 0xff) != cmd)
- continue;
-
- return state;
- }
-
- return NULL;
-}
-
-/*
* soc_legacy: A payload (Depthcharge) has indicated that the
* legacy payload (SeaBIOS) is being loaded. Switch devices that are
* in ACPI mode to PCI mode so that non-ACPI drivers may work.
@@ -243,7 +208,6 @@
static void southbridge_smi_apmc(void)
{
uint8_t reg8;
- em64t100_smm_state_save_area_t *state;
/* Emulate B2 register as the FADT / Linux expects it */
@@ -278,10 +242,12 @@
printk(BIOS_DEBUG, "SMI#: SMM structures already initialized!\n");
return;
}
- state = smi_apmc_find_state_save(reg8);
- if (state) {
- /* EBX in the state save contains the GNVS pointer */
- gnvs = (struct global_nvs *)((uint32_t)state->rbx);
+ int node = get_apmc_node(reg8);
+ if (node >= 0) {
+ if (get_save_state_reg(RBX, node, &gnvs, sizeof(gnvs))) {
+ printk(BIOS_ERR, "SMI#: ERROR: unable to get GNVS pointer\n");
+ return;
+ }
if (smm_points_to_smram(gnvs, sizeof(*gnvs))) {
printk(BIOS_ERR, "SMI#: ERROR: GNVS overlaps SMM\n");
return;
--
To view, visit https://review.coreboot.org/c/coreboot/+/45762
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ifbb9506cad9949f723f8a2eb05a95c426742a06e
Gerrit-Change-Number: 45762
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45761 )
Change subject: soc/intel/broadwell: Update GNVS using common save state accessors
......................................................................
soc/intel/broadwell: Update GNVS using common save state accessors
Change-Id: I66970b5d4d6408ed1810146d03a803e1cd54951d
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/soc/intel/broadwell/smihandler.c
1 file changed, 7 insertions(+), 42 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/45761/1
diff --git a/src/soc/intel/broadwell/smihandler.c b/src/soc/intel/broadwell/smihandler.c
index 8068a3c..ee0a817 100644
--- a/src/soc/intel/broadwell/smihandler.c
+++ b/src/soc/intel/broadwell/smihandler.c
@@ -9,7 +9,7 @@
#include <cpu/x86/cache.h>
#include <device/pci_def.h>
#include <cpu/x86/smm.h>
-#include <cpu/intel/em64t101_save_state.h>
+#include <cpu/x86/save_state.h>
#include <spi-generic.h>
#include <elog.h>
#include <halt.h>
@@ -235,46 +235,9 @@
}
}
-/*
- * Look for Synchronous IO SMI and use save state from that
- * core in case we are not running on the same core that
- * initiated the IO transaction.
- */
-static em64t101_smm_state_save_area_t *smi_apmc_find_state_save(u8 cmd)
-{
- em64t101_smm_state_save_area_t *state;
- int node;
-
- /* Check all nodes looking for the one that issued the IO */
- for (node = 0; node < CONFIG_MAX_CPUS; node++) {
- state = smm_get_save_state(node);
-
- /* Check for Synchronous IO (bit0==1) */
- if (!(state->io_misc_info & (1 << 0)))
- continue;
-
- /* Make sure it was a write (bit4==0) */
- if (state->io_misc_info & (1 << 4))
- continue;
-
- /* Check for APMC IO port */
- if (((state->io_misc_info >> 16) & 0xff) != APM_CNT)
- continue;
-
- /* Check AX against the requested command */
- if ((state->rax & 0xff) != cmd)
- continue;
-
- return state;
- }
-
- return NULL;
-}
-
static void southbridge_smi_apmc(void)
{
u8 reg8;
- em64t101_smm_state_save_area_t *state;
/* Emulate B2 register as the FADT / Linux expects it */
@@ -300,10 +263,12 @@
"SMI#: SMM structures already initialized!\n");
return;
}
- state = smi_apmc_find_state_save(reg8);
- if (state) {
- /* EBX in the state save contains the GNVS pointer */
- gnvs = (struct global_nvs *)((u32)state->rbx);
+ int node = get_apmc_node(reg8);
+ if (node >= 0) {
+ if (get_save_state_reg(RBX, node, &gnvs, sizeof(gnvs))) {
+ printk(BIOS_ERR, "SMI#: ERROR: unable to get GNVS pointer\n");
+ return;
+ }
if (smm_points_to_smram(gnvs, sizeof(*gnvs))) {
printk(BIOS_ERR, "SMI#: ERROR: GNVS overlaps SMM\n");
return;
--
To view, visit https://review.coreboot.org/c/coreboot/+/45761
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I66970b5d4d6408ed1810146d03a803e1cd54951d
Gerrit-Change-Number: 45761
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45760 )
Change subject: sb/intel/lynxpoint: Update GNVS using common save state accessors
......................................................................
sb/intel/lynxpoint: Update GNVS using common save state accessors
Change-Id: I4dd53d4bba20fd813137bc166e7eda547085db56
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/southbridge/intel/lynxpoint/smihandler.c
1 file changed, 8 insertions(+), 42 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/45760/1
diff --git a/src/southbridge/intel/lynxpoint/smihandler.c b/src/southbridge/intel/lynxpoint/smihandler.c
index 7890b17..0b88ec8 100644
--- a/src/southbridge/intel/lynxpoint/smihandler.c
+++ b/src/southbridge/intel/lynxpoint/smihandler.c
@@ -7,7 +7,7 @@
#include <cpu/x86/cache.h>
#include <device/pci_def.h>
#include <cpu/x86/smm.h>
-#include <cpu/intel/em64t101_save_state.h>
+#include <cpu/x86/save_state.h>
#include <elog.h>
#include <halt.h>
#include <option.h>
@@ -181,46 +181,10 @@
}
}
-/*
- * Look for Synchronous IO SMI and use save state from that
- * core in case we are not running on the same core that
- * initiated the IO transaction.
- */
-static em64t101_smm_state_save_area_t *smi_apmc_find_state_save(u8 cmd)
-{
- em64t101_smm_state_save_area_t *state;
- int node;
-
- /* Check all nodes looking for the one that issued the IO */
- for (node = 0; node < CONFIG_MAX_CPUS; node++) {
- state = smm_get_save_state(node);
-
- /* Check for Synchronous IO (bit0 == 1) */
- if (!(state->io_misc_info & (1 << 0)))
- continue;
-
- /* Make sure it was a write (bit4 == 0) */
- if (state->io_misc_info & (1 << 4))
- continue;
-
- /* Check for APMC IO port */
- if (((state->io_misc_info >> 16) & 0xff) != APM_CNT)
- continue;
-
- /* Check AX against the requested command */
- if ((state->rax & 0xff) != cmd)
- continue;
-
- return state;
- }
-
- return NULL;
-}
-
static void southbridge_smi_apmc(void)
{
u8 reg8;
- em64t101_smm_state_save_area_t *state;
+ int node;
static int chipset_finalized = 0;
/* Emulate B2 register as the FADT / Linux expects it */
@@ -268,10 +232,12 @@
"SMI#: SMM structures already initialized!\n");
return;
}
- state = smi_apmc_find_state_save(reg8);
- if (state) {
- /* EBX in the state save contains the GNVS pointer */
- gnvs = (struct global_nvs *)((u32)state->rbx);
+ int node = get_apmc_node(reg8);
+ if (node >= 0) {
+ if (get_save_state_reg(RBX, node, &gnvs, sizeof(gnvs))) {
+ printk(BIOS_ERR, "SMI#: ERROR: unable to get GNVS pointer\n");
+ return;
+ }
if (smm_points_to_smram(gnvs, sizeof(*gnvs))) {
printk(BIOS_ERR, "SMI#: ERROR: GNVS overlaps SMM\n");
return;
--
To view, visit https://review.coreboot.org/c/coreboot/+/45760
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4dd53d4bba20fd813137bc166e7eda547085db56
Gerrit-Change-Number: 45760
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange