From 166de9997a31cb752b5e6f8092997ba4bf14a421 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Thu, 13 Jul 2023 11:32:30 +0200 Subject: 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 Change-Id: I7a98b2325ee08feb1a3d1d4b333f3f4e53934b00 Reviewed-on: https://review.coreboot.org/c/coreboot/+/76466 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- util/sconfig/main.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'util') 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); } } -- cgit v1.2.3