summaryrefslogtreecommitdiff
path: root/src/soc/intel/denverton_ns
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2020-06-17 23:37:49 +0300
committerPatrick Georgi <pgeorgi@google.com>2020-06-30 09:19:10 +0000
commit0c1dd9c84188cc150a05302cc9b4af476a761d2b (patch)
treecf8249cc3ba689e903c64d926c162c1e1f742d78 /src/soc/intel/denverton_ns
parentbc1cb38ce15e059988263b04c0ea751ddf4b052d (diff)
ACPI: Drop typedef global_nvs_t
Bring all GNVS related initialisation function to global scope to force identical signatures. Followup work is likely to remove some as duplicates. Change-Id: Id4299c41d79c228f3d35bc7cb9bf427ce1e82ba1 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/42489 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/denverton_ns')
-rw-r--r--src/soc/intel/denverton_ns/acpi.c5
-rw-r--r--src/soc/intel/denverton_ns/include/soc/acpi.h1
-rw-r--r--src/soc/intel/denverton_ns/include/soc/nvs.h7
-rw-r--r--src/soc/intel/denverton_ns/smihandler.c6
4 files changed, 8 insertions, 11 deletions
diff --git a/src/soc/intel/denverton_ns/acpi.c b/src/soc/intel/denverton_ns/acpi.c
index 3f416b6cd9..92a9c2a771 100644
--- a/src/soc/intel/denverton_ns/acpi.c
+++ b/src/soc/intel/denverton_ns/acpi.c
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <acpi/acpi.h>
+#include <acpi/acpi_gnvs.h>
#include <acpi/acpigen.h>
#include <arch/smp/mpspec.h>
#include <cpu/x86/smm.h>
@@ -57,7 +58,7 @@ static acpi_cstate_t cstate_map[] = {
}
};
-void acpi_init_gnvs(global_nvs_t *gnvs)
+void acpi_init_gnvs(struct global_nvs *gnvs)
{
/* CPU core count */
gnvs->pcnt = dev_count_cpu();
@@ -280,7 +281,7 @@ unsigned long southcluster_write_acpi_tables(const struct device *device,
void southcluster_inject_dsdt(const struct device *device)
{
- global_nvs_t *gnvs;
+ struct global_nvs *gnvs;
gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS);
if (!gnvs) {
diff --git a/src/soc/intel/denverton_ns/include/soc/acpi.h b/src/soc/intel/denverton_ns/include/soc/acpi.h
index 00700a6aab..9bc5ed0924 100644
--- a/src/soc/intel/denverton_ns/include/soc/acpi.h
+++ b/src/soc/intel/denverton_ns/include/soc/acpi.h
@@ -8,7 +8,6 @@
void acpi_create_serialio_ssdt(acpi_header_t *ssdt);
unsigned long acpi_madt_irq_overrides(unsigned long current);
-void acpi_init_gnvs(global_nvs_t *gnvs);
unsigned long southcluster_write_acpi_tables(const struct device *device,
unsigned long current,
struct acpi_rsdp *rsdp);
diff --git a/src/soc/intel/denverton_ns/include/soc/nvs.h b/src/soc/intel/denverton_ns/include/soc/nvs.h
index 0195643a51..4aaabc9538 100644
--- a/src/soc/intel/denverton_ns/include/soc/nvs.h
+++ b/src/soc/intel/denverton_ns/include/soc/nvs.h
@@ -3,7 +3,7 @@
#ifndef _DENVERTON_NS_NVS_H_
#define _DENVERTON_NS_NVS_H_
-typedef struct global_nvs_t {
+struct __packed global_nvs {
/* Miscellaneous */
u16 osys; /* 0x00 - Operating System */
u8 smif; /* 0x02 - SMI function call ("TRAP") */
@@ -47,9 +47,6 @@ typedef struct global_nvs_t {
u32 tsegl; /* 0x58 - TSEG Length/Size */
u8 rsvd3[164];
-} __packed global_nvs_t;
-
-/* Used in SMM to find the ACPI GNVS address */
-global_nvs_t *smm_get_gnvs(void);
+};
#endif /* _DENVERTON_NS_NVS_H_ */
diff --git a/src/soc/intel/denverton_ns/smihandler.c b/src/soc/intel/denverton_ns/smihandler.c
index b81eb1157f..aa87630906 100644
--- a/src/soc/intel/denverton_ns/smihandler.c
+++ b/src/soc/intel/denverton_ns/smihandler.c
@@ -17,7 +17,7 @@
#include <soc/nvs.h>
/* GNVS needs to be set by coreboot initiating a software SMI. */
-static global_nvs_t *gnvs;
+static struct global_nvs *gnvs;
static int smm_initialized;
int southbridge_io_trap_handler(int smif)
@@ -39,7 +39,7 @@ int southbridge_io_trap_handler(int smif)
void southbridge_smi_set_eos(void) { enable_smi(EOS); }
-global_nvs_t *smm_get_gnvs(void) { return gnvs; }
+struct global_nvs *smm_get_gnvs(void) { return gnvs; }
static void busmaster_disable_on_bus(int bus)
{
@@ -241,7 +241,7 @@ static void southbridge_smi_apmc(void)
state = smi_apmc_find_state_save(reg8);
if (state) {
/* EBX in the state save contains the GNVS pointer */
- gnvs = (global_nvs_t *)((uint32_t)state->rbx);
+ gnvs = (struct global_nvs *)((uint32_t)state->rbx);
smm_initialized = 1;
printk(BIOS_DEBUG, "SMI#: Setting GNVS to %p\n", gnvs);
}