mb/amb/birman*/gpio: remove configuration for VDD_MEM_VID[0,1]
[coreboot2.git] / src / soc / amd / stoneyridge / Makefile.mk
blobe079fa31851f39b3c4646f6b0e0d36713603bc06
1 # SPDX-License-Identifier: BSD-3-Clause
3 ifeq ($(CONFIG_SOC_AMD_STONEYRIDGE),y)
5 subdirs-y += ../../../cpu/amd/mtrr/
7 bootblock-y += aoac.c
8 bootblock-y += BiosCallOuts.c
9 bootblock-y += bootblock.c
10 bootblock-y += early_fch.c
11 bootblock-y += gpio.c
12 bootblock-y += i2c.c
13 bootblock-y += enable_usbdebug.c
15 romstage-y += BiosCallOuts.c
16 romstage-y += i2c.c
17 romstage-y += romstage.c
18 romstage-y += enable_usbdebug.c
19 romstage-y += fch_agesa.c
20 romstage-y += gpio.c
21 romstage-y += smbus_spd.c
22 romstage-y += memmap.c
23 romstage-y += psp.c
25 verstage-y += gpio.c
26 verstage-y += i2c.c
28 postcar-y += memmap.c
29 postcar-$(CONFIG_TPM_MEASURED_BOOT) += i2c.c
31 ramstage-y += aoac.c
32 ramstage-y += BiosCallOuts.c
33 ramstage-y += i2c.c
34 ramstage-y += chip.c
35 ramstage-y += cpu.c
36 ramstage-y += mca.c
37 ramstage-y += enable_usbdebug.c
38 ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c
39 ramstage-y += fch.c
40 ramstage-y += fch_agesa.c
41 ramstage-y += gpio.c
42 ramstage-y += graphics.c
43 ramstage-y += northbridge.c
44 ramstage-y += sata.c
45 ramstage-y += memmap.c
46 ramstage-y += usb.c
47 ramstage-y += psp.c
49 all-y += monotonic_timer.c
50 all-y += pstate_util.c
51 all-y += reset.c
52 all-y += tsc_freq.c
53 all-y += uart.c
55 smm-y += pstate_util.c
56 smm-y += monotonic_timer.c
57 smm-y += smihandler.c
58 smm-y += tsc_freq.c
59 smm-$(CONFIG_DEBUG_SMI) += uart.c
60 smm-y += gpio.c
61 smm-y += psp.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 # +-----------+---------------+----------------+------------+
70 # |PSPDIR ADDR|
71 # +-----------+
73 # EC ROM should be 64K aligned.
74 ### 0
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)
81 FIRMWARE_TYPE=ST
82 else
83 ifeq ($(CONFIG_AMD_APU_MERLINFALCON),y)
84 FIRMWARE_TYPE=CZ
85 else
86 ifeq ($(CONFIG_AMD_APU_PRAIRIEFALCON),y)
87 FIRMWARE_TYPE=ST
88 else
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
95 # type = 0x04
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))","")
115 SMUFWM_FN_FILE=
116 SMUFIRMWARE2_FN_FILE=
117 endif
119 ifeq ($(CONFIG_USE_PSPSECUREOS),y)
120 PSP_USE_PSPSECUREOS="--use-pspsecureos"
121 endif
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)) \
130 $(DEP_FILES) \
131 $(AMDFWTOOL)
132 rm -f $@
133 @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n"
134 $(AMDFWTOOL) \
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) \
146 --output $@
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
174 smu_fw-type := raw
175 smu_fw2-type := raw
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)
183 else
184 $(error "Proper SMU Firmware not selected")
185 endif
187 endif # ifeq ($(CONFIG_SOC_AMD_PSP_SELECTABLE_SMU_FW),y)
189 else # ifneq ($(FIRMWARE_LOCATION),)
191 warn_no_amdfw:
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"
196 PHONY+=warn_no_amdfw
198 show_notices:: warn_no_amdfw
200 endif # ifneq ($(FIRMWARE_LOCATION),)
202 endif # ($(CONFIG_SOC_AMD_STONEYRIDGE),y)