summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSridhar Siricilla <sridhar.siricilla@intel.com>2022-04-21 10:33:51 +0530
committerFelix Held <felix-coreboot@felixheld.de>2022-04-25 13:55:18 +0000
commit574f3c8fe44593c9bba8e283f1e1f0b0cebea980 (patch)
tree0e080d887096684d7e39e29f8b3683b9fb34a48a
parent685f123852a5eee9dc93d861645e87394bbc30df (diff)
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>
-rw-r--r--src/soc/intel/common/basecode/debug/debug_feature.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/soc/intel/common/basecode/debug/debug_feature.c b/src/soc/intel/common/basecode/debug/debug_feature.c
index 5cdbaf7e5a..42cf992afa 100644
--- a/src/soc/intel/common/basecode/debug/debug_feature.c
+++ b/src/soc/intel/common/basecode/debug/debug_feature.c
@@ -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;
}