From a626d2748db9a299f68d004f67c700d266ffd719 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Wed, 18 Apr 2018 10:13:32 +0200 Subject: rules: Define SIMPLE_DEVICE on x86 only Make sure to define __SIMPLE_DEVICE__ on x86 only, as other platforms currently doesn't have support for it. Fixes static.c devicetree compilation on non x86. Change-Id: I75fb038681a8edf119415705af5da9f999fd8225 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/25721 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/include/rules.h | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/include/rules.h b/src/include/rules.h index 0f212318a6..8cb6d86683 100644 --- a/src/include/rules.h +++ b/src/include/rules.h @@ -123,20 +123,6 @@ #define ENV_STRING "UNKNOWN" #endif -/* For pre-DRAM stages and post-CAR always build with simple device model, ie. - * PCI, PNP and CPU functions operate without use of devicetree. The reason - * post-CAR utilizes __SIMPLE_DEVICE__ is for simplicity. Currently there's - * no known requirement that devicetree would be needed during that stage. - * - * For ramstage individual source file may define __SIMPLE_DEVICE__ - * before including any header files to force that particular source - * be built with simple device model. - */ - -#if defined(__PRE_RAM__) || ENV_SMM || ENV_POSTCAR -#define __SIMPLE_DEVICE__ -#endif - /* Define helpers about the current architecture, based on toolchain.inc. */ #if defined(__ARCH_arm__) @@ -250,4 +236,21 @@ #endif +/** + * For pre-DRAM stages and post-CAR always build with simple device model, ie. + * PCI, PNP and CPU functions operate without use of devicetree. The reason + * post-CAR utilizes __SIMPLE_DEVICE__ is for simplicity. Currently there's + * no known requirement that devicetree would be needed during that stage. + * + * For ramstage individual source file may define __SIMPLE_DEVICE__ + * before including any header files to force that particular source + * be built with simple device model. + * + * For now only x86 is supported. + */ + +#if ENV_X86 && (defined(__PRE_RAM__) || ENV_SMM || ENV_POSTCAR) +#define __SIMPLE_DEVICE__ +#endif + #endif /* _RULES_H */ -- cgit v1.2.3