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