blob: ae82833fc2ece65f5532c9715f1ca363def75b39 [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
Andrey Petrovb37fd672016-03-01 16:25:38 -080036
Arthur Heymans98cc7832020-12-08 12:49:38 +010037ifneq ($(CONFIG_NO_FSP_TEMP_RAM_EXIT),y)
Brenton Dong0a5971c2016-10-18 11:35:15 -070038postcar-$(CONFIG_FSP_CAR) += temp_ram_exit.c
Arthur Heymans98cc7832020-12-08 12:49:38 +010039endif
Brenton Dong0a5971c2016-10-18 11:35:15 -070040postcar-$(CONFIG_FSP_CAR) += util.c
41postcar-$(CONFIG_DISPLAY_FSP_HEADER) += header_display.c
Lijian Zhao8465a812017-07-11 12:33:22 -070042postcar-y += hand_off_block.c
Brandon Breitenstein135eae92016-09-30 13:57:12 -070043
Andrey Petrovb37fd672016-03-01 16:25:38 -080044CPPFLAGS_common += -I$(src)/drivers/intel/fsp2_0/include
Stefan Reinauer86ddd732016-03-11 20:22:28 -080045
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010046FSP_T_CBFS = $(call strip_quotes,$(CONFIG_FSP_T_CBFS))
47FSP_M_CBFS = $(call strip_quotes,$(CONFIG_FSP_M_CBFS))
48FSP_S_CBFS = $(call strip_quotes,$(CONFIG_FSP_S_CBFS))
49
Andrey Petrov9be1a112016-05-14 16:32:39 -070050# Add FSP blobs into cbfs. SoC code may supply additional options with
51# -options, e.g --xip or -b
Felix Held2651d992021-08-28 02:31:41 +020052ifeq ($(CONFIG_ADD_FSP_BINARIES)$(CONFIG_FSP_CAR),yy)
53cbfs-files-y += $(FSP_T_CBFS)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010054$(FSP_T_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_T_FILE))
55$(FSP_T_CBFS)-type := fsp
praveen hodagatta pranesh6c965422018-10-10 22:48:00 +080056ifeq ($(CONFIG_FSP_T_XIP),y)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010057$(FSP_T_CBFS)-options := --xip $(TXTIBB)
Arthur Heymans0f068a62021-05-03 10:59:45 +020058$(FSP_T_CBFS)-position = $(CONFIG_FSP_T_LOCATION)
Felix Held2651d992021-08-28 02:31:41 +020059endif # CONFIG_FSP_T_XIP
60endif # CONFIG_ADD_FSP_BINARIES && CONFIG_FSP_CAR
Brenton Dong0a5971c2016-10-18 11:35:15 -070061
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010062cbfs-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
Rizwan Qureshi69966cc2016-09-09 12:16:11 +053065ifeq ($(CONFIG_FSP_M_XIP),y)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010066$(FSP_M_CBFS)-options := --xip $(TXTIBB)
Rizwan Qureshi69966cc2016-09-09 12:16:11 +053067endif
Aaron Durbinecbfa992020-05-15 17:01:58 -060068ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZMA),y)
69$(FSP_M_CBFS)-compression := LZMA
70endif
71ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZ4),y)
72$(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
83endif
84ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZ4),y)
85$(FSP_S_CBFS)-compression := LZ4
86endif
Raul E Rangel82897c92021-11-05 10:29:24 -060087ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_S),)
88$(FSP_S_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_S)
89endif
Andrey Petrov9be1a112016-05-14 16:32:39 -070090
Michael Niewöhner59f06ad2020-11-25 13:55:42 +010091ifeq ($(CONFIG_FSP_FULL_FD),y)
Michael Niewöhner1aa8fc32020-12-10 02:55:47 +010092$(obj)/Fsp_M.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(DOTCONFIG)
Michael Niewöhner99908662021-10-02 21:05:20 +020093 python 3rdparty/fsp/Tools/SplitFspBin.py split -f $(CONFIG_FSP_FD_PATH) -o "$(obj)" -n "Fsp.fd"
Patrick Georgi6539e102018-09-13 11:48:43 -040094
95$(obj)/Fsp_S.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(obj)/Fsp_M.fd
96 true
97
98$(obj)/Fsp_T.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(obj)/Fsp_M.fd
99 true
100endif
101
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100102# Add logo to the cbfs image
Kyösti Mälkki4949a3d2021-01-09 20:38:43 +0200103cbfs-files-$(CONFIG_BMP_LOGO) += logo.bmp
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100104logo.bmp-file := $(call strip_quotes,$(CONFIG_FSP2_0_LOGO_FILE_NAME))
105logo.bmp-type := raw
106logo.bmp-compression := LZMA
107
Patrick Georgi6539e102018-09-13 11:48:43 -0400108ifneq ($(call strip_quotes,$(CONFIG_FSP_HEADER_PATH)),)
109CPPFLAGS_common+=-I$(CONFIG_FSP_HEADER_PATH)
110endif
111
Felix Heldc958f842021-08-28 00:36:17 +0200112# check if the FSP files that are supposed to be added are specified
113ifeq ($(CONFIG_ADD_FSP_BINARIES),y)
114ifeq ($(CONFIG_FSP_CAR),y)
115ifeq ($(call strip_quotes,$(CONFIG_FSP_T_FILE)),)
116$(error No FSP-T binary file specified.)
117endif # CONFIG_FSP_T_FILE
118endif # CONFIG_FSP_CAR
119ifeq ($(call strip_quotes,$(CONFIG_FSP_M_FILE)),)
120$(error No FSP-M binary file specified.)
121endif # CONFIG_FSP_M_FILE
122ifeq ($(call strip_quotes,$(CONFIG_FSP_S_FILE)),)
123$(error No FSP-S binary file specified.)
124endif # CONFIG_FSP_S_FILE
Felix Heldb33816e2021-09-03 16:18:28 +0200125else # CONFIG_ADD_FSP_BINARIES
126build_complete:: warn_no_fsp_binaries
Felix Heldc958f842021-08-28 00:36:17 +0200127endif # CONFIG_ADD_FSP_BINARIES
128
Felix Heldb33816e2021-09-03 16:18:28 +0200129PHONY+=warn_no_fsp_binaries
130warn_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"
135
Furquan Shaikh1a5f25e2021-02-03 23:02:34 -0800136subdirs-y += ppi
Subrata Banik52331ba2019-03-11 11:53:12 +0530137
Stefan Reinauer86ddd732016-03-11 20:22:28 -0800138endif