blob: f5641ac1821f5cb63868558280e232cd85f950ad [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
Andrey Petrovb37fd672016-03-01 16:25:38 -080018
Lee Leahy672df162016-07-24 18:21:13 -070019ramstage-y += debug.c
Subrata Banik3ba6f8c2022-03-23 03:22:28 +053020ramstage-$(CONFIG_FSP_USES_CB_DEBUG_EVENT_HANDLER) += fsp_debug_event.c
Subrata Banik96b32f12020-07-31 12:09:11 +053021ramstage-$(CONFIG_USE_INTEL_FSP_MP_INIT) += fsp_mpinit.c
Subrata Banik6de1d9f2022-03-20 19:50:38 +053022ramstage-$(CONFIG_DISPLAY_FSP_TIMESTAMPS) += fsp_timestamp.c
Nico Huber2e7f6cc2017-05-22 15:58:03 +020023ramstage-$(CONFIG_RUN_FSP_GOP) += graphics.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080024ramstage-y += hand_off_block.c
Lee Leahy37b5ef22016-07-31 14:15:49 -070025ramstage-$(CONFIG_DISPLAY_FSP_HEADER) += header_display.c
Lee Leahyac3b0a62016-07-27 07:40:25 -070026ramstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c
Lee Leahy52d0c682016-08-01 15:47:42 -070027ramstage-$(CONFIG_VERIFY_HOBS) += hob_verify.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080028ramstage-y += notify.c
29ramstage-y += silicon_init.c
Lee Leahye6f2f742016-07-21 09:48:49 -070030ramstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080031ramstage-y += util.c
Pratik Prajapatiffc934d2016-11-18 14:36:34 -080032ramstage-$(CONFIG_MMA) += mma_core.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080033
Arthur Heymans98cc7832020-12-08 12:49:38 +010034ifneq ($(CONFIG_NO_FSP_TEMP_RAM_EXIT),y)
Brenton Dong0a5971c2016-10-18 11:35:15 -070035postcar-$(CONFIG_FSP_CAR) += temp_ram_exit.c
Arthur Heymans98cc7832020-12-08 12:49:38 +010036endif
Brenton Dong0a5971c2016-10-18 11:35:15 -070037postcar-$(CONFIG_FSP_CAR) += util.c
38postcar-$(CONFIG_DISPLAY_FSP_HEADER) += header_display.c
Lijian Zhao8465a812017-07-11 12:33:22 -070039postcar-y += hand_off_block.c
Brandon Breitenstein135eae92016-09-30 13:57:12 -070040
Andrey Petrovb37fd672016-03-01 16:25:38 -080041CPPFLAGS_common += -I$(src)/drivers/intel/fsp2_0/include
Stefan Reinauer86ddd732016-03-11 20:22:28 -080042
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010043FSP_T_CBFS = $(call strip_quotes,$(CONFIG_FSP_T_CBFS))
44FSP_M_CBFS = $(call strip_quotes,$(CONFIG_FSP_M_CBFS))
45FSP_S_CBFS = $(call strip_quotes,$(CONFIG_FSP_S_CBFS))
46
Andrey Petrov9be1a112016-05-14 16:32:39 -070047# Add FSP blobs into cbfs. SoC code may supply additional options with
48# -options, e.g --xip or -b
Felix Held2651d992021-08-28 02:31:41 +020049ifeq ($(CONFIG_ADD_FSP_BINARIES)$(CONFIG_FSP_CAR),yy)
50cbfs-files-y += $(FSP_T_CBFS)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010051$(FSP_T_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_T_FILE))
52$(FSP_T_CBFS)-type := fsp
praveen hodagatta pranesh6c965422018-10-10 22:48:00 +080053ifeq ($(CONFIG_FSP_T_XIP),y)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010054$(FSP_T_CBFS)-options := --xip $(TXTIBB)
Arthur Heymans0f068a62021-05-03 10:59:45 +020055$(FSP_T_CBFS)-position = $(CONFIG_FSP_T_LOCATION)
Felix Held2651d992021-08-28 02:31:41 +020056endif # CONFIG_FSP_T_XIP
57endif # CONFIG_ADD_FSP_BINARIES && CONFIG_FSP_CAR
Brenton Dong0a5971c2016-10-18 11:35:15 -070058
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010059cbfs-files-$(CONFIG_ADD_FSP_BINARIES) += $(FSP_M_CBFS)
60$(FSP_M_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_M_FILE))
61$(FSP_M_CBFS)-type := fsp
Rizwan Qureshi69966cc2016-09-09 12:16:11 +053062ifeq ($(CONFIG_FSP_M_XIP),y)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010063$(FSP_M_CBFS)-options := --xip $(TXTIBB)
Rizwan Qureshi69966cc2016-09-09 12:16:11 +053064endif
Aaron Durbinecbfa992020-05-15 17:01:58 -060065ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZMA),y)
66$(FSP_M_CBFS)-compression := LZMA
67endif
68ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZ4),y)
69$(FSP_M_CBFS)-compression := LZ4
70endif
Raul E Rangel82897c92021-11-05 10:29:24 -060071ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_M),)
72$(FSP_M_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_M)
73endif
Andrey Petrov9be1a112016-05-14 16:32:39 -070074
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010075cbfs-files-$(CONFIG_ADD_FSP_BINARIES) += $(FSP_S_CBFS)
76$(FSP_S_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_S_FILE))
77$(FSP_S_CBFS)-type := fsp
Aaron Durbina85febc2020-05-15 15:09:10 -060078ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZMA),y)
79$(FSP_S_CBFS)-compression := LZMA
80endif
81ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZ4),y)
82$(FSP_S_CBFS)-compression := LZ4
83endif
Raul E Rangel82897c92021-11-05 10:29:24 -060084ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_S),)
85$(FSP_S_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_S)
86endif
Andrey Petrov9be1a112016-05-14 16:32:39 -070087
Michael Niewöhner59f06ad2020-11-25 13:55:42 +010088ifeq ($(CONFIG_FSP_FULL_FD),y)
Michael Niewöhner1aa8fc32020-12-10 02:55:47 +010089$(obj)/Fsp_M.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(DOTCONFIG)
Michael Niewöhner99908662021-10-02 21:05:20 +020090 python 3rdparty/fsp/Tools/SplitFspBin.py split -f $(CONFIG_FSP_FD_PATH) -o "$(obj)" -n "Fsp.fd"
Patrick Georgi6539e102018-09-13 11:48:43 -040091
92$(obj)/Fsp_S.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(obj)/Fsp_M.fd
93 true
94
95$(obj)/Fsp_T.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(obj)/Fsp_M.fd
96 true
97endif
98
Wim Vervoorncbc878d22019-11-28 14:45:12 +010099# Add logo to the cbfs image
Kyösti Mälkki4949a3d2021-01-09 20:38:43 +0200100cbfs-files-$(CONFIG_BMP_LOGO) += logo.bmp
Wim Vervoorncbc878d22019-11-28 14:45:12 +0100101logo.bmp-file := $(call strip_quotes,$(CONFIG_FSP2_0_LOGO_FILE_NAME))
102logo.bmp-type := raw
103logo.bmp-compression := LZMA
104
Patrick Georgi6539e102018-09-13 11:48:43 -0400105ifneq ($(call strip_quotes,$(CONFIG_FSP_HEADER_PATH)),)
106CPPFLAGS_common+=-I$(CONFIG_FSP_HEADER_PATH)
107endif
108
Felix Heldc958f842021-08-28 00:36:17 +0200109# check if the FSP files that are supposed to be added are specified
110ifeq ($(CONFIG_ADD_FSP_BINARIES),y)
111ifeq ($(CONFIG_FSP_CAR),y)
112ifeq ($(call strip_quotes,$(CONFIG_FSP_T_FILE)),)
113$(error No FSP-T binary file specified.)
114endif # CONFIG_FSP_T_FILE
115endif # CONFIG_FSP_CAR
116ifeq ($(call strip_quotes,$(CONFIG_FSP_M_FILE)),)
117$(error No FSP-M binary file specified.)
118endif # CONFIG_FSP_M_FILE
119ifeq ($(call strip_quotes,$(CONFIG_FSP_S_FILE)),)
120$(error No FSP-S binary file specified.)
121endif # CONFIG_FSP_S_FILE
Felix Heldb33816e2021-09-03 16:18:28 +0200122else # CONFIG_ADD_FSP_BINARIES
123build_complete:: warn_no_fsp_binaries
Felix Heldc958f842021-08-28 00:36:17 +0200124endif # CONFIG_ADD_FSP_BINARIES
125
Felix Heldb33816e2021-09-03 16:18:28 +0200126PHONY+=warn_no_fsp_binaries
127warn_no_fsp_binaries:
128 printf "\n\t** WARNING **\n"
129 printf "ADD_FSP_BINARIES isn't selected even though this SoC relies on the FSP.\n"
130 printf "The resulting image won't contain the FSP binaries and will not boot unless\n"
131 printf "they are added later.\n"
132
Furquan Shaikh1a5f25e2021-02-03 23:02:34 -0800133subdirs-y += ppi
Subrata Banik52331ba2019-03-11 11:53:12 +0530134
Stefan Reinauer86ddd732016-03-11 20:22:28 -0800135endif