1 # SPDX-License-Identifier: BSD-3-Clause
3 ifeq ($(CONFIG_SOC_AMD_STONEYRIDGE
),y
)
5 subdirs-y
+= ..
/..
/..
/cpu
/amd
/mtrr
/
8 bootblock-y
+= BiosCallOuts.c
9 bootblock-y
+= bootblock.c
10 bootblock-y
+= early_fch.c
13 bootblock-y
+= enable_usbdebug.c
15 romstage-y
+= BiosCallOuts.c
17 romstage-y
+= romstage.c
18 romstage-y
+= enable_usbdebug.c
19 romstage-y
+= fch_agesa.c
21 romstage-y
+= smbus_spd.c
22 romstage-y
+= memmap.c
29 postcar-
$(CONFIG_TPM_MEASURED_BOOT
) += i2c.c
32 ramstage-y
+= BiosCallOuts.c
37 ramstage-y
+= enable_usbdebug.c
38 ramstage-
$(CONFIG_HAVE_ACPI_TABLES
) += acpi.c
40 ramstage-y
+= fch_agesa.c
42 ramstage-y
+= graphics.c
43 ramstage-y
+= northbridge.c
45 ramstage-y
+= memmap.c
49 all-y
+= monotonic_timer.c
50 all-y
+= pstate_util.c
55 smm-y
+= pstate_util.c
56 smm-y
+= monotonic_timer.c
59 smm-
$(CONFIG_DEBUG_SMI
) += uart.c
63 CPPFLAGS_common
+= -I
$(src
)/soc
/amd
/stoneyridge
/include
64 CPPFLAGS_common
+= -I
$(src
)/soc
/amd
/stoneyridge
/acpi
66 # ROMSIG Normally At ROMBASE + 0x20000
67 # +-----------+---------------+----------------+------------+
68 # |0x55AA55AA |EC ROM Address |GEC ROM Address |USB3 ROM |
69 # +-----------+---------------+----------------+------------+
73 # EC ROM should be 64K aligned.
76 FIRMWARE_LOCATION
=$(shell grep
-e FIRMWARE_LOCATION
$(CONFIG_AMDFW_CONFIG_FILE
) | awk
'{print $$2}')
78 ifneq ($(FIRMWARE_LOCATION
),)
80 ifeq ($(CONFIG_AMD_APU_STONEYRIDGE
),y
)
83 ifeq ($(CONFIG_AMD_APU_MERLINFALCON
),y
)
86 ifeq ($(CONFIG_AMD_APU_PRAIRIEFALCON
),y
)
89 $(error soc
/amd
/stoneyridge
: Unusable FIRMWARE_TYPE
)
91 endif # CONFIG_AMD_APU_PRAIRIEFALCON
92 endif # CONFIG_AMD_APU_MERLINFALCON
93 endif # CONFIG_AMD_APU_STONEYRIDGE
96 # The flashmap section used for this is expected to be named PSP_NVRAM
97 PSP_NVRAM_BASE
=$(call get_fmap_value
,FMAP_SECTION_PSP_NVRAM_START
)
98 PSP_NVRAM_SIZE
=$(call get_fmap_value
,FMAP_SECTION_PSP_NVRAM_SIZE
)
100 add_opt_prefix
=$(if
$(call strip_quotes
, $(1)), $(2) $(call strip_quotes
, $(1)), )
102 OPT_PSP_NVRAM_BASE
=$(call add_opt_prefix
, $(PSP_NVRAM_BASE
), --nvram-base
)
103 OPT_PSP_NVRAM_SIZE
=$(call add_opt_prefix
, $(PSP_NVRAM_SIZE
), --nvram-size
)
105 OPT_STONEYRIDGE_XHCI_FWM_FILE
=$(call add_opt_prefix
, $(CONFIG_STONEYRIDGE_XHCI_FWM_FILE
), --xhci
)
106 OPT_STONEYRIDGE_GEC_FWM_FILE
=$(call add_opt_prefix
, $(CONFIG_STONEYRIDGE_GEC_FWM_FILE
), --gec
)
108 SMUFWM_FILE
=$(top
)/$(FIRMWARE_LOCATION
)/$(shell awk
'($$1=="PSP_SMUFW1_SUB0_FILE") {print $$2}' $(CONFIG_AMDFW_CONFIG_FILE
))
109 SMUFWM_FN_FILE
=$(top
)/$(FIRMWARE_LOCATION
)/$(shell awk
'($$1=="PSP_SMUFW1_SUB1_FILE") {print $$2}' $(CONFIG_AMDFW_CONFIG_FILE
))
111 SMUFIRMWARE2_FILE
=$(top
)/$(FIRMWARE_LOCATION
)/$(shell awk
'($$1=="PSP_SMUFW2_SUB0_FILE") {print $$2}' $(CONFIG_AMDFW_CONFIG_FILE
))
112 SMUFIRMWARE2_FN_FILE
=$(top
)/$(FIRMWARE_LOCATION
)/$(shell awk
'($$1=="PSP_SMUFW2_SUB1_FILE") {print $$2}' $(CONFIG_AMDFW_CONFIG_FILE
))
114 ifeq ("$(wildcard $(SMUFWM_FN_FILE))","")
116 SMUFIRMWARE2_FN_FILE
=
119 ifeq ($(CONFIG_USE_PSPSECUREOS
),y
)
120 PSP_USE_PSPSECUREOS
="--use-pspsecureos"
123 OPT_PSP_USE_PSPSECUREOS
=$(call strip_quotes
, $(PSP_USE_PSPSECUREOS
))
125 OPT_EFS_SPI_READ_MODE
=$(call add_opt_prefix
, $(CONFIG_EFS_SPI_READ_MODE
), --spi-read-mode
)
126 OPT_EFS_SPI_SPEED
=$(call add_opt_prefix
, $(CONFIG_EFS_SPI_SPEED
), --spi-speed
)
128 $(obj
)/amdfw.rom
: $(call strip_quotes
, $(CONFIG_STONEYRIDGE_XHCI_FWM_FILE
)) \
129 $(call strip_quotes
, $(CONFIG_STONEYRIDGE_GEC_FWM_FILE
)) \
133 @printf
" AMDFWTOOL $(subst $(obj)/,,$(@))\n"
135 $(OPT_PSP_NVRAM_BASE
) \
136 $(OPT_PSP_NVRAM_SIZE
) \
137 $(OPT_STONEYRIDGE_XHCI_FWM_FILE
) \
138 $(OPT_STONEYRIDGE_GEC_FWM_FILE
) \
139 $(OPT_PSP_USE_PSPSECUREOS
) \
140 $(OPT_EFS_SPI_READ_MODE
) \
141 $(OPT_EFS_SPI_SPEED
) \
142 $(OPT_DEBUG_AMDFWTOOL
) \
143 --config
$(CONFIG_AMDFW_CONFIG_FILE
) \
144 --flashsize
$(CONFIG_ROM_SIZE
) \
145 --location
$(CONFIG_AMD_FWM_POSITION
) \
148 ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS
),y
)
150 $(call add_intermediate
, add_amdfw
, $(obj
)/amdfw.rom
)
151 printf
" DD Adding AMD Firmware at ROM offset 0x%x\n" \
152 "$(CONFIG_AMD_FWM_POSITION)"
153 dd if
=$(obj
)/amdfw.rom \
154 of
=$< conv
=notrunc bs
=1 \
155 seek
=$(CONFIG_AMD_FWM_POSITION
) >/dev
/null
2>&1
157 else # ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y)
159 STONEYRIDGE_FWM_POSITION
=$(call int-add
, \
160 $(call int-subtract
, 0xffffffff $(CONFIG_ROM_SIZE
)) \
162 $(CONFIG_AMD_FWM_POSITION
))
163 cbfs-files-y
+= apu
/amdfw
164 apu
/amdfw-file
:= $(obj
)/amdfw.rom
165 apu
/amdfw-position
:= $(STONEYRIDGE_FWM_POSITION
)
166 apu
/amdfw-type
:= raw
168 endif # ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y)
170 ifeq ($(CONFIG_SOC_AMD_PSP_SELECTABLE_SMU_FW
),y
)
172 cbfs-files-y
+= smu_fw
173 cbfs-files-y
+= smu_fw2
177 ifeq ($(CONFIG_SOC_AMD_SMU_FANLESS
),y
)
178 smu_fw-file
:= $(SMUFWM_FN_FILE
)
179 smu_fw2-file
:= $(SMUFIRMWARE2_FN_FILE
)
180 else ifeq ($(CONFIG_SOC_AMD_SMU_FANNED
),y
)
181 smu_fw-file
:= $(SMUFWM_FILE
)
182 smu_fw2-file
:= $(SMUFIRMWARE2_FILE
)
184 $(error
"Proper SMU Firmware not selected")
187 endif # ifeq ($(CONFIG_SOC_AMD_PSP_SELECTABLE_SMU_FW),y)
189 else # ifneq ($(FIRMWARE_LOCATION),)
192 printf
"\n\t** WARNING **\n"
193 printf
"coreboot has been built with no PSP firmware and "
194 printf
"a non-booting image has been generated.\n\n"
198 show_notices
:: warn_no_amdfw
200 endif # ifneq ($(FIRMWARE_LOCATION),)
202 endif # ($(CONFIG_SOC_AMD_STONEYRIDGE),y)