diff options
author | Aaron Durbin <adurbin@chromium.org> | 2018-08-07 12:04:21 -0600 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2018-08-08 16:43:50 +0000 |
commit | 9a30c7289fd0d95655e368100ed444848d46e85d (patch) | |
tree | dedddf6cf79701962bb77938206c5de28fd6817c /src/soc/intel/apollolake/meminit_util_glk.c | |
parent | 577e41c06e74a30a422e30ff8b7b7d3db2d5a8b4 (diff) | |
download | coreboot-9a30c7289fd0d95655e368100ed444848d46e85d.tar.xz |
soc/intel/apollolake: add new dimm info saving API
The current call for saving dimm info passed the lpddr4_cfg and
memory sku id. In order to prepare decoupling the part number
from lpddr4_cfg provide a new API, save_lpddr4_dimm_info_part_num(),
which explicitly takes the part number. The previous API now
uses the new one internally.
BUG=b:112203105
Change-Id: Ieadf452b6daa3231a0c5e3be61b0603b40d0fff2
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/27944
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Justin TerAvest <teravest@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/soc/intel/apollolake/meminit_util_glk.c')
-rw-r--r-- | src/soc/intel/apollolake/meminit_util_glk.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/soc/intel/apollolake/meminit_util_glk.c b/src/soc/intel/apollolake/meminit_util_glk.c index 21b09af89b..db69f5184b 100644 --- a/src/soc/intel/apollolake/meminit_util_glk.c +++ b/src/soc/intel/apollolake/meminit_util_glk.c @@ -27,7 +27,7 @@ 0x88, 0xc3, 0xee, 0xe8, 0xc4, 0x9e, 0xfb, 0x89 \ } -void save_lpddr4_dimm_info(const struct lpddr4_cfg *lp4cfg, size_t mem_sku) +void save_lpddr4_dimm_info_part_num(const char *dram_part_num) { int channel, dimm, dimm_max, index, node; size_t hob_size; @@ -40,11 +40,9 @@ void save_lpddr4_dimm_info(const struct lpddr4_cfg *lp4cfg, size_t mem_sku) const uint8_t smbios_memory_info_guid[16] = FSP_SMBIOS_MEMORY_INFO_GUID; - if (mem_sku >= lp4cfg->num_skus) { - printk(BIOS_ERR, "Too few LPDDR4 SKUs: 0x%zx/0x%zx\n", - mem_sku, lp4cfg->num_skus); - return; - } + if (!dram_part_num) + dram_part_num = "Unknown"; + /* Locate the memory info HOB */ memory_info_hob = fsp_find_extension_hob_by_guid( smbios_memory_info_guid, @@ -95,8 +93,8 @@ void save_lpddr4_dimm_info(const struct lpddr4_cfg *lp4cfg, size_t mem_sku) memory_info_hob->ConfiguredMemoryClockSpeed, channel_info->ChannelId, src_dimm->DimmId, - lp4cfg->skus[mem_sku].part_num, - strlen(lp4cfg->skus[mem_sku].part_num), + dram_part_num, + strlen(dram_part_num), memory_info_hob->DataWidth); index++; } @@ -105,3 +103,17 @@ void save_lpddr4_dimm_info(const struct lpddr4_cfg *lp4cfg, size_t mem_sku) mem_info->dimm_cnt = index; printk(BIOS_DEBUG, "%d DIMMs found\n", mem_info->dimm_cnt); } + +void save_lpddr4_dimm_info(const struct lpddr4_cfg *lp4cfg, size_t mem_sku) +{ + const char *part_num = NULL; + + if (mem_sku >= lp4cfg->num_skus) { + printk(BIOS_ERR, "Too few LPDDR4 SKUs: 0x%zx/0x%zx\n", + mem_sku, lp4cfg->num_skus); + } else { + part_num = lp4cfg->skus[mem_sku].part_num; + } + + save_lpddr4_dimm_info_part_num(part_num); +} |