summaryrefslogtreecommitdiffstats
path: root/src/soc/amd
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/cezanne/xhci.c4
-rw-r--r--src/soc/amd/common/block/acpi/ivrs.c44
-rw-r--r--src/soc/amd/common/block/data_fabric/domain.c25
-rw-r--r--src/soc/amd/common/block/lpc/lpc.c4
-rw-r--r--src/soc/amd/genoa_poc/domain.c4
-rw-r--r--src/soc/amd/glinda/xhci.c6
-rw-r--r--src/soc/amd/mendocino/xhci.c6
-rw-r--r--src/soc/amd/phoenix/xhci.c6
-rw-r--r--src/soc/amd/picasso/xhci.c4
-rw-r--r--src/soc/amd/stoneyridge/northbridge.c8
10 files changed, 55 insertions, 56 deletions
diff --git a/src/soc/amd/cezanne/xhci.c b/src/soc/amd/cezanne/xhci.c
index b0205c6e2a5a..fc1c11920efb 100644
--- a/src/soc/amd/cezanne/xhci.c
+++ b/src/soc/amd/cezanne/xhci.c
@@ -26,10 +26,10 @@ static const struct sci_source xhci_sci_sources[] = {
enum cb_err pci_xhci_get_wake_gpe(const struct device *dev, int *gpe)
{
- if (dev->bus->dev->path.type != DEVICE_PATH_PCI)
+ if (dev->upstream->dev->path.type != DEVICE_PATH_PCI)
return CB_ERR_ARG;
- if (dev->bus->dev->path.pci.devfn != PCIE_ABC_A_DEVFN)
+ if (dev->upstream->dev->path.pci.devfn != PCIE_ABC_A_DEVFN)
return CB_ERR_ARG;
if (dev->path.type != DEVICE_PATH_PCI)
diff --git a/src/soc/amd/common/block/acpi/ivrs.c b/src/soc/amd/common/block/acpi/ivrs.c
index 57b5974e71da..bd52d7ca6f53 100644
--- a/src/soc/amd/common/block/acpi/ivrs.c
+++ b/src/soc/amd/common/block/acpi/ivrs.c
@@ -96,7 +96,7 @@ static unsigned long add_ivhd_dev_entry(struct device *parent, struct device *de
memset(ivhd_entry, 0, sizeof(*ivhd_entry));
ivhd_entry->type = type;
- ivhd_entry->dev_id = dev->path.pci.devfn | (dev->bus->secondary << 8);
+ ivhd_entry->dev_id = dev->path.pci.devfn | (dev->upstream->secondary << 8);
ivhd_entry->dte_setting = data;
*current += sizeof(ivrs_ivhd_generic_t);
} else if (type == IVHD_DEV_8_BYTE_ALIAS_SELECT) {
@@ -104,12 +104,12 @@ static unsigned long add_ivhd_dev_entry(struct device *parent, struct device *de
memset(ivhd_entry, 0, sizeof(*ivhd_entry));
ivhd_entry->type = type;
- ivhd_entry->dev_id = dev->path.pci.devfn | (dev->bus->secondary << 8);
+ ivhd_entry->dev_id = dev->path.pci.devfn | (dev->upstream->secondary << 8);
ivhd_entry->dte_setting = data;
ivhd_entry->reserved1 = 0;
ivhd_entry->reserved2 = 0;
ivhd_entry->source_dev_id = parent->path.pci.devfn |
- (parent->bus->secondary << 8);
+ (parent->upstream->secondary << 8);
*current += sizeof(ivrs_ivhd_alias_t);
}
@@ -145,7 +145,7 @@ static void add_ivhd_device_entries(struct device *parent, struct device *dev,
return;
if (dev->path.type == DEVICE_PATH_PCI) {
- if ((dev->bus->secondary == nb_bus) &&
+ if ((dev->upstream->secondary == nb_bus) &&
(dev->path.pci.devfn == 0x0))
*root_level = depth;
@@ -154,9 +154,9 @@ static void add_ivhd_device_entries(struct device *parent, struct device *dev,
ivrs_add_device_or_bridge(parent, dev, current);
}
- if (!dev->link_list)
+ if (!dev->downstream)
return;
- for (sibling = dev->link_list->children; sibling; sibling = sibling->sibling)
+ for (sibling = dev->downstream->children; sibling; sibling = sibling->sibling)
add_ivhd_device_entries(dev, sibling, depth + 1, depth, root_level, current,
nb_bus);
}
@@ -173,21 +173,21 @@ static unsigned long acpi_ivhd_misc(unsigned long current, struct device *dev)
* Add all possible PCI devices in the domain that can generate transactions
* processed by IOMMU. Start with device <bus>:01.0
*/
- current = ivhd_dev_range(current, PCI_DEVFN(0, 3) | (dev->link_list->secondary << 8),
- 0xff | (dev->link_list->subordinate << 8), 0);
+ current = ivhd_dev_range(current, PCI_DEVFN(0, 3) | (dev->downstream->secondary << 8),
+ 0xff | (dev->downstream->subordinate << 8), 0);
add_ivhd_device_entries(NULL, dev, 0, -1, &root_level,
- &current, dev->link_list->secondary);
+ &current, dev->downstream->secondary);
res = probe_resource(dev, IOMMU_IOAPIC_IDX);
if (res) {
/* Describe IOAPIC associated with the IOMMU */
current = acpi_fill_ivrs_ioapic(current, (u8 *)(uintptr_t)res->base,
- PCI_DEVFN(0, 1) | (dev->link_list->secondary << 8), 0);
+ PCI_DEVFN(0, 1) | (dev->downstream->secondary << 8), 0);
}
/* If the domain has secondary bus as zero then associate HPET & FCH IOAPIC */
- if (dev->link_list->secondary == 0) {
+ if (dev->downstream->secondary == 0) {
/* Describe HPET */
current = ivhd_describe_hpet(current, 0x00, SMBUS_DEVFN);
/* Describe FCH IOAPICs */
@@ -212,11 +212,11 @@ static unsigned long acpi_fill_ivrs40(unsigned long current, acpi_ivrs_ivhd_t *i
ivhd_40->flags = ivhd->flags & 0x3f;
ivhd_40->length = sizeof(struct acpi_ivrs_ivhd_40);
/* BDF <bus>:00.2 */
- ivhd_40->device_id = 0x02 | (nb_dev->bus->secondary << 8);
+ ivhd_40->device_id = 0x02 | (nb_dev->upstream->secondary << 8);
ivhd_40->capability_offset = pci_find_capability(iommu_dev, IOMMU_CAP_ID);
ivhd_40->iommu_base_low = ivhd->iommu_base_low;
ivhd_40->iommu_base_high = ivhd->iommu_base_high;
- ivhd_40->pci_segment_group = nb_dev->bus->segment_group;
+ ivhd_40->pci_segment_group = nb_dev->upstream->segment_group;
ivhd_40->iommu_info = ivhd->iommu_info;
/* For type 40h bits 31:28 and 12:0 are reserved */
ivhd_40->iommu_attributes = ivhd->iommu_feature_info & 0xfffe000;
@@ -230,9 +230,9 @@ static unsigned long acpi_fill_ivrs40(unsigned long current, acpi_ivrs_ivhd_t *i
/* Now repeat all the device entries from type 10h */
current_backup = current;
- current = acpi_ivhd_misc(current, nb_dev->bus->dev);
+ current = acpi_ivhd_misc(current, nb_dev->upstream->dev);
- if (nb_dev->bus->secondary == 0) {
+ if (nb_dev->upstream->secondary == 0) {
/* Describe EMMC */
if (CONFIG(SOC_AMD_COMMON_BLOCK_EMMC)) {
/* PCI_DEVFN(0x13, 1) doesn't exist in the hardware, but it's what the
@@ -269,11 +269,11 @@ static unsigned long acpi_fill_ivrs11(unsigned long current, acpi_ivrs_ivhd_t *i
ivhd_11->flags = ivhd->flags & 0x3f;
ivhd_11->length = sizeof(struct acpi_ivrs_ivhd_11);
/* BDF <bus>:00.2 */
- ivhd_11->device_id = 0x02 | (nb_dev->bus->secondary << 8);
+ ivhd_11->device_id = 0x02 | (nb_dev->upstream->secondary << 8);
ivhd_11->capability_offset = pci_find_capability(iommu_dev, IOMMU_CAP_ID);
ivhd_11->iommu_base_low = ivhd->iommu_base_low;
ivhd_11->iommu_base_high = ivhd->iommu_base_high;
- ivhd_11->pci_segment_group = nb_dev->bus->segment_group;
+ ivhd_11->pci_segment_group = nb_dev->upstream->segment_group;
ivhd_11->iommu_info = ivhd->iommu_info;
ivhd11_attr_ptr = (ivhd11_iommu_attr_t *)&ivhd->iommu_feature_info;
ivhd_11->iommu_attributes.perf_counters = ivhd11_attr_ptr->perf_counters;
@@ -289,7 +289,7 @@ static unsigned long acpi_fill_ivrs11(unsigned long current, acpi_ivrs_ivhd_t *i
/* Now repeat all the device entries from type 10h */
current_backup = current;
- current = acpi_ivhd_misc(current, nb_dev->bus->dev);
+ current = acpi_ivhd_misc(current, nb_dev->upstream->dev);
ivhd_11->length += (current - current_backup);
return acpi_fill_ivrs40(current, ivhd, nb_dev, iommu_dev);
@@ -317,8 +317,8 @@ static unsigned long acpi_fill_ivrs(acpi_ivrs_t *ivrs, unsigned long current)
while ((dev = dev_find_path(dev, DEVICE_PATH_DOMAIN)) != NULL) {
- nb_dev = pcidev_path_behind(dev->link_list, PCI_DEVFN(0, 0));
- iommu_dev = pcidev_path_behind(dev->link_list, PCI_DEVFN(0, 2));
+ nb_dev = pcidev_path_behind(dev->downstream, PCI_DEVFN(0, 0));
+ iommu_dev = pcidev_path_behind(dev->downstream, PCI_DEVFN(0, 2));
if (!nb_dev) {
printk(BIOS_WARNING, "%s: Northbridge device not present!\n", __func__);
printk(BIOS_WARNING, "%s: IVRS table not generated...\n", __func__);
@@ -334,7 +334,7 @@ static unsigned long acpi_fill_ivrs(acpi_ivrs_t *ivrs, unsigned long current)
ivhd->length = sizeof(struct acpi_ivrs_ivhd);
/* BDF <bus>:00.2 */
- ivhd->device_id = 0x02 | (nb_dev->bus->secondary << 8);
+ ivhd->device_id = 0x02 | (nb_dev->upstream->secondary << 8);
ivhd->capability_offset = pci_find_capability(iommu_dev, IOMMU_CAP_ID);
ivhd->iommu_base_low = pci_read_config32(iommu_dev, IOMMU_CAP_BASE_LO) & 0xffffc000;
ivhd->iommu_base_high = pci_read_config32(iommu_dev, IOMMU_CAP_BASE_HI);
@@ -363,7 +363,7 @@ static unsigned long acpi_fill_ivrs(acpi_ivrs_t *ivrs, unsigned long current)
ivhd->flags |= ((mmio_x18_value & MMIO_CTRL_HT_TUN_EN) ?
IVHD_FLAG_HT_TUN_EN : 0);
- ivhd->pci_segment_group = nb_dev->bus->segment_group;
+ ivhd->pci_segment_group = nb_dev->upstream->segment_group;
ivhd->iommu_info = pci_read_config16(iommu_dev,
ivhd->capability_offset + 0x10) & 0x1F;
diff --git a/src/soc/amd/common/block/data_fabric/domain.c b/src/soc/amd/common/block/data_fabric/domain.c
index b827dd3fad8b..f17346fedf3d 100644
--- a/src/soc/amd/common/block/data_fabric/domain.c
+++ b/src/soc/amd/common/block/data_fabric/domain.c
@@ -34,12 +34,12 @@ void amd_pci_domain_scan_bus(struct device *domain)
limit = MIN(limit, PCI_BUSES_PER_SEGMENT_GROUP - 1);
/* Set bus first number of PCI root */
- domain->link_list->secondary = bus;
+ domain->downstream->secondary = bus;
/* subordinate needs to be the same as secondary before pci_host_bridge_scan_bus call. */
- domain->link_list->subordinate = bus;
+ domain->downstream->subordinate = bus;
/* Tell allocator about maximum PCI bus number in domain */
- domain->link_list->max_subordinate = limit;
- domain->link_list->segment_group = segment_group;
+ domain->downstream->max_subordinate = limit;
+ domain->downstream->segment_group = segment_group;
pci_host_bridge_scan_bus(domain);
}
@@ -249,12 +249,12 @@ void amd_pci_domain_fill_ssdt(const struct device *domain)
/* PCI bus number range in domain */
printk(BIOS_DEBUG, "%s _CRS: adding busses [%x-%x] in segment group %x\n",
- acpi_device_name(domain), domain->link_list->secondary,
- domain->link_list->max_subordinate, domain->link_list->segment_group);
- acpigen_resource_producer_bus_number(domain->link_list->secondary,
- domain->link_list->max_subordinate);
+ acpi_device_name(domain), domain->downstream->secondary,
+ domain->downstream->max_subordinate, domain->downstream->segment_group);
+ acpigen_resource_producer_bus_number(domain->downstream->secondary,
+ domain->downstream->max_subordinate);
- if (domain->link_list->secondary == 0 && domain->link_list->segment_group == 0) {
+ if (domain->downstream->secondary == 0 && domain->downstream->segment_group == 0) {
/* ACPI 6.4.2.5 I/O Port Descriptor */
acpigen_write_io16(PCI_IO_CONFIG_INDEX, PCI_IO_CONFIG_LAST_PORT, 1,
PCI_IO_CONFIG_PORT_COUNT, 1);
@@ -282,7 +282,7 @@ void amd_pci_domain_fill_ssdt(const struct device *domain)
}
}
- if (domain->link_list->bridge_ctrl & PCI_BRIDGE_CTL_VGA) {
+ if (domain->downstream->bridge_ctrl & PCI_BRIDGE_CTL_VGA) {
printk(BIOS_DEBUG, "%s _CRS: adding VGA resource\n", acpi_device_name(domain));
acpigen_resource_producer_mmio(VGA_MMIO_BASE, VGA_MMIO_LIMIT,
MEM_RSRC_FLAG_MEM_READ_WRITE | MEM_RSRC_FLAG_MEM_ATTR_CACHE);
@@ -290,9 +290,8 @@ void amd_pci_domain_fill_ssdt(const struct device *domain)
acpigen_write_resourcetemplate_footer();
- acpigen_write_SEG(domain->link_list->segment_group);
- acpigen_write_BBN(domain->link_list->secondary);
-
+ acpigen_write_SEG(domain->downstream->segment_group);
+ acpigen_write_BBN(domain->downstream->secondary);
/* Scope */
acpigen_pop_len();
}
diff --git a/src/soc/amd/common/block/lpc/lpc.c b/src/soc/amd/common/block/lpc/lpc.c
index c07636108050..a90fc3e65c81 100644
--- a/src/soc/amd/common/block/lpc/lpc.c
+++ b/src/soc/amd/common/block/lpc/lpc.c
@@ -280,10 +280,10 @@ static void lpc_enable_children_resources(struct device *dev)
{
struct device *child;
- if (!dev->link_list)
+ if (!dev->downstream)
return;
- for (child = dev->link_list->children; child; child = child->sibling) {
+ for (child = dev->downstream->children; child; child = child->sibling) {
if (!child->enabled)
continue;
if (child->path.type != DEVICE_PATH_PNP)
diff --git a/src/soc/amd/genoa_poc/domain.c b/src/soc/amd/genoa_poc/domain.c
index dc3745061dd7..57e020a4b460 100644
--- a/src/soc/amd/genoa_poc/domain.c
+++ b/src/soc/amd/genoa_poc/domain.c
@@ -18,7 +18,7 @@ static void genoa_domain_read_resources(struct device *domain)
amd_pci_domain_read_resources(domain);
// We only want to add the DRAM memory map once
- if (domain->link_list->secondary == 0 && domain->link_list->segment_group == 0) {
+ if (domain->downstream->secondary == 0 && domain->downstream->segment_group == 0) {
/* 0x1000 is a large enough first index to be sure to not overlap with the
resources added by amd_pci_domain_read_resources */
add_opensil_memmap(domain, 0x1000);
@@ -27,7 +27,7 @@ static void genoa_domain_read_resources(struct device *domain)
static void genoa_domain_set_resources(struct device *domain)
{
- if (domain->link_list->bridge_ctrl & PCI_BRIDGE_CTL_VGA) {
+ if (domain->downstream->bridge_ctrl & PCI_BRIDGE_CTL_VGA) {
printk(BIOS_DEBUG, "Setting VGA decoding for domain 0x%x\n",
domain->path.domain.domain);
const union df_vga_en vga_en = {
diff --git a/src/soc/amd/glinda/xhci.c b/src/soc/amd/glinda/xhci.c
index dad559334d45..74e8816e8432 100644
--- a/src/soc/amd/glinda/xhci.c
+++ b/src/soc/amd/glinda/xhci.c
@@ -34,13 +34,13 @@ static const struct sci_source xhci_sci_sources[] = {
enum cb_err pci_xhci_get_wake_gpe(const struct device *dev, int *gpe)
{
- if (dev->bus->dev->path.type != DEVICE_PATH_PCI)
+ if (dev->upstream->dev->path.type != DEVICE_PATH_PCI)
return CB_ERR_ARG;
if (dev->path.type != DEVICE_PATH_PCI)
return CB_ERR_ARG;
- if (dev->bus->dev->path.pci.devfn == PCIE_ABC_A_DEVFN) {
+ if (dev->upstream->dev->path.pci.devfn == PCIE_ABC_A_DEVFN) {
if (dev->path.pci.devfn == XHCI0_DEVFN) {
*gpe = xhci_sci_sources[0].gpe;
return CB_SUCCESS;
@@ -48,7 +48,7 @@ enum cb_err pci_xhci_get_wake_gpe(const struct device *dev, int *gpe)
*gpe = xhci_sci_sources[1].gpe;
return CB_SUCCESS;
}
- } else if (dev->bus->dev->path.pci.devfn == PCIE_ABC_C_DEVFN) {
+ } else if (dev->upstream->dev->path.pci.devfn == PCIE_ABC_C_DEVFN) {
if (dev->path.pci.devfn == XHCI2_DEVFN
&& dev->device == PCI_DID_AMD_FAM17H_MODELA0H_XHCI2) {
*gpe = xhci_sci_sources[2].gpe;
diff --git a/src/soc/amd/mendocino/xhci.c b/src/soc/amd/mendocino/xhci.c
index e5649911f49c..8f46374fce05 100644
--- a/src/soc/amd/mendocino/xhci.c
+++ b/src/soc/amd/mendocino/xhci.c
@@ -35,13 +35,13 @@ static const struct sci_source xhci_sci_sources[] = {
enum cb_err pci_xhci_get_wake_gpe(const struct device *dev, int *gpe)
{
- if (dev->bus->dev->path.type != DEVICE_PATH_PCI)
+ if (dev->upstream->dev->path.type != DEVICE_PATH_PCI)
return CB_ERR_ARG;
if (dev->path.type != DEVICE_PATH_PCI)
return CB_ERR_ARG;
- if (dev->bus->dev->path.pci.devfn == PCIE_ABC_A_DEVFN) {
+ if (dev->upstream->dev->path.pci.devfn == PCIE_ABC_A_DEVFN) {
if (dev->path.pci.devfn == XHCI0_DEVFN) {
*gpe = xhci_sci_sources[0].gpe;
return CB_SUCCESS;
@@ -49,7 +49,7 @@ enum cb_err pci_xhci_get_wake_gpe(const struct device *dev, int *gpe)
*gpe = xhci_sci_sources[1].gpe;
return CB_SUCCESS;
}
- } else if (dev->bus->dev->path.pci.devfn == PCIE_ABC_C_DEVFN) {
+ } else if (dev->upstream->dev->path.pci.devfn == PCIE_ABC_C_DEVFN) {
if (dev->path.pci.devfn == XHCI2_DEVFN
&& dev->device == PCI_DID_AMD_FAM17H_MODELA0H_XHCI2) {
*gpe = xhci_sci_sources[2].gpe;
diff --git a/src/soc/amd/phoenix/xhci.c b/src/soc/amd/phoenix/xhci.c
index 99033f94c6cf..79d4d079fec1 100644
--- a/src/soc/amd/phoenix/xhci.c
+++ b/src/soc/amd/phoenix/xhci.c
@@ -39,13 +39,13 @@ static const struct sci_source xhci_sci_sources[] = {
enum cb_err pci_xhci_get_wake_gpe(const struct device *dev, int *gpe)
{
- if (dev->bus->dev->path.type != DEVICE_PATH_PCI)
+ if (dev->upstream->dev->path.type != DEVICE_PATH_PCI)
return CB_ERR_ARG;
if (dev->path.type != DEVICE_PATH_PCI)
return CB_ERR_ARG;
- if (dev->bus->dev->path.pci.devfn == PCIE_ABC_A_DEVFN) {
+ if (dev->upstream->dev->path.pci.devfn == PCIE_ABC_A_DEVFN) {
if (dev->path.pci.devfn == XHCI0_DEVFN) {
*gpe = xhci_sci_sources[0].gpe;
return CB_SUCCESS;
@@ -55,7 +55,7 @@ enum cb_err pci_xhci_get_wake_gpe(const struct device *dev, int *gpe)
}
}
- if (dev->bus->dev->path.pci.devfn == PCIE_ABC_C_DEVFN) {
+ if (dev->upstream->dev->path.pci.devfn == PCIE_ABC_C_DEVFN) {
if (dev->path.pci.devfn == USB4_XHCI0_DEVFN) {
*gpe = xhci_sci_sources[2].gpe;
return CB_SUCCESS;
diff --git a/src/soc/amd/picasso/xhci.c b/src/soc/amd/picasso/xhci.c
index 84b3a2b82d8b..a238916b71ee 100644
--- a/src/soc/amd/picasso/xhci.c
+++ b/src/soc/amd/picasso/xhci.c
@@ -26,10 +26,10 @@ static const struct sci_source xhci_sci_sources[] = {
enum cb_err pci_xhci_get_wake_gpe(const struct device *dev, int *gpe)
{
- if (dev->bus->dev->path.type != DEVICE_PATH_PCI)
+ if (dev->upstream->dev->path.type != DEVICE_PATH_PCI)
return CB_ERR_ARG;
- if (dev->bus->dev->path.pci.devfn != PCIE_GPP_A_DEVFN)
+ if (dev->upstream->dev->path.pci.devfn != PCIE_GPP_A_DEVFN)
return CB_ERR_ARG;
if (dev->path.type != DEVICE_PATH_PCI)
diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c
index b95c4cdf2e8d..a92c3b506de9 100644
--- a/src/soc/amd/stoneyridge/northbridge.c
+++ b/src/soc/amd/stoneyridge/northbridge.c
@@ -52,9 +52,9 @@ static void read_resources(struct device *dev)
static void create_vga_resource(struct device *dev)
{
- if (!dev->link_list)
+ if (!dev->downstream)
return;
- if (!(dev->link_list->bridge_ctrl & PCI_BRIDGE_CTL_VGA))
+ if (!(dev->downstream->bridge_ctrl & PCI_BRIDGE_CTL_VGA))
return;
printk(BIOS_DEBUG, "VGA: %s has VGA device\n", dev_path(dev));
@@ -67,8 +67,8 @@ static void set_resources(struct device *dev)
/* do we need this? */
create_vga_resource(dev);
- if (dev->link_list && dev->link_list->children)
- assign_resources(dev->link_list);
+ if (dev->downstream && dev->downstream->children)
+ assign_resources(dev->downstream);
}
static void northbridge_init(struct device *dev)