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