blob: 8b9d0747c86c45364fcfd067420b16acd7dddd77 [file] [log] [blame]
Alexandru Gagniuc00b579a2012-07-20 00:11:21 -05001################################################################################
2## Subdirectories
3################################################################################
Ronald G. Minnichfd4519b2009-08-12 15:56:17 +00004subdirs-y += amd
Hung-Te Lin7635a602013-02-12 00:07:38 +08005subdirs-y += armltd
Patrick Georgi0588d192009-08-12 15:00:51 +00006subdirs-y += intel
Stefan Reinauer9fe20cb2012-12-07 17:18:43 -08007subdirs-y += samsung
Gabe Black3c7e9392013-05-26 07:15:57 -07008subdirs-y += ti
Patrick Georgi0588d192009-08-12 15:00:51 +00009subdirs-y += via
Aaron Durbin716738a2013-05-10 00:33:32 -050010subdirs-y += x86
Gerd Hoffmanncbf30732013-05-31 09:23:26 +020011subdirs-$(CONFIG_CPU_QEMU_X86) += qemu-x86
Alexandru Gagniuc00b579a2012-07-20 00:11:21 -050012
13################################################################################
14## Rules for building the microcode blob in CBFS
15################################################################################
16
Alexandru Gagniuc00b579a2012-07-20 00:11:21 -050017# External microcode file, or are we generating one ?
18ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL), y)
Stefan Reinauer9c29cfa2013-02-27 20:24:11 +010019cbfs-files-y += cpu_microcode_blob.bin
20cpu_microcode_blob.bin-type = 0x53
Alexandru Gagniuc00b579a2012-07-20 00:11:21 -050021cpu_microcode_blob.bin-file = $(call strip_quotes,$(CONFIG_CPU_MICROCODE_FILE))
Stefan Reinauer9c29cfa2013-02-27 20:24:11 +010022endif
23
24ifeq ($(CONFIG_CPU_MICROCODE_CBFS_GENERATE), y)
25cbfs-files-y += cpu_microcode_blob.bin
26cpu_microcode_blob.bin-type = 0x53
Alexandru Gagniuc00b579a2012-07-20 00:11:21 -050027cpu_microcode_blob.bin-file = $(obj)/cpu_microcode_blob.bin
28endif
29
30# In case we have more than one "source" (cough) files containing microcode, we
Stefan Reinauer9c29cfa2013-02-27 20:24:11 +010031# link them together in one large blob, so that we get all the microcode updates
Alexandru Gagniuc00b579a2012-07-20 00:11:21 -050032# in one file. This makes it easier for objcopy in the final step.
33# The --entry=0 is just here to suppress the LD warning. It does not affect the
34# final microcode file.
35$(obj)/cpu_microcode_blob.o: $$(cpu_microcode-objs)
36 @printf " LD $(subst $(obj)/,,$(@))\n"
37 $(LD) -static --entry=0 $< -o $@
38
39# We have a lot of useless data in the large blob, and we are only interested in
40# the data section, so we only copy that part to the final microcode file
41$(obj)/cpu_microcode_blob.bin: $(obj)/cpu_microcode_blob.o
42 @printf " MICROCODE $(subst $(obj)/,,$(@))\n"
43 $(OBJCOPY) -j .data -O binary $< $@