blob: 5463405d63e2206cc386339f04cacaaa20355f5d [file] [log] [blame]
Patrick Georgic49d7a32020-05-08 22:50:46 +02001# SPDX-License-Identifier: GPL-2.0-only
Stefan Reinauer86ddd732016-03-11 20:22:28 -08002
3ifeq ($(CONFIG_PLATFORM_USES_FSP2_0),y)
4
Arthur Heymans5a663342020-10-28 14:03:14 +01005bootblock-$(CONFIG_FSP_CAR) += fspt_report.c
6
Lee Leahy672df162016-07-24 18:21:13 -07007romstage-y += debug.c
Subrata Banik3ba6f8c2022-03-23 03:22:28 +05308romstage-$(CONFIG_FSP_USES_CB_DEBUG_EVENT_HANDLER) += fsp_debug_event.c
Andrey Petrovb37fd672016-03-01 16:25:38 -08009romstage-y += hand_off_block.c
Lee Leahy37b5ef22016-07-31 14:15:49 -070010romstage-$(CONFIG_DISPLAY_FSP_HEADER) += header_display.c
Lee Leahyac3b0a62016-07-27 07:40:25 -070011romstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c
Lee Leahye6f2f742016-07-21 09:48:49 -070012romstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c
Lee Leahy52d0c682016-08-01 15:47:42 -070013romstage-$(CONFIG_VERIFY_HOBS) += hob_verify.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080014romstage-y += util.c
15romstage-y += memory_init.c
Pratik Prajapatiffc934d2016-11-18 14:36:34 -080016romstage-$(CONFIG_MMA) += mma_core.c
Michael Niewöhnerb8cd4b02019-11-04 22:13:44 +010017romstage-y += cbmem.c
Ray Han Lim, Ng65b72192022-01-21 14:33:11 +080018romstage-$(CONFIG_ENABLE_FSP_ERROR_INFO) += fsp_error_info_hob.c
Subrata Banike48f24d2023-08-31 14:38:38 +000019romstage-$(CONFIG_CACHE_MRC_SETTINGS) += save_mrc_data.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080020
Lee Leahy672df162016-07-24 18:21:13 -070021ramstage-y += debug.c
Subrata Banik3ba6f8c2022-03-23 03:22:28 +053022ramstage-$(CONFIG_FSP_USES_CB_DEBUG_EVENT_HANDLER) += fsp_debug_event.c
Subrata Banik96b32f12020-07-31 12:09:11 +053023ramstage-$(CONFIG_USE_INTEL_FSP_MP_INIT) += fsp_mpinit.c
Subrata Banik6de1d9f2022-03-20 19:50:38 +053024ramstage-$(CONFIG_DISPLAY_FSP_TIMESTAMPS) += fsp_timestamp.c
Nico Huber2e7f6cc2017-05-22 15:58:03 +020025ramstage-$(CONFIG_RUN_FSP_GOP) += graphics.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080026ramstage-y += hand_off_block.c
Lee Leahy37b5ef22016-07-31 14:15:49 -070027ramstage-$(CONFIG_DISPLAY_FSP_HEADER) += header_display.c
Lee Leahyac3b0a62016-07-27 07:40:25 -070028ramstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c
Lee Leahy52d0c682016-08-01 15:47:42 -070029ramstage-$(CONFIG_VERIFY_HOBS) += hob_verify.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080030ramstage-y += notify.c
31ramstage-y += silicon_init.c
Lee Leahye6f2f742016-07-21 09:48:49 -070032ramstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080033ramstage-y += util.c
Subrata Banike48f24d2023-08-31 14:38:38 +000034ramstage-$(CONFIG_FSP_NVS_DATA_POST_SILICON_INIT) += save_mrc_data.c
Pratik Prajapatiffc934d2016-11-18 14:36:34 -080035ramstage-$(CONFIG_MMA) += mma_core.c
Ray Han Lim, Ng65b72192022-01-21 14:33:11 +080036ramstage-$(CONFIG_ENABLE_FSP_ERROR_INFO) += fsp_error_info_hob.c
Subrata Banik7bc92f02023-08-03 10:11:28 +000037ramstage-$(CONFIG_BMP_LOGO) += fsp_gop_blt.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080038
Arthur Heymans98cc7832020-12-08 12:49:38 +010039ifneq ($(CONFIG_NO_FSP_TEMP_RAM_EXIT),y)
Brenton Dong0a5971c2016-10-18 11:35:15 -070040postcar-$(CONFIG_FSP_CAR) += temp_ram_exit.c
Arthur Heymans98cc7832020-12-08 12:49:38 +010041endif
Brenton Dong0a5971c2016-10-18 11:35:15 -070042postcar-$(CONFIG_FSP_CAR) += util.c
43postcar-$(CONFIG_DISPLAY_FSP_HEADER) += header_display.c
Lijian Zhao8465a812017-07-11 12:33:22 -070044postcar-y += hand_off_block.c
Brandon Breitenstein135eae92016-09-30 13:57:12 -070045
Andrey Petrovb37fd672016-03-01 16:25:38 -080046CPPFLAGS_common += -I$(src)/drivers/intel/fsp2_0/include
Stefan Reinauer86ddd732016-03-11 20:22:28 -080047
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010048FSP_T_CBFS = $(call strip_quotes,$(CONFIG_FSP_T_CBFS))
49FSP_M_CBFS = $(call strip_quotes,$(CONFIG_FSP_M_CBFS))
Jonathon Halleb834d92023-09-27 12:50:59 -040050FSP_M_CBFS_2 = $(call strip_quotes,$(CONFIG_FSP_M_CBFS_2))
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010051FSP_S_CBFS = $(call strip_quotes,$(CONFIG_FSP_S_CBFS))
Jonathon Halleb834d92023-09-27 12:50:59 -040052FSP_S_CBFS_2 = $(call strip_quotes,$(CONFIG_FSP_S_CBFS_2))
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010053
Andrey Petrov9be1a112016-05-14 16:32:39 -070054# Add FSP blobs into cbfs. SoC code may supply additional options with
55# -options, e.g --xip or -b
Felix Held2651d992021-08-28 02:31:41 +020056ifeq ($(CONFIG_ADD_FSP_BINARIES)$(CONFIG_FSP_CAR),yy)
57cbfs-files-y += $(FSP_T_CBFS)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010058$(FSP_T_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_T_FILE))
59$(FSP_T_CBFS)-type := fsp
praveen hodagatta pranesh6c965422018-10-10 22:48:00 +080060ifeq ($(CONFIG_FSP_T_XIP),y)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010061$(FSP_T_CBFS)-options := --xip $(TXTIBB)
Arthur Heymans0f068a62021-05-03 10:59:45 +020062$(FSP_T_CBFS)-position = $(CONFIG_FSP_T_LOCATION)
Felix Held2651d992021-08-28 02:31:41 +020063endif # CONFIG_FSP_T_XIP
64endif # CONFIG_ADD_FSP_BINARIES && CONFIG_FSP_CAR
Brenton Dong0a5971c2016-10-18 11:35:15 -070065
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010066cbfs-files-$(CONFIG_ADD_FSP_BINARIES) += $(FSP_M_CBFS)
Jonathon Halleb834d92023-09-27 12:50:59 -040067ifeq ($(CONFIG_PLATFORM_USES_SECOND_FSP)$(CONFIG_ADD_FSP_BINARIES),yy)
68cbfs-files-y += $(FSP_M_CBFS_2)
69endif
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010070$(FSP_M_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_M_FILE))
Jonathon Halleb834d92023-09-27 12:50:59 -040071$(FSP_M_CBFS_2)-file := $(call strip_quotes,$(CONFIG_FSP_M_FILE_2))
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010072$(FSP_M_CBFS)-type := fsp
Jonathon Halleb834d92023-09-27 12:50:59 -040073$(FSP_M_CBFS_2)-type := fsp
Rizwan Qureshi69966cc2016-09-09 12:16:11 +053074ifeq ($(CONFIG_FSP_M_XIP),y)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010075$(FSP_M_CBFS)-options := --xip $(TXTIBB)
Jonathon Halleb834d92023-09-27 12:50:59 -040076$(FSP_M_CBFS_2)-options := --xip $(TXTIBB)
Rizwan Qureshi69966cc2016-09-09 12:16:11 +053077endif
Aaron Durbinecbfa992020-05-15 17:01:58 -060078ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZMA),y)
79$(FSP_M_CBFS)-compression := LZMA
Jonathon Halleb834d92023-09-27 12:50:59 -040080$(FSP_M_CBFS_2)-compression := LZMA
Felix Singer53a43f12023-08-20 03:09:49 +020081else ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZ4),y)
Aaron Durbinecbfa992020-05-15 17:01:58 -060082$(FSP_M_CBFS)-compression := LZ4
Jonathon Halleb834d92023-09-27 12:50:59 -040083$(FSP_M_CBFS_2)-compression := LZ4
Aaron Durbinecbfa992020-05-15 17:01:58 -060084endif
Raul E Rangel82897c92021-11-05 10:29:24 -060085ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_M),)
86$(FSP_M_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_M)
Jonathon Halleb834d92023-09-27 12:50:59 -040087$(FSP_M_CBFS_2)-align := $(CONFIG_FSP_ALIGNMENT_FSP_M)
Raul E Rangel82897c92021-11-05 10:29:24 -060088endif
Andrey Petrov9be1a112016-05-14 16:32:39 -070089
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010090cbfs-files-$(CONFIG_ADD_FSP_BINARIES) += $(FSP_S_CBFS)
Jonathon Halleb834d92023-09-27 12:50:59 -040091ifeq ($(CONFIG_PLATFORM_USES_SECOND_FSP)$(CONFIG_ADD_FSP_BINARIES),yy)
92cbfs-files-y += $(FSP_S_CBFS_2)
93endif
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010094$(FSP_S_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_S_FILE))
Jonathon Halleb834d92023-09-27 12:50:59 -040095$(FSP_S_CBFS_2)-file := $(call strip_quotes,$(CONFIG_FSP_S_FILE_2))
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010096$(FSP_S_CBFS)-type := fsp
Jonathon Halleb834d92023-09-27 12:50:59 -040097$(FSP_S_CBFS_2)-type := fsp
Aaron Durbina85febc2020-05-15 15:09:10 -060098ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZMA),y)
99$(FSP_S_CBFS)-compression := LZMA
Jonathon Halleb834d92023-09-27 12:50:59 -0400100$(FSP_S_CBFS_2)-compression := LZMA
Felix Singer53a43f12023-08-20 03:09:49 +0200101else ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZ4),y)
Aaron Durbina85febc2020-05-15 15:09:10 -0600102$(FSP_S_CBFS)-compression := LZ4
Jonathon Halleb834d92023-09-27 12:50:59 -0400103$(FSP_S_CBFS_2)-compression := LZ4
Aaron Durbina85febc2020-05-15 15:09:10 -0600104endif
Raul E Rangel82897c92021-11-05 10:29:24 -0600105ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_S),)
106$(FSP_S_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_S)
Jonathon Halleb834d92023-09-27 12:50:59 -0400107$(FSP_S_CBFS_2)-align := $(CONFIG_FSP_ALIGNMENT_FSP_S)
Raul E Rangel82897c92021-11-05 10:29:24 -0600108endif
Andrey Petrov9be1a112016-05-14 16:32:39 -0700109
Michael Niewöhner59f06ad2020-11-25 13:55:42 +0100110ifeq ($(CONFIG_FSP_FULL_FD),y)
Michael Niewöhner1aa8fc32020-12-10 02:55:47 +0100111$(obj)/Fsp_M.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(DOTCONFIG)
Michael Niewöhner99908662021-10-02 21:05:20 +0200112 python 3rdparty/fsp/Tools/SplitFspBin.py split -f $(CONFIG_FSP_FD_PATH) -o "$(obj)" -n "Fsp.fd"
Patrick Georgi6539e102018-09-13 11:48:43 -0400113
114$(obj)/Fsp_S.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(obj)/Fsp_M.fd
115 true
116
117$(obj)/Fsp_T.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(obj)/Fsp_M.fd
118 true
119endif
120
Jonathon Halleb834d92023-09-27 12:50:59 -0400121ifeq ($(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"
124
125$(obj)/Fsp_2_S.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH_2)) $(obj)/Fsp_M.fd
126 true
127endif
128
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100129# Add logo to the cbfs image
Kyösti Mälkki4949a3d2021-01-09 20:38:43 +0200130cbfs-files-$(CONFIG_BMP_LOGO) += logo.bmp
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100131logo.bmp-file := $(call strip_quotes,$(CONFIG_FSP2_0_LOGO_FILE_NAME))
132logo.bmp-type := raw
Subrata Banik7a6f8882023-08-04 21:31:05 +0530133ifeq ($(CONFIG_BMP_LOGO_COMPRESS_LZMA),y)
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100134logo.bmp-compression := LZMA
Subrata Banika0d44702023-08-18 20:17:16 +0530135else ifeq ($(CONFIG_BMP_LOGO_COMPRESS_LZ4),y)
Subrata Banik7a6f8882023-08-04 21:31:05 +0530136logo.bmp-compression := LZ4
137endif
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100138
Patrick Georgi6539e102018-09-13 11:48:43 -0400139ifneq ($(call strip_quotes,$(CONFIG_FSP_HEADER_PATH)),)
140CPPFLAGS_common+=-I$(CONFIG_FSP_HEADER_PATH)
141endif
142
Felix Heldc958f842021-08-28 00:36:17 +0200143# check if the FSP files that are supposed to be added are specified
144ifeq ($(CONFIG_ADD_FSP_BINARIES),y)
145ifeq ($(CONFIG_FSP_CAR),y)
146ifeq ($(call strip_quotes,$(CONFIG_FSP_T_FILE)),)
147$(error No FSP-T binary file specified.)
148endif # CONFIG_FSP_T_FILE
149endif # CONFIG_FSP_CAR
150ifeq ($(call strip_quotes,$(CONFIG_FSP_M_FILE)),)
151$(error No FSP-M binary file specified.)
152endif # CONFIG_FSP_M_FILE
153ifeq ($(call strip_quotes,$(CONFIG_FSP_S_FILE)),)
154$(error No FSP-S binary file specified.)
155endif # CONFIG_FSP_S_FILE
Jonathon Halleb834d92023-09-27 12:50:59 -0400156ifeq ($(CONFIG_PLATFORM_USES_SECOND_FSP),y)
157ifeq ($(call strip_quotes,$(CONFIG_FSP_M_FILE_2)),)
158$(error No second FSP-M binary file specified.)
159endif # CONFIG_FSP_M_FILE_2
160ifeq ($(call strip_quotes,$(CONFIG_FSP_S_FILE_2)),)
161$(error No second FSP-S binary file specified.)
162endif # CONFIG_FSP_S_FILE_2
163endif # CONFIG_PLATFORM_USES_SECOND_FSP
Felix Heldb33816e2021-09-03 16:18:28 +0200164else # CONFIG_ADD_FSP_BINARIES
Martin Roth372503f2023-12-08 00:43:23 -0700165show_notices:: warn_no_fsp_binaries
Felix Heldc958f842021-08-28 00:36:17 +0200166endif # CONFIG_ADD_FSP_BINARIES
167
Felix Heldb33816e2021-09-03 16:18:28 +0200168PHONY+=warn_no_fsp_binaries
169warn_no_fsp_binaries:
170 printf "\n\t** WARNING **\n"
171 printf "ADD_FSP_BINARIES isn't selected even though this SoC relies on the FSP.\n"
172 printf "The resulting image won't contain the FSP binaries and will not boot unless\n"
173 printf "they are added later.\n"
174
Furquan Shaikh1a5f25e2021-02-03 23:02:34 -0800175subdirs-y += ppi
Subrata Banik52331ba2019-03-11 11:53:12 +0530176
Stefan Reinauer86ddd732016-03-11 20:22:28 -0800177endif