mb/google/volteer: add support for ddr4 memory

Add new ddr_memory_cfg structure to support both DDR4 and LPDDR4x
memory types.

Change existing variant code to use the new meminit_ddr() call
instead of calling meminit_lpddr4x() directly.

BUG=b:161772961
TEST='emerge-volteer coreboot chromeos-bootimage' and verify that
volteer still boots.  NOTE that this only tests the lpddr4 side
of the implementation as I do not have a DDR4 board to test this on.

Change-Id: Id4bca2bfa97530f0d04a0e8d90f01b8281d2aea6
Signed-off-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44250
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Caveh Jalali <caveh@chromium.org>
This commit is contained in:
Nick Vaccaro 2020-08-05 14:50:40 -07:00
parent 0cc63ccaa2
commit ce25b947e0
8 changed files with 45 additions and 15 deletions

View File

@ -15,7 +15,7 @@
void mainboard_memory_init_params(FSPM_UPD *mupd)
{
FSP_M_CONFIG *mem_cfg = &mupd->FspmConfig;
const struct lpddr4x_cfg *board_cfg = variant_memory_params();
const struct ddr_memory_cfg *board_cfg = variant_memory_params();
const struct spd_info spd_info = {
.topology = MEMORY_DOWN,
.md_spd_loc = SPD_CBFS,
@ -27,7 +27,7 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
if (fw_config_probe(FW_CONFIG(AUDIO, NONE)))
mem_cfg->PchHdaEnable = 0;
meminit_lpddr4x(mem_cfg, board_cfg, &spd_info, half_populated);
meminit_ddr(mem_cfg, board_cfg, &spd_info, half_populated);
}
bool mainboard_get_dram_part_num(const char **part_num, size_t *len)

View File

@ -18,7 +18,7 @@ const struct pad_config *variant_override_gpio_table(size_t *num);
const struct cros_gpio *variant_cros_gpios(size_t *num);
const struct lpddr4x_cfg *variant_memory_params(void);
const struct ddr_memory_cfg *variant_memory_params(void);
int variant_memory_sku(void);
#endif /* __BASEBOARD_VARIANTS_H__ */

View File

@ -4,7 +4,7 @@
#include <baseboard/variants.h>
#include <gpio.h>
static const struct lpddr4x_cfg baseboard_memcfg = {
static const struct lpddr4x_cfg baseboard_lpddr4x_memcfg = {
/* DQ CPU<>DRAM map */
.dq_map = {
[0] = {
@ -56,7 +56,12 @@ static const struct lpddr4x_cfg baseboard_memcfg = {
.ect = 1, /* Enable Early Command Training */
};
const struct lpddr4x_cfg *__weak variant_memory_params(void)
static const struct ddr_memory_cfg baseboard_memcfg = {
.mem_type = MEMTYPE_LPDDR4X,
.lpddr4_cfg = &baseboard_lpddr4x_memcfg
};
const struct ddr_memory_cfg *__weak variant_memory_params(void)
{
return &baseboard_memcfg;
}

View File

@ -54,7 +54,12 @@ static const struct lpddr4x_cfg delbin_memcfg = {
.ect = 1, /* Enable Early Command Training */
};
const struct lpddr4x_cfg *variant_memory_params(void)
static const struct ddr_memory_cfg board_memcfg = {
.mem_type = MEMTYPE_LPDDR4X,
.lpddr4_cfg = &delbin_memcfg
};
const struct ddr_memory_cfg *variant_memory_params(void)
{
return &delbin_memcfg;
return &board_memcfg;
}

View File

@ -54,7 +54,12 @@ static const struct lpddr4x_cfg malefor_memcfg = {
.ect = 1, /* Enable Early Command Training */
};
const struct lpddr4x_cfg *variant_memory_params(void)
static const struct ddr_memory_cfg board_memcfg = {
.mem_type = MEMTYPE_LPDDR4X,
.lpddr4_cfg = &malefor_memcfg
};
const struct ddr_memory_cfg *variant_memory_params(void)
{
return &malefor_memcfg;
return &board_memcfg;
}

View File

@ -54,7 +54,12 @@ static const struct lpddr4x_cfg terrador_memcfg = {
.ect = 1, /* Enable Early Command Training */
};
const struct lpddr4x_cfg *variant_memory_params(void)
static const struct ddr_memory_cfg board_memcfg = {
.mem_type = MEMTYPE_LPDDR4X,
.lpddr4_cfg = &terrador_memcfg
};
const struct ddr_memory_cfg *variant_memory_params(void)
{
return &terrador_memcfg;
return &board_memcfg;
}

View File

@ -54,7 +54,12 @@ static const struct lpddr4x_cfg todor_memcfg = {
.ect = 1, /* Enable Early Command Training */
};
const struct lpddr4x_cfg *variant_memory_params(void)
static const struct ddr_memory_cfg board_memcfg = {
.mem_type = MEMTYPE_LPDDR4X,
.lpddr4_cfg = &todor_memcfg
};
const struct ddr_memory_cfg *variant_memory_params(void)
{
return &todor_memcfg;
return &board_memcfg;
}

View File

@ -54,7 +54,12 @@ static const struct lpddr4x_cfg voxel_memcfg = {
.ect = 1, /* Enable Early Command Training */
};
const struct lpddr4x_cfg *variant_memory_params(void)
static const struct ddr_memory_cfg board_memcfg = {
.mem_type = MEMTYPE_LPDDR4X,
.lpddr4_cfg = &voxel_memcfg
};
const struct ddr_memory_cfg *variant_memory_params(void)
{
return &voxel_memcfg;
return &board_memcfg;
}