diff options
Diffstat (limited to 'src/soc/amd')
-rw-r--r-- | src/soc/amd/common/block/spi/fch_spi_ctrl.c | 4 | ||||
-rw-r--r-- | src/soc/amd/common/psp_verstage/psp_verstage.c | 16 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/soc/amd/common/block/spi/fch_spi_ctrl.c b/src/soc/amd/common/block/spi/fch_spi_ctrl.c index b3d7c69a68..ec3eef6ba3 100644 --- a/src/soc/amd/common/block/spi/fch_spi_ctrl.c +++ b/src/soc/amd/common/block/spi/fch_spi_ctrl.c @@ -221,8 +221,8 @@ static int fch_spi_flash_protect(const struct spi_flash *flash, const struct reg size_t addr, len, gran_value, total_ranges, range; bool granularity_64k = true; /* assume 64k granularity */ - addr = region->offset; - len = region->size; + addr = region_offset(region); + len = region_sz(region); reg32 = pci_read_config32(SOC_LPC_DEV, ROM_ADDRESS_RANGE2_START); rom_base = WORD_TO_DWORD_UPPER(reg32); diff --git a/src/soc/amd/common/psp_verstage/psp_verstage.c b/src/soc/amd/common/psp_verstage/psp_verstage.c index 7d9ef35d58..b49acae843 100644 --- a/src/soc/amd/common/psp_verstage/psp_verstage.c +++ b/src/soc/amd/common/psp_verstage/psp_verstage.c @@ -85,13 +85,17 @@ static uint32_t update_boot_region(struct vb2_context *ctx) if (vboot_is_firmware_slot_a(ctx)) { fname = "apu/amdfw_a"; - if (!fmap_locate_area("FW_MAIN_A", &fw_slot)) - map_base = rdev_mmap(boot_device_ro(), fw_slot.offset, fw_slot.size); + if (!fmap_locate_area("FW_MAIN_A", &fw_slot)) { + map_base = rdev_mmap(boot_device_ro(), + region_offset(&fw_slot), region_sz(&fw_slot)); + } } else { fname = "apu/amdfw_b"; - if (!fmap_locate_area("FW_MAIN_B", &fw_slot)) - map_base = rdev_mmap(boot_device_ro(), fw_slot.offset, fw_slot.size); + if (!fmap_locate_area("FW_MAIN_B", &fw_slot)) { + map_base = rdev_mmap(boot_device_ro(), + region_offset(&fw_slot), region_sz(&fw_slot)); + } } if (!map_base) { @@ -118,7 +122,7 @@ static uint32_t update_boot_region(struct vb2_context *ctx) psp_dir_addr = ef_table->new_psp_directory; bios_dir_addr = get_bios_dir_addr(ef_table); psp_dir_in_spi = (uint32_t *)((psp_dir_addr & SPI_ADDR_MASK) + - (uint32_t)map_base - fw_slot.offset); + (uint32_t)map_base - region_offset(&fw_slot)); if (*psp_dir_in_spi != PSP_COOKIE) { printk(BIOS_ERR, "PSP Directory address is not correct.\n"); cbfs_unmap(amdfw_location); @@ -129,7 +133,7 @@ static uint32_t update_boot_region(struct vb2_context *ctx) if (bios_dir_addr) { bios_dir_in_spi = (uint32_t *)((bios_dir_addr & SPI_ADDR_MASK) + - (uint32_t)map_base - fw_slot.offset); + (uint32_t)map_base - region_offset(&fw_slot)); if (*bios_dir_in_spi != BHD_COOKIE) { printk(BIOS_ERR, "BIOS Directory address is not correct.\n"); cbfs_unmap(amdfw_location); |