amdfam_10h-15h: Use ENV_PCI_SIMPLE_DEVICE

Change-Id: I265d50af1099ae4449b5adebcf21e2043aa02c7a
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35654
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Kyösti Mälkki
2019-09-27 15:32:22 +03:00
parent 0f639750a1
commit 23d4d9f368
6 changed files with 25 additions and 27 deletions

View File

@@ -1017,11 +1017,9 @@ BOOL AMD_CB_ManualBUIDSwapList(u8 Node, u8 Link, const u8 **List);
struct acpi_rsdp;
#ifndef __SIMPLE_DEVICE__
unsigned long northbridge_write_acpi_tables(struct device *device,
unsigned long start,
struct acpi_rsdp *rsdp);
void northbridge_acpi_write_vars(struct device *device);
#endif
#endif /* AMDFAM10_H */

View File

@@ -21,7 +21,7 @@
#include "raminit.h"
#include <northbridge/amd/amdmct/amddefs.h>
#ifndef __SIMPLE_DEVICE__
#if !ENV_PCI_SIMPLE_DEVICE
u32 Get_NB32(u32 dev, u32 reg)
{
return pci_read_config32(pcidev_path_on_root(PCI_DEV2DEVFN(dev)), reg);

View File

@@ -69,7 +69,7 @@ ssize_t get_s3nv_file_offset(void)
return s3nv_region.region.offset;
}
#ifdef __SIMPLE_DEVICE__
#if ENV_PCI_SIMPLE_DEVICE
static uint32_t read_config32_dct(pci_devfn_t dev, uint8_t node, uint8_t dct,
uint32_t reg)
#else
@@ -79,7 +79,7 @@ static uint32_t read_config32_dct(struct device *dev, uint8_t node, uint8_t dct,
{
if (is_fam15h()) {
uint32_t dword;
#ifdef __SIMPLE_DEVICE__
#if ENV_PCI_SIMPLE_DEVICE
pci_devfn_t dev_fn1 = PCI_DEV(0, 0x18 + node, 1);
#else
struct device *dev_fn1 = pcidev_on_root(0x18 + node, 1);
@@ -98,7 +98,7 @@ static uint32_t read_config32_dct(struct device *dev, uint8_t node, uint8_t dct,
return pci_read_config32(dev, reg);
}
#ifdef __SIMPLE_DEVICE__
#if ENV_PCI_SIMPLE_DEVICE
static void write_config32_dct(pci_devfn_t dev, uint8_t node, uint8_t dct,
uint32_t reg, uint32_t value)
#else
@@ -108,7 +108,7 @@ static void write_config32_dct(struct device *dev, uint8_t node, uint8_t dct,
{
if (is_fam15h()) {
uint32_t dword;
#ifdef __SIMPLE_DEVICE__
#if ENV_PCI_SIMPLE_DEVICE
pci_devfn_t dev_fn1 = PCI_DEV(0, 0x18 + node, 1);
#else
struct device *dev_fn1 = pcidev_on_root(0x18 + node, 1);
@@ -127,7 +127,7 @@ static void write_config32_dct(struct device *dev, uint8_t node, uint8_t dct,
pci_write_config32(dev, reg, value);
}
#ifdef __SIMPLE_DEVICE__
#if ENV_PCI_SIMPLE_DEVICE
static uint32_t read_amd_dct_index_register(pci_devfn_t dev,
uint32_t index_ctl_reg, uint32_t index)
#else
@@ -147,7 +147,7 @@ static uint32_t read_amd_dct_index_register(struct device *dev,
return dword;
}
#ifdef __SIMPLE_DEVICE__
#if ENV_PCI_SIMPLE_DEVICE
static uint32_t read_amd_dct_index_register_dct(pci_devfn_t dev, uint8_t node,
uint8_t dct, uint32_t index_ctl_reg, uint32_t index)
#else
@@ -158,7 +158,7 @@ static uint32_t read_amd_dct_index_register_dct(struct device *dev,
{
if (is_fam15h()) {
uint32_t dword;
#ifdef __SIMPLE_DEVICE__
#if ENV_PCI_SIMPLE_DEVICE
pci_devfn_t dev_fn1 = PCI_DEV(0, 0x18 + node, 1);
#else
struct device *dev_fn1 = pcidev_on_root(0x18 + node, 1);