From 86517315376011afa864c30571091e4789ca26c3 Mon Sep 17 00:00:00 2001 From: Nicholas Chin Date: Thu, 19 Sep 2024 20:56:56 -0600 Subject: sconfig: Move config_of_soc from device.h to static.h Many sources include device.h and thus static.h, but many only need the function declarations and type definitions, not the compiled devicetree from sconfig. This causes many unnecessary recompiles whenever the devicetree is updated due to the dependency. Address this by moving the config_of_soc macro directly into the generated static.h header, as it seems to be the only line in device.h that actually requires static.h. For now, static.h remains included in device.h so that the build is not affected. Subsequent commits will include static.h directly into sources that actually need it, after which it can be dropped from device.h. Some statistics for C objects: Dell Latitude E6400 (GM45/ICH9): 669 total objects 181 depend on static.h 2 require static.h Dell Latitude E6430 (Ivy Bridge/Panther Point): 693 total objects 199 depend on static.h 3 require static.h Lenovo ThinkCentre M700 / M900 Tiny (Kaby Lake): 794 total objects 298 depend on static.h 23 objects require static.h MSI PRO Z690-A (WIFI) DDR4 (Alder Lake): 959 total objects 319 depend on static.h 25 require static.h The number of objects was determined by grepping the build log for calls to CC, the number of objects that depend on static.h was determined by grepping for calls to CC after touching static.h, and the number of objects that actually require the static.h related lines from device.h was determined by grepping for objects that failed to build after removing the static.h lines from device.h and running make with the --keep-going flag. Change-Id: I7c40135bf2815093b81e47201c38b7d0a6ac8fa8 Signed-off-by: Nicholas Chin Reviewed-on: https://review.coreboot.org/c/coreboot/+/84431 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/include/device/device.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/include/device/device.h') diff --git a/src/include/device/device.h b/src/include/device/device.h index a1a64e2e28..b52be54177 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -487,12 +487,6 @@ static inline DEVTREE_CONST void *config_of(const struct device *dev) devtree_die(); } -/* - * Returns pointer to config structure of root device (B:D:F = 0:00:0) defined by - * sconfig in static.{h/c}. - */ -#define config_of_soc() __pci_0_00_0_config - static inline bool is_root_device(const struct device *dev) { if (!dev || !dev->upstream) -- cgit v1.2.3