2012-07-20 07:11:21 +02:00
|
|
|
################################################################################
|
|
|
|
## Subdirectories
|
|
|
|
################################################################################
|
2013-12-14 03:44:48 +01:00
|
|
|
subdirs-y += allwinner
|
2009-08-12 17:56:17 +02:00
|
|
|
subdirs-y += amd
|
2013-06-19 12:55:08 +02:00
|
|
|
subdirs-y += dmp
|
2013-02-11 17:07:38 +01:00
|
|
|
subdirs-y += armltd
|
2009-08-12 17:00:51 +02:00
|
|
|
subdirs-y += intel
|
2012-12-08 02:18:43 +01:00
|
|
|
subdirs-y += samsung
|
2013-05-26 16:15:57 +02:00
|
|
|
subdirs-y += ti
|
2009-08-12 17:00:51 +02:00
|
|
|
subdirs-y += via
|
2013-05-10 07:33:32 +02:00
|
|
|
subdirs-y += x86
|
2013-05-31 09:23:26 +02:00
|
|
|
subdirs-$(CONFIG_CPU_QEMU_X86) += qemu-x86
|
2012-07-20 07:11:21 +02:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## Rules for building the microcode blob in CBFS
|
|
|
|
################################################################################
|
|
|
|
|
2013-06-11 23:36:37 +02:00
|
|
|
cpu_ucode_cbfs_name = cpu_microcode_blob.bin
|
|
|
|
|
2012-07-20 07:11:21 +02:00
|
|
|
# External microcode file, or are we generating one ?
|
|
|
|
ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL), y)
|
2013-06-11 23:36:37 +02:00
|
|
|
cpu_ucode_cbfs_file = $(call strip_quotes,$(CONFIG_CPU_MICROCODE_FILE))
|
|
|
|
cbfs_include_ucode = y
|
2013-02-27 20:24:11 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_CPU_MICROCODE_CBFS_GENERATE), y)
|
2013-06-11 23:36:37 +02:00
|
|
|
cpu_ucode_cbfs_file = $(obj)/cpu_microcode_blob.bin
|
|
|
|
cbfs_include_ucode = y
|
2012-07-20 07:11:21 +02:00
|
|
|
endif
|
|
|
|
|
2013-10-30 00:46:54 +01:00
|
|
|
ifneq ($(CONFIG_CPU_MICROCODE_CBFS_LOC), 0)
|
|
|
|
cpu_ucode_cbfs_offset = "-b $(CONFIG_CPU_MICROCODE_CBFS_LOC)"
|
|
|
|
else
|
|
|
|
cpu_ucode_cbfs_offset = "-b"
|
|
|
|
endif
|
|
|
|
|
2012-07-20 07:11:21 +02:00
|
|
|
# In case we have more than one "source" (cough) files containing microcode, we
|
2013-02-27 20:24:11 +01:00
|
|
|
# link them together in one large blob, so that we get all the microcode updates
|
2012-07-20 07:11:21 +02:00
|
|
|
# in one file. This makes it easier for objcopy in the final step.
|
|
|
|
# The --entry=0 is just here to suppress the LD warning. It does not affect the
|
|
|
|
# final microcode file.
|
|
|
|
$(obj)/cpu_microcode_blob.o: $$(cpu_microcode-objs)
|
|
|
|
@printf " LD $(subst $(obj)/,,$(@))\n"
|
2013-12-08 01:57:02 +01:00
|
|
|
$(LD) -static --entry=0 $+ -o $@
|
2012-07-20 07:11:21 +02:00
|
|
|
|
|
|
|
# We have a lot of useless data in the large blob, and we are only interested in
|
|
|
|
# the data section, so we only copy that part to the final microcode file
|
|
|
|
$(obj)/cpu_microcode_blob.bin: $(obj)/cpu_microcode_blob.o
|
|
|
|
@printf " MICROCODE $(subst $(obj)/,,$(@))\n"
|
|
|
|
$(OBJCOPY) -j .data -O binary $< $@
|
2013-06-11 23:36:37 +02:00
|
|
|
|
|
|
|
ifeq ($(cbfs_include_ucode),y)
|
|
|
|
# Add CPU microcode to specified rom image $(1)
|
|
|
|
add-cpu-microcode-to-cbfs = \
|
2013-10-30 00:46:54 +01:00
|
|
|
$(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)
|
2013-06-11 23:36:37 +02:00
|
|
|
else
|
|
|
|
add-cpu-microcode-to-cbfs = true
|
|
|
|
endif
|