1 # SPDX-License-Identifier: GPL-2.0-only
3 ifeq ($(CONFIG_PLATFORM_USES_FSP2_0),y)
5 bootblock-$(CONFIG_FSP_CAR) += fspt_report.c
8 romstage-$(CONFIG_FSP_USES_CB_DEBUG_EVENT_HANDLER) += fsp_debug_event.c
9 romstage-y += hand_off_block.c
10 romstage-$(CONFIG_DISPLAY_FSP_HEADER) += header_display.c
11 romstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c
12 romstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c
13 romstage-$(CONFIG_VERIFY_HOBS) += hob_verify.c
15 romstage-y += memory_init.c
16 romstage-$(CONFIG_MMA) += mma_core.c
18 romstage-$(CONFIG_ENABLE_FSP_ERROR_INFO) += fsp_error_info_hob.c
21 ramstage-$(CONFIG_FSP_USES_CB_DEBUG_EVENT_HANDLER) += fsp_debug_event.c
22 ramstage-$(CONFIG_USE_INTEL_FSP_MP_INIT) += fsp_mpinit.c
23 ramstage-$(CONFIG_DISPLAY_FSP_TIMESTAMPS) += fsp_timestamp.c
24 ramstage-$(CONFIG_RUN_FSP_GOP) += graphics.c
25 ramstage-y += hand_off_block.c
26 ramstage-$(CONFIG_DISPLAY_FSP_HEADER) += header_display.c
27 ramstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c
28 ramstage-$(CONFIG_VERIFY_HOBS) += hob_verify.c
29 ramstage-y += notify.c
30 ramstage-y += silicon_init.c
31 ramstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c
33 ramstage-$(CONFIG_CACHE_MRC_SETTINGS) += save_mrc_data.c
34 ramstage-$(CONFIG_MMA) += mma_core.c
35 ramstage-$(CONFIG_ENABLE_FSP_ERROR_INFO) += fsp_error_info_hob.c
37 ifneq ($(CONFIG_NO_FSP_TEMP_RAM_EXIT),y)
38 postcar-$(CONFIG_FSP_CAR) += temp_ram_exit.c
40 postcar-$(CONFIG_FSP_CAR) += util.c
41 postcar-$(CONFIG_DISPLAY_FSP_HEADER) += header_display.c
42 postcar-y += hand_off_block.c
44 CPPFLAGS_common += -I$(src)/drivers/intel/fsp2_0/include
46 FSP_T_CBFS = $(call strip_quotes,$(CONFIG_FSP_T_CBFS))
47 FSP_M_CBFS = $(call strip_quotes,$(CONFIG_FSP_M_CBFS))
48 FSP_S_CBFS = $(call strip_quotes,$(CONFIG_FSP_S_CBFS))
50 # Add FSP blobs into cbfs. SoC code may supply additional options with
51 # -options, e.g --xip or -b
52 ifeq ($(CONFIG_ADD_FSP_BINARIES)$(CONFIG_FSP_CAR),yy)
53 cbfs-files-y += $(FSP_T_CBFS)
54 $(FSP_T_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_T_FILE))
55 $(FSP_T_CBFS)-type := fsp
56 ifeq ($(CONFIG_FSP_T_XIP),y)
57 $(FSP_T_CBFS)-options := --xip $(TXTIBB)
58 $(FSP_T_CBFS)-position = $(CONFIG_FSP_T_LOCATION)
59 endif # CONFIG_FSP_T_XIP
60 endif # CONFIG_ADD_FSP_BINARIES && CONFIG_FSP_CAR
62 cbfs-files-$(CONFIG_ADD_FSP_BINARIES) += $(FSP_M_CBFS)
63 $(FSP_M_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_M_FILE))
64 $(FSP_M_CBFS)-type := fsp
65 ifeq ($(CONFIG_FSP_M_XIP),y)
66 $(FSP_M_CBFS)-options := --xip $(TXTIBB)
68 ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZMA),y)
69 $(FSP_M_CBFS)-compression := LZMA
71 ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZ4),y)
72 $(FSP_M_CBFS)-compression := LZ4
74 ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_M),)
75 $(FSP_M_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_M)
78 cbfs-files-$(CONFIG_ADD_FSP_BINARIES) += $(FSP_S_CBFS)
79 $(FSP_S_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_S_FILE))
80 $(FSP_S_CBFS)-type := fsp
81 ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZMA),y)
82 $(FSP_S_CBFS)-compression := LZMA
84 ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZ4),y)
85 $(FSP_S_CBFS)-compression := LZ4
87 ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_S),)
88 $(FSP_S_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_S)
91 ifeq ($(CONFIG_FSP_FULL_FD),y)
92 $(obj)/Fsp_M.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(DOTCONFIG)
93 python 3rdparty/fsp/Tools/SplitFspBin.py split -f $(CONFIG_FSP_FD_PATH) -o "$(obj)" -n "Fsp.fd"
95 $(obj)/Fsp_S.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(obj)/Fsp_M.fd
98 $(obj)/Fsp_T.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(obj)/Fsp_M.fd
102 # Add logo to the cbfs image
103 cbfs-files-$(CONFIG_BMP_LOGO) += logo.bmp
104 logo.bmp-file := $(call strip_quotes,$(CONFIG_FSP2_0_LOGO_FILE_NAME))
106 logo.bmp-compression := LZMA
108 ifneq ($(call strip_quotes,$(CONFIG_FSP_HEADER_PATH)),)
109 CPPFLAGS_common+=-I$(CONFIG_FSP_HEADER_PATH)
112 # check if the FSP files that are supposed to be added are specified
113 ifeq ($(CONFIG_ADD_FSP_BINARIES),y)
114 ifeq ($(CONFIG_FSP_CAR),y)
115 ifeq ($(call strip_quotes,$(CONFIG_FSP_T_FILE)),)
116 $(error No FSP-T binary file specified.)
117 endif # CONFIG_FSP_T_FILE
118 endif # CONFIG_FSP_CAR
119 ifeq ($(call strip_quotes,$(CONFIG_FSP_M_FILE)),)
120 $(error No FSP-M binary file specified.)
121 endif # CONFIG_FSP_M_FILE
122 ifeq ($(call strip_quotes,$(CONFIG_FSP_S_FILE)),)
123 $(error No FSP-S binary file specified.)
124 endif # CONFIG_FSP_S_FILE
125 else # CONFIG_ADD_FSP_BINARIES
126 build_complete:: warn_no_fsp_binaries
127 endif # CONFIG_ADD_FSP_BINARIES
129 PHONY+=warn_no_fsp_binaries
130 warn_no_fsp_binaries:
131 printf "\n\t** WARNING **\n"
132 printf "ADD_FSP_BINARIES isn't selected even though this SoC relies on the FSP.\n"
133 printf "The resulting image won't contain the FSP binaries and will not boot unless\n"
134 printf "they are added later.\n"