device: Use pcidev_path_on_root()
Change-Id: I2e28b9f4ecaf258bff8a062b5a54cb3d8e2bb9b0 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/30400 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
committed by
Felix Held
parent
c70eed1e62
commit
e7377556cc
@@ -22,7 +22,7 @@ const struct soc_intel_common_config *chip_get_common_soc_structure(void)
|
||||
const struct soc_intel_common_config *soc_config;
|
||||
const config_t *config;
|
||||
int devfn = SA_DEVFN_ROOT;
|
||||
const struct device *dev = dev_find_slot(0, devfn);
|
||||
const struct device *dev = pcidev_path_on_root(devfn);
|
||||
|
||||
if (!dev || !dev->chip_info)
|
||||
die("Could not find SA_DEV_ROOT devicetree config!\n");
|
||||
|
@@ -236,7 +236,7 @@ static uintptr_t gspi_calc_base_addr(unsigned int gspi_bus)
|
||||
if (devfn < 0)
|
||||
return 0;
|
||||
|
||||
dev = dev_find_slot(0, devfn);
|
||||
dev = pcidev_path_on_root(devfn);
|
||||
if (!dev || !dev->enabled)
|
||||
return 0;
|
||||
|
||||
|
@@ -65,7 +65,7 @@ static int lpss_i2c_early_init_bus(unsigned int bus)
|
||||
|
||||
/* Look up the controller device in the devicetree */
|
||||
dev = PCI_DEV(0, PCI_SLOT(devfn), PCI_FUNC(devfn));
|
||||
tree_dev = dev_find_slot(0, devfn);
|
||||
tree_dev = pcidev_path_on_root(devfn);
|
||||
if (!tree_dev || !tree_dev->enabled) {
|
||||
printk(BIOS_ERR, "I2C%u device not enabled\n", bus);
|
||||
return -1;
|
||||
@@ -134,7 +134,7 @@ uintptr_t dw_i2c_base_address(unsigned int bus)
|
||||
return (uintptr_t)NULL;
|
||||
|
||||
/* devfn -> dev */
|
||||
dev = dev_find_slot(0, devfn);
|
||||
dev = pcidev_path_on_root(devfn);
|
||||
if (!dev || !dev->enabled)
|
||||
return (uintptr_t)NULL;
|
||||
|
||||
|
@@ -173,7 +173,7 @@ typedef struct soc_intel_fsp_baytrail_config config_t;
|
||||
void acpi_fill_in_fadt(acpi_fadt_t * fadt, acpi_facs_t * facs, void *dsdt)
|
||||
{
|
||||
acpi_header_t *header = &(fadt->header);
|
||||
struct device *lpcdev = dev_find_slot(0, FADT_SOC_LPC_DEVFN);
|
||||
struct device *lpcdev = pcidev_path_on_root(FADT_SOC_LPC_DEVFN);
|
||||
u16 pmbase = pci_read_config16(lpcdev, ABASE) & 0xfff0;
|
||||
config_t *config = lpcdev->chip_info;
|
||||
|
||||
|
@@ -86,7 +86,7 @@ static void ConfigureDefaultUpdData(FSP_INFO_HEADER *FspInfo, UPD_DATA_REGION *U
|
||||
DEVTREE_CONST config_t *config;
|
||||
printk(FSP_INFO_LEVEL, "Configure Default UPD Data\n");
|
||||
|
||||
dev = dev_find_slot(0, SOC_DEV_FUNC);
|
||||
dev = pcidev_path_on_root(SOC_DEV_FUNC);
|
||||
config = dev->chip_info;
|
||||
|
||||
/* Set up default verb tables - Just HDMI audio */
|
||||
|
@@ -312,7 +312,7 @@ void acpi_fill_in_fadt(acpi_fadt_t *fadt, acpi_facs_t *facs, void *dsdt)
|
||||
static unsigned long acpi_fill_dmar(unsigned long current)
|
||||
{
|
||||
uint32_t vtbar, tmp = current;
|
||||
struct device *dev = dev_find_slot(0, VTD_DEV_FUNC);
|
||||
struct device *dev = pcidev_path_on_root(VTD_DEV_FUNC);
|
||||
uint16_t bdf, hpet_bdf[8];
|
||||
uint8_t i, j;
|
||||
|
||||
@@ -329,7 +329,7 @@ static unsigned long acpi_fill_dmar(unsigned long current)
|
||||
current += acpi_create_dmar_ds_ioapic(current,
|
||||
9, 0, 5, 4);
|
||||
/* Get the PCI BDF for the PCH I/O APIC */
|
||||
dev = dev_find_slot(0, LPC_DEV_FUNC);
|
||||
dev = pcidev_path_on_root(LPC_DEV_FUNC);
|
||||
bdf = pci_read_config16(dev, 0x6c);
|
||||
current += acpi_create_dmar_ds_ioapic(current,
|
||||
8, (bdf >> 8), PCI_SLOT(bdf), PCI_FUNC(bdf));
|
||||
|
@@ -84,7 +84,7 @@ void soc_memory_init_params(struct romstage_params *params,
|
||||
size_t rmu_data_len;
|
||||
|
||||
/* Locate the configuration data from devicetree.cb */
|
||||
dev = dev_find_slot(0, LPC_DEV_FUNC);
|
||||
dev = pcidev_path_on_root(LPC_DEV_FUNC);
|
||||
if (!dev) {
|
||||
printk(BIOS_CRIT,
|
||||
"Error! Device (PCI:0:%02x.%01x) not found, "
|
||||
|
@@ -120,7 +120,7 @@ void platform_fsp_memory_init_params_cb(FSPM_UPD *fspm_upd, uint32_t version)
|
||||
die("Microcode file (rmu.bin) not found.");
|
||||
|
||||
/* Locate the configuration data from devicetree.cb */
|
||||
dev = dev_find_slot(0, LPC_DEV_FUNC);
|
||||
dev = pcidev_path_on_root(LPC_DEV_FUNC);
|
||||
if (!dev)
|
||||
die("ERROR - LPC device not found!");
|
||||
config = dev->chip_info;
|
||||
|
Reference in New Issue
Block a user