blob: 756ba1ec5a90ee8ca9ec3093eaa1b4cdbf7af32a [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
Andrey Petrovb37fd672016-03-01 16:25:38 -080019
Lee Leahy672df162016-07-24 18:21:13 -070020ramstage-y += debug.c
Subrata Banik3ba6f8c2022-03-23 03:22:28 +053021ramstage-$(CONFIG_FSP_USES_CB_DEBUG_EVENT_HANDLER) += fsp_debug_event.c
Subrata Banik96b32f12020-07-31 12:09:11 +053022ramstage-$(CONFIG_USE_INTEL_FSP_MP_INIT) += fsp_mpinit.c
Subrata Banik6de1d9f2022-03-20 19:50:38 +053023ramstage-$(CONFIG_DISPLAY_FSP_TIMESTAMPS) += fsp_timestamp.c
Nico Huber2e7f6cc2017-05-22 15:58:03 +020024ramstage-$(CONFIG_RUN_FSP_GOP) += graphics.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080025ramstage-y += hand_off_block.c
Lee Leahy37b5ef22016-07-31 14:15:49 -070026ramstage-$(CONFIG_DISPLAY_FSP_HEADER) += header_display.c
Lee Leahyac3b0a62016-07-27 07:40:25 -070027ramstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c
Lee Leahy52d0c682016-08-01 15:47:42 -070028ramstage-$(CONFIG_VERIFY_HOBS) += hob_verify.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080029ramstage-y += notify.c
30ramstage-y += silicon_init.c
Lee Leahye6f2f742016-07-21 09:48:49 -070031ramstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080032ramstage-y += util.c
Reka Norman7b5a9312022-09-13 14:06:52 +100033ramstage-$(CONFIG_CACHE_MRC_SETTINGS) += save_mrc_data.c
Pratik Prajapatiffc934d2016-11-18 14:36:34 -080034ramstage-$(CONFIG_MMA) += mma_core.c
Ray Han Lim, Ng65b72192022-01-21 14:33:11 +080035ramstage-$(CONFIG_ENABLE_FSP_ERROR_INFO) += fsp_error_info_hob.c
Subrata Banik7bc92f02023-08-03 10:11:28 +000036ramstage-$(CONFIG_BMP_LOGO) += fsp_gop_blt.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080037
Arthur Heymans98cc7832020-12-08 12:49:38 +010038ifneq ($(CONFIG_NO_FSP_TEMP_RAM_EXIT),y)
Brenton Dong0a5971c2016-10-18 11:35:15 -070039postcar-$(CONFIG_FSP_CAR) += temp_ram_exit.c
Arthur Heymans98cc7832020-12-08 12:49:38 +010040endif
Brenton Dong0a5971c2016-10-18 11:35:15 -070041postcar-$(CONFIG_FSP_CAR) += util.c
42postcar-$(CONFIG_DISPLAY_FSP_HEADER) += header_display.c
Lijian Zhao8465a812017-07-11 12:33:22 -070043postcar-y += hand_off_block.c
Brandon Breitenstein135eae92016-09-30 13:57:12 -070044
Andrey Petrovb37fd672016-03-01 16:25:38 -080045CPPFLAGS_common += -I$(src)/drivers/intel/fsp2_0/include
Stefan Reinauer86ddd732016-03-11 20:22:28 -080046
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010047FSP_T_CBFS = $(call strip_quotes,$(CONFIG_FSP_T_CBFS))
48FSP_M_CBFS = $(call strip_quotes,$(CONFIG_FSP_M_CBFS))
49FSP_S_CBFS = $(call strip_quotes,$(CONFIG_FSP_S_CBFS))
50
Andrey Petrov9be1a112016-05-14 16:32:39 -070051# Add FSP blobs into cbfs. SoC code may supply additional options with
52# -options, e.g --xip or -b
Felix Held2651d992021-08-28 02:31:41 +020053ifeq ($(CONFIG_ADD_FSP_BINARIES)$(CONFIG_FSP_CAR),yy)
54cbfs-files-y += $(FSP_T_CBFS)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010055$(FSP_T_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_T_FILE))
56$(FSP_T_CBFS)-type := fsp
praveen hodagatta pranesh6c965422018-10-10 22:48:00 +080057ifeq ($(CONFIG_FSP_T_XIP),y)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010058$(FSP_T_CBFS)-options := --xip $(TXTIBB)
Arthur Heymans0f068a62021-05-03 10:59:45 +020059$(FSP_T_CBFS)-position = $(CONFIG_FSP_T_LOCATION)
Felix Held2651d992021-08-28 02:31:41 +020060endif # CONFIG_FSP_T_XIP
61endif # CONFIG_ADD_FSP_BINARIES && CONFIG_FSP_CAR
Brenton Dong0a5971c2016-10-18 11:35:15 -070062
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010063cbfs-files-$(CONFIG_ADD_FSP_BINARIES) += $(FSP_M_CBFS)
64$(FSP_M_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_M_FILE))
65$(FSP_M_CBFS)-type := fsp
Rizwan Qureshi69966cc2016-09-09 12:16:11 +053066ifeq ($(CONFIG_FSP_M_XIP),y)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010067$(FSP_M_CBFS)-options := --xip $(TXTIBB)
Rizwan Qureshi69966cc2016-09-09 12:16:11 +053068endif
Aaron Durbinecbfa992020-05-15 17:01:58 -060069ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZMA),y)
70$(FSP_M_CBFS)-compression := LZMA
Felix Singer53a43f12023-08-20 03:09:49 +020071else ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZ4),y)
Aaron Durbinecbfa992020-05-15 17:01:58 -060072$(FSP_M_CBFS)-compression := LZ4
73endif
Raul E Rangel82897c92021-11-05 10:29:24 -060074ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_M),)
75$(FSP_M_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_M)
76endif
Andrey Petrov9be1a112016-05-14 16:32:39 -070077
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010078cbfs-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
Aaron Durbina85febc2020-05-15 15:09:10 -060081ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZMA),y)
82$(FSP_S_CBFS)-compression := LZMA
Felix Singer53a43f12023-08-20 03:09:49 +020083else ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZ4),y)
Aaron Durbina85febc2020-05-15 15:09:10 -060084$(FSP_S_CBFS)-compression := LZ4
85endif
Raul E Rangel82897c92021-11-05 10:29:24 -060086ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_S),)
87$(FSP_S_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_S)
88endif
Andrey Petrov9be1a112016-05-14 16:32:39 -070089
Michael Niewöhner59f06ad2020-11-25 13:55:42 +010090ifeq ($(CONFIG_FSP_FULL_FD),y)
Michael Niewöhner1aa8fc32020-12-10 02:55:47 +010091$(obj)/Fsp_M.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(DOTCONFIG)
Michael Niewöhner99908662021-10-02 21:05:20 +020092 python 3rdparty/fsp/Tools/SplitFspBin.py split -f $(CONFIG_FSP_FD_PATH) -o "$(obj)" -n "Fsp.fd"
Patrick Georgi6539e102018-09-13 11:48:43 -040093
94$(obj)/Fsp_S.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(obj)/Fsp_M.fd
95 true
96
97$(obj)/Fsp_T.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(obj)/Fsp_M.fd
98 true
99endif
100
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100101# Add logo to the cbfs image
Kyösti Mälkki4949a3d2021-01-09 20:38:43 +0200102cbfs-files-$(CONFIG_BMP_LOGO) += logo.bmp
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100103logo.bmp-file := $(call strip_quotes,$(CONFIG_FSP2_0_LOGO_FILE_NAME))
104logo.bmp-type := raw
Subrata Banik7a6f8882023-08-04 21:31:05 +0530105ifeq ($(CONFIG_BMP_LOGO_COMPRESS_LZMA),y)
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100106logo.bmp-compression := LZMA
Subrata Banika0d44702023-08-18 20:17:16 +0530107else ifeq ($(CONFIG_BMP_LOGO_COMPRESS_LZ4),y)
Subrata Banik7a6f8882023-08-04 21:31:05 +0530108logo.bmp-compression := LZ4
109endif
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100110
Patrick Georgi6539e102018-09-13 11:48:43 -0400111ifneq ($(call strip_quotes,$(CONFIG_FSP_HEADER_PATH)),)
112CPPFLAGS_common+=-I$(CONFIG_FSP_HEADER_PATH)
113endif
114
Felix Heldc958f842021-08-28 00:36:17 +0200115# check if the FSP files that are supposed to be added are specified
116ifeq ($(CONFIG_ADD_FSP_BINARIES),y)
117ifeq ($(CONFIG_FSP_CAR),y)
118ifeq ($(call strip_quotes,$(CONFIG_FSP_T_FILE)),)
119$(error No FSP-T binary file specified.)
120endif # CONFIG_FSP_T_FILE
121endif # CONFIG_FSP_CAR
122ifeq ($(call strip_quotes,$(CONFIG_FSP_M_FILE)),)
123$(error No FSP-M binary file specified.)
124endif # CONFIG_FSP_M_FILE
125ifeq ($(call strip_quotes,$(CONFIG_FSP_S_FILE)),)
126$(error No FSP-S binary file specified.)
127endif # CONFIG_FSP_S_FILE
Felix Heldb33816e2021-09-03 16:18:28 +0200128else # CONFIG_ADD_FSP_BINARIES
129build_complete:: warn_no_fsp_binaries
Felix Heldc958f842021-08-28 00:36:17 +0200130endif # CONFIG_ADD_FSP_BINARIES
131
Felix Heldb33816e2021-09-03 16:18:28 +0200132PHONY+=warn_no_fsp_binaries
133warn_no_fsp_binaries:
134 printf "\n\t** WARNING **\n"
135 printf "ADD_FSP_BINARIES isn't selected even though this SoC relies on the FSP.\n"
136 printf "The resulting image won't contain the FSP binaries and will not boot unless\n"
137 printf "they are added later.\n"
138
Furquan Shaikh1a5f25e2021-02-03 23:02:34 -0800139subdirs-y += ppi
Subrata Banik52331ba2019-03-11 11:53:12 +0530140
Stefan Reinauer86ddd732016-03-11 20:22:28 -0800141endif