soc/intel/common: Fix buggy code tries to access DESC region
The patch fixes the buggy code which tries to access the Descriptor Region. The existing code doesn't use correct APIs to access the Descriptor Region. Hence, error message is getting displayed during the boot. BUG=b:229003612 TEST=Build and verify no errors seen while accessing the Descriptor Region. Signed-off-by: Sridhar Siricilla <sridhar.siricilla@intel.com> Change-Id: Ib144cc0845b7527e5a3032529b0802f961944b87 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63734 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
parent
685f123852
commit
574f3c8fe4
@ -1,10 +1,8 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include <boot_device.h>
|
||||
#include <commonlib/region.h>
|
||||
#include <intelbasecode/debug_feature.h>
|
||||
#include <console/console.h>
|
||||
#include <fmap.h>
|
||||
#include <spi_flash.h>
|
||||
|
||||
#define SI_DESC_OEM_SECTION_OFFSET 0xF00
|
||||
#define PRE_MEM_FEATURE_CTRL_OFFSET SI_DESC_OEM_SECTION_OFFSET
|
||||
@ -22,21 +20,8 @@ _Static_assert(sizeof(struct pre_mem_ft) % 64 == 0 && sizeof(struct pre_mem_ft)
|
||||
|
||||
uint8_t pre_mem_debug_init(void)
|
||||
{
|
||||
struct region_device desc_rdev;
|
||||
const struct region_device *boot_device = boot_device_ro();
|
||||
|
||||
if (!boot_device) {
|
||||
printk(BIOS_ERR, "Failed to get RW boot device\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (rdev_chain(&desc_rdev, boot_device, 0, SI_DESC_REGION_SZ)) {
|
||||
printk(BIOS_ERR, "Failed to get description region device\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (rdev_readat(&desc_rdev, &pre_mem_debug, PRE_MEM_FEATURE_CTRL_OFFSET,
|
||||
PRE_MEM_FEATURE_CTRL_SZ) != PRE_MEM_FEATURE_CTRL_SZ) {
|
||||
if (spi_flash_read(boot_device_spi_flash(), PRE_MEM_FEATURE_CTRL_OFFSET,
|
||||
PRE_MEM_FEATURE_CTRL_SZ, &pre_mem_debug)) {
|
||||
printk(BIOS_ERR, "Failed to read Descriptor Region from SPI Flash\n");
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user