mb/google/nissa/var/rull: Configure Acoustic noise mitigation
[coreboot2.git] / src / soc / amd / common / block / psp / spl_fuse.c
blobb6e715ad4b8208eddcebd26784f7088113414af9
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <bootstate.h>
4 #include <console/console.h>
5 #include <types.h>
6 #include "psp_def.h"
8 static void psp_set_spl_fuse(void *unused)
10 int cmd_status = 0;
11 uint32_t c2p38 = 0;
12 struct mbox_cmd_late_spl_buffer buffer = {
13 .header = {
14 .size = sizeof(buffer)
18 if (soc_read_c2p38(&c2p38) != CB_SUCCESS) {
19 printk(BIOS_ERR, "PSP: Failed to get base address.\n");
20 return;
23 if (c2p38 & CORE_2_PSP_MSG_38_FUSE_SPL) {
24 printk(BIOS_DEBUG, "PSP: SPL Fusing may be updated.\n");
25 } else {
26 printk(BIOS_DEBUG, "PSP: SPL Fusing not currently required.\n");
27 return;
30 if (c2p38 & CORE_2_PSP_MSG_38_SPL_FUSE_ERROR) {
31 printk(BIOS_ERR, "PSP: SPL Table does not meet fuse requirements.\n");
32 return;
35 if (c2p38 & CORE_2_PSP_MSG_38_SPL_ENTRY_ERROR) {
36 printk(BIOS_ERR, "PSP: Critical SPL entry missing or current firmware does"
37 " not meet requirements.\n");
38 return;
41 if (c2p38 & CORE_2_PSP_MSG_38_SPL_ENTRY_MISSING) {
42 printk(BIOS_ERR, "PSP: Table of critical SPL values is missing.\n");
43 return;
46 if (!CONFIG(PERFORM_SPL_FUSING))
47 return;
49 printk(BIOS_DEBUG, "PSP: SPL Fusing Update Requested.\n");
50 cmd_status = send_psp_command(MBOX_BIOS_CMD_SET_SPL_FUSE, &buffer);
51 psp_print_cmd_status(cmd_status, NULL);
54 BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_ENTRY, psp_set_spl_fuse, NULL);