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>
This commit is contained in:
parent
7779a08c61
commit
166de9997a
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue