blob: eaf99d14929f7298118f6215a053e117454cc2dc [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
Andrey Petrovb37fd672016-03-01 16:25:38 -08008romstage-y += hand_off_block.c
Lee Leahy37b5ef22016-07-31 14:15:49 -07009romstage-$(CONFIG_DISPLAY_FSP_HEADER) += header_display.c
Lee Leahyac3b0a62016-07-27 07:40:25 -070010romstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c
Lee Leahye6f2f742016-07-21 09:48:49 -070011romstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c
Lee Leahy52d0c682016-08-01 15:47:42 -070012romstage-$(CONFIG_VERIFY_HOBS) += hob_verify.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080013romstage-y += util.c
14romstage-y += memory_init.c
Pratik Prajapatiffc934d2016-11-18 14:36:34 -080015romstage-$(CONFIG_MMA) += mma_core.c
Michael Niewöhnerb8cd4b02019-11-04 22:13:44 +010016romstage-y += cbmem.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080017
Lee Leahy672df162016-07-24 18:21:13 -070018ramstage-y += debug.c
Subrata Banik96b32f12020-07-31 12:09:11 +053019ramstage-$(CONFIG_USE_INTEL_FSP_MP_INIT) += fsp_mpinit.c
Nico Huber2e7f6cc2017-05-22 15:58:03 +020020ramstage-$(CONFIG_RUN_FSP_GOP) += graphics.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080021ramstage-y += hand_off_block.c
Lee Leahy37b5ef22016-07-31 14:15:49 -070022ramstage-$(CONFIG_DISPLAY_FSP_HEADER) += header_display.c
Lee Leahyac3b0a62016-07-27 07:40:25 -070023ramstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c
Lee Leahy52d0c682016-08-01 15:47:42 -070024ramstage-$(CONFIG_VERIFY_HOBS) += hob_verify.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080025ramstage-y += notify.c
26ramstage-y += silicon_init.c
Lee Leahye6f2f742016-07-21 09:48:49 -070027ramstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080028ramstage-y += util.c
Pratik Prajapatiffc934d2016-11-18 14:36:34 -080029ramstage-$(CONFIG_MMA) += mma_core.c
Andrey Petrovb37fd672016-03-01 16:25:38 -080030
Arthur Heymans98cc7832020-12-08 12:49:38 +010031ifneq ($(CONFIG_NO_FSP_TEMP_RAM_EXIT),y)
Brenton Dong0a5971c2016-10-18 11:35:15 -070032postcar-$(CONFIG_FSP_CAR) += temp_ram_exit.c
Arthur Heymans98cc7832020-12-08 12:49:38 +010033endif
Brenton Dong0a5971c2016-10-18 11:35:15 -070034postcar-$(CONFIG_FSP_CAR) += util.c
35postcar-$(CONFIG_DISPLAY_FSP_HEADER) += header_display.c
Lijian Zhao8465a812017-07-11 12:33:22 -070036postcar-y += hand_off_block.c
Brandon Breitenstein135eae92016-09-30 13:57:12 -070037
Andrey Petrovb37fd672016-03-01 16:25:38 -080038CPPFLAGS_common += -I$(src)/drivers/intel/fsp2_0/include
Stefan Reinauer86ddd732016-03-11 20:22:28 -080039
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010040FSP_T_CBFS = $(call strip_quotes,$(CONFIG_FSP_T_CBFS))
41FSP_M_CBFS = $(call strip_quotes,$(CONFIG_FSP_M_CBFS))
42FSP_S_CBFS = $(call strip_quotes,$(CONFIG_FSP_S_CBFS))
43
Andrey Petrov9be1a112016-05-14 16:32:39 -070044# Add FSP blobs into cbfs. SoC code may supply additional options with
45# -options, e.g --xip or -b
Felix Held2651d992021-08-28 02:31:41 +020046ifeq ($(CONFIG_ADD_FSP_BINARIES)$(CONFIG_FSP_CAR),yy)
47cbfs-files-y += $(FSP_T_CBFS)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010048$(FSP_T_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_T_FILE))
49$(FSP_T_CBFS)-type := fsp
praveen hodagatta pranesh6c965422018-10-10 22:48:00 +080050ifeq ($(CONFIG_FSP_T_XIP),y)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010051$(FSP_T_CBFS)-options := --xip $(TXTIBB)
Arthur Heymans0f068a62021-05-03 10:59:45 +020052$(FSP_T_CBFS)-position = $(CONFIG_FSP_T_LOCATION)
Felix Held2651d992021-08-28 02:31:41 +020053endif # CONFIG_FSP_T_XIP
54endif # CONFIG_ADD_FSP_BINARIES && CONFIG_FSP_CAR
Brenton Dong0a5971c2016-10-18 11:35:15 -070055
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010056cbfs-files-$(CONFIG_ADD_FSP_BINARIES) += $(FSP_M_CBFS)
57$(FSP_M_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_M_FILE))
58$(FSP_M_CBFS)-type := fsp
Rizwan Qureshi69966cc2016-09-09 12:16:11 +053059ifeq ($(CONFIG_FSP_M_XIP),y)
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010060$(FSP_M_CBFS)-options := --xip $(TXTIBB)
Rizwan Qureshi69966cc2016-09-09 12:16:11 +053061endif
Aaron Durbinecbfa992020-05-15 17:01:58 -060062ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZMA),y)
63$(FSP_M_CBFS)-compression := LZMA
64endif
65ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZ4),y)
66$(FSP_M_CBFS)-compression := LZ4
67endif
Raul E Rangel82897c92021-11-05 10:29:24 -060068ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_M),)
69$(FSP_M_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_M)
70endif
Andrey Petrov9be1a112016-05-14 16:32:39 -070071
Wim Vervoorn8fc523e2019-11-01 12:43:58 +010072cbfs-files-$(CONFIG_ADD_FSP_BINARIES) += $(FSP_S_CBFS)
73$(FSP_S_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_S_FILE))
74$(FSP_S_CBFS)-type := fsp
Aaron Durbina85febc2020-05-15 15:09:10 -060075ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZMA),y)
76$(FSP_S_CBFS)-compression := LZMA
77endif
78ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZ4),y)
79$(FSP_S_CBFS)-compression := LZ4
80endif
Raul E Rangel82897c92021-11-05 10:29:24 -060081ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_S),)
82$(FSP_S_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_S)
83endif
Andrey Petrov9be1a112016-05-14 16:32:39 -070084
Michael Niewöhner59f06ad2020-11-25 13:55:42 +010085ifeq ($(CONFIG_FSP_FULL_FD),y)
Michael Niewöhner1aa8fc32020-12-10 02:55:47 +010086$(obj)/Fsp_M.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(DOTCONFIG)
Michael Niewöhner99908662021-10-02 21:05:20 +020087 python 3rdparty/fsp/Tools/SplitFspBin.py split -f $(CONFIG_FSP_FD_PATH) -o "$(obj)" -n "Fsp.fd"
Patrick Georgi6539e102018-09-13 11:48:43 -040088
89$(obj)/Fsp_S.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(obj)/Fsp_M.fd
90 true
91
92$(obj)/Fsp_T.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(obj)/Fsp_M.fd
93 true
94endif
95
Wim Vervoorncbc878d22019-11-28 14:45:12 +010096# Add logo to the cbfs image
Kyösti Mälkki4949a3d2021-01-09 20:38:43 +020097cbfs-files-$(CONFIG_BMP_LOGO) += logo.bmp
Wim Vervoorncbc878d22019-11-28 14:45:12 +010098logo.bmp-file := $(call strip_quotes,$(CONFIG_FSP2_0_LOGO_FILE_NAME))
99logo.bmp-type := raw
100logo.bmp-compression := LZMA
101
Patrick Georgi6539e102018-09-13 11:48:43 -0400102ifneq ($(call strip_quotes,$(CONFIG_FSP_HEADER_PATH)),)
103CPPFLAGS_common+=-I$(CONFIG_FSP_HEADER_PATH)
104endif
105
Felix Heldc958f842021-08-28 00:36:17 +0200106# check if the FSP files that are supposed to be added are specified
107ifeq ($(CONFIG_ADD_FSP_BINARIES),y)
108ifeq ($(CONFIG_FSP_CAR),y)
109ifeq ($(call strip_quotes,$(CONFIG_FSP_T_FILE)),)
110$(error No FSP-T binary file specified.)
111endif # CONFIG_FSP_T_FILE
112endif # CONFIG_FSP_CAR
113ifeq ($(call strip_quotes,$(CONFIG_FSP_M_FILE)),)
114$(error No FSP-M binary file specified.)
115endif # CONFIG_FSP_M_FILE
116ifeq ($(call strip_quotes,$(CONFIG_FSP_S_FILE)),)
117$(error No FSP-S binary file specified.)
118endif # CONFIG_FSP_S_FILE
Felix Heldb33816e2021-09-03 16:18:28 +0200119else # CONFIG_ADD_FSP_BINARIES
120build_complete:: warn_no_fsp_binaries
Felix Heldc958f842021-08-28 00:36:17 +0200121endif # CONFIG_ADD_FSP_BINARIES
122
Felix Heldb33816e2021-09-03 16:18:28 +0200123PHONY+=warn_no_fsp_binaries
124warn_no_fsp_binaries:
125 printf "\n\t** WARNING **\n"
126 printf "ADD_FSP_BINARIES isn't selected even though this SoC relies on the FSP.\n"
127 printf "The resulting image won't contain the FSP binaries and will not boot unless\n"
128 printf "they are added later.\n"
129
Furquan Shaikh1a5f25e2021-02-03 23:02:34 -0800130subdirs-y += ppi
Subrata Banik52331ba2019-03-11 11:53:12 +0530131
Stefan Reinauer86ddd732016-03-11 20:22:28 -0800132endif