coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
psp_gen2.c File Reference
#include <bootstate.h>
#include <console/console.h>
#include <cpu/amd/msr.h>
#include <cpu/x86/msr.h>
#include <device/mmio.h>
#include <timer.h>
#include <amdblocks/psp.h>
#include <soc/iomap.h>
#include "psp_def.h"
Include dependency graph for psp_gen2.c:

Go to the source code of this file.

Data Structures

union  pspv2_mbox_command
 
struct  pspv2_mbox_command::pspv2_mbox_cmd_fields
 

Macros

#define PSP_MAILBOX_COMMAND_OFFSET   0x10570 /* 4 bytes */
 
#define PSP_MAILBOX_BUFFER_OFFSET   0x10574 /* 8 bytes */
 

Functions

static uintptr_t soc_get_psp_base_address (void)
 
static u16 rd_mbox_sts (uintptr_t psp_mmio)
 
static void wr_mbox_cmd (uintptr_t psp_mmio, u8 cmd)
 
static u8 rd_mbox_recovery (uintptr_t psp_mmio)
 
static void wr_mbox_buffer_ptr (uintptr_t psp_mmio, void *buffer)
 
static int wait_command (uintptr_t psp_mmio, bool wait_for_ready)
 
int send_psp_command (u32 command, void *buffer)
 
enum cb_err soc_read_c2p38 (uint32_t *msg_38_value)
 
static void psp_set_spl_fuse (void *unused)
 
 BOOT_STATE_INIT_ENTRY (BS_PAYLOAD_BOOT, BS_ON_ENTRY, psp_set_spl_fuse, NULL)
 

Macro Definition Documentation

◆ PSP_MAILBOX_BUFFER_OFFSET

#define PSP_MAILBOX_BUFFER_OFFSET   0x10574 /* 8 bytes */

Definition at line 14 of file psp_gen2.c.

◆ PSP_MAILBOX_COMMAND_OFFSET

#define PSP_MAILBOX_COMMAND_OFFSET   0x10570 /* 4 bytes */

Definition at line 13 of file psp_gen2.c.

Function Documentation

◆ BOOT_STATE_INIT_ENTRY()

BOOT_STATE_INIT_ENTRY ( BS_PAYLOAD_BOOT  ,
BS_ON_ENTRY  ,
psp_set_spl_fuse  ,
NULL   
)

◆ psp_set_spl_fuse()

static void psp_set_spl_fuse ( void unused)
static

◆ rd_mbox_recovery()

static u8 rd_mbox_recovery ( uintptr_t  psp_mmio)
static

Definition at line 52 of file psp_gen2.c.

References pspv2_mbox_command::fields, PSP_MAILBOX_COMMAND_OFFSET, read32p(), pspv2_mbox_command::pspv2_mbox_cmd_fields::recovery, and pspv2_mbox_command::val.

Referenced by send_psp_command().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rd_mbox_sts()

static u16 rd_mbox_sts ( uintptr_t  psp_mmio)
static

Definition at line 35 of file psp_gen2.c.

References pspv2_mbox_command::fields, pspv2_mbox_command::pspv2_mbox_cmd_fields::mbox_status, PSP_MAILBOX_COMMAND_OFFSET, read32p(), and pspv2_mbox_command::val.

Referenced by send_psp_command().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_psp_command()

◆ soc_get_psp_base_address()

static uintptr_t soc_get_psp_base_address ( void  )
static

Definition at line 27 of file psp_gen2.c.

References BIOS_ERR, msr_struct::lo, printk, PSP_ADDR_MSR, and rdmsr().

Referenced by send_psp_command().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ soc_read_c2p38()

enum cb_err soc_read_c2p38 ( uint32_t msg_38_value)

Definition at line 92 of file psp_gen2.c.

Referenced by psp_set_spl_fuse().

Here is the caller graph for this function:

◆ wait_command()

static int wait_command ( uintptr_t  psp_mmio,
bool  wait_for_ready 
)
static

◆ wr_mbox_buffer_ptr()

static void wr_mbox_buffer_ptr ( uintptr_t  psp_mmio,
void buffer 
)
static

Definition at line 60 of file psp_gen2.c.

References buffer, PSP_MAILBOX_BUFFER_OFFSET, and write64p().

Referenced by send_psp_command().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wr_mbox_cmd()

static void wr_mbox_cmd ( uintptr_t  psp_mmio,
u8  cmd 
)
static

Definition at line 43 of file psp_gen2.c.

References pspv2_mbox_command::fields, pspv2_mbox_command::pspv2_mbox_cmd_fields::mbox_command, PSP_MAILBOX_COMMAND_OFFSET, pspv2_mbox_command::val, and write32p().

Referenced by send_psp_command().

Here is the call graph for this function:
Here is the caller graph for this function: