summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/amd/mendocino/psp_verstage/chipset.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/soc/amd/mendocino/psp_verstage/chipset.c b/src/soc/amd/mendocino/psp_verstage/chipset.c
index 0b622e73de..282ad21227 100644
--- a/src/soc/amd/mendocino/psp_verstage/chipset.c
+++ b/src/soc/amd/mendocino/psp_verstage/chipset.c
@@ -6,6 +6,7 @@
#include <arch/hlt.h>
#include <bl_uapp/bl_errorcodes_public.h>
#include <bl_uapp/bl_syscall_public.h>
+#include <boot_device.h>
#include <cbfs.h>
#include <console/console.h>
#include <psp_verstage.h>
@@ -25,7 +26,8 @@ static struct psp_fw_entry_hash_384 hash_384[MAX_NUM_HASH_ENTRIES];
void update_psp_fw_hash_table(const char *fname)
{
- uint8_t *spi_ptr = (uint8_t *)cbfs_map(fname, NULL);
+ void *hash_file = cbfs_map(fname, NULL);
+ uint8_t *spi_ptr = (uint8_t *)hash_file;
uint32_t len;
if (!spi_ptr) {
@@ -44,7 +46,8 @@ void update_psp_fw_hash_table(const char *fname)
printk(BIOS_ERR, "Too many entries in AMD Firmware hash table"
" (SHA256:%d, SHA384:%d)\n",
hash_table.no_of_entries_256, hash_table.no_of_entries_384);
- cbfs_unmap(spi_ptr);
+ cbfs_unmap(hash_file);
+ rdev_munmap(boot_device_ro(), hash_file);
return;
}
@@ -53,7 +56,8 @@ void update_psp_fw_hash_table(const char *fname)
printk(BIOS_ERR, "No entries in AMD Firmware hash table"
" (SHA256:%d, SHA384:%d)\n",
hash_table.no_of_entries_256, hash_table.no_of_entries_384);
- cbfs_unmap(spi_ptr);
+ cbfs_unmap(hash_file);
+ rdev_munmap(boot_device_ro(), hash_file);
return;
}
@@ -69,7 +73,8 @@ void update_psp_fw_hash_table(const char *fname)
memcpy(hash_384, spi_ptr, len);
svc_set_fw_hash_table(&hash_table);
- cbfs_unmap(spi_ptr);
+ cbfs_unmap(hash_file);
+ rdev_munmap(boot_device_ro(), hash_file);
}
uint32_t update_psp_bios_dir(uint32_t *psp_dir_offset, uint32_t *bios_dir_offset)