Aaron Durbin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41355 )
Change subject: soc/{amd,intel}: remove soc specific directory from include path ......................................................................
soc/{amd,intel}: remove soc specific directory from include path
We shouldn't be providing -I include paths to the root of the soc specific directory. It allows for lazy includes that can collide, but there's no way of knowing the winning path since the winning path is determined by Makefile.inc parsing order.
Change-Id: I2dea1b7e01ea1d40686acd8f06fa8df193bf1769 Signed-off-by: Aaron Durbin adurbin@chromium.org --- M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/early_memmap.c M src/soc/amd/stoneyridge/Makefile.inc M src/soc/intel/braswell/Makefile.inc M src/soc/intel/cannonlake/Makefile.inc M src/soc/intel/icelake/Makefile.inc M src/soc/intel/jasperlake/Makefile.inc M src/soc/intel/quark/Makefile.inc M src/soc/intel/skylake/Makefile.inc M src/soc/intel/tigerlake/Makefile.inc 10 files changed, 77 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/41355/1
diff --git a/src/soc/amd/picasso/Makefile.inc b/src/soc/amd/picasso/Makefile.inc index 0e54661..e2765b6 100644 --- a/src/soc/amd/picasso/Makefile.inc +++ b/src/soc/amd/picasso/Makefile.inc @@ -69,7 +69,6 @@ smm-y += gpio.c smm-y += psp.c
-CPPFLAGS_common += -I$(src)/soc/amd/picasso CPPFLAGS_common += -I$(src)/soc/amd/picasso/include CPPFLAGS_common += -I$(src)/soc/amd/picasso/acpi CPPFLAGS_common += -I$(src)/vendorcode/amd/fsp/picasso diff --git a/src/soc/amd/picasso/early_memmap.c b/src/soc/amd/picasso/early_memmap.c new file mode 100644 index 0000000..b7de324 --- /dev/null +++ b/src/soc/amd/picasso/early_memmap.c @@ -0,0 +1,77 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* This file is part of the coreboot project. */ + +#include <console/console.h> +#include <imd.h> +#include <rules.h> + +static inline size_t early_mmap_imd_size(void) +{ + return CONFIG_EARLY_MEMMAP_SIZE; +} + +static inline void *early_mmap_imd_top(void) +{ + uintptr_t imd_base = (uintptr_t)CONFIG_EARLY_MEMMAP_BASE_ADDR; + + return (void *)(imd_base + early_mmap_imd_size()); +} + +static struct imd *get_imd(void) +{ + static struct imd gimd; + static struct imd *gimd_ptr; + + if (gimd_ptr) + return gimd_ptr; + + if (ENV_BOOTBLOCK) { + imd_handle_init(&gimd, early_mmap_imd_top()); + if (imd_create_emtpy(&gimd, 2*KiB, 2*KiB)) { + printk(BIOS_ERR, "Unable to create empty imd for early memmap.\n"); + return NULL; + } + if (imd_limit_size(&gimd, early_mmap_imd_size())) { + printk(BIOS_ERR, "Unable to limit early memmap size.\n"); + return NULL; + } + } else { + imd_handle_init(&gimd, early_mmap_imd_top()); + if (imd_recover(&gimd)) { + printk(BIOS_ERR, "Unable to recover early memmap.\n"); + return NULL; + } + } + + gimd_ptr = &gimd; + + return gimd_ptr; +} + +int early_memmap_reserved_memory(uintptr_t *base, size_t size) +{ + void *imd_base; + const struct imd *imd = get_imd(); + + *base = 0; + size = 0; + if (imd == NULL) + return -1; + + if (imd_region_used(imd, &imd_base, &size)) { + printk(BIOS_ERR, "Couldn't obtain early memmap usage.\n"); + return -1; + } + + *base = (uintptr_t)imd_base; + + return 0; +} + +enum early_memmap_entry { + EARLY_MEMMAP_BOOTBLOCK, + EARLY_MEMMAP_APOB, + EARLY_MEMMAP_VBOOT_WORKBUF, + EARLY_MEMMAP_ROMSTAGE, + EARLY_MEMMAP_FSP_M, +}; diff --git a/src/soc/amd/stoneyridge/Makefile.inc b/src/soc/amd/stoneyridge/Makefile.inc index 0d7b5d1..9bbbd0a 100644 --- a/src/soc/amd/stoneyridge/Makefile.inc +++ b/src/soc/amd/stoneyridge/Makefile.inc @@ -82,7 +82,6 @@ smm-y += gpio.c smm-y += psp.c
-CPPFLAGS_common += -I$(src)/soc/amd/stoneyridge CPPFLAGS_common += -I$(src)/soc/amd/stoneyridge/include CPPFLAGS_common += -I$(src)/soc/amd/stoneyridge/acpi
diff --git a/src/soc/intel/braswell/Makefile.inc b/src/soc/intel/braswell/Makefile.inc index 5923e39..c54a21d 100644 --- a/src/soc/intel/braswell/Makefile.inc +++ b/src/soc/intel/braswell/Makefile.inc @@ -62,7 +62,6 @@ verstage-y += pmutil.c verstage-y += tsc_freq.c
-CPPFLAGS_common += -I$(src)/soc/intel/braswell/ CPPFLAGS_common += -I$(src)/soc/intel/braswell/include CPPFLAGS_common += -I$(call strip_quotes,$(CONFIG_FSP_HEADER_PATH))
diff --git a/src/soc/intel/cannonlake/Makefile.inc b/src/soc/intel/cannonlake/Makefile.inc index e060581..fab15ee 100644 --- a/src/soc/intel/cannonlake/Makefile.inc +++ b/src/soc/intel/cannonlake/Makefile.inc @@ -115,7 +115,6 @@ endif endif
-CPPFLAGS_common += -I$(src)/soc/intel/cannonlake CPPFLAGS_common += -I$(src)/soc/intel/cannonlake/include
# DSP firmware settings files. diff --git a/src/soc/intel/icelake/Makefile.inc b/src/soc/intel/icelake/Makefile.inc index f30816e..fc48cdd 100644 --- a/src/soc/intel/icelake/Makefile.inc +++ b/src/soc/intel/icelake/Makefile.inc @@ -52,7 +52,6 @@ smm-y += smihandler.c smm-y += uart.c
-CPPFLAGS_common += -I$(src)/soc/intel/icelake CPPFLAGS_common += -I$(src)/soc/intel/icelake/include
endif diff --git a/src/soc/intel/jasperlake/Makefile.inc b/src/soc/intel/jasperlake/Makefile.inc index 4a65adc..4db137f 100644 --- a/src/soc/intel/jasperlake/Makefile.inc +++ b/src/soc/intel/jasperlake/Makefile.inc @@ -54,7 +54,6 @@
verstage-y += gpio.c
-CPPFLAGS_common += -I$(src)/soc/intel/jasperlake CPPFLAGS_common += -I$(src)/soc/intel/jasperlake/include
endif diff --git a/src/soc/intel/quark/Makefile.inc b/src/soc/intel/quark/Makefile.inc index b49ee3e..e41436b 100644 --- a/src/soc/intel/quark/Makefile.inc +++ b/src/soc/intel/quark/Makefile.inc @@ -53,7 +53,6 @@ ramstage-$(CONFIG_ENABLE_BUILTIN_HSUART1) += uart_common.c ramstage-$(CONFIG_ENABLE_BUILTIN_HSUART1) += uart.c
-CPPFLAGS_common += -I$(src)/soc/intel/quark CPPFLAGS_common += -I$(src)/soc/intel/quark/include CPPFLAGS_common += -I$(src)/soc/intel/quark/include/soc/fsp
diff --git a/src/soc/intel/skylake/Makefile.inc b/src/soc/intel/skylake/Makefile.inc index 75121ab..77f9a23 100644 --- a/src/soc/intel/skylake/Makefile.inc +++ b/src/soc/intel/skylake/Makefile.inc @@ -104,7 +104,6 @@ # Missing for Skylake C0 (0x406e2), Kabylake G0 (0x406e8), Kabylake HA0 (0x506e8) # since those are probably pre-release samples.
-CPPFLAGS_common += -I$(src)/soc/intel/skylake CPPFLAGS_common += -I$(src)/soc/intel/skylake/include
# Currently used for microcode path. diff --git a/src/soc/intel/tigerlake/Makefile.inc b/src/soc/intel/tigerlake/Makefile.inc index f62bfaf..12c7198 100644 --- a/src/soc/intel/tigerlake/Makefile.inc +++ b/src/soc/intel/tigerlake/Makefile.inc @@ -54,7 +54,6 @@
verstage-y += gpio.c
-CPPFLAGS_common += -I$(src)/soc/intel/tigerlake CPPFLAGS_common += -I$(src)/soc/intel/tigerlake/include
endif