blob: ce0ad695b9d9bcc59325765c0d019897726166aa [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
71endif
72ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZ4),y)
73$(FSP_M_CBFS)-compression := LZ4
74endif
Raul E Rangel82897c92021-11-05 10:29:24 -060075ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_M),)
76$(FSP_M_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_M)
77endif
Andrey Petrov9be1a112016-05-14 16:32:39 -070078
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010079cbfs-files-$(CONFIG_ADD_FSP_BINARIES) += $(FSP_S_CBFS)
80$(FSP_S_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_S_FILE))
81$(FSP_S_CBFS)-type := fsp
Aaron Durbina85febc2020-05-15 15:09:10 -060082ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZMA),y)
83$(FSP_S_CBFS)-compression := LZMA
84endif
85ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZ4),y)
86$(FSP_S_CBFS)-compression := LZ4
87endif
Raul E Rangel82897c92021-11-05 10:29:24 -060088ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_S),)
89$(FSP_S_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_S)
90endif
Andrey Petrov9be1a112016-05-14 16:32:39 -070091
Michael Niewöhner59f06ad2020-11-25 13:55:42 +010092ifeq ($(CONFIG_FSP_FULL_FD),y)
Michael Niewöhner1aa8fc32020-12-10 02:55:47 +010093$(obj)/Fsp_M.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(DOTCONFIG)
Michael Niewöhner99908662021-10-02 21:05:20 +020094 python 3rdparty/fsp/Tools/SplitFspBin.py split -f $(CONFIG_FSP_FD_PATH) -o "$(obj)" -n "Fsp.fd"
Patrick Georgi6539e102018-09-13 11:48:43 -040095
96$(obj)/Fsp_S.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(obj)/Fsp_M.fd
97 true
98
99$(obj)/Fsp_T.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(obj)/Fsp_M.fd
100 true
101endif
102
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100103# Add logo to the cbfs image
Kyösti Mälkki4949a3d2021-01-09 20:38:43 +0200104cbfs-files-$(CONFIG_BMP_LOGO) += logo.bmp
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100105logo.bmp-file := $(call strip_quotes,$(CONFIG_FSP2_0_LOGO_FILE_NAME))
106logo.bmp-type := raw
Subrata Banik7a6f8882023-08-04 21:31:05 +0530107ifeq ($(CONFIG_BMP_LOGO_COMPRESS_LZMA),y)
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100108logo.bmp-compression := LZMA
Subrata Banik7a6f8882023-08-04 21:31:05 +0530109else ($(CONFIG_BMP_LOGO_COMPRESS_LZ4),y)
110logo.bmp-compression := LZ4
111endif
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100112
Patrick Georgi6539e102018-09-13 11:48:43 -0400113ifneq ($(call strip_quotes,$(CONFIG_FSP_HEADER_PATH)),)
114CPPFLAGS_common+=-I$(CONFIG_FSP_HEADER_PATH)
115endif
116
Felix Heldc958f842021-08-28 00:36:17 +0200117# check if the FSP files that are supposed to be added are specified
118ifeq ($(CONFIG_ADD_FSP_BINARIES),y)
119ifeq ($(CONFIG_FSP_CAR),y)
120ifeq ($(call strip_quotes,$(CONFIG_FSP_T_FILE)),)
121$(error No FSP-T binary file specified.)
122endif # CONFIG_FSP_T_FILE
123endif # CONFIG_FSP_CAR
124ifeq ($(call strip_quotes,$(CONFIG_FSP_M_FILE)),)
125$(error No FSP-M binary file specified.)
126endif # CONFIG_FSP_M_FILE
127ifeq ($(call strip_quotes,$(CONFIG_FSP_S_FILE)),)
128$(error No FSP-S binary file specified.)
129endif # CONFIG_FSP_S_FILE
Felix Heldb33816e2021-09-03 16:18:28 +0200130else # CONFIG_ADD_FSP_BINARIES
131build_complete:: warn_no_fsp_binaries
Felix Heldc958f842021-08-28 00:36:17 +0200132endif # CONFIG_ADD_FSP_BINARIES
133
Felix Heldb33816e2021-09-03 16:18:28 +0200134PHONY+=warn_no_fsp_binaries
135warn_no_fsp_binaries:
136 printf "\n\t** WARNING **\n"
137 printf "ADD_FSP_BINARIES isn't selected even though this SoC relies on the FSP.\n"
138 printf "The resulting image won't contain the FSP binaries and will not boot unless\n"
139 printf "they are added later.\n"
140
Furquan Shaikh1a5f25e2021-02-03 23:02:34 -0800141subdirs-y += ppi
Subrata Banik52331ba2019-03-11 11:53:12 +0530142
Stefan Reinauer86ddd732016-03-11 20:22:28 -0800143endif