1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <amdblocks/psp_efs.h>
4 #include <boot_device.h>
5 #include <commonlib/region.h>
6 #include <device/mmio.h>
9 bool read_efs_spi_settings(uint8_t *mode
, uint8_t *speed
)
12 struct embedded_firmware
*efs
;
14 efs
= rdev_mmap(boot_device_ro(), EFS_OFFSET
, sizeof(*efs
));
18 if (efs
->signature
== EMBEDDED_FW_SIGNATURE
) {
19 #ifndef SPI_MODE_FIELD
20 printk(BIOS_ERR
, "Unknown cpu in psp_efs.h\n");
21 printk(BIOS_ERR
, "SPI speed/mode not set.\n");
23 *mode
= efs
->SPI_MODE_FIELD
;
24 *speed
= efs
->SPI_SPEED_FIELD
;
28 rdev_munmap(boot_device_ro(), efs
);