soc/amd/*/northbridge,root_complex: simplify mmconf_resource index

In the northbridge's and root complex' read_resources function, the
mmconf resource used the number of the MMIO_CONF_BASE MSR as index which
might be misleading. Instead use idx++ as a unique index for this
resource.

TEST=Resource allocator doesn't complain and no related warnings or
errors in dmesg. The update_constraints console output changes like
expected:

Before: PCI: 00:00.0 c0010058 base f8000000 limit fbffffff mem (fixed)
After: PCI: 00:00.0 06 base f8000000 limit fbffffff mem (fixed)

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Id66c6153fad86bed36db7bd2455075f4a0850750
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62545
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
Felix Held 2022-03-02 22:57:01 +01:00
parent 49fff57a09
commit 56b037b857
4 changed files with 5 additions and 4 deletions

View File

@ -138,7 +138,7 @@ static void read_resources(struct device *dev)
ram_resource(dev, idx++, early_reserved_dram_end / KiB, ram_resource(dev, idx++, early_reserved_dram_end / KiB,
(mem_usable - early_reserved_dram_end) / KiB); (mem_usable - early_reserved_dram_end) / KiB);
mmconf_resource(dev, MMIO_CONF_BASE); mmconf_resource(dev, idx++);
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",

View File

@ -136,7 +136,7 @@ static void read_resources(struct device *dev)
ram_resource(dev, idx++, early_reserved_dram_end / KiB, ram_resource(dev, idx++, early_reserved_dram_end / KiB,
(mem_usable - early_reserved_dram_end) / KiB); (mem_usable - early_reserved_dram_end) / KiB);
mmconf_resource(dev, MMIO_CONF_BASE); mmconf_resource(dev, idx++);
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",

View File

@ -140,7 +140,7 @@ static void read_resources(struct device *dev)
ram_resource(dev, idx++, early_reserved_dram_end / KiB, ram_resource(dev, idx++, early_reserved_dram_end / KiB,
(mem_usable - early_reserved_dram_end) / KiB); (mem_usable - early_reserved_dram_end) / KiB);
mmconf_resource(dev, MMIO_CONF_BASE); mmconf_resource(dev, idx++);
if (!hob) { if (!hob) {
printk(BIOS_ERR, "Error: %s incomplete because no HOB list was found\n", printk(BIOS_ERR, "Error: %s incomplete because no HOB list was found\n",

View File

@ -57,6 +57,7 @@ static void set_mmio_addr_reg(u32 nodeid, u32 linkn, u32 reg, u32 index,
static void read_resources(struct device *dev) static void read_resources(struct device *dev)
{ {
unsigned int idx = 0;
struct resource *res; struct resource *res;
/* /*
@ -64,7 +65,7 @@ static void read_resources(struct device *dev)
* It is not honored by the coreboot resource allocator if it is in * It is not honored by the coreboot resource allocator if it is in
* the CPU_CLUSTER. * the CPU_CLUSTER.
*/ */
mmconf_resource(dev, MMIO_CONF_BASE); mmconf_resource(dev, idx++);
/* NB IOAPIC2 resource */ /* NB IOAPIC2 resource */
res = new_resource(dev, IO_APIC2_ADDR); /* IOAPIC2 */ res = new_resource(dev, IO_APIC2_ADDR); /* IOAPIC2 */