Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 1 | ################################################################################ |
| 2 | ## Subdirectories |
| 3 | ################################################################################ |
Alexandru Gagniuc | f64111b | 2013-12-13 20:44:48 -0600 | [diff] [blame] | 4 | subdirs-y += allwinner |
Ronald G. Minnich | fd4519b | 2009-08-12 15:56:17 +0000 | [diff] [blame] | 5 | subdirs-y += amd |
Hung-Te Lin | 7635a60 | 2013-02-12 00:07:38 +0800 | [diff] [blame] | 6 | subdirs-y += armltd |
Paul Burton | c1081a4 | 2014-06-14 00:08:02 +0100 | [diff] [blame] | 7 | subdirs-y += imgtec |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 8 | subdirs-y += intel |
Gabe Black | 3c7e939 | 2013-05-26 07:15:57 -0700 | [diff] [blame] | 9 | subdirs-y += ti |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 10 | subdirs-y += via |
Alexandru Gagniuc | cc32842 | 2015-10-04 19:34:08 -0700 | [diff] [blame] | 11 | subdirs-$(CONFIG_ARCH_X86) += x86 |
Gerd Hoffmann | cbf3073 | 2013-05-31 09:23:26 +0200 | [diff] [blame] | 12 | subdirs-$(CONFIG_CPU_QEMU_X86) += qemu-x86 |
Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 13 | |
Furquan Shaikh | 99ac98f | 2014-04-23 10:18:48 -0700 | [diff] [blame] | 14 | $(eval $(call create_class_compiler,cpu_microcode,x86_32)) |
Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 15 | ################################################################################ |
| 16 | ## Rules for building the microcode blob in CBFS |
| 17 | ################################################################################ |
| 18 | |
Timothy Pearson | 24e6d04 | 2015-10-08 16:58:58 -0500 | [diff] [blame] | 19 | ifneq ($(CONFIG_CPU_MICROCODE_MULTIPLE_FILES), y) |
Timothy Pearson | 855fc1f | 2015-10-14 15:41:49 -0500 | [diff] [blame] | 20 | cbfs-files-$(CONFIG_CPU_MICROCODE_CBFS_GENERATE) += cpu_microcode_blob.bin |
Timothy Pearson | 24e6d04 | 2015-10-08 16:58:58 -0500 | [diff] [blame] | 21 | endif |
Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 22 | |
Martin Roth | 4c50269 | 2015-11-05 08:03:45 -0700 | [diff] [blame] | 23 | ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_HEADER),y) |
| 24 | cbfs-files-y += cpu_microcode_blob.bin |
| 25 | cpu_microcode_blob.bin-file = $(objgenerated)/microcode.bin |
| 26 | |
Julien Viard de Galbert | c467334 | 2017-11-03 14:07:55 +0100 | [diff] [blame] | 27 | $(objgenerated)/microcode.bin: $(call strip_quotes,$(CONFIG_CPU_MICROCODE_HEADER_FILES)) |
Martin Roth | 4c50269 | 2015-11-05 08:03:45 -0700 | [diff] [blame] | 28 | echo " util/scripts/ucode_h_to_bin.sh $(objgenerated)/microcode.bin \"$(CONFIG_CPU_MICROCODE_HEADER_FILES)\"" |
| 29 | util/scripts/ucode_h_to_bin.sh $(objgenerated)/microcode.bin $(CONFIG_CPU_MICROCODE_HEADER_FILES) |
| 30 | endif |
| 31 | |
Alexandru Gagniuc | 1d85700 | 2015-09-09 22:38:06 -0700 | [diff] [blame] | 32 | # We just mash all microcode binaries together into one binary to rule them all. |
| 33 | # This approach assumes that the microcode binaries are properly padded, and |
| 34 | # their headers specify the correct size. This works fairly well on isolatied |
| 35 | # updates, such as Intel and some AMD microcode, but won't work very well if the |
| 36 | # updates are wrapped in a container, like AMD's microcode update container. If |
| 37 | # there is only one microcode binary (i.e. one container), then we don't have |
| 38 | # this issue, and this rule will continue to work. |
Martin Roth | 8565374 | 2016-12-22 10:29:20 -0700 | [diff] [blame] | 39 | $(obj)/cpu_microcode_blob.bin: $$(wildcard $$(cpu_microcode_bins)) |
| 40 | for bin in $(cpu_microcode_bins); do \ |
| 41 | if [ ! -f "$$bin" ]; then \ |
| 42 | echo "Microcode error: $$bin does not exist"; \ |
| 43 | NO_MICROCODE_FILE=1; \ |
| 44 | fi; \ |
| 45 | done; \ |
| 46 | if [ -n "$$NO_MICROCODE_FILE" ]; then \ |
| 47 | if [ -z "$(CONFIG_USE_BLOBS)" ] && [ -n "$(CONFIG_CPU_MICROCODE_CBFS_GENERATE)" ]; then \ |
| 48 | echo "Try enabling binary-only repository in Kconfig 'General setup' menu."; \ |
| 49 | fi; \ |
| 50 | false; \ |
| 51 | fi |
Daniele Forsi | 21fbc08 | 2014-08-10 15:18:42 +0200 | [diff] [blame] | 52 | @printf " MICROCODE $(subst $(obj)/,,$(@))\n" |
Alexandru Gagniuc | 1d85700 | 2015-09-09 22:38:06 -0700 | [diff] [blame] | 53 | @echo $(cpu_microcode_bins) |
Alexander Couzens | d1adafe | 2015-10-21 12:02:39 +0200 | [diff] [blame] | 54 | cat /dev/null $+ > $@ |
Aaron Durbin | 32ab283 | 2013-06-11 16:36:37 -0500 | [diff] [blame] | 55 | |
Martin Roth | 4c50269 | 2015-11-05 08:03:45 -0700 | [diff] [blame] | 56 | cpu_microcode_blob.bin-file ?= $(obj)/cpu_microcode_blob.bin |
Alexandru Gagniuc | f55e668 | 2015-09-07 00:35:55 -0700 | [diff] [blame] | 57 | cpu_microcode_blob.bin-type := microcode |
| 58 | |
| 59 | ifneq ($(CONFIG_CPU_MICROCODE_CBFS_LOC),) |
Barnali Sarkar | 4aa295c | 2016-09-29 11:25:49 +0530 | [diff] [blame] | 60 | cpu_microcode_blob.bin-COREBOOT-position := $(CONFIG_CPU_MICROCODE_CBFS_LOC) |
Aaron Durbin | 32ab283 | 2013-06-11 16:36:37 -0500 | [diff] [blame] | 61 | else |
Alexandru Gagniuc | f55e668 | 2015-09-07 00:35:55 -0700 | [diff] [blame] | 62 | cpu_microcode_blob.bin-align := 16 |
Aaron Durbin | 32ab283 | 2013-06-11 16:36:37 -0500 | [diff] [blame] | 63 | endif |