blob: d9390610c662bba8f6c35b110898e9251ac8488b [file] [log] [blame]
Alexandru Gagniuc00b579a2012-07-20 00:11:21 -05001################################################################################
2## Subdirectories
3################################################################################
Alexandru Gagniucf64111b2013-12-13 20:44:48 -06004subdirs-y += allwinner
Ronald G. Minnichfd4519b2009-08-12 15:56:17 +00005subdirs-y += amd
Andrew Wu52e665b2013-06-19 18:55:08 +08006subdirs-y += dmp
Hung-Te Lin7635a602013-02-12 00:07:38 +08007subdirs-y += armltd
Paul Burtonc1081a42014-06-14 00:08:02 +01008subdirs-y += imgtec
Patrick Georgi0588d192009-08-12 15:00:51 +00009subdirs-y += intel
Gabe Black3c7e9392013-05-26 07:15:57 -070010subdirs-y += ti
Patrick Georgi0588d192009-08-12 15:00:51 +000011subdirs-y += via
Alexandru Gagniuccc328422015-10-04 19:34:08 -070012subdirs-$(CONFIG_ARCH_X86) += x86
Gerd Hoffmanncbf30732013-05-31 09:23:26 +020013subdirs-$(CONFIG_CPU_QEMU_X86) += qemu-x86
Alexandru Gagniuc00b579a2012-07-20 00:11:21 -050014
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070015$(eval $(call create_class_compiler,cpu_microcode,x86_32))
Alexandru Gagniuc00b579a2012-07-20 00:11:21 -050016################################################################################
17## Rules for building the microcode blob in CBFS
18################################################################################
19
Alexandru Gagniuc00b579a2012-07-20 00:11:21 -050020# External microcode file, or are we generating one ?
21ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL), y)
Aaron Durbin32ab2832013-06-11 16:36:37 -050022cpu_ucode_cbfs_file = $(call strip_quotes,$(CONFIG_CPU_MICROCODE_FILE))
23cbfs_include_ucode = y
Stefan Reinauer9c29cfa2013-02-27 20:24:11 +010024endif
25
26ifeq ($(CONFIG_CPU_MICROCODE_CBFS_GENERATE), y)
Timothy Pearson24e6d042015-10-08 16:58:58 -050027ifneq ($(CONFIG_CPU_MICROCODE_MULTIPLE_FILES), y)
Aaron Durbin32ab2832013-06-11 16:36:37 -050028cpu_ucode_cbfs_file = $(obj)/cpu_microcode_blob.bin
29cbfs_include_ucode = y
Alexandru Gagniuc00b579a2012-07-20 00:11:21 -050030endif
Timothy Pearson24e6d042015-10-08 16:58:58 -050031endif
Alexandru Gagniuc00b579a2012-07-20 00:11:21 -050032
Alexandru Gagniuc1d857002015-09-09 22:38:06 -070033# We just mash all microcode binaries together into one binary to rule them all.
34# This approach assumes that the microcode binaries are properly padded, and
35# their headers specify the correct size. This works fairly well on isolatied
36# updates, such as Intel and some AMD microcode, but won't work very well if the
37# updates are wrapped in a container, like AMD's microcode update container. If
38# there is only one microcode binary (i.e. one container), then we don't have
39# this issue, and this rule will continue to work.
40$(obj)/cpu_microcode_blob.bin: $$(cpu_microcode_bins)
Daniele Forsi21fbc082014-08-10 15:18:42 +020041 @printf " MICROCODE $(subst $(obj)/,,$(@))\n"
Alexandru Gagniuc1d857002015-09-09 22:38:06 -070042 @echo $(cpu_microcode_bins)
43 cat $+ > $@
Aaron Durbin32ab2832013-06-11 16:36:37 -050044
Alexandru Gagniucf55e6682015-09-07 00:35:55 -070045cbfs-files-$(cbfs_include_ucode) += cpu_microcode_blob.bin
46cpu_microcode_blob.bin-file := $(cpu_ucode_cbfs_file)
47cpu_microcode_blob.bin-type := microcode
48
49ifneq ($(CONFIG_CPU_MICROCODE_CBFS_LOC),)
50cpu_microcode_blob.bin-position := $(CONFIG_CPU_MICROCODE_CBFS_LOC)
Aaron Durbin32ab2832013-06-11 16:36:37 -050051else
Alexandru Gagniucf55e6682015-09-07 00:35:55 -070052cpu_microcode_blob.bin-align := 16
Aaron Durbin32ab2832013-06-11 16:36:37 -050053endif