Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 1 | ################################################################################ |
| 2 | ## Subdirectories |
| 3 | ################################################################################ |
Ronald G. Minnich | fd4519b | 2009-08-12 15:56:17 +0000 | [diff] [blame] | 4 | subdirs-y += amd |
Hung-Te Lin | 7635a60 | 2013-02-12 00:07:38 +0800 | [diff] [blame] | 5 | subdirs-y += armltd |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 6 | subdirs-y += intel |
Stefan Reinauer | 9fe20cb | 2012-12-07 17:18:43 -0800 | [diff] [blame] | 7 | subdirs-y += samsung |
Gabe Black | 3c7e939 | 2013-05-26 07:15:57 -0700 | [diff] [blame] | 8 | subdirs-y += ti |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 9 | subdirs-y += via |
Aaron Durbin | 716738a | 2013-05-10 00:33:32 -0500 | [diff] [blame] | 10 | subdirs-y += x86 |
Gerd Hoffmann | cbf3073 | 2013-05-31 09:23:26 +0200 | [diff] [blame^] | 11 | subdirs-$(CONFIG_CPU_QEMU_X86) += qemu-x86 |
Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 12 | |
| 13 | ################################################################################ |
| 14 | ## Rules for building the microcode blob in CBFS |
| 15 | ################################################################################ |
| 16 | |
Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 17 | # External microcode file, or are we generating one ? |
| 18 | ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL), y) |
Stefan Reinauer | 9c29cfa | 2013-02-27 20:24:11 +0100 | [diff] [blame] | 19 | cbfs-files-y += cpu_microcode_blob.bin |
| 20 | cpu_microcode_blob.bin-type = 0x53 |
Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 21 | cpu_microcode_blob.bin-file = $(call strip_quotes,$(CONFIG_CPU_MICROCODE_FILE)) |
Stefan Reinauer | 9c29cfa | 2013-02-27 20:24:11 +0100 | [diff] [blame] | 22 | endif |
| 23 | |
| 24 | ifeq ($(CONFIG_CPU_MICROCODE_CBFS_GENERATE), y) |
| 25 | cbfs-files-y += cpu_microcode_blob.bin |
| 26 | cpu_microcode_blob.bin-type = 0x53 |
Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 27 | cpu_microcode_blob.bin-file = $(obj)/cpu_microcode_blob.bin |
| 28 | endif |
| 29 | |
| 30 | # In case we have more than one "source" (cough) files containing microcode, we |
Stefan Reinauer | 9c29cfa | 2013-02-27 20:24:11 +0100 | [diff] [blame] | 31 | # link them together in one large blob, so that we get all the microcode updates |
Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 32 | # 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 $< $@ |