diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2023-07-13 11:32:30 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-07-31 14:00:34 +0000 |
commit | 166de9997a31cb752b5e6f8092997ba4bf14a421 (patch) | |
tree | 5a1a88b2df8175f34ccaba429335b41622b97330 /util/sconfig | |
parent | 7779a08c61a35c24c0373213d55c778fad2e2fa0 (diff) |
util/sconfig: Don't hardcode PCI device domain
Use the domain number in static references to pci device so that
device domain 0x20 on
device pci 00.0 on end
end
results in
DEVTREE_CONST struct device *const __pci_32_00_0 = &dev_#something;
in static.c
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: I7a98b2325ee08feb1a3d1d4b333f3f4e53934b00
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76466
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Diffstat (limited to 'util/sconfig')
-rw-r--r-- | util/sconfig/main.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/util/sconfig/main.c b/util/sconfig/main.c index 2e6188ff56..fb598282da 100644 --- a/util/sconfig/main.c +++ b/util/sconfig/main.c @@ -1328,16 +1328,17 @@ static void expose_device_names(FILE *fil, FILE *head, struct device *ptr, struc /* Only devices on root bus here. */ if (ptr->bustype == PCI && ptr->parent->dev->bustype == DOMAIN) { - fprintf(head, "extern DEVTREE_CONST struct device *const __pci_0_%02x_%d;\n", - ptr->path_a, ptr->path_b); - fprintf(fil, "DEVTREE_CONST struct device *const __pci_0_%02x_%d = &%s;\n", - ptr->path_a, ptr->path_b, ptr->name); + fprintf(head, "extern DEVTREE_CONST struct device *const __pci_%d_%02x_%d;\n", + ptr->parent->dev->path_a, ptr->path_a, ptr->path_b); + fprintf(fil, "DEVTREE_CONST struct device *const __pci_%d_%02x_%d = &%s;\n", + ptr->parent->dev->path_a, ptr->path_a, ptr->path_b, ptr->name); if (chip_ins->chip->chiph_exists) { - fprintf(head, "extern DEVTREE_CONST void *const __pci_0_%02x_%d_config;\n", - ptr->path_a, ptr->path_b); - fprintf(fil, "DEVTREE_CONST void *const __pci_0_%02x_%d_config = &%s_info_%d;\n", - ptr->path_a, ptr->path_b, chip_ins->chip->name_underscore, chip_ins->id); + fprintf(head, "extern DEVTREE_CONST void *const __pci_%d_%02x_%d_config;\n", + ptr->parent->dev->path_a, ptr->path_a, ptr->path_b); + fprintf(fil, "DEVTREE_CONST void *const __pci_%d_%02x_%d_config = &%s_info_%d;\n", + ptr->parent->dev->path_a, ptr->path_a, ptr->path_b, + chip_ins->chip->name_underscore, chip_ins->id); } } |