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