summaryrefslogtreecommitdiff
path: root/src/soc/intel/alderlake
diff options
context:
space:
mode:
authorSridhar Siricilla <sridhar.siricilla@intel.com>2022-02-23 12:37:11 +0530
committerFelix Held <felix-coreboot@felixheld.de>2022-03-07 17:09:57 +0000
commitbe082fe9f401304c29a839c63a835e793b9f41ff (patch)
tree7e7b855bdfbbbf577179d652353f002866196d0d /src/soc/intel/alderlake
parentb24c528e46b394d274ed32ef04067a73a9308425 (diff)
soc/intel/alderlake: Use Kconfigs for Descriptor Region
The patch uses Kconfigs for Descriptor Region and Descriptor Region size instead of locally defined macros TEST=Build and boot Brya board Signed-off-by: Sridhar Siricilla <sridhar.siricilla@intel.com> Change-Id: I3f9461c8604383f995a4438f45286b14fb94deaa Reviewed-on: https://review.coreboot.org/c/coreboot/+/62264 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Maulik V Vaghela <maulik.v.vaghela@intel.com> Reviewed-by: Krishna P Bhat D <krishna.p.bhat.d@intel.com>
Diffstat (limited to 'src/soc/intel/alderlake')
-rw-r--r--src/soc/intel/alderlake/bootblock/pmc_descriptor.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/soc/intel/alderlake/bootblock/pmc_descriptor.c b/src/soc/intel/alderlake/bootblock/pmc_descriptor.c
index 4e8095750a..c585f70c37 100644
--- a/src/soc/intel/alderlake/bootblock/pmc_descriptor.c
+++ b/src/soc/intel/alderlake/bootblock/pmc_descriptor.c
@@ -11,8 +11,6 @@
#include <soc/bootblock.h>
#include <types.h>
-#define SI_DESC_REGION "SI_DESC"
-#define SI_DESC_REGION_SZ 4096
#define PMC_DESC_7_BYTE3 0xc32
/* Flash Master 1 : HOST/BIOS */
@@ -44,18 +42,19 @@ static int is_descriptor_writeable(uint8_t *desc)
/* It updates PMC Descriptor in the Descriptor Region */
void configure_pmc_descriptor(void)
{
- uint8_t si_desc_buf[SI_DESC_REGION_SZ];
+ uint8_t si_desc_buf[CONFIG_SI_DESC_REGION_SZ];
struct region_device desc_rdev;
if (cpu_get_cpuid() != CPUID_ALDERLAKE_A0)
return;
- if (fmap_locate_area_as_rdev_rw(SI_DESC_REGION, &desc_rdev) < 0) {
- printk(BIOS_ERR, "Failed to locate %s in the FMAP\n", SI_DESC_REGION);
+ if (fmap_locate_area_as_rdev_rw(CONFIG_SI_DESC_REGION, &desc_rdev) < 0) {
+ printk(BIOS_ERR, "Failed to locate %s in the FMAP\n", CONFIG_SI_DESC_REGION);
return;
}
- if (rdev_readat(&desc_rdev, si_desc_buf, 0, SI_DESC_REGION_SZ) != SI_DESC_REGION_SZ) {
+ if (rdev_readat(&desc_rdev, si_desc_buf, 0, CONFIG_SI_DESC_REGION_SZ) !=
+ CONFIG_SI_DESC_REGION_SZ) {
printk(BIOS_ERR, "Failed to read Descriptor Region from SPI Flash\n");
return;
}
@@ -70,13 +69,13 @@ void configure_pmc_descriptor(void)
si_desc_buf[PMC_DESC_7_BYTE3] = 0x44;
- if (rdev_eraseat(&desc_rdev, 0, SI_DESC_REGION_SZ) != SI_DESC_REGION_SZ) {
+ if (rdev_eraseat(&desc_rdev, 0, CONFIG_SI_DESC_REGION_SZ) != CONFIG_SI_DESC_REGION_SZ) {
printk(BIOS_ERR, "Failed to erase Descriptor Region area\n");
return;
}
- if (rdev_writeat(&desc_rdev, si_desc_buf, 0, SI_DESC_REGION_SZ)
- != SI_DESC_REGION_SZ) {
+ if (rdev_writeat(&desc_rdev, si_desc_buf, 0, CONFIG_SI_DESC_REGION_SZ)
+ != CONFIG_SI_DESC_REGION_SZ) {
printk(BIOS_ERR, "Failed to update Descriptor Region\n");
return;
}