Martin Roth | f6ca89c | 2023-08-04 12:06:21 -0600 | [diff] [blame] | 1 | ## SPDX-License-Identifier: GPL-2.0-only |
| 2 | |
Arthur Heymans | c9aecb4 | 2021-03-16 16:53:00 +0100 | [diff] [blame] | 3 | bootblock-y += fit.c |
Arthur Heymans | 0f34054 | 2020-10-14 16:35:11 +0200 | [diff] [blame] | 4 | |
Arthur Heymans | eeacd83 | 2021-02-19 17:14:23 +0100 | [diff] [blame] | 5 | # The FIT table is generated as a separate CBFS file. |
| 6 | # The FIT pointer is reserved in fit.c and updated to point to the 'intel_fit' |
| 7 | # CBFS file using 'ifittool -F'. |
| 8 | # With a TOP_SWAP enabled bootblock the FIT pointer at the top swap offset |
| 9 | # will point to the 'intel_fit_ts' CBFS file. |
| 10 | |
| 11 | cbfs-files-y += intel_fit |
| 12 | intel_fit-file := fit_table.c:struct |
Julius Werner | af20fd7 | 2022-05-27 18:33:15 -0700 | [diff] [blame] | 13 | intel_fit-type := intel_fit |
Arthur Heymans | eeacd83 | 2021-02-19 17:14:23 +0100 | [diff] [blame] | 14 | intel_fit-align := 16 |
| 15 | |
| 16 | $(call add_intermediate, set_fit_ptr, $(IFITTOOL)) |
| 17 | @printf " UPDATE-FIT set FIT pointer to table\n" |
Arthur Heymans | 422fdce | 2022-03-23 19:59:59 +0100 | [diff] [blame] | 18 | $(IFITTOOL) -f $< -F -n intel_fit -r COREBOOT -c |
Arthur Heymans | eeacd83 | 2021-02-19 17:14:23 +0100 | [diff] [blame] | 19 | |
Arthur Heymans | 0f34054 | 2020-10-14 16:35:11 +0200 | [diff] [blame] | 20 | FIT_ENTRY=$(call strip_quotes, $(CONFIG_INTEL_TOP_SWAP_FIT_ENTRY_FMAP_REG)) |
| 21 | |
| 22 | ifneq ($(CONFIG_UPDATE_IMAGE),y) # never update the bootblock |
| 23 | |
Subrata Banik | 3c1b7b4 | 2023-05-20 16:28:18 +0530 | [diff] [blame] | 24 | ifneq ($(CONFIG_CPU_MICROCODE_CBFS_NONE)$(CONFIG_CPU_INTEL_MICROCODE_CBFS_SPLIT_BINS),y) |
Arthur Heymans | 0f34054 | 2020-10-14 16:35:11 +0200 | [diff] [blame] | 25 | |
Arthur Heymans | 95761c5 | 2021-07-06 12:26:41 +0200 | [diff] [blame] | 26 | $(call add_intermediate, add_mcu_fit, set_fit_ptr $(IFITTOOL)) |
Arthur Heymans | 0f34054 | 2020-10-14 16:35:11 +0200 | [diff] [blame] | 27 | @printf " UPDATE-FIT Microcode\n" |
| 28 | $(IFITTOOL) -f $< -a -n cpu_microcode_blob.bin -t 1 -s $(CONFIG_CPU_INTEL_NUM_FIT_ENTRIES) -r COREBOOT |
| 29 | |
| 30 | # Second FIT in TOP_SWAP bootblock |
| 31 | ifeq ($(CONFIG_INTEL_ADD_TOP_SWAP_BOOTBLOCK),y) |
| 32 | |
Arthur Heymans | 0d93ca4 | 2021-05-19 14:47:59 +0200 | [diff] [blame] | 33 | $(call add_intermediate, set_ts_fit_ptr, $(IFITTOOL)) |
| 34 | @printf " UPDATE-FIT Top Swap: set FIT pointer to table\n" |
| 35 | $(IFITTOOL) -f $< -F -n intel_fit_ts -r COREBOOT $(TS_OPTIONS) |
| 36 | |
Arthur Heymans | 95761c5 | 2021-07-06 12:26:41 +0200 | [diff] [blame] | 37 | $(call add_intermediate, add_ts_mcu_fit, set_ts_fit_ptr $(IFITTOOL)) |
Arthur Heymans | 0f34054 | 2020-10-14 16:35:11 +0200 | [diff] [blame] | 38 | @printf " UPDATE-FIT Top Swap: Microcode\n" |
| 39 | ifneq ($(FIT_ENTRY),) |
| 40 | $(IFITTOOL) -f $< -A -n $(FIT_ENTRY) -t 1 -s $(CONFIG_CPU_INTEL_NUM_FIT_ENTRIES) $(TS_OPTIONS) -r COREBOOT |
| 41 | endif # FIT_ENTRY |
| 42 | $(IFITTOOL) -f $< -a -n cpu_microcode_blob.bin -t 1 -s $(CONFIG_CPU_INTEL_NUM_FIT_ENTRIES) $(TS_OPTIONS) -r COREBOOT |
| 43 | |
Arthur Heymans | eeacd83 | 2021-02-19 17:14:23 +0100 | [diff] [blame] | 44 | cbfs-files-y += intel_fit_ts |
| 45 | intel_fit_ts-file := fit_table.c:struct |
Julius Werner | af20fd7 | 2022-05-27 18:33:15 -0700 | [diff] [blame] | 46 | intel_fit_ts-type := intel_fit |
Arthur Heymans | eeacd83 | 2021-02-19 17:14:23 +0100 | [diff] [blame] | 47 | intel_fit_ts-align := 16 |
| 48 | |
Arthur Heymans | 0f34054 | 2020-10-14 16:35:11 +0200 | [diff] [blame] | 49 | endif # CONFIG_INTEL_ADD_TOP_SWAP_BOOTBLOCK |
| 50 | |
| 51 | endif # CONFIG_CPU_MICROCODE_CBFS_NONE |
| 52 | |
| 53 | endif # CONFIG_UPDATE_IMAGE |