blob: 48d61be038552df231f01b5aad5dd9f53cf9895e [file] [log] [blame]
Felix Held3c44c622022-01-10 20:57:29 +01001# SPDX-License-Identifier: GPL-2.0-only
2
3# TODO: Check if this is still correct
4
Ritul Gurud3dae3d2022-04-04 13:33:01 +05305config SOC_AMD_REMBRANDT_BASE
6 bool
7
Felix Held3c44c622022-01-10 20:57:29 +01008config SOC_AMD_SABRINA
9 bool
Ritul Gurud3dae3d2022-04-04 13:33:01 +053010 select SOC_AMD_REMBRANDT_BASE
Felix Held3c44c622022-01-10 20:57:29 +010011 help
12 AMD Sabrina support
13
Ritul Gurud3dae3d2022-04-04 13:33:01 +053014config SOC_AMD_REMBRANDT
15 bool
16 select SOC_AMD_REMBRANDT_BASE
17 help
18 AMD Rembrandt support
19
20
21if SOC_AMD_REMBRANDT_BASE
Felix Held3c44c622022-01-10 20:57:29 +010022
23config SOC_SPECIFIC_OPTIONS
24 def_bool y
25 select ACPI_SOC_NVS
26 select ARCH_BOOTBLOCK_X86_32
27 select ARCH_VERSTAGE_X86_32 if !VBOOT_STARTS_BEFORE_BOOTBLOCK
28 select ARCH_ROMSTAGE_X86_32
29 select ARCH_RAMSTAGE_X86_32
30 select ARCH_X86
31 select BOOT_DEVICE_SUPPORTS_WRITES if BOOT_DEVICE_SPI_FLASH
32 select CONSOLE_CBMEM_PRINT_PRE_BOOTBLOCK_CONTENTS if VBOOT_STARTS_BEFORE_BOOTBLOCK
33 select DRIVERS_USB_ACPI
Felix Held3c44c622022-01-10 20:57:29 +010034 select DRIVERS_USB_PCI_XHCI
35 select FSP_COMPRESS_FSP_M_LZMA if !ASYNC_FILE_LOADING
36 select FSP_COMPRESS_FSP_M_LZ4 if ASYNC_FILE_LOADING
37 select FSP_COMPRESS_FSP_S_LZ4
38 select GENERIC_GPIO_LIB
39 select HAVE_ACPI_TABLES
40 select HAVE_CF9_RESET
41 select HAVE_EM100_SUPPORT
42 select HAVE_FSP_GOP
43 select HAVE_SMI_HANDLER
44 select IDT_IN_EVERY_STAGE
45 select PARALLEL_MP_AP_WORK
46 select PLATFORM_USES_FSP2_0
47 select PROVIDES_ROM_SHARING
48 select PSP_VERSTAGE_CCP_DMA if VBOOT_STARTS_BEFORE_BOOTBLOCK
49 select RESET_VECTOR_IN_RAM
50 select RTC
51 select SOC_AMD_COMMON
Fred Reitberger81d3cde2022-02-10 09:31:26 -050052 select SOC_AMD_COMMON_BLOCK_ACP_GEN2
Felix Held3c44c622022-01-10 20:57:29 +010053 select SOC_AMD_COMMON_BLOCK_ACPI # TODO: Check if this is still correct
Felix Held70f32bb2022-02-04 16:23:47 +010054 select SOC_AMD_COMMON_BLOCK_ACPIMMIO
Felix Held3c44c622022-01-10 20:57:29 +010055 select SOC_AMD_COMMON_BLOCK_ACPI_ALIB # TODO: Check if this is still correct
Felix Heldaf803a62022-06-22 18:22:16 +020056 select SOC_AMD_COMMON_BLOCK_ACPI_GPIO
Felix Held3c44c622022-01-10 20:57:29 +010057 select SOC_AMD_COMMON_BLOCK_ACPI_IVRS # TODO: Check if this is still correct
Felix Held716ccb72022-02-03 18:27:29 +010058 select SOC_AMD_COMMON_BLOCK_AOAC
Felix Held3c44c622022-01-10 20:57:29 +010059 select SOC_AMD_COMMON_BLOCK_APOB # TODO: Check if this is still correct
60 select SOC_AMD_COMMON_BLOCK_BANKED_GPIOS # TODO: Check if this is still correct
Felix Held75739d32022-02-03 18:44:27 +010061 select SOC_AMD_COMMON_BLOCK_DATA_FABRIC
Karthikeyan Ramasubramanian4a8bbea2022-03-25 13:49:36 -060062 select SOC_AMD_COMMON_BLOCK_ESPI_RETAIN_PORT80_EN # TODO: Remove(b/227201571)
Felix Held3c44c622022-01-10 20:57:29 +010063 select SOC_AMD_COMMON_BLOCK_GRAPHICS # TODO: Check if this is still correct
64 select SOC_AMD_COMMON_BLOCK_HAS_ESPI # TODO: Check if this is still correct
Raul E Rangel5a5de332022-04-25 13:33:50 -060065 select SOC_AMD_COMMON_BLOCK_HAS_ESPI_ALERT_ENABLE
Felix Held8e4742d2022-02-03 15:15:37 +010066 select SOC_AMD_COMMON_BLOCK_I2C
Felix Held3bdbdb72022-02-02 22:55:34 +010067 select SOC_AMD_COMMON_BLOCK_I23C_PAD_CTRL
Felix Held0eef54b2022-02-04 19:28:51 +010068 select SOC_AMD_COMMON_BLOCK_IOMMU
Felix Held3c44c622022-01-10 20:57:29 +010069 select SOC_AMD_COMMON_BLOCK_LPC # TODO: Check if this is still correct
Felix Held901481f2022-06-22 15:38:44 +020070 select SOC_AMD_COMMON_BLOCK_MCAX
Felix Held3c44c622022-01-10 20:57:29 +010071 select SOC_AMD_COMMON_BLOCK_NONCAR # TODO: Check if this is still correct
72 select SOC_AMD_COMMON_BLOCK_PCI # TODO: Check if this is still correct
Felix Heldceefc742022-02-07 15:27:27 +010073 select SOC_AMD_COMMON_BLOCK_PCI_MMCONF
Felix Held3c44c622022-01-10 20:57:29 +010074 select SOC_AMD_COMMON_BLOCK_PCIE_GPP_DRIVER # TODO: Check if this is still correct
75 select SOC_AMD_COMMON_BLOCK_PM # TODO: Check if this is still correct
76 select SOC_AMD_COMMON_BLOCK_PM_CHIPSET_STATE_SAVE # TODO: Check if this is still correct
77 select SOC_AMD_COMMON_BLOCK_PSP_GEN2 # TODO: Check if this is still correct
78 select SOC_AMD_COMMON_BLOCK_SMBUS # TODO: Check if this is still correct
79 select SOC_AMD_COMMON_BLOCK_SMI # TODO: Check if this is still correct
80 select SOC_AMD_COMMON_BLOCK_SMM # TODO: Check if this is still correct
Felix Held6f9e4ab2022-02-03 18:34:23 +010081 select SOC_AMD_COMMON_BLOCK_SMU
Felix Held3c44c622022-01-10 20:57:29 +010082 select SOC_AMD_COMMON_BLOCK_SPI # TODO: Check if this is still correct
83 select SOC_AMD_COMMON_BLOCK_TSC_FAM17H_19H # TODO: Check if this is still correct
Felix Heldb0789ed2022-02-04 22:36:32 +010084 select SOC_AMD_COMMON_BLOCK_UART
Felix Heldd9bb9fc2022-06-22 15:35:35 +020085 select SOC_AMD_COMMON_BLOCK_UCODE
Felix Held3c44c622022-01-10 20:57:29 +010086 select SOC_AMD_COMMON_FSP_DMI_TABLES # TODO: Check if this is still correct
87 select SOC_AMD_COMMON_FSP_PCI # TODO: Check if this is still correct
88 select SSE2
89 select UDK_2017_BINDING
Subrata Banik34f26b22022-02-10 12:38:02 +053090 select USE_FSP_NOTIFY_PHASE_POST_PCI_ENUM
91 select USE_FSP_NOTIFY_PHASE_READY_TO_BOOT
92 select USE_FSP_NOTIFY_PHASE_END_OF_FIRMWARE
Felix Held3c44c622022-01-10 20:57:29 +010093 select VBOOT_DEFINE_WIDEVINE_COUNTERS if VBOOT_STARTS_BEFORE_BOOTBLOCK
94 select X86_AMD_FIXED_MTRRS
95 select X86_INIT_NEED_1_SIPI
96
97config ARCH_ALL_STAGES_X86
98 default n
99
Felix Held3c44c622022-01-10 20:57:29 +0100100config CHIPSET_DEVICETREE
101 string
Ritul Gurud3dae3d2022-04-04 13:33:01 +0530102 default "soc/amd/sabrina/chipset_sabrina.cb" if SOC_AMD_SABRINA
103 default "soc/amd/sabrina/chipset_rembrandt.cb"
Felix Held3c44c622022-01-10 20:57:29 +0100104
105config EARLY_RESERVED_DRAM_BASE
106 hex
107 default 0x2000000
108 help
109 This variable defines the base address of the DRAM which is reserved
110 for usage by coreboot in early stages (i.e. before ramstage is up).
111 This memory gets reserved in BIOS tables to ensure that the OS does
112 not use it, thus preventing corruption of OS memory in case of S3
113 resume.
114
115config EARLYRAM_BSP_STACK_SIZE
116 hex
117 default 0x1000
118
119config PSP_APOB_DRAM_ADDRESS
120 hex
121 default 0x2001000
122 help
123 Location in DRAM where the PSP will copy the AGESA PSP Output
124 Block.
125
Fred Reitberger475e2822022-07-14 11:06:30 -0400126config PSP_APOB_DRAM_SIZE
127 hex
128 default 0x20000
129
Felix Held3c44c622022-01-10 20:57:29 +0100130config PSP_SHAREDMEM_BASE
131 hex
Fred Reitberger475e2822022-07-14 11:06:30 -0400132 default 0x2021000 if VBOOT
Felix Held3c44c622022-01-10 20:57:29 +0100133 default 0x0
134 help
135 This variable defines the base address in DRAM memory where PSP copies
136 the vboot workbuf. This is used in the linker script to have a static
137 allocation for the buffer as well as for adding relevant entries in
138 the BIOS directory table for the PSP.
139
140config PSP_SHAREDMEM_SIZE
141 hex
142 default 0x8000 if VBOOT
143 default 0x0
144 help
145 Sets the maximum size for the PSP to pass the vboot workbuf and
146 any logs or timestamps back to coreboot. This will be copied
147 into main memory by the PSP and will be available when the x86 is
148 started. The workbuf's base depends on the address of the reset
149 vector.
150
Felix Held55614682022-01-25 04:31:15 +0100151config PRE_X86_CBMEM_CONSOLE_SIZE
152 hex
153 default 0x1600
154 help
155 Size of the CBMEM console used in PSP verstage.
156
Felix Held3c44c622022-01-10 20:57:29 +0100157config PRERAM_CBMEM_CONSOLE_SIZE
158 hex
159 default 0x1600
160 help
161 Increase this value if preram cbmem console is getting truncated
162
163config CBFS_MCACHE_SIZE
164 hex
165 default 0x2000 if VBOOT_STARTS_BEFORE_BOOTBLOCK
166
167config C_ENV_BOOTBLOCK_SIZE
168 hex
169 default 0x10000
170 help
171 Sets the size of the bootblock stage that should be loaded in DRAM.
172 This variable controls the DRAM allocation size in linker script
173 for bootblock stage.
174
175config ROMSTAGE_ADDR
176 hex
177 default 0x2040000
178 help
179 Sets the address in DRAM where romstage should be loaded.
180
181config ROMSTAGE_SIZE
182 hex
183 default 0x80000
184 help
185 Sets the size of DRAM allocation for romstage in linker script.
186
187config FSP_M_ADDR
188 hex
189 default 0x20C0000
190 help
191 Sets the address in DRAM where FSP-M should be loaded. cbfstool
192 performs relocation of FSP-M to this address.
193
194config FSP_M_SIZE
195 hex
196 default 0xC0000
197 help
198 Sets the size of DRAM allocation for FSP-M in linker script.
199
200config FSP_TEMP_RAM_SIZE
201 hex
202 default 0x40000
203 help
204 The amount of coreboot-allocated heap and stack usage by the FSP.
205
206config VERSTAGE_ADDR
207 hex
208 depends on VBOOT_SEPARATE_VERSTAGE
209 default 0x2180000
210 help
211 Sets the address in DRAM where verstage should be loaded if running
212 as a separate stage on x86.
213
214config VERSTAGE_SIZE
215 hex
216 depends on VBOOT_SEPARATE_VERSTAGE
217 default 0x80000
218 help
219 Sets the size of DRAM allocation for verstage in linker script if
220 running as a separate stage on x86.
221
222config ASYNC_FILE_LOADING
223 bool "Loads files from SPI asynchronously"
224 select COOP_MULTITASKING
225 select SOC_AMD_COMMON_BLOCK_LPC_SPI_DMA
226 select CBFS_PRELOAD
227 help
228 When enabled, the platform will use the LPC SPI DMA controller to
229 asynchronously load contents from the SPI ROM. This will improve
230 boot time because the CPUs can be performing useful work while the
231 SPI contents are being preloaded.
232
233config CBFS_CACHE_SIZE
234 hex
235 default 0x40000 if CBFS_PRELOAD
236
Felix Held3c44c622022-01-10 20:57:29 +0100237config RO_REGION_ONLY
238 string
239 depends on VBOOT_SLOTS_RW_AB || VBOOT_SLOTS_RW_A
240 default "apu/amdfw"
241
242config ECAM_MMCONF_BASE_ADDRESS
243 default 0xF8000000
244
245config ECAM_MMCONF_BUS_NUMBER
246 default 64
247
248config MAX_CPUS
249 int
Ritul Gurud3dae3d2022-04-04 13:33:01 +0530250 default 8 if SOC_AMD_SABRINA
251 default 16
Felix Held3c44c622022-01-10 20:57:29 +0100252 help
253 Maximum number of threads the platform can have.
254
255config CONSOLE_UART_BASE_ADDRESS
256 depends on CONSOLE_SERIAL && AMD_SOC_CONSOLE_UART
257 hex
258 default 0xfedc9000 if UART_FOR_CONSOLE = 0
259 default 0xfedca000 if UART_FOR_CONSOLE = 1
Felix Heldb1fe9de2022-01-12 23:18:54 +0100260 default 0xfedce000 if UART_FOR_CONSOLE = 2
261 default 0xfedcf000 if UART_FOR_CONSOLE = 3
262 default 0xfedd1000 if UART_FOR_CONSOLE = 4
Felix Held3c44c622022-01-10 20:57:29 +0100263
264config SMM_TSEG_SIZE
265 hex
266 default 0x800000 if HAVE_SMI_HANDLER
267 default 0x0
268
269config SMM_RESERVED_SIZE
270 hex
271 default 0x180000
272
273config SMM_MODULE_STACK_SIZE
274 hex
275 default 0x800
276
277config ACPI_BERT
278 bool "Build ACPI BERT Table"
279 default y
280 depends on HAVE_ACPI_TABLES
281 help
282 Report Machine Check errors identified in POST to the OS in an
283 ACPI Boot Error Record Table.
284
285config ACPI_BERT_SIZE
286 hex
287 default 0x4000 if ACPI_BERT
288 default 0x0
289 help
290 Specify the amount of DRAM reserved for gathering the data used to
291 generate the ACPI table.
292
293config DRIVERS_I2C_DESIGNWARE_CLOCK_MHZ
294 int
295 default 150
296
297config DISABLE_SPI_FLASH_ROM_SHARING
298 def_bool n
299 help
300 Instruct the chipset to not honor the EGPIO67_SPI_ROM_REQ pin
301 which indicates a board level ROM transaction request. This
302 removes arbitration with board and assumes the chipset controls
303 the SPI flash bus entirely.
304
305config DISABLE_KEYBOARD_RESET_PIN
306 bool
307 help
308 Instruct the SoC to not use the state of GPIO_129 as keyboard reset
309 signal. When this pin is used as GPIO and the keyboard reset
310 functionality isn't disabled, configuring it as an output and driving
311 it as 0 will cause a reset.
312
313config ACPI_SSDT_PSD_INDEPENDENT
314 bool "Allow core p-state independent transitions"
315 default y
316 help
317 AMD recommends the ACPI _PSD object to be configured to cause
318 cores to transition between p-states independently. A vendor may
319 choose to generate _PSD object to allow cores to transition together.
320
321menu "PSP Configuration Options"
322
323config AMD_FWM_POSITION_INDEX
324 int "Firmware Directory Table location (0 to 5)"
325 range 0 5
326 default 0 if BOARD_ROMSIZE_KB_512
327 default 1 if BOARD_ROMSIZE_KB_1024
328 default 2 if BOARD_ROMSIZE_KB_2048
329 default 3 if BOARD_ROMSIZE_KB_4096
330 default 4 if BOARD_ROMSIZE_KB_8192
331 default 5 if BOARD_ROMSIZE_KB_16384
332 help
333 Typically this is calculated by the ROM size, but there may
334 be situations where you want to put the firmware directory
335 table in a different location.
336 0: 512 KB - 0xFFFA0000
337 1: 1 MB - 0xFFF20000
338 2: 2 MB - 0xFFE20000
339 3: 4 MB - 0xFFC20000
340 4: 8 MB - 0xFF820000
341 5: 16 MB - 0xFF020000
342
343comment "AMD Firmware Directory Table set to location for 512KB ROM"
344 depends on AMD_FWM_POSITION_INDEX = 0
345comment "AMD Firmware Directory Table set to location for 1MB ROM"
346 depends on AMD_FWM_POSITION_INDEX = 1
347comment "AMD Firmware Directory Table set to location for 2MB ROM"
348 depends on AMD_FWM_POSITION_INDEX = 2
349comment "AMD Firmware Directory Table set to location for 4MB ROM"
350 depends on AMD_FWM_POSITION_INDEX = 3
351comment "AMD Firmware Directory Table set to location for 8MB ROM"
352 depends on AMD_FWM_POSITION_INDEX = 4
353comment "AMD Firmware Directory Table set to location for 16MB ROM"
354 depends on AMD_FWM_POSITION_INDEX = 5
355
356config AMDFW_CONFIG_FILE
Karthikeyan Ramasubramanian9cb0a052022-03-21 17:49:11 -0600357 string "AMD PSP Firmware config file"
Felix Held3c44c622022-01-10 20:57:29 +0100358 default "src/soc/amd/sabrina/fw.cfg"
Karthikeyan Ramasubramanian9cb0a052022-03-21 17:49:11 -0600359 help
360 Specify the path/location of AMD PSP Firmware config file.
Felix Held3c44c622022-01-10 20:57:29 +0100361
362config PSP_DISABLE_POSTCODES
363 bool "Disable PSP post codes"
364 help
365 Disables the output of port80 post codes from PSP.
366
367config PSP_POSTCODES_ON_ESPI
368 bool "Use eSPI bus for PSP post codes"
369 default y
370 depends on !PSP_DISABLE_POSTCODES
371 help
372 Select to send PSP port80 post codes on eSPI bus.
373 If not selected, PSP port80 codes will be sent on LPC bus.
374
375config PSP_LOAD_MP2_FW
376 bool
377 default n
378 help
379 Include the MP2 firmwares and configuration into the PSP build.
380
381 If unsure, answer 'n'
382
383config PSP_UNLOCK_SECURE_DEBUG
384 bool "Unlock secure debug"
385 default y
386 help
387 Select this item to enable secure debug options in PSP.
388
389config HAVE_PSP_WHITELIST_FILE
390 bool "Include a debug whitelist file in PSP build"
391 default n
392 help
393 Support secured unlock prior to reset using a whitelisted
394 serial number. This feature requires a signed whitelist image
395 and bootloader from AMD.
396
397 If unsure, answer 'n'
398
399config PSP_WHITELIST_FILE
400 string "Debug whitelist file path"
401 depends on HAVE_PSP_WHITELIST_FILE
402 default "3rdparty/amd_blobs/cezanne/PSP/wtl-czn.sbin"
403
Karthikeyan Ramasubramanian8ee94292022-04-01 17:21:14 -0600404config HAVE_SPL_FILE
405 bool "Have a mainboard specific SPL table file"
406 default n
407 help
408 Have a mainboard specific Security Patch Level (SPL) table file. SPL file
409 is required to support PSP FW anti-rollback and needs to be created by AMD.
410 The default SPL file applies to all boards that use the concerned SoC and
411 is dropped under 3rdparty/blobs. The mainboard specific SPL file override
412 can be applied through SPL_TABLE_FILE config.
413
414 If unsure, answer 'n'
415
416config SPL_TABLE_FILE
417 string "SPL table file"
418 depends on HAVE_SPL_FILE
419 default "3rdparty/amd_blobs/cezanne/PSP/TypeId0x55_SplTableBl_CZN.sbin"
420
Felix Held3c44c622022-01-10 20:57:29 +0100421config PSP_SOFTFUSE_BITS
422 string "PSP Soft Fuse bits to enable"
Felix Helded694502022-06-22 15:09:23 +0200423 default "34 28 6"
Felix Held3c44c622022-01-10 20:57:29 +0100424 help
425 Space separated list of Soft Fuse bits to enable.
426 Bit 0: Enable secure debug (Set by PSP_UNLOCK_SECURE_DEBUG)
427 Bit 7: Disable PSP postcodes on Renoir and newer chips only
428 (Set by PSP_DISABLE_PORT80)
Felix Heldc3579002022-03-23 22:15:56 +0100429 Bit 15: PSP debug output destination:
430 0=SoC MMIO UART, 1=IO port 0x3F8
Felix Held3c44c622022-01-10 20:57:29 +0100431 Bit 29: Disable MP2 firmware loading (Set by PSP_LOAD_MP2_FW)
432
433 See #55758 (NDA) for additional bit definitions.
434
435config PSP_VERSTAGE_FILE
436 string "Specify the PSP_verstage file path"
437 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
438 default "\$(obj)/psp_verstage.bin"
439 help
440 Add psp_verstage file to the build & PSP Directory Table
441
442config PSP_VERSTAGE_SIGNING_TOKEN
443 string "Specify the PSP_verstage Signature Token file path"
444 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
445 default ""
446 help
447 Add psp_verstage signature token to the build & PSP Directory Table
448
449endmenu
450
451config VBOOT
452 select VBOOT_VBNV_CMOS
453 select VBOOT_VBNV_CMOS_BACKUP_TO_FLASH
454
455config VBOOT_STARTS_BEFORE_BOOTBLOCK
456 def_bool n
457 depends on VBOOT
458 select ARCH_VERSTAGE_ARMV7
459 help
460 Runs verstage on the PSP. Only available on
Jon Murphyc4e90452022-06-28 10:36:23 -0600461 certain ChromeOS branded parts from AMD.
Felix Held3c44c622022-01-10 20:57:29 +0100462
463config VBOOT_HASH_BLOCK_SIZE
464 hex
465 default 0x9000
466 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
467 help
468 Because the bulk of the time in psp_verstage to hash the RO cbfs is
469 spent in the overhead of doing svc calls, increasing the hash block
470 size significantly cuts the verstage hashing time as seen below.
471
472 4k takes 180ms
473 16k takes 44ms
474 32k takes 33.7ms
475 36k takes 32.5ms
476 There's actually still room for an even bigger stack, but we've
477 reached a point of diminishing returns.
478
479config CMOS_RECOVERY_BYTE
480 hex
481 default 0x51
482 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
483 help
484 If the workbuf is not passed from the PSP to coreboot, set the
485 recovery flag and reboot. The PSP will read this byte, mark the
486 recovery request in VBNV, and reset the system into recovery mode.
487
488 This is the byte before the default first byte used by VBNV
489 (0x26 + 0x0E - 1)
490
491if VBOOT_SLOTS_RW_AB && VBOOT_STARTS_BEFORE_BOOTBLOCK
492
493config RWA_REGION_ONLY
494 string
495 default "apu/amdfw_a"
496 help
497 Add a space-delimited list of filenames that should only be in the
498 RW-A section.
499
500config RWB_REGION_ONLY
501 string
502 default "apu/amdfw_b"
503 help
504 Add a space-delimited list of filenames that should only be in the
505 RW-B section.
506
507endif # VBOOT_SLOTS_RW_AB && VBOOT_STARTS_BEFORE_BOOTBLOCK
508
Ritul Gurud3dae3d2022-04-04 13:33:01 +0530509endif # SOC_AMD_REMBRANDT_BASE