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 #ifndef AMD_PICASSO_PSP_TRANSFER_H
4 #define AMD_PICASSO_PSP_TRANSFER_H
5 
6 # if (CONFIG_CMOS_RECOVERY_BYTE != 0)
7 # define CMOS_RECOVERY_BYTE CONFIG_CMOS_RECOVERY_BYTE
8 # elif CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)
9 # error "Must set CONFIG_CMOS_RECOVERY_BYTE"
10 # endif
11 
12 #define CMOS_RECOVERY_MAGIC_VAL 0x96
13 
14 #define TRANSFER_INFO_SIZE 64
15 #define TIMESTAMP_BUFFER_SIZE 0x200
16 
17 #define TRANSFER_MAGIC_VAL 0x50544953
18 
19 /* Bit definitions for the psp_info field in the PSP transfer_info_struct */
20 #define PSP_INFO_PRODUCTION_MODE 0x00000001UL
21 #define PSP_INFO_PRODUCTION_SILICON 0x00000002UL
22 #define PSP_INFO_VALID 0x80000000UL
23 
24 /* Area for things that would cause errors in a linker script */
25 #if !defined(__ASSEMBLER__)
26 #include <stdint.h>
27 
28 struct transfer_info_struct {
29  uint32_t magic_val; /* Identifier */
30  uint32_t struct_bytes; /* Size of this structure */
31  uint32_t buffer_size; /* Size of the transfer buffer area */
32 
33  /* Offsets from start of transfer buffer */
38 
39  uint32_t unused1[5];
40 
41  /* Fields reserved for the PSP */
42  uint64_t timestamp; /* Offset 0x30 */
43  uint32_t psp_unused; /* Offset 0x38 */
44  uint32_t psp_info; /* Offset 0x3C */
45 };
46 
48  "TRANSFER_INFO_SIZE is incorrect");
49 
50 /* Make sure the PSP transferred information over to x86 side. */
51 int transfer_buffer_valid(const struct transfer_info_struct *ptr);
52 /* Verify vboot work buffer is valid in transfer buffer */
53 void verify_psp_transfer_buf(void);
54 /* Display the transfer block's PSP_info data */
55 void show_psp_transfer_info(void);
56 /* Replays the pre-x86 cbmem console into the x86 cbmem console */
58 /* Called by bootblock_c_entry in the VBOOT_STARTS_BEFORE_BOOTBLOCK case */
59 void boot_with_psp_timestamp(uint64_t base_timestamp);
60 
61 #endif
62 
63 #endif /* AMD_PICASSO_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:14
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