blob: 3df7a4be6e1cb51cce512a5710f971c5d6191d6a [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
23 select DRIVERS_I2C_DESIGNWARE
24 select DRIVERS_USB_PCI_XHCI
25 select FSP_COMPRESS_FSP_M_LZMA if !ASYNC_FILE_LOADING
26 select FSP_COMPRESS_FSP_M_LZ4 if ASYNC_FILE_LOADING
27 select FSP_COMPRESS_FSP_S_LZ4
28 select GENERIC_GPIO_LIB
29 select HAVE_ACPI_TABLES
30 select HAVE_CF9_RESET
31 select HAVE_EM100_SUPPORT
32 select HAVE_FSP_GOP
33 select HAVE_SMI_HANDLER
34 select IDT_IN_EVERY_STAGE
35 select PARALLEL_MP_AP_WORK
36 select PLATFORM_USES_FSP2_0
37 select PROVIDES_ROM_SHARING
38 select PSP_VERSTAGE_CCP_DMA if VBOOT_STARTS_BEFORE_BOOTBLOCK
39 select RESET_VECTOR_IN_RAM
40 select RTC
41 select SOC_AMD_COMMON
Fred Reitberger81d3cde2022-02-10 09:31:26 -050042 select SOC_AMD_COMMON_BLOCK_ACP_GEN2
Felix Held3c44c622022-01-10 20:57:29 +010043 select SOC_AMD_COMMON_BLOCK_ACPI # TODO: Check if this is still correct
Felix Held70f32bb2022-02-04 16:23:47 +010044 select SOC_AMD_COMMON_BLOCK_ACPIMMIO
Felix Held3c44c622022-01-10 20:57:29 +010045 select SOC_AMD_COMMON_BLOCK_ACPI_ALIB # TODO: Check if this is still correct
46 select SOC_AMD_COMMON_BLOCK_ACPI_GPIO # TODO: Check if this is still correct
47 select SOC_AMD_COMMON_BLOCK_ACPI_IVRS # TODO: Check if this is still correct
Felix Held716ccb72022-02-03 18:27:29 +010048 select SOC_AMD_COMMON_BLOCK_AOAC
Felix Held3c44c622022-01-10 20:57:29 +010049 select SOC_AMD_COMMON_BLOCK_APOB # TODO: Check if this is still correct
50 select SOC_AMD_COMMON_BLOCK_BANKED_GPIOS # TODO: Check if this is still correct
Felix Held75739d32022-02-03 18:44:27 +010051 select SOC_AMD_COMMON_BLOCK_DATA_FABRIC
Karthikeyan Ramasubramanian4a8bbea2022-03-25 13:49:36 -060052 select SOC_AMD_COMMON_BLOCK_ESPI_RETAIN_PORT80_EN # TODO: Remove(b/227201571)
Felix Held3c44c622022-01-10 20:57:29 +010053 select SOC_AMD_COMMON_BLOCK_GRAPHICS # TODO: Check if this is still correct
54 select SOC_AMD_COMMON_BLOCK_HAS_ESPI # TODO: Check if this is still correct
Felix Held8e4742d2022-02-03 15:15:37 +010055 select SOC_AMD_COMMON_BLOCK_I2C
Felix Held556d1cc2022-02-02 22:11:52 +010056 select SOC_AMD_COMMON_BLOCK_I2C_PAD_CTRL
Felix Held3bdbdb72022-02-02 22:55:34 +010057 select SOC_AMD_COMMON_BLOCK_I23C_PAD_CTRL
Felix Held0eef54b2022-02-04 19:28:51 +010058 select SOC_AMD_COMMON_BLOCK_IOMMU
Felix Held3c44c622022-01-10 20:57:29 +010059 select SOC_AMD_COMMON_BLOCK_LPC # TODO: Check if this is still correct
60 select SOC_AMD_COMMON_BLOCK_MCAX # TODO: Check if this is still correct
61 select SOC_AMD_COMMON_BLOCK_NONCAR # TODO: Check if this is still correct
62 select SOC_AMD_COMMON_BLOCK_PCI # TODO: Check if this is still correct
Felix Heldceefc742022-02-07 15:27:27 +010063 select SOC_AMD_COMMON_BLOCK_PCI_MMCONF
Felix Held3c44c622022-01-10 20:57:29 +010064 select SOC_AMD_COMMON_BLOCK_PCIE_GPP_DRIVER # TODO: Check if this is still correct
65 select SOC_AMD_COMMON_BLOCK_PM # TODO: Check if this is still correct
66 select SOC_AMD_COMMON_BLOCK_PM_CHIPSET_STATE_SAVE # TODO: Check if this is still correct
67 select SOC_AMD_COMMON_BLOCK_PSP_GEN2 # TODO: Check if this is still correct
68 select SOC_AMD_COMMON_BLOCK_SMBUS # TODO: Check if this is still correct
69 select SOC_AMD_COMMON_BLOCK_SMI # TODO: Check if this is still correct
70 select SOC_AMD_COMMON_BLOCK_SMM # TODO: Check if this is still correct
Felix Held6f9e4ab2022-02-03 18:34:23 +010071 select SOC_AMD_COMMON_BLOCK_SMU
Felix Held3c44c622022-01-10 20:57:29 +010072 select SOC_AMD_COMMON_BLOCK_SPI # TODO: Check if this is still correct
73 select SOC_AMD_COMMON_BLOCK_TSC_FAM17H_19H # TODO: Check if this is still correct
Felix Heldb0789ed2022-02-04 22:36:32 +010074 select SOC_AMD_COMMON_BLOCK_UART
Felix Held3c44c622022-01-10 20:57:29 +010075 select SOC_AMD_COMMON_BLOCK_UCODE # TODO: Check if this is still correct
76 select SOC_AMD_COMMON_FSP_DMI_TABLES # TODO: Check if this is still correct
77 select SOC_AMD_COMMON_FSP_PCI # TODO: Check if this is still correct
78 select SSE2
79 select UDK_2017_BINDING
Subrata Banik34f26b22022-02-10 12:38:02 +053080 select USE_FSP_NOTIFY_PHASE_POST_PCI_ENUM
81 select USE_FSP_NOTIFY_PHASE_READY_TO_BOOT
82 select USE_FSP_NOTIFY_PHASE_END_OF_FIRMWARE
Felix Held3c44c622022-01-10 20:57:29 +010083 select VBOOT_DEFINE_WIDEVINE_COUNTERS if VBOOT_STARTS_BEFORE_BOOTBLOCK
84 select X86_AMD_FIXED_MTRRS
85 select X86_INIT_NEED_1_SIPI
86
87config ARCH_ALL_STAGES_X86
88 default n
89
90config SOC_AMD_COMMON_BLOCK_UCODE_SIZE
Felix Heldb16d1812022-03-27 17:44:16 +020091 default 3200
Felix Held3c44c622022-01-10 20:57:29 +010092
93config CHIPSET_DEVICETREE
94 string
95 default "soc/amd/sabrina/chipset.cb"
96
97config EARLY_RESERVED_DRAM_BASE
98 hex
99 default 0x2000000
100 help
101 This variable defines the base address of the DRAM which is reserved
102 for usage by coreboot in early stages (i.e. before ramstage is up).
103 This memory gets reserved in BIOS tables to ensure that the OS does
104 not use it, thus preventing corruption of OS memory in case of S3
105 resume.
106
107config EARLYRAM_BSP_STACK_SIZE
108 hex
109 default 0x1000
110
111config PSP_APOB_DRAM_ADDRESS
112 hex
113 default 0x2001000
114 help
115 Location in DRAM where the PSP will copy the AGESA PSP Output
116 Block.
117
118config PSP_SHAREDMEM_BASE
119 hex
120 default 0x2011000 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
Felix Held55614682022-01-25 04:31:15 +0100139config PRE_X86_CBMEM_CONSOLE_SIZE
140 hex
141 default 0x1600
142 help
143 Size of the CBMEM console used in PSP verstage.
144
Felix Held3c44c622022-01-10 20:57:29 +0100145config 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 RAMBASE
226 hex
227 default 0x10000000
228
229config RO_REGION_ONLY
230 string
231 depends on VBOOT_SLOTS_RW_AB || VBOOT_SLOTS_RW_A
232 default "apu/amdfw"
233
234config ECAM_MMCONF_BASE_ADDRESS
235 default 0xF8000000
236
237config ECAM_MMCONF_BUS_NUMBER
238 default 64
239
240config MAX_CPUS
241 int
242 default 16
243 help
244 Maximum number of threads the platform can have.
245
246config CONSOLE_UART_BASE_ADDRESS
247 depends on CONSOLE_SERIAL && AMD_SOC_CONSOLE_UART
248 hex
249 default 0xfedc9000 if UART_FOR_CONSOLE = 0
250 default 0xfedca000 if UART_FOR_CONSOLE = 1
Felix Heldb1fe9de2022-01-12 23:18:54 +0100251 default 0xfedce000 if UART_FOR_CONSOLE = 2
252 default 0xfedcf000 if UART_FOR_CONSOLE = 3
253 default 0xfedd1000 if UART_FOR_CONSOLE = 4
Felix Held3c44c622022-01-10 20:57:29 +0100254
255config SMM_TSEG_SIZE
256 hex
257 default 0x800000 if HAVE_SMI_HANDLER
258 default 0x0
259
260config SMM_RESERVED_SIZE
261 hex
262 default 0x180000
263
264config SMM_MODULE_STACK_SIZE
265 hex
266 default 0x800
267
268config ACPI_BERT
269 bool "Build ACPI BERT Table"
270 default y
271 depends on HAVE_ACPI_TABLES
272 help
273 Report Machine Check errors identified in POST to the OS in an
274 ACPI Boot Error Record Table.
275
276config ACPI_BERT_SIZE
277 hex
278 default 0x4000 if ACPI_BERT
279 default 0x0
280 help
281 Specify the amount of DRAM reserved for gathering the data used to
282 generate the ACPI table.
283
284config DRIVERS_I2C_DESIGNWARE_CLOCK_MHZ
285 int
286 default 150
287
288config DISABLE_SPI_FLASH_ROM_SHARING
289 def_bool n
290 help
291 Instruct the chipset to not honor the EGPIO67_SPI_ROM_REQ pin
292 which indicates a board level ROM transaction request. This
293 removes arbitration with board and assumes the chipset controls
294 the SPI flash bus entirely.
295
296config DISABLE_KEYBOARD_RESET_PIN
297 bool
298 help
299 Instruct the SoC to not use the state of GPIO_129 as keyboard reset
300 signal. When this pin is used as GPIO and the keyboard reset
301 functionality isn't disabled, configuring it as an output and driving
302 it as 0 will cause a reset.
303
304config ACPI_SSDT_PSD_INDEPENDENT
305 bool "Allow core p-state independent transitions"
306 default y
307 help
308 AMD recommends the ACPI _PSD object to be configured to cause
309 cores to transition between p-states independently. A vendor may
310 choose to generate _PSD object to allow cores to transition together.
311
312menu "PSP Configuration Options"
313
314config AMD_FWM_POSITION_INDEX
315 int "Firmware Directory Table location (0 to 5)"
316 range 0 5
317 default 0 if BOARD_ROMSIZE_KB_512
318 default 1 if BOARD_ROMSIZE_KB_1024
319 default 2 if BOARD_ROMSIZE_KB_2048
320 default 3 if BOARD_ROMSIZE_KB_4096
321 default 4 if BOARD_ROMSIZE_KB_8192
322 default 5 if BOARD_ROMSIZE_KB_16384
323 help
324 Typically this is calculated by the ROM size, but there may
325 be situations where you want to put the firmware directory
326 table in a different location.
327 0: 512 KB - 0xFFFA0000
328 1: 1 MB - 0xFFF20000
329 2: 2 MB - 0xFFE20000
330 3: 4 MB - 0xFFC20000
331 4: 8 MB - 0xFF820000
332 5: 16 MB - 0xFF020000
333
334comment "AMD Firmware Directory Table set to location for 512KB ROM"
335 depends on AMD_FWM_POSITION_INDEX = 0
336comment "AMD Firmware Directory Table set to location for 1MB ROM"
337 depends on AMD_FWM_POSITION_INDEX = 1
338comment "AMD Firmware Directory Table set to location for 2MB ROM"
339 depends on AMD_FWM_POSITION_INDEX = 2
340comment "AMD Firmware Directory Table set to location for 4MB ROM"
341 depends on AMD_FWM_POSITION_INDEX = 3
342comment "AMD Firmware Directory Table set to location for 8MB ROM"
343 depends on AMD_FWM_POSITION_INDEX = 4
344comment "AMD Firmware Directory Table set to location for 16MB ROM"
345 depends on AMD_FWM_POSITION_INDEX = 5
346
347config AMDFW_CONFIG_FILE
Karthikeyan Ramasubramanian9cb0a052022-03-21 17:49:11 -0600348 string "AMD PSP Firmware config file"
Felix Held3c44c622022-01-10 20:57:29 +0100349 default "src/soc/amd/sabrina/fw.cfg"
Karthikeyan Ramasubramanian9cb0a052022-03-21 17:49:11 -0600350 help
351 Specify the path/location of AMD PSP Firmware config file.
Felix Held3c44c622022-01-10 20:57:29 +0100352
353config PSP_DISABLE_POSTCODES
354 bool "Disable PSP post codes"
355 help
356 Disables the output of port80 post codes from PSP.
357
358config PSP_POSTCODES_ON_ESPI
359 bool "Use eSPI bus for PSP post codes"
360 default y
361 depends on !PSP_DISABLE_POSTCODES
362 help
363 Select to send PSP port80 post codes on eSPI bus.
364 If not selected, PSP port80 codes will be sent on LPC bus.
365
366config PSP_LOAD_MP2_FW
367 bool
368 default n
369 help
370 Include the MP2 firmwares and configuration into the PSP build.
371
372 If unsure, answer 'n'
373
374config PSP_UNLOCK_SECURE_DEBUG
375 bool "Unlock secure debug"
376 default y
377 help
378 Select this item to enable secure debug options in PSP.
379
380config HAVE_PSP_WHITELIST_FILE
381 bool "Include a debug whitelist file in PSP build"
382 default n
383 help
384 Support secured unlock prior to reset using a whitelisted
385 serial number. This feature requires a signed whitelist image
386 and bootloader from AMD.
387
388 If unsure, answer 'n'
389
390config PSP_WHITELIST_FILE
391 string "Debug whitelist file path"
392 depends on HAVE_PSP_WHITELIST_FILE
393 default "3rdparty/amd_blobs/cezanne/PSP/wtl-czn.sbin"
394
395config PSP_SOFTFUSE_BITS
396 string "PSP Soft Fuse bits to enable"
397 default "28 6"
398 help
399 Space separated list of Soft Fuse bits to enable.
400 Bit 0: Enable secure debug (Set by PSP_UNLOCK_SECURE_DEBUG)
401 Bit 7: Disable PSP postcodes on Renoir and newer chips only
402 (Set by PSP_DISABLE_PORT80)
Felix Heldc3579002022-03-23 22:15:56 +0100403 Bit 15: PSP debug output destination:
404 0=SoC MMIO UART, 1=IO port 0x3F8
Felix Held3c44c622022-01-10 20:57:29 +0100405 Bit 29: Disable MP2 firmware loading (Set by PSP_LOAD_MP2_FW)
406
407 See #55758 (NDA) for additional bit definitions.
408
409config PSP_VERSTAGE_FILE
410 string "Specify the PSP_verstage file path"
411 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
412 default "\$(obj)/psp_verstage.bin"
413 help
414 Add psp_verstage file to the build & PSP Directory Table
415
416config PSP_VERSTAGE_SIGNING_TOKEN
417 string "Specify the PSP_verstage Signature Token file path"
418 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
419 default ""
420 help
421 Add psp_verstage signature token to the build & PSP Directory Table
422
423endmenu
424
425config VBOOT
426 select VBOOT_VBNV_CMOS
427 select VBOOT_VBNV_CMOS_BACKUP_TO_FLASH
428
429config VBOOT_STARTS_BEFORE_BOOTBLOCK
430 def_bool n
431 depends on VBOOT
432 select ARCH_VERSTAGE_ARMV7
433 help
434 Runs verstage on the PSP. Only available on
435 certain Chrome OS branded parts from AMD.
436
437config VBOOT_HASH_BLOCK_SIZE
438 hex
439 default 0x9000
440 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
441 help
442 Because the bulk of the time in psp_verstage to hash the RO cbfs is
443 spent in the overhead of doing svc calls, increasing the hash block
444 size significantly cuts the verstage hashing time as seen below.
445
446 4k takes 180ms
447 16k takes 44ms
448 32k takes 33.7ms
449 36k takes 32.5ms
450 There's actually still room for an even bigger stack, but we've
451 reached a point of diminishing returns.
452
453config CMOS_RECOVERY_BYTE
454 hex
455 default 0x51
456 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
457 help
458 If the workbuf is not passed from the PSP to coreboot, set the
459 recovery flag and reboot. The PSP will read this byte, mark the
460 recovery request in VBNV, and reset the system into recovery mode.
461
462 This is the byte before the default first byte used by VBNV
463 (0x26 + 0x0E - 1)
464
465if VBOOT_SLOTS_RW_AB && VBOOT_STARTS_BEFORE_BOOTBLOCK
466
467config RWA_REGION_ONLY
468 string
469 default "apu/amdfw_a"
470 help
471 Add a space-delimited list of filenames that should only be in the
472 RW-A section.
473
474config RWB_REGION_ONLY
475 string
476 default "apu/amdfw_b"
477 help
478 Add a space-delimited list of filenames that should only be in the
479 RW-B section.
480
481endif # VBOOT_SLOTS_RW_AB && VBOOT_STARTS_BEFORE_BOOTBLOCK
482
483endif # SOC_AMD_SABRINA