soc/amd/root_complex: don't skip reporting IOAPIC resource in !hob case

When no HOB list is found, not only adding the resources reported by the
FSP were skipped, but also adding the GNB IOAPIC resource was skipped.
Fix this bug by moving the reporting of the GNB IOAPIC resource before
the resources reported in the FSP HOBs to not skip the IOAPIC resource
when there's no HOB list.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I9174c8d7e5e94144187d27210e12f2dca3a6010f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69460
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Felix Held 2022-11-10 18:19:36 +01:00
parent 88cf831ed1
commit dafc6194a0
5 changed files with 30 additions and 30 deletions

View File

@ -142,6 +142,12 @@ static void read_resources(struct device *dev)
mmconf_resource(dev, idx++); mmconf_resource(dev, idx++);
/* GNB IOAPIC resource */
gnb_apic = new_resource(dev, idx++);
gnb_apic->base = GNB_IO_APIC_ADDR;
gnb_apic->size = 0x00001000;
gnb_apic->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
if (!hob) { if (!hob) {
printk(BIOS_ERR, "%s incomplete because no HOB list was found\n", printk(BIOS_ERR, "%s incomplete because no HOB list was found\n",
__func__); __func__);
@ -168,12 +174,6 @@ static void read_resources(struct device *dev)
printk(BIOS_ERR, "failed to set resources for type %d\n", printk(BIOS_ERR, "failed to set resources for type %d\n",
res->type); res->type);
} }
/* GNB IOAPIC resource */
gnb_apic = new_resource(dev, idx++);
gnb_apic->base = GNB_IO_APIC_ADDR;
gnb_apic->size = 0x00001000;
gnb_apic->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
} }
static void root_complex_init(struct device *dev) static void root_complex_init(struct device *dev)

View File

@ -157,6 +157,12 @@ static void read_resources(struct device *dev)
mmconf_resource(dev, idx++); mmconf_resource(dev, idx++);
/* GNB IOAPIC resource */
gnb_apic = new_resource(dev, idx++);
gnb_apic->base = GNB_IO_APIC_ADDR;
gnb_apic->size = 0x00001000;
gnb_apic->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
if (!hob) { if (!hob) {
printk(BIOS_ERR, "%s incomplete because no HOB list was found\n", printk(BIOS_ERR, "%s incomplete because no HOB list was found\n",
__func__); __func__);
@ -183,12 +189,6 @@ static void read_resources(struct device *dev)
printk(BIOS_ERR, "Failed to set resources for type %d\n", printk(BIOS_ERR, "Failed to set resources for type %d\n",
res->type); res->type);
} }
/* GNB IOAPIC resource */
gnb_apic = new_resource(dev, idx++);
gnb_apic->base = GNB_IO_APIC_ADDR;
gnb_apic->size = 0x00001000;
gnb_apic->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
} }
static void root_complex_init(struct device *dev) static void root_complex_init(struct device *dev)

View File

@ -157,6 +157,12 @@ static void read_resources(struct device *dev)
mmconf_resource(dev, idx++); mmconf_resource(dev, idx++);
/* GNB IOAPIC resource */
gnb_apic = new_resource(dev, idx++);
gnb_apic->base = GNB_IO_APIC_ADDR;
gnb_apic->size = 0x00001000;
gnb_apic->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
if (!hob) { if (!hob) {
printk(BIOS_ERR, "%s incomplete because no HOB list was found\n", printk(BIOS_ERR, "%s incomplete because no HOB list was found\n",
__func__); __func__);
@ -183,12 +189,6 @@ static void read_resources(struct device *dev)
printk(BIOS_ERR, "Failed to set resources for type %d\n", printk(BIOS_ERR, "Failed to set resources for type %d\n",
res->type); res->type);
} }
/* GNB IOAPIC resource */
gnb_apic = new_resource(dev, idx++);
gnb_apic->base = GNB_IO_APIC_ADDR;
gnb_apic->size = 0x00001000;
gnb_apic->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
} }
static void root_complex_init(struct device *dev) static void root_complex_init(struct device *dev)

View File

@ -157,6 +157,12 @@ static void read_resources(struct device *dev)
mmconf_resource(dev, idx++); mmconf_resource(dev, idx++);
/* GNB IOAPIC resource */
gnb_apic = new_resource(dev, idx++);
gnb_apic->base = GNB_IO_APIC_ADDR;
gnb_apic->size = 0x00001000;
gnb_apic->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
if (!hob) { if (!hob) {
printk(BIOS_ERR, "%s incomplete because no HOB list was found\n", printk(BIOS_ERR, "%s incomplete because no HOB list was found\n",
__func__); __func__);
@ -183,12 +189,6 @@ static void read_resources(struct device *dev)
printk(BIOS_ERR, "Failed to set resources for type %d\n", printk(BIOS_ERR, "Failed to set resources for type %d\n",
res->type); res->type);
} }
/* GNB IOAPIC resource */
gnb_apic = new_resource(dev, idx++);
gnb_apic->base = GNB_IO_APIC_ADDR;
gnb_apic->size = 0x00001000;
gnb_apic->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
} }
static void root_complex_init(struct device *dev) static void root_complex_init(struct device *dev)

View File

@ -140,6 +140,12 @@ static void read_resources(struct device *dev)
mmconf_resource(dev, idx++); mmconf_resource(dev, idx++);
/* GNB IOAPIC resource */
gnb_apic = new_resource(dev, idx++);
gnb_apic->base = GNB_IO_APIC_ADDR;
gnb_apic->size = 0x00001000;
gnb_apic->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
if (!hob) { if (!hob) {
printk(BIOS_ERR, "%s incomplete because no HOB list was found\n", printk(BIOS_ERR, "%s incomplete because no HOB list was found\n",
__func__); __func__);
@ -166,12 +172,6 @@ static void read_resources(struct device *dev)
printk(BIOS_ERR, "failed to set resources for type %d\n", printk(BIOS_ERR, "failed to set resources for type %d\n",
res->type); res->type);
} }
/* GNB IOAPIC resource */
gnb_apic = new_resource(dev, idx++);
gnb_apic->base = GNB_IO_APIC_ADDR;
gnb_apic->size = 0x00001000;
gnb_apic->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
} }
static void root_complex_init(struct device *dev) static void root_complex_init(struct device *dev)