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
19 romstage-
$(CONFIG_CACHE_MRC_SETTINGS
) += save_mrc_data.c
22 ramstage-
$(CONFIG_FSP_USES_CB_DEBUG_EVENT_HANDLER
) += fsp_debug_event.c
23 ramstage-
$(CONFIG_USE_INTEL_FSP_MP_INIT
) += fsp_mpinit.c
24 ramstage-
$(CONFIG_DISPLAY_FSP_TIMESTAMPS
) += fsp_timestamp.c
25 ramstage-
$(CONFIG_RUN_FSP_GOP
) += graphics.c
26 ramstage-y
+= hand_off_block.c
27 ramstage-
$(CONFIG_DISPLAY_FSP_HEADER
) += header_display.c
28 ramstage-
$(CONFIG_DISPLAY_HOBS
) += hob_display.c
29 ramstage-
$(CONFIG_VERIFY_HOBS
) += hob_verify.c
30 ramstage-y
+= notify.c
31 ramstage-y
+= silicon_init.c
32 ramstage-
$(CONFIG_DISPLAY_UPD_DATA
) += upd_display.c
34 ramstage-
$(CONFIG_FSP_NVS_DATA_POST_SILICON_INIT
) += save_mrc_data.c
35 ramstage-
$(CONFIG_MMA
) += mma_core.c
36 ramstage-
$(CONFIG_ENABLE_FSP_ERROR_INFO
) += fsp_error_info_hob.c
37 ramstage-
$(CONFIG_BMP_LOGO
) += fsp_gop_blt.c
39 ifneq ($(CONFIG_NO_FSP_TEMP_RAM_EXIT
),y
)
40 postcar-
$(CONFIG_FSP_CAR
) += temp_ram_exit.c
42 postcar-
$(CONFIG_FSP_CAR
) += util.c
43 postcar-
$(CONFIG_DISPLAY_FSP_HEADER
) += header_display.c
44 postcar-y
+= hand_off_block.c
46 CPPFLAGS_common
+= -I
$(src
)/drivers
/intel
/fsp2_0
/include
48 FSP_T_CBFS
= $(call strip_quotes
,$(CONFIG_FSP_T_CBFS
))
49 FSP_M_CBFS
= $(call strip_quotes
,$(CONFIG_FSP_M_CBFS
))
50 FSP_M_CBFS_2
= $(call strip_quotes
,$(CONFIG_FSP_M_CBFS_2
))
51 FSP_S_CBFS
= $(call strip_quotes
,$(CONFIG_FSP_S_CBFS
))
52 FSP_S_CBFS_2
= $(call strip_quotes
,$(CONFIG_FSP_S_CBFS_2
))
54 # Add FSP blobs into cbfs. SoC code may supply additional options with
55 # -options, e.g --xip or -b
56 ifeq ($(CONFIG_ADD_FSP_BINARIES
)$(CONFIG_FSP_CAR
),yy
)
57 cbfs-files-y
+= $(FSP_T_CBFS
)
58 $(FSP_T_CBFS
)-file
:= $(call strip_quotes
,$(CONFIG_FSP_T_FILE
))
59 $(FSP_T_CBFS
)-type
:= fsp
60 ifeq ($(CONFIG_FSP_T_XIP
),y
)
61 $(FSP_T_CBFS
)-options
:= --xip
$(TXTIBB
)
62 $(FSP_T_CBFS
)-position
= $(CONFIG_FSP_T_LOCATION
)
63 endif # CONFIG_FSP_T_XIP
64 endif # CONFIG_ADD_FSP_BINARIES && CONFIG_FSP_CAR
66 cbfs-files-
$(CONFIG_ADD_FSP_BINARIES
) += $(FSP_M_CBFS
)
67 ifeq ($(CONFIG_PLATFORM_USES_SECOND_FSP
)$(CONFIG_ADD_FSP_BINARIES
),yy
)
68 cbfs-files-y
+= $(FSP_M_CBFS_2
)
70 $(FSP_M_CBFS
)-file
:= $(call strip_quotes
,$(CONFIG_FSP_M_FILE
))
71 $(FSP_M_CBFS_2
)-file
:= $(call strip_quotes
,$(CONFIG_FSP_M_FILE_2
))
72 $(FSP_M_CBFS
)-type
:= fsp
73 $(FSP_M_CBFS_2
)-type
:= fsp
74 ifeq ($(CONFIG_FSP_M_XIP
),y
)
75 $(FSP_M_CBFS
)-options
:= --xip
$(TXTIBB
)
76 $(FSP_M_CBFS_2
)-options
:= --xip
$(TXTIBB
)
78 ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZMA
),y
)
79 $(FSP_M_CBFS
)-compression
:= LZMA
80 $(FSP_M_CBFS_2
)-compression
:= LZMA
81 else ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZ4
),y
)
82 $(FSP_M_CBFS
)-compression
:= LZ4
83 $(FSP_M_CBFS_2
)-compression
:= LZ4
85 ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_M
),)
86 $(FSP_M_CBFS
)-align
:= $(CONFIG_FSP_ALIGNMENT_FSP_M
)
87 $(FSP_M_CBFS_2
)-align
:= $(CONFIG_FSP_ALIGNMENT_FSP_M
)
90 cbfs-files-
$(CONFIG_ADD_FSP_BINARIES
) += $(FSP_S_CBFS
)
91 ifeq ($(CONFIG_PLATFORM_USES_SECOND_FSP
)$(CONFIG_ADD_FSP_BINARIES
),yy
)
92 cbfs-files-y
+= $(FSP_S_CBFS_2
)
94 $(FSP_S_CBFS
)-file
:= $(call strip_quotes
,$(CONFIG_FSP_S_FILE
))
95 $(FSP_S_CBFS_2
)-file
:= $(call strip_quotes
,$(CONFIG_FSP_S_FILE_2
))
96 $(FSP_S_CBFS
)-type
:= fsp
97 $(FSP_S_CBFS_2
)-type
:= fsp
98 ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZMA
),y
)
99 $(FSP_S_CBFS
)-compression
:= LZMA
100 $(FSP_S_CBFS_2
)-compression
:= LZMA
101 else ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZ4
),y
)
102 $(FSP_S_CBFS
)-compression
:= LZ4
103 $(FSP_S_CBFS_2
)-compression
:= LZ4
105 ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_S
),)
106 $(FSP_S_CBFS
)-align
:= $(CONFIG_FSP_ALIGNMENT_FSP_S
)
107 $(FSP_S_CBFS_2
)-align
:= $(CONFIG_FSP_ALIGNMENT_FSP_S
)
110 ifeq ($(CONFIG_FSP_FULL_FD
),y
)
111 $(obj
)/Fsp_M.fd
: $(call strip_quotes
,$(CONFIG_FSP_FD_PATH
)) $(DOTCONFIG
)
112 python
3rdparty
/fsp
/Tools
/SplitFspBin.py split
-f
$(CONFIG_FSP_FD_PATH
) -o
"$(obj)" -n
"Fsp.fd"
114 $(obj
)/Fsp_S.fd
: $(call strip_quotes
,$(CONFIG_FSP_FD_PATH
)) $(obj
)/Fsp_M.fd
117 $(obj
)/Fsp_T.fd
: $(call strip_quotes
,$(CONFIG_FSP_FD_PATH
)) $(obj
)/Fsp_M.fd
121 ifeq ($(CONFIG_PLATFORM_USES_SECOND_FSP
)$(CONFIG_FSP_FULL_FD
),yy
)
122 $(obj
)/Fsp_2_M.fd
: $(call strip_quotes
,$(CONFIG_FSP_FD_PATH_2
)) $(DOTCONFIG
)
123 python
3rdparty
/fsp
/Tools
/SplitFspBin.py split
-f
$(CONFIG_FSP_FD_PATH_2
) -o
"$(obj)" -n
"Fsp_2.fd"
125 $(obj
)/Fsp_2_S.fd
: $(call strip_quotes
,$(CONFIG_FSP_FD_PATH_2
)) $(obj
)/Fsp_M.fd
129 # Add logo to the cbfs image
130 ifneq ($(CONFIG_HAVE_CUSTOM_BMP_LOGO
),y
)
131 cbfs-files-
$(CONFIG_BMP_LOGO
) += logo.bmp
132 logo.bmp-file
:= $(call strip_quotes
,$(CONFIG_FSP2_0_LOGO_FILE_NAME
))
134 ifeq ($(CONFIG_BMP_LOGO_COMPRESS_LZMA
),y
)
135 logo.bmp-compression
:= LZMA
136 else ifeq ($(CONFIG_BMP_LOGO_COMPRESS_LZ4
),y
)
137 logo.bmp-compression
:= LZ4
141 ifneq ($(call strip_quotes
,$(CONFIG_FSP_HEADER_PATH
)),)
142 CPPFLAGS_common
+=-I
$(CONFIG_FSP_HEADER_PATH
)
145 # check if the FSP files that are supposed to be added are specified
146 ifeq ($(CONFIG_ADD_FSP_BINARIES
),y
)
147 ifeq ($(CONFIG_FSP_CAR
),y
)
148 ifeq ($(call strip_quotes
,$(CONFIG_FSP_T_FILE
)),)
149 $(error No FSP-T binary file specified.
)
150 endif # CONFIG_FSP_T_FILE
151 endif # CONFIG_FSP_CAR
152 ifeq ($(call strip_quotes
,$(CONFIG_FSP_M_FILE
)),)
153 $(error No FSP-M binary file specified.
)
154 endif # CONFIG_FSP_M_FILE
155 ifeq ($(call strip_quotes
,$(CONFIG_FSP_S_FILE
)),)
156 $(error No FSP-S binary file specified.
)
157 endif # CONFIG_FSP_S_FILE
158 ifeq ($(CONFIG_PLATFORM_USES_SECOND_FSP
),y
)
159 ifeq ($(call strip_quotes
,$(CONFIG_FSP_M_FILE_2
)),)
160 $(error No second FSP-M binary file specified.
)
161 endif # CONFIG_FSP_M_FILE_2
162 ifeq ($(call strip_quotes
,$(CONFIG_FSP_S_FILE_2
)),)
163 $(error No second FSP-S binary file specified.
)
164 endif # CONFIG_FSP_S_FILE_2
165 endif # CONFIG_PLATFORM_USES_SECOND_FSP
166 else # CONFIG_ADD_FSP_BINARIES
167 show_notices
:: warn_no_fsp_binaries
168 endif # CONFIG_ADD_FSP_BINARIES
170 PHONY
+=warn_no_fsp_binaries
171 warn_no_fsp_binaries
:
172 printf
"\n\t** WARNING **\n"
173 printf
"ADD_FSP_BINARIES isn't selected even though this SoC relies on the FSP.\n"
174 printf
"The resulting image won't contain the FSP binaries and will not boot unless\n"
175 printf
"they are added later.\n"