coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
psp_efs.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 
4 #ifndef AMD_COMMON_PSP_EFS_H
5 #define AMD_COMMON_PSP_EFS_H
6 
7 #include <types.h>
8 
9 #define EFS_OFFSET (0xffffff - (0x80000 << CONFIG_AMD_FWM_POSITION_INDEX) + 0x20000 + 1)
10 
11 #define EMBEDDED_FW_SIGNATURE 0x55aa55aa
12 
13 #if CONFIG(SOC_AMD_STONEYRIDGE)
14  #define SPI_MODE_FIELD spi_readmode_f15_mod_60_6f
15  #define SPI_SPEED_FIELD fast_speed_new_f15_mod_60_6f
16 #elif CONFIG(SOC_AMD_PICASSO)
17  #define SPI_MODE_FIELD spi_readmode_f17_mod_00_2f
18  #define SPI_SPEED_FIELD spi_fastspeed_f17_mod_00_2f
19 #elif CONFIG(SOC_AMD_CEZANNE) | CONFIG(SOC_AMD_SABRINA)
20  #define SPI_MODE_FIELD spi_readmode_f17_mod_30_3f
21  #define SPI_SPEED_FIELD spi_fastspeed_f17_mod_30_3f
22 #else
23  #error <Error: Unknown Processor>
24 #endif
25 
26 
27 struct second_gen_efs { /* todo: expand for Server products */
28  uint32_t gen:1; /* Client products only use bit 0 */
30 } __attribute__((packed));
31 
32 #define EFS_SECOND_GEN 0
33 
34 /* Copied from coreboot/util/amdfwtool.h */
36  uint32_t signature; /* 0x55aa55aa */
45  struct second_gen_efs efs_gen;
65 } __attribute__((packed, aligned(16)));
66 
67 bool efs_is_valid(void);
68 bool read_efs_spi_settings(uint8_t *mode, uint8_t *speed);
69 
70 #endif /* AMD_COMMON_PSP_EFS_H */
bool efs_is_valid(void)
Definition: psp_efs.c:11
bool read_efs_spi_settings(uint8_t *mode, uint8_t *speed)
Definition: psp_efs.c:22
unsigned int uint32_t
Definition: stdint.h:14
unsigned char uint8_t
Definition: stdint.h:8
uint32_t reserved_3Ch
Definition: psp_efs.h:51
uint8_t spi_fastspeed_f17_mod_00_2f
Definition: psp_efs.h:56
uint8_t qpr_dummy_cycle_f17_mod_00_2f
Definition: psp_efs.h:57
uint32_t combo_psp_directory
Definition: psp_efs.h:41
uint8_t spi_readmode_f17_mod_00_2f
Definition: psp_efs.h:55
uint32_t reserved_4Ch
Definition: psp_efs.h:64
uint32_t bios1_entry
Definition: psp_efs.h:43
uint8_t fast_speed_new_f15_mod_60_6f
Definition: psp_efs.h:53
uint8_t spi_fastspeed_f17_mod_30_3f
Definition: psp_efs.h:60
uint8_t reserved_46h
Definition: psp_efs.h:58
uint32_t imc_entry
Definition: psp_efs.h:37
uint32_t reserved_2Ch
Definition: psp_efs.h:47
uint32_t signature
Definition: psp_efs.h:36
uint32_t gec_entry
Definition: psp_efs.h:38
uint32_t bios3_entry
Definition: psp_efs.h:46
uint32_t bios2_entry
Definition: psp_efs.h:44
uint32_t psp_directory
Definition: psp_efs.h:40
uint8_t micron_detect_f17_mod_30_3f
Definition: psp_efs.h:61
uint8_t spi_readmode_f15_mod_60_6f
Definition: psp_efs.h:52
uint8_t spi_readmode_f17_mod_30_3f
Definition: psp_efs.h:59
uint32_t xhci_entry
Definition: psp_efs.h:39
uint8_t reserved_4Bh
Definition: psp_efs.h:63
uint8_t reserved_42h
Definition: psp_efs.h:54
uint8_t reserved_4Ah
Definition: psp_efs.h:62
uint32_t promontory_fw_ptr
Definition: psp_efs.h:48
uint32_t bios0_entry
Definition: psp_efs.h:42
uint32_t reserved_38h
Definition: psp_efs.h:50
struct second_gen_efs efs_gen
Definition: psp_efs.h:45
uint32_t lp_promontory_fw_ptr
Definition: psp_efs.h:49
uint32_t gen
Definition: psp_efs.h:28
uint32_t reserved
Definition: psp_efs.h:29