diff options
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/intel/cannonlake/cnl_memcfg_init.c | 8 | ||||
-rw-r--r-- | src/soc/intel/common/block/memory/meminit.c | 10 | ||||
-rw-r--r-- | src/soc/intel/elkhartlake/meminit.c | 10 | ||||
-rw-r--r-- | src/soc/intel/jasperlake/meminit.c | 10 |
4 files changed, 15 insertions, 23 deletions
diff --git a/src/soc/intel/cannonlake/cnl_memcfg_init.c b/src/soc/intel/cannonlake/cnl_memcfg_init.c index 46452a8b32..a9f9e95b72 100644 --- a/src/soc/intel/cannonlake/cnl_memcfg_init.c +++ b/src/soc/intel/cannonlake/cnl_memcfg_init.c @@ -86,19 +86,17 @@ static void meminit_cbfs_spd_index(FSP_M_CONFIG *mem_cfg, assert(mem_slot < NUM_DIMM_SLOT); if ((spd_data_ptr == 0) || (last_spd_index != spd_index)) { - struct region_device spd_rdev; - printk(BIOS_DEBUG, "SPD INDEX = %d\n", spd_index); - if (get_spd_cbfs_rdev(&spd_rdev, spd_index) < 0) + spd_data_ptr = spd_cbfs_map(spd_index); + if (!spd_data_ptr) die("spd.bin not found or incorrect index\n"); - spd_data_len = region_device_sz(&spd_rdev); + spd_data_len = CONFIG_DIMM_SPD_SIZE; /* Memory leak is ok since we have memory mapped boot media */ assert(CONFIG(BOOT_DEVICE_MEMORY_MAPPED)); - spd_data_ptr = (uintptr_t)rdev_mmap_full(&spd_rdev); last_spd_index = spd_index; print_spd_info((unsigned char *)spd_data_ptr); } diff --git a/src/soc/intel/common/block/memory/meminit.c b/src/soc/intel/common/block/memory/meminit.c index 17bf066ba2..50c8b40df2 100644 --- a/src/soc/intel/common/block/memory/meminit.c +++ b/src/soc/intel/common/block/memory/meminit.c @@ -39,7 +39,6 @@ static void read_spd_md(const struct soc_mem_cfg *soc_mem_cfg, const struct mem_ { size_t ch; size_t num_phys_ch = soc_mem_cfg->num_phys_channels; - struct region_device spd_rdev; uintptr_t spd_data; /* @@ -63,15 +62,14 @@ static void read_spd_md(const struct soc_mem_cfg *soc_mem_cfg, const struct mem_ printk(BIOS_DEBUG, "SPD index = %zu\n", info->cbfs_index); - if (get_spd_cbfs_rdev(&spd_rdev, info->cbfs_index) < 0) - die("SPD not found in CBFS or incorrect index!\n"); - /* Memory leak is ok as long as we have memory mapped boot media */ _Static_assert(CONFIG(BOOT_DEVICE_MEMORY_MAPPED), "Function assumes memory-mapped boot media"); - spd_data = (uintptr_t)rdev_mmap_full(&spd_rdev); - *spd_len = region_device_sz(&spd_rdev); + *spd_len = CONFIG_DIMM_SPD_SIZE; + spd_data = spd_cbfs_map(info->cbfs_index); + if (!spd_data) + die("SPD not found in CBFS or incorrect index!\n"); print_spd_info((uint8_t *)spd_data); diff --git a/src/soc/intel/elkhartlake/meminit.c b/src/soc/intel/elkhartlake/meminit.c index f1f82708d8..d6de9a4046 100644 --- a/src/soc/intel/elkhartlake/meminit.c +++ b/src/soc/intel/elkhartlake/meminit.c @@ -10,19 +10,17 @@ static void spd_read_from_cbfs(const struct spd_info *spd_info, uintptr_t *spd_data_ptr, size_t *spd_data_len) { - struct region_device spd_rdev; size_t spd_index = spd_info->spd_spec.spd_index; printk(BIOS_DEBUG, "SPD INDEX = %lu\n", spd_index); - if (get_spd_cbfs_rdev(&spd_rdev, spd_index) < 0) - die("spd.bin not found or incorrect index\n"); - - *spd_data_len = region_device_sz(&spd_rdev); /* Memory leak is ok since we have memory mapped boot media */ assert(CONFIG(BOOT_DEVICE_MEMORY_MAPPED)); - *spd_data_ptr = (uintptr_t)rdev_mmap_full(&spd_rdev); + *spd_data_len = CONFIG_DIMM_SPD_SIZE; + *spd_data_ptr = spd_cbfs_map(spd_index); + if (!*spd_data_ptr) + die("spd.bin not found or incorrect index\n"); } static void get_spd_data(const struct spd_info *spd_info, uintptr_t *spd_data_ptr, diff --git a/src/soc/intel/jasperlake/meminit.c b/src/soc/intel/jasperlake/meminit.c index cd777ba3a0..9ec1ffa82d 100644 --- a/src/soc/intel/jasperlake/meminit.c +++ b/src/soc/intel/jasperlake/meminit.c @@ -10,19 +10,17 @@ static void spd_read_from_cbfs(const struct spd_info *spd_info, uintptr_t *spd_data_ptr, size_t *spd_data_len) { - struct region_device spd_rdev; size_t spd_index = spd_info->spd_spec.spd_index; printk(BIOS_DEBUG, "SPD INDEX = %lu\n", spd_index); - if (get_spd_cbfs_rdev(&spd_rdev, spd_index) < 0) - die("spd.bin not found or incorrect index\n"); - - *spd_data_len = region_device_sz(&spd_rdev); /* Memory leak is ok since we have memory mapped boot media */ assert(CONFIG(BOOT_DEVICE_MEMORY_MAPPED)); - *spd_data_ptr = (uintptr_t)rdev_mmap_full(&spd_rdev); + *spd_data_len = CONFIG_DIMM_SPD_SIZE; + *spd_data_ptr = spd_cbfs_map(spd_index); + if (!*spd_data_ptr) + die("spd.bin not found or incorrect index\n"); } static void get_spd_data(const struct spd_info *spd_info, uintptr_t *spd_data_ptr, |