coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
psp_transfer.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 /* TODO: Check if this is still correct */
4 
5 #ifndef AMD_SABRINA_PSP_TRANSFER_H
6 #define AMD_SABRINA_PSP_TRANSFER_H
7 
8 # if (CONFIG_CMOS_RECOVERY_BYTE != 0)
9 # define CMOS_RECOVERY_BYTE CONFIG_CMOS_RECOVERY_BYTE
10 # elif CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)
11 # error "Must set CONFIG_CMOS_RECOVERY_BYTE"
12 # endif
13 
14 #define CMOS_RECOVERY_MAGIC_VAL 0x96
15 
16 #define TRANSFER_INFO_SIZE 64
17 #define TIMESTAMP_BUFFER_SIZE 0x200
18 
19 #define TRANSFER_MAGIC_VAL 0x50544953
20 
21 /* Bit definitions for the psp_info field in the PSP transfer_info_struct */
22 #define PSP_INFO_PRODUCTION_MODE 0x00000001UL
23 #define PSP_INFO_PRODUCTION_SILICON 0x00000002UL
24 #define PSP_INFO_VALID 0x80000000UL
25 
26 /* Area for things that would cause errors in a linker script */
27 #if !defined(__ASSEMBLER__)
28 #include <stdint.h>
29 
30 struct transfer_info_struct {
31  uint32_t magic_val; /* Identifier */
32  uint32_t struct_bytes; /* Size of this structure */
33  uint32_t buffer_size; /* Size of the transfer buffer area */
34 
35  /* Offsets from start of transfer buffer */
40 
41  uint32_t unused1[5];
42 
43  /* Fields reserved for the PSP */
44  uint64_t timestamp; /* Offset 0x30 */
45  uint32_t psp_unused; /* Offset 0x38 */
46  uint32_t psp_info; /* Offset 0x3C */
47 };
48 
50  "TRANSFER_INFO_SIZE is incorrect");
51 
52 /* Make sure the PSP transferred information over to x86 side. */
53 int transfer_buffer_valid(const struct transfer_info_struct *ptr);
54 /* Verify vboot work buffer is valid in transfer buffer */
55 void verify_psp_transfer_buf(void);
56 /* Display the transfer block's PSP_info data */
57 void show_psp_transfer_info(void);
58 /* Replays the pre-x86 cbmem console into the x86 cbmem console */
60 /* Called by bootblock_c_entry in the VBOOT_STARTS_BEFORE_BOOTBLOCK case */
61 void boot_with_psp_timestamp(uint64_t base_timestamp);
62 
63 #endif
64 #endif /* AMD_SABRINA_PSP_TRANSFER_H */
void boot_with_psp_timestamp(uint64_t base_timestamp)
void verify_psp_transfer_buf(void)
int transfer_buffer_valid(const struct transfer_info_struct *ptr)
_Static_assert(sizeof(struct transfer_info_struct)==TRANSFER_INFO_SIZE, "TRANSFER_INFO_SIZE is incorrect")
void show_psp_transfer_info(void)
void replay_transfer_buffer_cbmemc(void)
#define TRANSFER_INFO_SIZE
Definition: psp_transfer.h:16
unsigned int uint32_t
Definition: stdint.h:14
unsigned long long uint64_t
Definition: stdint.h:17
uint32_t timestamp_offset
Definition: psp_transfer.h:36
uint32_t unused1[5]
Definition: psp_transfer.h:39