2012-07-20 07:11:21 +02:00
|
|
|
################################################################################
|
|
|
|
## Subdirectories
|
|
|
|
################################################################################
|
2009-08-12 17:56:17 +02:00
|
|
|
subdirs-y += amd
|
2013-02-11 17:07:38 +01:00
|
|
|
subdirs-y += armltd
|
2009-08-12 17:00:51 +02:00
|
|
|
subdirs-y += intel
|
2013-05-26 16:15:57 +02:00
|
|
|
subdirs-y += ti
|
2015-10-05 04:34:08 +02:00
|
|
|
subdirs-$(CONFIG_ARCH_X86) += x86
|
2013-05-31 09:23:26 +02:00
|
|
|
subdirs-$(CONFIG_CPU_QEMU_X86) += qemu-x86
|
2020-12-14 14:52:50 +01:00
|
|
|
subdirs-$(CONFIG_CPU_POWER9) += power9
|
2012-07-20 07:11:21 +02:00
|
|
|
|
Introduce stage-specific architecture for coreboot
Make all three coreboot stages (bootblock, romstage and ramstage) aware of the
architecture specific to that stage i.e. we will have CONFIG_ARCH variables for
each of the three stages. This allows us to have an SOC with any combination of
architectures and thus every stage can be made to run on a completely different
architecture independent of others. Thus, bootblock can have an x86 arch whereas
romstage and ramstage can have arm32 and arm64 arch respectively. These stage
specific CONFIG_ARCH_ variables enable us to select the proper set of toolchain
and compiler flags for every stage.
These options can be considered as either arch or modes eg: x86 running in
different modes or ARM having different arch types (v4, v7, v8). We have got rid
of the original CONFIG_ARCH option completely as every stage can have any
architecture of its own. Thus, almost all the components of coreboot are
identified as being part of one of the three stages (bootblock, romstage or
ramstage). The components which cannot be classified as such e.g. smm, rmodules
can have their own compiler toolset which is for now set to *_i386. Hence, all
special classes are treated in a similar way and the compiler toolset is defined
using create_class_compiler defined in Makefile.
In order to meet these requirements, changes have been made to CC, LD, OBJCOPY
and family to add CC_bootblock, CC_romstage, CC_ramstage and similarly others.
Additionally, CC_x86_32 and CC_armv7 handle all the special classes. All the
toolsets are defined using create_class_compiler.
Few additional macros have been introduced to identify the class to be used at
various points, e.g.: CC_$(class) derives the $(class) part from the name of
the stage being compiled.
We have also got rid of COREBOOT_COMPILER, COREBOOT_ASSEMBLER and COREBOOT_LINKER
as they do not make any sense for coreboot as a whole. All these attributes are
associated with each of the stages.
Change-Id: I923f3d4fb097d21071030b104c372cc138c68c7b
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: http://review.coreboot.org/5577
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@gmail.com>
2014-04-23 19:18:48 +02:00
|
|
|
$(eval $(call create_class_compiler,cpu_microcode,x86_32))
|
2012-07-20 07:11:21 +02:00
|
|
|
################################################################################
|
|
|
|
## Rules for building the microcode blob in CBFS
|
|
|
|
################################################################################
|
|
|
|
|
2018-11-29 17:05:32 +01:00
|
|
|
cbfs-files-$(CONFIG_USE_CPU_MICROCODE_CBFS_BINS) += cpu_microcode_blob.bin
|
2012-07-20 07:11:21 +02:00
|
|
|
|
2015-11-05 16:03:45 +01:00
|
|
|
ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_HEADER),y)
|
|
|
|
cbfs-files-y += cpu_microcode_blob.bin
|
|
|
|
cpu_microcode_blob.bin-file = $(objgenerated)/microcode.bin
|
|
|
|
|
2017-11-03 14:07:55 +01:00
|
|
|
$(objgenerated)/microcode.bin: $(call strip_quotes,$(CONFIG_CPU_MICROCODE_HEADER_FILES))
|
2015-11-05 16:03:45 +01:00
|
|
|
echo " util/scripts/ucode_h_to_bin.sh $(objgenerated)/microcode.bin \"$(CONFIG_CPU_MICROCODE_HEADER_FILES)\""
|
|
|
|
util/scripts/ucode_h_to_bin.sh $(objgenerated)/microcode.bin $(CONFIG_CPU_MICROCODE_HEADER_FILES)
|
|
|
|
endif
|
|
|
|
|
2018-11-29 17:05:32 +01:00
|
|
|
ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS),y)
|
2020-02-20 20:20:00 +01:00
|
|
|
$(obj)/cpu_microcode_blob.bin: cpu_microcode_bins := $(call strip_quotes,$(CONFIG_CPU_UCODE_BINARIES))
|
2018-11-29 17:05:32 +01:00
|
|
|
endif
|
|
|
|
# otherwise `cpu_microcode_bins` should be filled by platform makefiles
|
|
|
|
|
2015-09-10 07:38:06 +02:00
|
|
|
# We just mash all microcode binaries together into one binary to rule them all.
|
|
|
|
# This approach assumes that the microcode binaries are properly padded, and
|
|
|
|
# their headers specify the correct size. This works fairly well on isolatied
|
|
|
|
# updates, such as Intel and some AMD microcode, but won't work very well if the
|
|
|
|
# updates are wrapped in a container, like AMD's microcode update container. If
|
|
|
|
# there is only one microcode binary (i.e. one container), then we don't have
|
|
|
|
# this issue, and this rule will continue to work.
|
2016-12-22 18:29:20 +01:00
|
|
|
$(obj)/cpu_microcode_blob.bin: $$(wildcard $$(cpu_microcode_bins))
|
|
|
|
for bin in $(cpu_microcode_bins); do \
|
|
|
|
if [ ! -f "$$bin" ]; then \
|
|
|
|
echo "Microcode error: $$bin does not exist"; \
|
|
|
|
NO_MICROCODE_FILE=1; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
if [ -n "$$NO_MICROCODE_FILE" ]; then \
|
2018-11-29 17:05:32 +01:00
|
|
|
if [ -z "$(CONFIG_USE_BLOBS)" ] && [ -n "$(CONFIG_CPU_MICROCODE_CBFS_DEFAULT_BINS)" ]; then \
|
2016-12-22 18:29:20 +01:00
|
|
|
echo "Try enabling binary-only repository in Kconfig 'General setup' menu."; \
|
|
|
|
fi; \
|
|
|
|
false; \
|
|
|
|
fi
|
2018-11-29 17:05:32 +01:00
|
|
|
$(if $^,,false) # fail if no file is given at all
|
2014-08-10 15:18:42 +02:00
|
|
|
@printf " MICROCODE $(subst $(obj)/,,$(@))\n"
|
2015-09-10 07:38:06 +02:00
|
|
|
@echo $(cpu_microcode_bins)
|
2018-11-29 17:05:32 +01:00
|
|
|
cat $^ > $@
|
2013-06-11 23:36:37 +02:00
|
|
|
|
2015-11-05 16:03:45 +01:00
|
|
|
cpu_microcode_blob.bin-file ?= $(obj)/cpu_microcode_blob.bin
|
2015-09-07 09:35:55 +02:00
|
|
|
cpu_microcode_blob.bin-type := microcode
|
2021-11-19 19:38:35 +01:00
|
|
|
# The AMD LPC SPI DMA controller requires source files to be 64 byte aligned.
|
|
|
|
ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_LPC_SPI_DMA),y)
|
|
|
|
cpu_microcode_blob.bin-align := 64
|
|
|
|
else
|
2015-09-07 09:35:55 +02:00
|
|
|
cpu_microcode_blob.bin-align := 16
|
2021-11-19 19:38:35 +01:00
|
|
|
endif
|
2020-01-28 19:51:36 +01:00
|
|
|
|
|
|
|
ifneq ($(CONFIG_CPU_MICROCODE_CBFS_LOC),)
|
|
|
|
cpu_microcode_blob.bin-COREBOOT-position := $(CONFIG_CPU_MICROCODE_CBFS_LOC)
|
|
|
|
endif
|