mb/google/nissa/var/rull: Configure Acoustic noise mitigation
[coreboot2.git] / src / soc / amd / common / block / psp / psp_efs.c
blobfa69aea5548b7a1a4c7f7927aa1808bae7774441
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>
7 #include <types.h>
9 bool read_efs_spi_settings(uint8_t *mode, uint8_t *speed)
11 bool ret = false;
12 struct embedded_firmware *efs;
14 efs = rdev_mmap(boot_device_ro(), EFS_OFFSET, sizeof(*efs));
15 if (!efs)
16 return false;
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");
22 #else
23 *mode = efs->SPI_MODE_FIELD;
24 *speed = efs->SPI_SPEED_FIELD;
25 ret = true;
26 #endif
28 rdev_munmap(boot_device_ro(), efs);
29 return ret;