ACPI: Replace uses of CBMEM_ID_ACPI_GNVS
Change-Id: I45a2d9cb7f07609a1ff03fd70f17c3f2d4f013b9 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/48705 Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
committed by
Nico Huber
parent
46e37c6343
commit
9f441dfc70
@ -7,7 +7,6 @@
|
|||||||
#include <acpi/acpi.h>
|
#include <acpi/acpi.h>
|
||||||
#include <acpi/acpi_gnvs.h>
|
#include <acpi/acpi_gnvs.h>
|
||||||
#include <bootstate.h>
|
#include <bootstate.h>
|
||||||
#include <cbmem.h>
|
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <cpu/x86/smm.h>
|
#include <cpu/x86/smm.h>
|
||||||
#include <device/device.h>
|
#include <device/device.h>
|
||||||
@ -486,18 +485,13 @@ void southcluster_enable_dev(struct device *dev)
|
|||||||
|
|
||||||
static void southcluster_inject_dsdt(const struct device *device)
|
static void southcluster_inject_dsdt(const struct device *device)
|
||||||
{
|
{
|
||||||
struct global_nvs *gnvs;
|
struct global_nvs *gnvs = acpi_get_gnvs();
|
||||||
|
if (!gnvs)
|
||||||
|
return;
|
||||||
|
|
||||||
gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS);
|
|
||||||
|
|
||||||
if (gnvs) {
|
|
||||||
acpi_create_gnvs(gnvs);
|
acpi_create_gnvs(gnvs);
|
||||||
|
|
||||||
/* Add it to DSDT. */
|
acpi_inject_nvsa();
|
||||||
acpigen_write_scope("\\");
|
|
||||||
acpigen_write_name_dword("NVSA", (u32) gnvs);
|
|
||||||
acpigen_pop_len();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct device_operations device_ops = {
|
static struct device_operations device_ops = {
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
#include <acpi/acpigen.h>
|
#include <acpi/acpigen.h>
|
||||||
#include <device/mmio.h>
|
#include <device/mmio.h>
|
||||||
#include <arch/smp/mpspec.h>
|
#include <arch/smp/mpspec.h>
|
||||||
#include <cbmem.h>
|
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <cpu/intel/turbo.h>
|
#include <cpu/intel/turbo.h>
|
||||||
#include <cpu/x86/msr.h>
|
#include <cpu/x86/msr.h>
|
||||||
@ -367,18 +366,13 @@ unsigned long southcluster_write_acpi_tables(const struct device *device, unsign
|
|||||||
|
|
||||||
void southcluster_inject_dsdt(const struct device *device)
|
void southcluster_inject_dsdt(const struct device *device)
|
||||||
{
|
{
|
||||||
struct global_nvs *gnvs;
|
struct global_nvs *gnvs = acpi_get_gnvs();
|
||||||
|
if (!gnvs)
|
||||||
|
return;
|
||||||
|
|
||||||
gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS);
|
|
||||||
|
|
||||||
if (gnvs) {
|
|
||||||
acpi_create_gnvs(gnvs);
|
acpi_create_gnvs(gnvs);
|
||||||
|
|
||||||
/* Add it to DSDT */
|
acpi_inject_nvsa();
|
||||||
acpigen_write_scope("\\");
|
|
||||||
acpigen_write_name_dword("NVSA", (u32) gnvs);
|
|
||||||
acpigen_pop_len();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void acpi_create_serialio_ssdt(acpi_header_t *ssdt)
|
__weak void acpi_create_serialio_ssdt(acpi_header_t *ssdt)
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#include <acpi/acpi.h>
|
#include <acpi/acpi.h>
|
||||||
#include <acpi/acpi_gnvs.h>
|
#include <acpi/acpi_gnvs.h>
|
||||||
#include <cpu/x86/smm.h>
|
#include <cpu/x86/smm.h>
|
||||||
#include <cbmem.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <soc/gpio.h>
|
#include <soc/gpio.h>
|
||||||
#include <soc/iobp.h>
|
#include <soc/iobp.h>
|
||||||
@ -603,12 +602,9 @@ static void pch_lpc_read_resources(struct device *dev)
|
|||||||
|
|
||||||
static void southcluster_inject_dsdt(const struct device *device)
|
static void southcluster_inject_dsdt(const struct device *device)
|
||||||
{
|
{
|
||||||
struct global_nvs *gnvs;
|
struct global_nvs *gnvs = acpi_get_gnvs();
|
||||||
|
if (!gnvs)
|
||||||
gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS);
|
return;
|
||||||
|
|
||||||
if (gnvs) {
|
|
||||||
acpi_create_gnvs(gnvs);
|
|
||||||
|
|
||||||
/* Set unknown wake source */
|
/* Set unknown wake source */
|
||||||
gnvs->pm1i = -1;
|
gnvs->pm1i = -1;
|
||||||
@ -616,11 +612,8 @@ static void southcluster_inject_dsdt(const struct device *device)
|
|||||||
/* CPU core count */
|
/* CPU core count */
|
||||||
gnvs->pcnt = dev_count_cpu();
|
gnvs->pcnt = dev_count_cpu();
|
||||||
|
|
||||||
/* Add it to DSDT. */
|
acpi_create_gnvs(gnvs);
|
||||||
acpigen_write_scope("\\");
|
acpi_inject_nvsa();
|
||||||
acpigen_write_name_dword("NVSA", (u32) gnvs);
|
|
||||||
acpigen_pop_len();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned long broadwell_write_acpi_tables(const struct device *device,
|
static unsigned long broadwell_write_acpi_tables(const struct device *device,
|
||||||
|
@ -241,18 +241,12 @@ __weak void acpi_create_gnvs(struct global_nvs *gnvs)
|
|||||||
|
|
||||||
void southbridge_inject_dsdt(const struct device *device)
|
void southbridge_inject_dsdt(const struct device *device)
|
||||||
{
|
{
|
||||||
struct global_nvs *gnvs;
|
struct global_nvs *gnvs = acpi_get_gnvs();
|
||||||
|
if (!gnvs)
|
||||||
|
return;
|
||||||
|
|
||||||
gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS);
|
|
||||||
|
|
||||||
if (gnvs) {
|
|
||||||
acpi_create_gnvs(gnvs);
|
acpi_create_gnvs(gnvs);
|
||||||
|
acpi_inject_nvsa();
|
||||||
/* Add it to DSDT. */
|
|
||||||
acpigen_write_scope("\\");
|
|
||||||
acpigen_write_name_dword("NVSA", (uintptr_t) gnvs);
|
|
||||||
acpigen_pop_len();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int common_calculate_power_ratio(int tdp, int p1_ratio, int ratio)
|
int common_calculate_power_ratio(int tdp, int p1_ratio, int ratio)
|
||||||
|
@ -243,18 +243,12 @@ unsigned long southcluster_write_acpi_tables(const struct device *device,
|
|||||||
|
|
||||||
void southcluster_inject_dsdt(const struct device *device)
|
void southcluster_inject_dsdt(const struct device *device)
|
||||||
{
|
{
|
||||||
struct global_nvs *gnvs;
|
struct global_nvs *gnvs = acpi_get_gnvs();
|
||||||
|
if (!gnvs)
|
||||||
|
return;
|
||||||
|
|
||||||
gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS);
|
|
||||||
|
|
||||||
if (gnvs) {
|
|
||||||
acpi_create_gnvs(gnvs);
|
acpi_create_gnvs(gnvs);
|
||||||
|
acpi_inject_nvsa();
|
||||||
/* Add it to DSDT. */
|
|
||||||
acpigen_write_scope("\\");
|
|
||||||
acpigen_write_name_dword("NVSA", (u32)gnvs);
|
|
||||||
acpigen_pop_len();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void acpi_create_serialio_ssdt(acpi_header_t *ssdt) {}
|
__weak void acpi_create_serialio_ssdt(acpi_header_t *ssdt) {}
|
||||||
|
@ -524,18 +524,12 @@ unsigned long southbridge_write_acpi_tables(const struct device *device,
|
|||||||
|
|
||||||
void southbridge_inject_dsdt(const struct device *device)
|
void southbridge_inject_dsdt(const struct device *device)
|
||||||
{
|
{
|
||||||
struct global_nvs *gnvs;
|
struct global_nvs *gnvs = acpi_get_gnvs();
|
||||||
|
if (!gnvs)
|
||||||
|
return;
|
||||||
|
|
||||||
gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS);
|
|
||||||
|
|
||||||
if (gnvs) {
|
|
||||||
acpi_create_gnvs(gnvs);
|
acpi_create_gnvs(gnvs);
|
||||||
|
acpi_inject_nvsa();
|
||||||
/* Add it to DSDT. */
|
|
||||||
acpigen_write_scope("\\");
|
|
||||||
acpigen_write_name_dword("NVSA", (u32) (uintptr_t)gnvs);
|
|
||||||
acpigen_pop_len();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save wake source information for calculating ACPI _SWS values */
|
/* Save wake source information for calculating ACPI _SWS values */
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
#include <acpi/acpi.h>
|
#include <acpi/acpi.h>
|
||||||
#include <acpi/acpi_gnvs.h>
|
#include <acpi/acpi_gnvs.h>
|
||||||
#include <cpu/x86/smm.h>
|
#include <cpu/x86/smm.h>
|
||||||
#include <cbmem.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
#include "iobp.h"
|
#include "iobp.h"
|
||||||
@ -697,22 +696,17 @@ void *gnvs_chromeos_ptr(struct global_nvs *gnvs)
|
|||||||
|
|
||||||
void southbridge_inject_dsdt(const struct device *dev)
|
void southbridge_inject_dsdt(const struct device *dev)
|
||||||
{
|
{
|
||||||
struct global_nvs *gnvs;
|
struct global_nvs *gnvs = acpi_get_gnvs();
|
||||||
|
if (!gnvs)
|
||||||
|
return;
|
||||||
|
|
||||||
gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS);
|
|
||||||
|
|
||||||
if (gnvs) {
|
|
||||||
acpi_create_gnvs(gnvs);
|
acpi_create_gnvs(gnvs);
|
||||||
|
|
||||||
gnvs->apic = 1;
|
gnvs->apic = 1;
|
||||||
gnvs->mpen = 1; /* Enable Multi Processing */
|
gnvs->mpen = 1; /* Enable Multi Processing */
|
||||||
gnvs->pcnt = dev_count_cpu();
|
gnvs->pcnt = dev_count_cpu();
|
||||||
|
|
||||||
/* Add it to DSDT. */
|
acpi_inject_nvsa();
|
||||||
acpigen_write_scope("\\");
|
|
||||||
acpigen_write_name_dword("NVSA", (u32)gnvs);
|
|
||||||
acpigen_pop_len();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *lpc_acpi_name(const struct device *dev)
|
static const char *lpc_acpi_name(const struct device *dev)
|
||||||
|
Reference in New Issue
Block a user