blob: ba15e469e1336f85a53d4024c820ec727e9340f5 [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
5config SOC_AMD_SABRINA
6 bool
7 help
8 AMD Sabrina support
9
10if SOC_AMD_SABRINA
11
12config SOC_SPECIFIC_OPTIONS
13 def_bool y
14 select ACPI_SOC_NVS
15 select ARCH_BOOTBLOCK_X86_32
16 select ARCH_VERSTAGE_X86_32 if !VBOOT_STARTS_BEFORE_BOOTBLOCK
17 select ARCH_ROMSTAGE_X86_32
18 select ARCH_RAMSTAGE_X86_32
19 select ARCH_X86
20 select BOOT_DEVICE_SUPPORTS_WRITES if BOOT_DEVICE_SPI_FLASH
21 select CONSOLE_CBMEM_PRINT_PRE_BOOTBLOCK_CONTENTS if VBOOT_STARTS_BEFORE_BOOTBLOCK
22 select DRIVERS_USB_ACPI
Felix Held3c44c622022-01-10 20:57:29 +010023 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
34 select PARALLEL_MP_AP_WORK
35 select PLATFORM_USES_FSP2_0
36 select PROVIDES_ROM_SHARING
37 select PSP_VERSTAGE_CCP_DMA if VBOOT_STARTS_BEFORE_BOOTBLOCK
38 select RESET_VECTOR_IN_RAM
39 select RTC
40 select SOC_AMD_COMMON
Fred Reitberger81d3cde2022-02-10 09:31:26 -050041 select SOC_AMD_COMMON_BLOCK_ACP_GEN2
Felix Held3c44c622022-01-10 20:57:29 +010042 select SOC_AMD_COMMON_BLOCK_ACPI # TODO: Check if this is still correct
Felix Held70f32bb2022-02-04 16:23:47 +010043 select SOC_AMD_COMMON_BLOCK_ACPIMMIO
Felix Held3c44c622022-01-10 20:57:29 +010044 select SOC_AMD_COMMON_BLOCK_ACPI_ALIB # TODO: Check if this is still correct
45 select SOC_AMD_COMMON_BLOCK_ACPI_GPIO # TODO: Check if this is still correct
46 select SOC_AMD_COMMON_BLOCK_ACPI_IVRS # TODO: Check if this is still correct
Felix Held716ccb72022-02-03 18:27:29 +010047 select SOC_AMD_COMMON_BLOCK_AOAC
Felix Held3c44c622022-01-10 20:57:29 +010048 select SOC_AMD_COMMON_BLOCK_APOB # TODO: Check if this is still correct
49 select SOC_AMD_COMMON_BLOCK_BANKED_GPIOS # TODO: Check if this is still correct
Felix Held75739d32022-02-03 18:44:27 +010050 select SOC_AMD_COMMON_BLOCK_DATA_FABRIC
Karthikeyan Ramasubramanian4a8bbea2022-03-25 13:49:36 -060051 select SOC_AMD_COMMON_BLOCK_ESPI_RETAIN_PORT80_EN # TODO: Remove(b/227201571)
Felix Held3c44c622022-01-10 20:57:29 +010052 select SOC_AMD_COMMON_BLOCK_GRAPHICS # TODO: Check if this is still correct
53 select SOC_AMD_COMMON_BLOCK_HAS_ESPI # TODO: Check if this is still correct
Raul E Rangel5a5de332022-04-25 13:33:50 -060054 select SOC_AMD_COMMON_BLOCK_HAS_ESPI_ALERT_ENABLE
Felix Held8e4742d2022-02-03 15:15:37 +010055 select SOC_AMD_COMMON_BLOCK_I2C
Felix Held3bdbdb72022-02-02 22:55:34 +010056 select SOC_AMD_COMMON_BLOCK_I23C_PAD_CTRL
Felix Held0eef54b2022-02-04 19:28:51 +010057 select SOC_AMD_COMMON_BLOCK_IOMMU
Felix Held3c44c622022-01-10 20:57:29 +010058 select SOC_AMD_COMMON_BLOCK_LPC # TODO: Check if this is still correct
59 select SOC_AMD_COMMON_BLOCK_MCAX # TODO: Check if this is still correct
60 select SOC_AMD_COMMON_BLOCK_NONCAR # TODO: Check if this is still correct
61 select SOC_AMD_COMMON_BLOCK_PCI # TODO: Check if this is still correct
Felix Heldceefc742022-02-07 15:27:27 +010062 select SOC_AMD_COMMON_BLOCK_PCI_MMCONF
Felix Held3c44c622022-01-10 20:57:29 +010063 select SOC_AMD_COMMON_BLOCK_PCIE_GPP_DRIVER # TODO: Check if this is still correct
64 select SOC_AMD_COMMON_BLOCK_PM # TODO: Check if this is still correct
65 select SOC_AMD_COMMON_BLOCK_PM_CHIPSET_STATE_SAVE # TODO: Check if this is still correct
66 select SOC_AMD_COMMON_BLOCK_PSP_GEN2 # TODO: Check if this is still correct
67 select SOC_AMD_COMMON_BLOCK_SMBUS # TODO: Check if this is still correct
68 select SOC_AMD_COMMON_BLOCK_SMI # TODO: Check if this is still correct
69 select SOC_AMD_COMMON_BLOCK_SMM # TODO: Check if this is still correct
Felix Held6f9e4ab2022-02-03 18:34:23 +010070 select SOC_AMD_COMMON_BLOCK_SMU
Felix Held3c44c622022-01-10 20:57:29 +010071 select SOC_AMD_COMMON_BLOCK_SPI # TODO: Check if this is still correct
72 select SOC_AMD_COMMON_BLOCK_TSC_FAM17H_19H # TODO: Check if this is still correct
Felix Heldb0789ed2022-02-04 22:36:32 +010073 select SOC_AMD_COMMON_BLOCK_UART
Felix Heldd9bb9fc2022-06-22 15:35:35 +020074 select SOC_AMD_COMMON_BLOCK_UCODE
Felix Held3c44c622022-01-10 20:57:29 +010075 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
77 select SSE2
78 select UDK_2017_BINDING
Subrata Banik34f26b22022-02-10 12:38:02 +053079 select USE_FSP_NOTIFY_PHASE_POST_PCI_ENUM
80 select USE_FSP_NOTIFY_PHASE_READY_TO_BOOT
81 select USE_FSP_NOTIFY_PHASE_END_OF_FIRMWARE
Felix Held3c44c622022-01-10 20:57:29 +010082 select VBOOT_DEFINE_WIDEVINE_COUNTERS if VBOOT_STARTS_BEFORE_BOOTBLOCK
83 select X86_AMD_FIXED_MTRRS
84 select X86_INIT_NEED_1_SIPI
85
86config ARCH_ALL_STAGES_X86
87 default n
88
Felix Held3c44c622022-01-10 20:57:29 +010089config CHIPSET_DEVICETREE
90 string
91 default "soc/amd/sabrina/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_SHAREDMEM_BASE
115 hex
116 default 0x2011000 if VBOOT
117 default 0x0
118 help
119 This variable defines the base address in DRAM memory where PSP copies
120 the vboot workbuf. This is used in the linker script to have a static
121 allocation for the buffer as well as for adding relevant entries in
122 the BIOS directory table for the PSP.
123
124config PSP_SHAREDMEM_SIZE
125 hex
126 default 0x8000 if VBOOT
127 default 0x0
128 help
129 Sets the maximum size for the PSP to pass the vboot workbuf and
130 any logs or timestamps back to coreboot. This will be copied
131 into main memory by the PSP and will be available when the x86 is
132 started. The workbuf's base depends on the address of the reset
133 vector.
134
Felix Held55614682022-01-25 04:31:15 +0100135config PRE_X86_CBMEM_CONSOLE_SIZE
136 hex
137 default 0x1600
138 help
139 Size of the CBMEM console used in PSP verstage.
140
Felix Held3c44c622022-01-10 20:57:29 +0100141config PRERAM_CBMEM_CONSOLE_SIZE
142 hex
143 default 0x1600
144 help
145 Increase this value if preram cbmem console is getting truncated
146
147config CBFS_MCACHE_SIZE
148 hex
149 default 0x2000 if VBOOT_STARTS_BEFORE_BOOTBLOCK
150
151config C_ENV_BOOTBLOCK_SIZE
152 hex
153 default 0x10000
154 help
155 Sets the size of the bootblock stage that should be loaded in DRAM.
156 This variable controls the DRAM allocation size in linker script
157 for bootblock stage.
158
159config ROMSTAGE_ADDR
160 hex
161 default 0x2040000
162 help
163 Sets the address in DRAM where romstage should be loaded.
164
165config ROMSTAGE_SIZE
166 hex
167 default 0x80000
168 help
169 Sets the size of DRAM allocation for romstage in linker script.
170
171config FSP_M_ADDR
172 hex
173 default 0x20C0000
174 help
175 Sets the address in DRAM where FSP-M should be loaded. cbfstool
176 performs relocation of FSP-M to this address.
177
178config FSP_M_SIZE
179 hex
180 default 0xC0000
181 help
182 Sets the size of DRAM allocation for FSP-M in linker script.
183
184config FSP_TEMP_RAM_SIZE
185 hex
186 default 0x40000
187 help
188 The amount of coreboot-allocated heap and stack usage by the FSP.
189
190config VERSTAGE_ADDR
191 hex
192 depends on VBOOT_SEPARATE_VERSTAGE
193 default 0x2180000
194 help
195 Sets the address in DRAM where verstage should be loaded if running
196 as a separate stage on x86.
197
198config VERSTAGE_SIZE
199 hex
200 depends on VBOOT_SEPARATE_VERSTAGE
201 default 0x80000
202 help
203 Sets the size of DRAM allocation for verstage in linker script if
204 running as a separate stage on x86.
205
206config ASYNC_FILE_LOADING
207 bool "Loads files from SPI asynchronously"
208 select COOP_MULTITASKING
209 select SOC_AMD_COMMON_BLOCK_LPC_SPI_DMA
210 select CBFS_PRELOAD
211 help
212 When enabled, the platform will use the LPC SPI DMA controller to
213 asynchronously load contents from the SPI ROM. This will improve
214 boot time because the CPUs can be performing useful work while the
215 SPI contents are being preloaded.
216
217config CBFS_CACHE_SIZE
218 hex
219 default 0x40000 if CBFS_PRELOAD
220
Felix Held3c44c622022-01-10 20:57:29 +0100221config RO_REGION_ONLY
222 string
223 depends on VBOOT_SLOTS_RW_AB || VBOOT_SLOTS_RW_A
224 default "apu/amdfw"
225
226config ECAM_MMCONF_BASE_ADDRESS
227 default 0xF8000000
228
229config ECAM_MMCONF_BUS_NUMBER
230 default 64
231
232config MAX_CPUS
233 int
Felix Heldd40e8b62022-02-07 17:25:44 +0100234 default 8
Felix Held3c44c622022-01-10 20:57:29 +0100235 help
236 Maximum number of threads the platform can have.
237
238config CONSOLE_UART_BASE_ADDRESS
239 depends on CONSOLE_SERIAL && AMD_SOC_CONSOLE_UART
240 hex
241 default 0xfedc9000 if UART_FOR_CONSOLE = 0
242 default 0xfedca000 if UART_FOR_CONSOLE = 1
Felix Heldb1fe9de2022-01-12 23:18:54 +0100243 default 0xfedce000 if UART_FOR_CONSOLE = 2
244 default 0xfedcf000 if UART_FOR_CONSOLE = 3
245 default 0xfedd1000 if UART_FOR_CONSOLE = 4
Felix Held3c44c622022-01-10 20:57:29 +0100246
247config SMM_TSEG_SIZE
248 hex
249 default 0x800000 if HAVE_SMI_HANDLER
250 default 0x0
251
252config SMM_RESERVED_SIZE
253 hex
254 default 0x180000
255
256config SMM_MODULE_STACK_SIZE
257 hex
258 default 0x800
259
260config ACPI_BERT
261 bool "Build ACPI BERT Table"
262 default y
263 depends on HAVE_ACPI_TABLES
264 help
265 Report Machine Check errors identified in POST to the OS in an
266 ACPI Boot Error Record Table.
267
268config ACPI_BERT_SIZE
269 hex
270 default 0x4000 if ACPI_BERT
271 default 0x0
272 help
273 Specify the amount of DRAM reserved for gathering the data used to
274 generate the ACPI table.
275
276config DRIVERS_I2C_DESIGNWARE_CLOCK_MHZ
277 int
278 default 150
279
280config DISABLE_SPI_FLASH_ROM_SHARING
281 def_bool n
282 help
283 Instruct the chipset to not honor the EGPIO67_SPI_ROM_REQ pin
284 which indicates a board level ROM transaction request. This
285 removes arbitration with board and assumes the chipset controls
286 the SPI flash bus entirely.
287
288config DISABLE_KEYBOARD_RESET_PIN
289 bool
290 help
291 Instruct the SoC to not use the state of GPIO_129 as keyboard reset
292 signal. When this pin is used as GPIO and the keyboard reset
293 functionality isn't disabled, configuring it as an output and driving
294 it as 0 will cause a reset.
295
296config ACPI_SSDT_PSD_INDEPENDENT
297 bool "Allow core p-state independent transitions"
298 default y
299 help
300 AMD recommends the ACPI _PSD object to be configured to cause
301 cores to transition between p-states independently. A vendor may
302 choose to generate _PSD object to allow cores to transition together.
303
304menu "PSP Configuration Options"
305
306config AMD_FWM_POSITION_INDEX
307 int "Firmware Directory Table location (0 to 5)"
308 range 0 5
309 default 0 if BOARD_ROMSIZE_KB_512
310 default 1 if BOARD_ROMSIZE_KB_1024
311 default 2 if BOARD_ROMSIZE_KB_2048
312 default 3 if BOARD_ROMSIZE_KB_4096
313 default 4 if BOARD_ROMSIZE_KB_8192
314 default 5 if BOARD_ROMSIZE_KB_16384
315 help
316 Typically this is calculated by the ROM size, but there may
317 be situations where you want to put the firmware directory
318 table in a different location.
319 0: 512 KB - 0xFFFA0000
320 1: 1 MB - 0xFFF20000
321 2: 2 MB - 0xFFE20000
322 3: 4 MB - 0xFFC20000
323 4: 8 MB - 0xFF820000
324 5: 16 MB - 0xFF020000
325
326comment "AMD Firmware Directory Table set to location for 512KB ROM"
327 depends on AMD_FWM_POSITION_INDEX = 0
328comment "AMD Firmware Directory Table set to location for 1MB ROM"
329 depends on AMD_FWM_POSITION_INDEX = 1
330comment "AMD Firmware Directory Table set to location for 2MB ROM"
331 depends on AMD_FWM_POSITION_INDEX = 2
332comment "AMD Firmware Directory Table set to location for 4MB ROM"
333 depends on AMD_FWM_POSITION_INDEX = 3
334comment "AMD Firmware Directory Table set to location for 8MB ROM"
335 depends on AMD_FWM_POSITION_INDEX = 4
336comment "AMD Firmware Directory Table set to location for 16MB ROM"
337 depends on AMD_FWM_POSITION_INDEX = 5
338
339config AMDFW_CONFIG_FILE
Karthikeyan Ramasubramanian9cb0a052022-03-21 17:49:11 -0600340 string "AMD PSP Firmware config file"
Felix Held3c44c622022-01-10 20:57:29 +0100341 default "src/soc/amd/sabrina/fw.cfg"
Karthikeyan Ramasubramanian9cb0a052022-03-21 17:49:11 -0600342 help
343 Specify the path/location of AMD PSP Firmware config file.
Felix Held3c44c622022-01-10 20:57:29 +0100344
345config PSP_DISABLE_POSTCODES
346 bool "Disable PSP post codes"
347 help
348 Disables the output of port80 post codes from PSP.
349
350config PSP_POSTCODES_ON_ESPI
351 bool "Use eSPI bus for PSP post codes"
352 default y
353 depends on !PSP_DISABLE_POSTCODES
354 help
355 Select to send PSP port80 post codes on eSPI bus.
356 If not selected, PSP port80 codes will be sent on LPC bus.
357
358config PSP_LOAD_MP2_FW
359 bool
360 default n
361 help
362 Include the MP2 firmwares and configuration into the PSP build.
363
364 If unsure, answer 'n'
365
366config PSP_UNLOCK_SECURE_DEBUG
367 bool "Unlock secure debug"
368 default y
369 help
370 Select this item to enable secure debug options in PSP.
371
372config HAVE_PSP_WHITELIST_FILE
373 bool "Include a debug whitelist file in PSP build"
374 default n
375 help
376 Support secured unlock prior to reset using a whitelisted
377 serial number. This feature requires a signed whitelist image
378 and bootloader from AMD.
379
380 If unsure, answer 'n'
381
382config PSP_WHITELIST_FILE
383 string "Debug whitelist file path"
384 depends on HAVE_PSP_WHITELIST_FILE
385 default "3rdparty/amd_blobs/cezanne/PSP/wtl-czn.sbin"
386
Karthikeyan Ramasubramanian8ee94292022-04-01 17:21:14 -0600387config HAVE_SPL_FILE
388 bool "Have a mainboard specific SPL table file"
389 default n
390 help
391 Have a mainboard specific Security Patch Level (SPL) table file. SPL file
392 is required to support PSP FW anti-rollback and needs to be created by AMD.
393 The default SPL file applies to all boards that use the concerned SoC and
394 is dropped under 3rdparty/blobs. The mainboard specific SPL file override
395 can be applied through SPL_TABLE_FILE config.
396
397 If unsure, answer 'n'
398
399config SPL_TABLE_FILE
400 string "SPL table file"
401 depends on HAVE_SPL_FILE
402 default "3rdparty/amd_blobs/cezanne/PSP/TypeId0x55_SplTableBl_CZN.sbin"
403
Felix Held3c44c622022-01-10 20:57:29 +0100404config PSP_SOFTFUSE_BITS
405 string "PSP Soft Fuse bits to enable"
Felix Helded694502022-06-22 15:09:23 +0200406 default "34 28 6"
Felix Held3c44c622022-01-10 20:57:29 +0100407 help
408 Space separated list of Soft Fuse bits to enable.
409 Bit 0: Enable secure debug (Set by PSP_UNLOCK_SECURE_DEBUG)
410 Bit 7: Disable PSP postcodes on Renoir and newer chips only
411 (Set by PSP_DISABLE_PORT80)
Felix Heldc3579002022-03-23 22:15:56 +0100412 Bit 15: PSP debug output destination:
413 0=SoC MMIO UART, 1=IO port 0x3F8
Felix Held3c44c622022-01-10 20:57:29 +0100414 Bit 29: Disable MP2 firmware loading (Set by PSP_LOAD_MP2_FW)
415
416 See #55758 (NDA) for additional bit definitions.
417
418config PSP_VERSTAGE_FILE
419 string "Specify the PSP_verstage file path"
420 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
421 default "\$(obj)/psp_verstage.bin"
422 help
423 Add psp_verstage file to the build & PSP Directory Table
424
425config PSP_VERSTAGE_SIGNING_TOKEN
426 string "Specify the PSP_verstage Signature Token file path"
427 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
428 default ""
429 help
430 Add psp_verstage signature token to the build & PSP Directory Table
431
432endmenu
433
434config VBOOT
435 select VBOOT_VBNV_CMOS
436 select VBOOT_VBNV_CMOS_BACKUP_TO_FLASH
437
438config VBOOT_STARTS_BEFORE_BOOTBLOCK
439 def_bool n
440 depends on VBOOT
441 select ARCH_VERSTAGE_ARMV7
442 help
443 Runs verstage on the PSP. Only available on
444 certain Chrome OS branded parts from AMD.
445
446config VBOOT_HASH_BLOCK_SIZE
447 hex
448 default 0x9000
449 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
450 help
451 Because the bulk of the time in psp_verstage to hash the RO cbfs is
452 spent in the overhead of doing svc calls, increasing the hash block
453 size significantly cuts the verstage hashing time as seen below.
454
455 4k takes 180ms
456 16k takes 44ms
457 32k takes 33.7ms
458 36k takes 32.5ms
459 There's actually still room for an even bigger stack, but we've
460 reached a point of diminishing returns.
461
462config CMOS_RECOVERY_BYTE
463 hex
464 default 0x51
465 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
466 help
467 If the workbuf is not passed from the PSP to coreboot, set the
468 recovery flag and reboot. The PSP will read this byte, mark the
469 recovery request in VBNV, and reset the system into recovery mode.
470
471 This is the byte before the default first byte used by VBNV
472 (0x26 + 0x0E - 1)
473
474if VBOOT_SLOTS_RW_AB && VBOOT_STARTS_BEFORE_BOOTBLOCK
475
476config RWA_REGION_ONLY
477 string
478 default "apu/amdfw_a"
479 help
480 Add a space-delimited list of filenames that should only be in the
481 RW-A section.
482
483config RWB_REGION_ONLY
484 string
485 default "apu/amdfw_b"
486 help
487 Add a space-delimited list of filenames that should only be in the
488 RW-B section.
489
490endif # VBOOT_SLOTS_RW_AB && VBOOT_STARTS_BEFORE_BOOTBLOCK
491
492endif # SOC_AMD_SABRINA