Move nehalem/sandy/ivy to per-device acpi

Change-Id: I3d664ab575bf9c49a7bff9a395fbab96748430d0
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/6802
Reviewed-by: Aaron Durbin <adurbin@google.com>
Tested-by: build bot (Jenkins)
This commit is contained in:
Vladimir Serbinenko
2014-09-02 22:25:36 +02:00
parent 955ca5d948
commit 35c0f439fc
32 changed files with 150 additions and 2223 deletions

View File

@@ -36,6 +36,7 @@ config SOUTH_BRIDGE_OPTIONS # dummy
select PCIEXP_ASPM
select PCIEXP_COMMON_CLOCK
select SPI_FLASH
select PER_DEVICE_ACPI_TABLES
config EHCI_BAR
hex

View File

@@ -31,8 +31,8 @@ Name(\DSEN, 1) // Display Output Switching Enable
* we have to fix it up in coreboot's ACPI creation phase.
*/
OperationRegion (GNVS, SystemMemory, 0xC0DEBABE, 0xf00)
External(NVSA)
OperationRegion (GNVS, SystemMemory, NVSA, 0xf00)
Field (GNVS, ByteAcc, NoLock, Preserve)
{
/* Miscellaneous */

View File

@@ -30,7 +30,11 @@
#include <arch/acpi.h>
#include <cpu/cpu.h>
#include <elog.h>
#include <arch/acpigen.h>
#include <drivers/intel/gma/i915.h>
#include <cbmem.h>
#include "pch.h"
#include "nvs.h"
#define NMI_OFF 0
@@ -663,6 +667,31 @@ static void set_subsystem(device_t dev, unsigned vendor, unsigned device)
}
}
static unsigned long southbridge_fill_ssdt(unsigned long current, const char *oem_table_id)
{
global_nvs_t *gnvs = cbmem_add (CBMEM_ID_ACPI_GNVS, sizeof (*gnvs));
void *opregion;
/* Calling northbridge code as gnvs contains opregion address. */
opregion = igd_make_opregion();
if (gnvs) {
int scopelen;
acpi_create_gnvs(gnvs);
/* IGD OpRegion Base Address */
gnvs->aslb = (u32)opregion;
/* And tell SMI about it */
smm_setup_structures(gnvs, NULL, NULL);
/* Add it to SSDT. */
scopelen = acpigen_write_scope("\\");
scopelen += acpigen_write_name_dword("NVSA", (u32) gnvs);
acpigen_patch_len(scopelen - 1);
}
return (unsigned long) (acpigen_get_current());
}
static struct pci_operations pci_ops = {
.set_subsystem = set_subsystem,
};
@@ -671,6 +700,8 @@ static struct device_operations device_ops = {
.read_resources = pch_lpc_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pch_lpc_enable_resources,
.write_acpi_tables = acpi_write_hpet,
.acpi_fill_ssdt_generator = southbridge_fill_ssdt,
.init = lpc_init,
.enable = pch_lpc_enable,
.scan_bus = scan_static_bus,

View File

@@ -158,3 +158,4 @@ typedef struct {
/* Used in SMM to find the ACPI GNVS address */
global_nvs_t *smm_get_gnvs(void);
#endif
void acpi_create_gnvs(global_nvs_t *gnvs);

View File

@@ -34,6 +34,7 @@ config SOUTH_BRIDGE_OPTIONS # dummy
select SPI_FLASH
select SOUTHBRIDGE_INTEL_COMMON
select HAVE_USBDEBUG_OPTIONS
select PER_DEVICE_ACPI_TABLES
config EHCI_BAR
hex

View File

@@ -31,7 +31,11 @@
#include <arch/acpi.h>
#include <cpu/cpu.h>
#include <elog.h>
#include <arch/acpigen.h>
#include <drivers/intel/gma/i915.h>
#include <cbmem.h>
#include "pch.h"
#include "nvs.h"
#define NMI_OFF 0
@@ -660,6 +664,31 @@ static void set_subsystem(device_t dev, unsigned vendor, unsigned device)
}
}
static unsigned long southbridge_fill_ssdt(unsigned long current, const char *oem_table_id)
{
global_nvs_t *gnvs = cbmem_add (CBMEM_ID_ACPI_GNVS, sizeof (*gnvs));
void *opregion;
/* Calling northbridge code as gnvs contains opregion address. */
opregion = igd_make_opregion();
if (gnvs) {
int scopelen;
acpi_create_gnvs(gnvs);
/* IGD OpRegion Base Address */
gnvs->aslb = (u32)opregion;
/* And tell SMI about it */
smm_setup_structures(gnvs, NULL, NULL);
/* Add it to SSDT. */
scopelen = acpigen_write_scope("\\");
scopelen += acpigen_write_name_dword("NVSA", (u32) gnvs);
acpigen_patch_len(scopelen - 1);
}
return (unsigned long) (acpigen_get_current());
}
static struct pci_operations pci_ops = {
.set_subsystem = set_subsystem,
};
@@ -668,6 +697,8 @@ static struct device_operations device_ops = {
.read_resources = pch_lpc_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pch_lpc_enable_resources,
.acpi_fill_ssdt_generator = southbridge_fill_ssdt,
.write_acpi_tables = acpi_write_hpet,
.init = lpc_init,
.enable = pch_lpc_enable,
.scan_bus = scan_static_bus,

View File

@@ -158,3 +158,4 @@ typedef struct {
/* Used in SMM to find the ACPI GNVS address */
global_nvs_t *smm_get_gnvs(void);
#endif
void acpi_create_gnvs(global_nvs_t *gnvs);