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 |
Andrew Wu | 52e665b | 2013-06-19 18:55:08 +0800 | [diff] [blame] | 6 | subdirs-y += dmp |
Hung-Te Lin | 7635a60 | 2013-02-12 00:07:38 +0800 | [diff] [blame] | 7 | subdirs-y += armltd |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 8 | subdirs-y += intel |
Stefan Reinauer | 9fe20cb | 2012-12-07 17:18:43 -0800 | [diff] [blame] | 9 | subdirs-y += samsung |
Gabe Black | 3c7e939 | 2013-05-26 07:15:57 -0700 | [diff] [blame] | 10 | subdirs-y += ti |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 11 | subdirs-y += via |
Aaron Durbin | 716738a | 2013-05-10 00:33:32 -0500 | [diff] [blame] | 12 | subdirs-y += x86 |
Gerd Hoffmann | cbf3073 | 2013-05-31 09:23:26 +0200 | [diff] [blame] | 13 | subdirs-$(CONFIG_CPU_QEMU_X86) += qemu-x86 |
Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 14 | |
| 15 | ################################################################################ |
| 16 | ## Rules for building the microcode blob in CBFS |
| 17 | ################################################################################ |
| 18 | |
Aaron Durbin | 32ab283 | 2013-06-11 16:36:37 -0500 | [diff] [blame] | 19 | cpu_ucode_cbfs_name = cpu_microcode_blob.bin |
| 20 | |
Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 21 | # External microcode file, or are we generating one ? |
| 22 | ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL), y) |
Aaron Durbin | 32ab283 | 2013-06-11 16:36:37 -0500 | [diff] [blame] | 23 | cpu_ucode_cbfs_file = $(call strip_quotes,$(CONFIG_CPU_MICROCODE_FILE)) |
| 24 | cbfs_include_ucode = y |
Stefan Reinauer | 9c29cfa | 2013-02-27 20:24:11 +0100 | [diff] [blame] | 25 | endif |
| 26 | |
| 27 | ifeq ($(CONFIG_CPU_MICROCODE_CBFS_GENERATE), y) |
Aaron Durbin | 32ab283 | 2013-06-11 16:36:37 -0500 | [diff] [blame] | 28 | cpu_ucode_cbfs_file = $(obj)/cpu_microcode_blob.bin |
| 29 | cbfs_include_ucode = y |
Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 30 | endif |
| 31 | |
Marc Jones | bdafcfa | 2013-10-29 17:46:54 -0600 | [diff] [blame] | 32 | ifneq ($(CONFIG_CPU_MICROCODE_CBFS_LOC), 0) |
| 33 | cpu_ucode_cbfs_offset = "-b $(CONFIG_CPU_MICROCODE_CBFS_LOC)" |
| 34 | else |
| 35 | cpu_ucode_cbfs_offset = "-b" |
| 36 | endif |
| 37 | |
Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 38 | # 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] | 39 | # 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] | 40 | # in one file. This makes it easier for objcopy in the final step. |
| 41 | # The --entry=0 is just here to suppress the LD warning. It does not affect the |
| 42 | # final microcode file. |
| 43 | $(obj)/cpu_microcode_blob.o: $$(cpu_microcode-objs) |
| 44 | @printf " LD $(subst $(obj)/,,$(@))\n" |
Alexandru Gagniuc | c6c8cb7 | 2013-12-07 18:57:02 -0600 | [diff] [blame] | 45 | $(LD) -static --entry=0 $+ -o $@ |
Alexandru Gagniuc | 00b579a | 2012-07-20 00:11:21 -0500 | [diff] [blame] | 46 | |
| 47 | # We have a lot of useless data in the large blob, and we are only interested in |
| 48 | # the data section, so we only copy that part to the final microcode file |
| 49 | $(obj)/cpu_microcode_blob.bin: $(obj)/cpu_microcode_blob.o |
| 50 | @printf " MICROCODE $(subst $(obj)/,,$(@))\n" |
| 51 | $(OBJCOPY) -j .data -O binary $< $@ |
Aaron Durbin | 32ab283 | 2013-06-11 16:36:37 -0500 | [diff] [blame] | 52 | |
| 53 | ifeq ($(cbfs_include_ucode),y) |
| 54 | # Add CPU microcode to specified rom image $(1) |
| 55 | add-cpu-microcode-to-cbfs = \ |
Marc Jones | bdafcfa | 2013-10-29 17:46:54 -0600 | [diff] [blame] | 56 | $(CBFSTOOL) $(1) locate -f $(cpu_ucode_cbfs_file) -n $(cpu_ucode_cbfs_name) -a 16 | xargs $(CBFSTOOL) $(1) add -n $(cpu_ucode_cbfs_name) -f $(cpu_ucode_cbfs_file) -t 0x53 $(cpu_ucode_cbfs_offset) |
Aaron Durbin | 32ab283 | 2013-06-11 16:36:37 -0500 | [diff] [blame] | 57 | else |
| 58 | add-cpu-microcode-to-cbfs = true |
| 59 | endif |