blob: 37a2fc9c4ce0395b53e2bd977f56bd96793df0e7 [file] [log] [blame]
Martin Roth1a3de8e2022-10-06 15:57:21 -06001# SPDX-License-Identifier: GPL-2.0-only
2
3# TODO: Evaluate what can be moved to a common directory
Martin Roth20646cd2023-01-04 21:27:06 -07004# TODO: Update for Phoenix
Martin Roth1a3de8e2022-10-06 15:57:21 -06005
Martin Roth20646cd2023-01-04 21:27:06 -07006config SOC_AMD_PHOENIX
Martin Roth1a3de8e2022-10-06 15:57:21 -06007 bool
Martin Roth1a3de8e2022-10-06 15:57:21 -06008 select ACPI_SOC_NVS
Martin Roth1a3de8e2022-10-06 15:57:21 -06009 select ARCH_X86
10 select BOOT_DEVICE_SUPPORTS_WRITES if BOOT_DEVICE_SPI_FLASH
11 select DRIVERS_USB_ACPI
12 select DRIVERS_USB_PCI_XHCI
13 select FSP_COMPRESS_FSP_M_LZMA if !ASYNC_FILE_LOADING
14 select FSP_COMPRESS_FSP_M_LZ4 if ASYNC_FILE_LOADING
15 select FSP_COMPRESS_FSP_S_LZ4
16 select GENERIC_GPIO_LIB
17 select HAVE_ACPI_TABLES
18 select HAVE_CF9_RESET
19 select HAVE_EM100_SUPPORT
20 select HAVE_FSP_GOP
21 select HAVE_SMI_HANDLER
22 select IDT_IN_EVERY_STAGE
Martin Rothbcb610a2022-10-29 13:31:54 -060023 select NO_DDR4
24 select NO_DDR3
25 select NO_DDR2
26 select NO_LPDDR4
Martin Roth1a3de8e2022-10-06 15:57:21 -060027 select PARALLEL_MP_AP_WORK
28 select PLATFORM_USES_FSP2_0
29 select PROVIDES_ROM_SHARING
30 select PSP_SUPPORTS_EFS2_RELATIVE_ADDR if VBOOT_STARTS_BEFORE_BOOTBLOCK
31 select PSP_VERSTAGE_CCP_DMA if VBOOT_STARTS_BEFORE_BOOTBLOCK
32 select RESET_VECTOR_IN_RAM
33 select RTC
34 select SOC_AMD_COMMON
Fred Reitberger2dceb122022-11-04 14:37:34 -040035 select SOC_AMD_COMMON_BLOCK_ACP_GEN2
Martin Roth9c64c082022-10-18 17:54:52 -060036 select SOC_AMD_COMMON_BLOCK_ACPI # TODO: Check if this is still correct
37 select SOC_AMD_COMMON_BLOCK_ACPIMMIO # TODO: Check if this is still correct
38 select SOC_AMD_COMMON_BLOCK_ACPI_ALIB # TODO: Check if this is still correct
39 select SOC_AMD_COMMON_BLOCK_ACPI_CPPC # TODO: Check if this is still correct
40 select SOC_AMD_COMMON_BLOCK_ACPI_GPIO # TODO: Check if this is still correct
41 select SOC_AMD_COMMON_BLOCK_ACPI_IVRS # TODO: Check if this is still correct
Fred Reitberger2dceb122022-11-04 14:37:34 -040042 select SOC_AMD_COMMON_BLOCK_AOAC
Martin Roth9c64c082022-10-18 17:54:52 -060043 select SOC_AMD_COMMON_BLOCK_APOB # TODO: Check if this is still correct
Fred Reitberger2dceb122022-11-04 14:37:34 -040044 select SOC_AMD_COMMON_BLOCK_APOB_HASH
45 select SOC_AMD_COMMON_BLOCK_BANKED_GPIOS
Fred Reitberger28908412022-11-01 10:49:16 -040046 select SOC_AMD_COMMON_BLOCK_DATA_FABRIC
Fred Reitberger267edec2022-12-13 12:56:09 -050047 select SOC_AMD_COMMON_BLOCK_ESPI_EXTENDED_DECODE_RANGES
Martin Roth9c64c082022-10-18 17:54:52 -060048 select SOC_AMD_COMMON_BLOCK_GRAPHICS # TODO: Check if this is still correct
Fred Reitberger267edec2022-12-13 12:56:09 -050049 select SOC_AMD_COMMON_BLOCK_HAS_ESPI
50 select SOC_AMD_COMMON_BLOCK_HAS_ESPI_ALERT_ENABLE
Fred Reitberger2dceb122022-11-04 14:37:34 -040051 select SOC_AMD_COMMON_BLOCK_I2C
52 select SOC_AMD_COMMON_BLOCK_I23C_PAD_CTRL
53 select SOC_AMD_COMMON_BLOCK_IOMMU
Fred Reitberger267edec2022-12-13 12:56:09 -050054 select SOC_AMD_COMMON_BLOCK_LPC
Fred Reitberger2dceb122022-11-04 14:37:34 -040055 select SOC_AMD_COMMON_BLOCK_MCAX
56 select SOC_AMD_COMMON_BLOCK_NONCAR
Fred Reitbergera6514e22022-12-07 08:39:55 -050057 select SOC_AMD_COMMON_BLOCK_PCI
58 select SOC_AMD_COMMON_BLOCK_PCI_MMCONF
59 select SOC_AMD_COMMON_BLOCK_PCIE_GPP_DRIVER
60 select SOC_AMD_COMMON_BLOCK_PCIE_CLK_REQ
Fred Reitberger2dceb122022-11-04 14:37:34 -040061 select SOC_AMD_COMMON_BLOCK_PM
62 select SOC_AMD_COMMON_BLOCK_PM_CHIPSET_STATE_SAVE
Martin Roth9c64c082022-10-18 17:54:52 -060063 select SOC_AMD_COMMON_BLOCK_PSP_GEN2 # TODO: Check if this is still correct
Martin Roth10c43a22023-02-02 17:21:37 -070064 select SOC_AMD_COMMON_BLOCK_RESET
Fred Reitberger2dceb122022-11-04 14:37:34 -040065 select SOC_AMD_COMMON_BLOCK_SMBUS
66 select SOC_AMD_COMMON_BLOCK_SMI
Fred Reitberger267edec2022-12-13 12:56:09 -050067 select SOC_AMD_COMMON_BLOCK_SMM
68 select SOC_AMD_COMMON_BLOCK_SMU
Felix Held65d822e2023-01-12 23:11:42 +010069 select SOC_AMD_COMMON_BLOCK_SMU_SX_ENTRY
Fred Reitberger2dceb122022-11-04 14:37:34 -040070 select SOC_AMD_COMMON_BLOCK_SPI
71 select SOC_AMD_COMMON_BLOCK_TSC_FAM17H_19H
72 select SOC_AMD_COMMON_BLOCK_UART
73 select SOC_AMD_COMMON_BLOCK_UCODE
Martin Roth9c64c082022-10-18 17:54:52 -060074 select SOC_AMD_COMMON_FSP_CCX_CPPC_HOB # TODO: Check if this is still correct
75 select SOC_AMD_COMMON_FSP_DMI_TABLES # TODO: Check if this is still correct
76 select SOC_AMD_COMMON_FSP_PCI # TODO: Check if this is still correct
Fred Reitberger010c4082023-01-11 15:11:48 -050077 select SOC_AMD_COMMON_FSP_PRELOAD_FSPS
Martin Roth1a3de8e2022-10-06 15:57:21 -060078 select SSE2
79 select UDK_2017_BINDING
Martin Rothbcb610a2022-10-29 13:31:54 -060080 select USE_DDR5
Martin Roth1a3de8e2022-10-06 15:57:21 -060081 select USE_FSP_NOTIFY_PHASE_POST_PCI_ENUM
82 select USE_FSP_NOTIFY_PHASE_READY_TO_BOOT
83 select USE_FSP_NOTIFY_PHASE_END_OF_FIRMWARE
84 select VBOOT_DEFINE_WIDEVINE_COUNTERS if VBOOT_STARTS_BEFORE_BOOTBLOCK
85 select X86_AMD_FIXED_MTRRS
86 select X86_INIT_NEED_1_SIPI
Elyes Haouas3cd06cc2023-01-05 07:42:24 +010087 help
Martin Roth20646cd2023-01-04 21:27:06 -070088 AMD Phoenix support
Elyes Haouas3cd06cc2023-01-05 07:42:24 +010089
Martin Roth20646cd2023-01-04 21:27:06 -070090if SOC_AMD_PHOENIX
Martin Roth1a3de8e2022-10-06 15:57:21 -060091
Martin Roth1a3de8e2022-10-06 15:57:21 -060092config CHIPSET_DEVICETREE
93 string
Martin Roth20646cd2023-01-04 21:27:06 -070094 default "soc/amd/phoenix/chipset.cb"
Martin Roth1a3de8e2022-10-06 15:57:21 -060095
96config EARLY_RESERVED_DRAM_BASE
97 hex
98 default 0x2000000
99 help
100 This variable defines the base address of the DRAM which is reserved
101 for usage by coreboot in early stages (i.e. before ramstage is up).
102 This memory gets reserved in BIOS tables to ensure that the OS does
103 not use it, thus preventing corruption of OS memory in case of S3
104 resume.
105
106config EARLYRAM_BSP_STACK_SIZE
107 hex
108 default 0x1000
109
110config PSP_APOB_DRAM_ADDRESS
111 hex
112 default 0x2001000
113 help
114 Location in DRAM where the PSP will copy the AGESA PSP Output
115 Block.
116
117config PSP_APOB_DRAM_SIZE
118 hex
119 default 0x1E000
120
121config PSP_SHAREDMEM_BASE
122 hex
123 default 0x201F000 if VBOOT
124 default 0x0
125 help
126 This variable defines the base address in DRAM memory where PSP copies
127 the vboot workbuf. This is used in the linker script to have a static
128 allocation for the buffer as well as for adding relevant entries in
129 the BIOS directory table for the PSP.
130
131config PSP_SHAREDMEM_SIZE
132 hex
133 default 0x8000 if VBOOT
134 default 0x0
135 help
136 Sets the maximum size for the PSP to pass the vboot workbuf and
137 any logs or timestamps back to coreboot. This will be copied
138 into main memory by the PSP and will be available when the x86 is
139 started. The workbuf's base depends on the address of the reset
140 vector.
141
142config PRE_X86_CBMEM_CONSOLE_SIZE
143 hex
144 default 0x1600
145 help
146 Size of the CBMEM console used in PSP verstage.
147
148config PRERAM_CBMEM_CONSOLE_SIZE
149 hex
150 default 0x1600
151 help
152 Increase this value if preram cbmem console is getting truncated
153
154config CBFS_MCACHE_SIZE
155 hex
156 default 0x2000 if VBOOT_STARTS_BEFORE_BOOTBLOCK
157
158config C_ENV_BOOTBLOCK_SIZE
159 hex
160 default 0x10000
161 help
162 Sets the size of the bootblock stage that should be loaded in DRAM.
163 This variable controls the DRAM allocation size in linker script
164 for bootblock stage.
165
166config ROMSTAGE_ADDR
167 hex
168 default 0x2040000
169 help
170 Sets the address in DRAM where romstage should be loaded.
171
172config ROMSTAGE_SIZE
173 hex
174 default 0x80000
175 help
176 Sets the size of DRAM allocation for romstage in linker script.
177
178config FSP_M_ADDR
179 hex
180 default 0x20C0000
181 help
182 Sets the address in DRAM where FSP-M should be loaded. cbfstool
183 performs relocation of FSP-M to this address.
184
185config FSP_M_SIZE
186 hex
187 default 0xC0000
188 help
189 Sets the size of DRAM allocation for FSP-M in linker script.
190
191config FSP_TEMP_RAM_SIZE
192 hex
193 default 0x40000
194 help
195 The amount of coreboot-allocated heap and stack usage by the FSP.
196
197config VERSTAGE_ADDR
198 hex
199 depends on VBOOT_SEPARATE_VERSTAGE
200 default 0x2180000
201 help
202 Sets the address in DRAM where verstage should be loaded if running
203 as a separate stage on x86.
204
205config VERSTAGE_SIZE
206 hex
207 depends on VBOOT_SEPARATE_VERSTAGE
208 default 0x80000
209 help
210 Sets the size of DRAM allocation for verstage in linker script if
211 running as a separate stage on x86.
212
213config ASYNC_FILE_LOADING
214 bool "Loads files from SPI asynchronously"
215 select COOP_MULTITASKING
216 select SOC_AMD_COMMON_BLOCK_LPC_SPI_DMA
217 select CBFS_PRELOAD
218 help
219 When enabled, the platform will use the LPC SPI DMA controller to
220 asynchronously load contents from the SPI ROM. This will improve
221 boot time because the CPUs can be performing useful work while the
222 SPI contents are being preloaded.
223
224config CBFS_CACHE_SIZE
225 hex
226 default 0x40000 if CBFS_PRELOAD
227
228config RO_REGION_ONLY
229 string
230 depends on VBOOT_SLOTS_RW_AB || VBOOT_SLOTS_RW_A
231 default "apu/amdfw"
232
233config ECAM_MMCONF_BASE_ADDRESS
Ritul Guru75a073d2023-01-12 17:42:54 +0530234 default 0xE0000000
Martin Roth1a3de8e2022-10-06 15:57:21 -0600235
236config ECAM_MMCONF_BUS_NUMBER
Ritul Guru75a073d2023-01-12 17:42:54 +0530237 default 256
Martin Roth1a3de8e2022-10-06 15:57:21 -0600238
239config MAX_CPUS
240 int
Martin Roth1a3de8e2022-10-06 15:57:21 -0600241 default 16
242 help
243 Maximum number of threads the platform can have.
244
245config CONSOLE_UART_BASE_ADDRESS
246 depends on CONSOLE_SERIAL && AMD_SOC_CONSOLE_UART
247 hex
248 default 0xfedc9000 if UART_FOR_CONSOLE = 0
249 default 0xfedca000 if UART_FOR_CONSOLE = 1
250 default 0xfedce000 if UART_FOR_CONSOLE = 2
251 default 0xfedcf000 if UART_FOR_CONSOLE = 3
252 default 0xfedd1000 if UART_FOR_CONSOLE = 4
253
254config SMM_TSEG_SIZE
255 hex
256 default 0x800000 if HAVE_SMI_HANDLER
257 default 0x0
258
259config SMM_RESERVED_SIZE
260 hex
261 default 0x180000
262
263config SMM_MODULE_STACK_SIZE
264 hex
265 default 0x800
266
267config ACPI_BERT
268 bool "Build ACPI BERT Table"
269 default y
270 depends on HAVE_ACPI_TABLES
271 help
272 Report Machine Check errors identified in POST to the OS in an
273 ACPI Boot Error Record Table.
274
275config ACPI_BERT_SIZE
276 hex
277 default 0x4000 if ACPI_BERT
278 default 0x0
279 help
280 Specify the amount of DRAM reserved for gathering the data used to
281 generate the ACPI table.
282
283config DRIVERS_I2C_DESIGNWARE_CLOCK_MHZ
284 int
285 default 150
286
287config DISABLE_SPI_FLASH_ROM_SHARING
288 def_bool n
289 help
290 Instruct the chipset to not honor the EGPIO67_SPI_ROM_REQ pin
291 which indicates a board level ROM transaction request. This
292 removes arbitration with board and assumes the chipset controls
293 the SPI flash bus entirely.
294
295config DISABLE_KEYBOARD_RESET_PIN
296 bool
297 help
298 Instruct the SoC to not use the state of GPIO_129 as keyboard reset
299 signal. When this pin is used as GPIO and the keyboard reset
300 functionality isn't disabled, configuring it as an output and driving
301 it as 0 will cause a reset.
302
303config ACPI_SSDT_PSD_INDEPENDENT
304 bool "Allow core p-state independent transitions"
305 default y
306 help
307 AMD recommends the ACPI _PSD object to be configured to cause
308 cores to transition between p-states independently. A vendor may
309 choose to generate _PSD object to allow cores to transition together.
310
311menu "PSP Configuration Options"
312
313config AMD_FWM_POSITION_INDEX
314 int "Firmware Directory Table location (0 to 5)"
315 range 0 5
316 default 0 if BOARD_ROMSIZE_KB_512
317 default 1 if BOARD_ROMSIZE_KB_1024
318 default 2 if BOARD_ROMSIZE_KB_2048
319 default 3 if BOARD_ROMSIZE_KB_4096
320 default 4 if BOARD_ROMSIZE_KB_8192
321 default 5 if BOARD_ROMSIZE_KB_16384
322 help
323 Typically this is calculated by the ROM size, but there may
324 be situations where you want to put the firmware directory
325 table in a different location.
326 0: 512 KB - 0xFFFA0000
327 1: 1 MB - 0xFFF20000
328 2: 2 MB - 0xFFE20000
329 3: 4 MB - 0xFFC20000
330 4: 8 MB - 0xFF820000
331 5: 16 MB - 0xFF020000
332
333comment "AMD Firmware Directory Table set to location for 512KB ROM"
334 depends on AMD_FWM_POSITION_INDEX = 0
335comment "AMD Firmware Directory Table set to location for 1MB ROM"
336 depends on AMD_FWM_POSITION_INDEX = 1
337comment "AMD Firmware Directory Table set to location for 2MB ROM"
338 depends on AMD_FWM_POSITION_INDEX = 2
339comment "AMD Firmware Directory Table set to location for 4MB ROM"
340 depends on AMD_FWM_POSITION_INDEX = 3
341comment "AMD Firmware Directory Table set to location for 8MB ROM"
342 depends on AMD_FWM_POSITION_INDEX = 4
343comment "AMD Firmware Directory Table set to location for 16MB ROM"
344 depends on AMD_FWM_POSITION_INDEX = 5
345
346config AMDFW_CONFIG_FILE
347 string "AMD PSP Firmware config file"
Martin Roth20646cd2023-01-04 21:27:06 -0700348 default "src/soc/amd/phoenix/fw.cfg"
Martin Roth1a3de8e2022-10-06 15:57:21 -0600349 help
350 Specify the path/location of AMD PSP Firmware config file.
351
352config PSP_DISABLE_POSTCODES
353 bool "Disable PSP post codes"
354 help
355 Disables the output of port80 post codes from PSP.
356
357config PSP_POSTCODES_ON_ESPI
358 bool "Use eSPI bus for PSP post codes"
359 default y
360 depends on !PSP_DISABLE_POSTCODES
361 help
362 Select to send PSP port80 post codes on eSPI bus.
363 If not selected, PSP port80 codes will be sent on LPC bus.
364
365config PSP_LOAD_MP2_FW
366 bool
367 default n
368 help
369 Include the MP2 firmwares and configuration into the PSP build.
370
371 If unsure, answer 'n'
372
373config PSP_UNLOCK_SECURE_DEBUG
374 bool "Unlock secure debug"
375 default y
376 help
377 Select this item to enable secure debug options in PSP.
378
379config HAVE_PSP_WHITELIST_FILE
380 bool "Include a debug whitelist file in PSP build"
381 default n
382 help
383 Support secured unlock prior to reset using a whitelisted
384 serial number. This feature requires a signed whitelist image
385 and bootloader from AMD.
386
387 If unsure, answer 'n'
388
389config PSP_WHITELIST_FILE
390 string "Debug whitelist file path"
391 depends on HAVE_PSP_WHITELIST_FILE
Martin Roth20646cd2023-01-04 21:27:06 -0700392 default "site-local/3rdparty/amd_blobs/phoenix/PSP/wtl-phx.sbin"
Martin Roth1a3de8e2022-10-06 15:57:21 -0600393
394config HAVE_SPL_FILE
395 bool "Have a mainboard specific SPL table file"
396 default n
397 help
398 Have a mainboard specific Security Patch Level (SPL) table file. SPL file
399 is required to support PSP FW anti-rollback and needs to be created by AMD.
400 The default SPL file applies to all boards that use the concerned SoC and
401 is dropped under 3rdparty/blobs. The mainboard specific SPL file override
402 can be applied through SPL_TABLE_FILE config.
403
404 If unsure, answer 'n'
405
406config SPL_TABLE_FILE
407 string "SPL table file"
408 depends on HAVE_SPL_FILE
Martin Roth20646cd2023-01-04 21:27:06 -0700409 default "3rdparty/blobs/mainboard/\$(CONFIG_MAINBOARD_DIR)/TypeId0x55_SplTableBl_PHX.sbin"
Martin Roth1a3de8e2022-10-06 15:57:21 -0600410
411config HAVE_SPL_RW_AB_FILE
412 bool "Have a separate mainboard-specific SPL file in RW A/B partitions"
413 default n
414 depends on HAVE_SPL_FILE
415 depends on VBOOT_SLOTS_RW_AB
416 help
417 Have separate mainboard-specific Security Patch Level (SPL) table
418 file for the RW A/B FMAP partitions. See the help text of
419 HAVE_SPL_FILE for a more detailed description.
420
421config SPL_RW_AB_TABLE_FILE
422 string "Separate SPL table file for RW A/B partitions"
423 depends on HAVE_SPL_RW_AB_FILE
Martin Roth20646cd2023-01-04 21:27:06 -0700424 default "3rdparty/blobs/mainboard/\$(CONFIG_MAINBOARD_DIR)/TypeId0x55_SplTableBl_PHX.sbin"
Martin Roth1a3de8e2022-10-06 15:57:21 -0600425
426config PSP_SOFTFUSE_BITS
427 string "PSP Soft Fuse bits to enable"
428 default "34 28 6"
429 help
430 Space separated list of Soft Fuse bits to enable.
431 Bit 0: Enable secure debug (Set by PSP_UNLOCK_SECURE_DEBUG)
432 Bit 7: Disable PSP postcodes on Renoir and newer chips only
433 (Set by PSP_DISABLE_PORT80)
434 Bit 15: PSP debug output destination:
435 0=SoC MMIO UART, 1=IO port 0x3F8
436 Bit 29: Disable MP2 firmware loading (Set by PSP_LOAD_MP2_FW)
437
438 See #55758 (NDA) for additional bit definitions.
439
440config PSP_VERSTAGE_FILE
441 string "Specify the PSP_verstage file path"
442 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
443 default "\$(obj)/psp_verstage.bin"
444 help
445 Add psp_verstage file to the build & PSP Directory Table
446
447config PSP_VERSTAGE_SIGNING_TOKEN
448 string "Specify the PSP_verstage Signature Token file path"
449 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
450 default ""
451 help
452 Add psp_verstage signature token to the build & PSP Directory Table
453
454endmenu
455
456config VBOOT
457 select VBOOT_VBNV_CMOS
458 select VBOOT_VBNV_CMOS_BACKUP_TO_FLASH
459
460config VBOOT_STARTS_BEFORE_BOOTBLOCK
461 def_bool n
462 depends on VBOOT
463 select ARCH_VERSTAGE_ARMV7
464 help
465 Runs verstage on the PSP. Only available on
466 certain ChromeOS branded parts from AMD.
467
468config VBOOT_HASH_BLOCK_SIZE
469 hex
470 default 0x9000
471 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
472 help
473 Because the bulk of the time in psp_verstage to hash the RO cbfs is
474 spent in the overhead of doing svc calls, increasing the hash block
475 size significantly cuts the verstage hashing time as seen below.
476
477 4k takes 180ms
478 16k takes 44ms
479 32k takes 33.7ms
480 36k takes 32.5ms
481 There's actually still room for an even bigger stack, but we've
482 reached a point of diminishing returns.
483
484config CMOS_RECOVERY_BYTE
485 hex
486 default 0x51
487 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
488 help
489 If the workbuf is not passed from the PSP to coreboot, set the
490 recovery flag and reboot. The PSP will read this byte, mark the
491 recovery request in VBNV, and reset the system into recovery mode.
492
493 This is the byte before the default first byte used by VBNV
494 (0x26 + 0x0E - 1)
495
496if VBOOT_SLOTS_RW_AB && VBOOT_STARTS_BEFORE_BOOTBLOCK
497
498config RWA_REGION_ONLY
499 string
500 default "apu/amdfw_a"
501 help
502 Add a space-delimited list of filenames that should only be in the
503 RW-A section.
504
505config RWB_REGION_ONLY
506 string
507 default "apu/amdfw_b"
508 help
509 Add a space-delimited list of filenames that should only be in the
510 RW-B section.
511
512endif # VBOOT_SLOTS_RW_AB && VBOOT_STARTS_BEFORE_BOOTBLOCK
513
514endif # SOC_AMD_REMBRANDT_BASE