blob: 9e17e2769c58b6e75d7f5e54356d5842cb266f2d [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
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
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
Felix Held8e4742d2022-02-03 15:15:37 +010054 select SOC_AMD_COMMON_BLOCK_I2C
Felix Held556d1cc2022-02-02 22:11:52 +010055 select SOC_AMD_COMMON_BLOCK_I2C_PAD_CTRL
Felix Held3bdbdb72022-02-02 22:55:34 +010056 select SOC_AMD_COMMON_BLOCK_I23C_PAD_CTRL
Felix Held3c44c622022-01-10 20:57:29 +010057 select SOC_AMD_COMMON_BLOCK_IOMMU # TODO: Check if this is still correct
58 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
62 select SOC_AMD_COMMON_BLOCK_PCI_MMCONF # TODO: Check if this is still correct
63 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
73 select SOC_AMD_COMMON_BLOCK_UART # TODO: Check if this is still correct
74 select SOC_AMD_COMMON_BLOCK_UCODE # TODO: Check if this is still correct
75 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
79 select VBOOT_DEFINE_WIDEVINE_COUNTERS if VBOOT_STARTS_BEFORE_BOOTBLOCK
80 select X86_AMD_FIXED_MTRRS
81 select X86_INIT_NEED_1_SIPI
82
83config ARCH_ALL_STAGES_X86
84 default n
85
86config SOC_AMD_COMMON_BLOCK_UCODE_SIZE
87 default 5568
88
89config 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
221config RAMBASE
222 hex
223 default 0x10000000
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
238 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
Felix Heldb1fe9de2022-01-12 23:18:54 +0100247 default 0xfedce000 if UART_FOR_CONSOLE = 2
248 default 0xfedcf000 if UART_FOR_CONSOLE = 3
249 default 0xfedd1000 if UART_FOR_CONSOLE = 4
Felix Held3c44c622022-01-10 20:57:29 +0100250
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
345 default "src/soc/amd/sabrina/fw.cfg"
346
347config PSP_DISABLE_POSTCODES
348 bool "Disable PSP post codes"
349 help
350 Disables the output of port80 post codes from PSP.
351
352config PSP_POSTCODES_ON_ESPI
353 bool "Use eSPI bus for PSP post codes"
354 default y
355 depends on !PSP_DISABLE_POSTCODES
356 help
357 Select to send PSP port80 post codes on eSPI bus.
358 If not selected, PSP port80 codes will be sent on LPC bus.
359
360config PSP_LOAD_MP2_FW
361 bool
362 default n
363 help
364 Include the MP2 firmwares and configuration into the PSP build.
365
366 If unsure, answer 'n'
367
368config PSP_UNLOCK_SECURE_DEBUG
369 bool "Unlock secure debug"
370 default y
371 help
372 Select this item to enable secure debug options in PSP.
373
374config HAVE_PSP_WHITELIST_FILE
375 bool "Include a debug whitelist file in PSP build"
376 default n
377 help
378 Support secured unlock prior to reset using a whitelisted
379 serial number. This feature requires a signed whitelist image
380 and bootloader from AMD.
381
382 If unsure, answer 'n'
383
384config PSP_WHITELIST_FILE
385 string "Debug whitelist file path"
386 depends on HAVE_PSP_WHITELIST_FILE
387 default "3rdparty/amd_blobs/cezanne/PSP/wtl-czn.sbin"
388
389config PSP_SOFTFUSE_BITS
390 string "PSP Soft Fuse bits to enable"
391 default "28 6"
392 help
393 Space separated list of Soft Fuse bits to enable.
394 Bit 0: Enable secure debug (Set by PSP_UNLOCK_SECURE_DEBUG)
395 Bit 7: Disable PSP postcodes on Renoir and newer chips only
396 (Set by PSP_DISABLE_PORT80)
397 Bit 15: PSP post code destination: 0=LPC 1=eSPI
398 (Set by PSP_INITIALIZE_ESPI)
399 Bit 29: Disable MP2 firmware loading (Set by PSP_LOAD_MP2_FW)
400
401 See #55758 (NDA) for additional bit definitions.
402
403config PSP_VERSTAGE_FILE
404 string "Specify the PSP_verstage file path"
405 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
406 default "\$(obj)/psp_verstage.bin"
407 help
408 Add psp_verstage file to the build & PSP Directory Table
409
410config PSP_VERSTAGE_SIGNING_TOKEN
411 string "Specify the PSP_verstage Signature Token file path"
412 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
413 default ""
414 help
415 Add psp_verstage signature token to the build & PSP Directory Table
416
417endmenu
418
419config VBOOT
420 select VBOOT_VBNV_CMOS
421 select VBOOT_VBNV_CMOS_BACKUP_TO_FLASH
422
423config VBOOT_STARTS_BEFORE_BOOTBLOCK
424 def_bool n
425 depends on VBOOT
426 select ARCH_VERSTAGE_ARMV7
427 help
428 Runs verstage on the PSP. Only available on
429 certain Chrome OS branded parts from AMD.
430
431config VBOOT_HASH_BLOCK_SIZE
432 hex
433 default 0x9000
434 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
435 help
436 Because the bulk of the time in psp_verstage to hash the RO cbfs is
437 spent in the overhead of doing svc calls, increasing the hash block
438 size significantly cuts the verstage hashing time as seen below.
439
440 4k takes 180ms
441 16k takes 44ms
442 32k takes 33.7ms
443 36k takes 32.5ms
444 There's actually still room for an even bigger stack, but we've
445 reached a point of diminishing returns.
446
447config CMOS_RECOVERY_BYTE
448 hex
449 default 0x51
450 depends on VBOOT_STARTS_BEFORE_BOOTBLOCK
451 help
452 If the workbuf is not passed from the PSP to coreboot, set the
453 recovery flag and reboot. The PSP will read this byte, mark the
454 recovery request in VBNV, and reset the system into recovery mode.
455
456 This is the byte before the default first byte used by VBNV
457 (0x26 + 0x0E - 1)
458
459if VBOOT_SLOTS_RW_AB && VBOOT_STARTS_BEFORE_BOOTBLOCK
460
461config RWA_REGION_ONLY
462 string
463 default "apu/amdfw_a"
464 help
465 Add a space-delimited list of filenames that should only be in the
466 RW-A section.
467
468config RWB_REGION_ONLY
469 string
470 default "apu/amdfw_b"
471 help
472 Add a space-delimited list of filenames that should only be in the
473 RW-B section.
474
475endif # VBOOT_SLOTS_RW_AB && VBOOT_STARTS_BEFORE_BOOTBLOCK
476
477endif # SOC_AMD_SABRINA