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