coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
psp_efs.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#include <
amdblocks/psp_efs.h
>
4
#include <arch/mmio.h>
5
#include <
boot_device.h
>
6
#include <
commonlib/region.h
>
7
#include <types.h>
8
9
static
struct
embedded_firmware
*
efs
;
10
11
bool
efs_is_valid
(
void
)
12
{
13
if
(!
efs
)
14
efs
=
rdev_mmap
(
boot_device_ro
(),
EFS_OFFSET
,
sizeof
(*
efs
));
15
16
if
(!
efs
||
efs
->
signature
!=
EMBEDDED_FW_SIGNATURE
)
17
return
false
;
18
19
return
true
;
20
}
21
22
bool
read_efs_spi_settings
(
uint8_t
*mode,
uint8_t
*speed)
23
{
24
if
(!
efs_is_valid
())
25
return
false
;
26
27
*mode =
efs
->SPI_MODE_FIELD;
28
*speed =
efs
->SPI_SPEED_FIELD;
29
return
true
;
30
}
boot_device_ro
const struct region_device * boot_device_ro(void)
Definition:
rom_media.c:9
boot_device.h
efs_is_valid
bool efs_is_valid(void)
Definition:
psp_efs.c:11
read_efs_spi_settings
bool read_efs_spi_settings(uint8_t *mode, uint8_t *speed)
Definition:
psp_efs.c:22
efs
static struct embedded_firmware * efs
Definition:
psp_efs.c:9
psp_efs.h
EMBEDDED_FW_SIGNATURE
#define EMBEDDED_FW_SIGNATURE
Definition:
psp_efs.h:11
EFS_OFFSET
#define EFS_OFFSET
Definition:
psp_efs.h:9
region.h
rdev_mmap
void * rdev_mmap(const struct region_device *rd, size_t offset, size_t size)
Definition:
region.c:46
uint8_t
unsigned char uint8_t
Definition:
stdint.h:8
embedded_firmware
Definition:
psp_efs.h:35
embedded_firmware::signature
uint32_t signature
Definition:
psp_efs.h:36
src
soc
amd
common
block
psp
psp_efs.c
Generated by
1.9.1