mb/intel/ehlcrb: Add EHL CRB memory initialization support

Update memory parameters based on memory type supported by
Elkhart Lake CRB:

1. Update spd data for EHL LPDDR4X memory
   - DQ byte map
   - DQS CPU-DRAM map
   - Rcomp resistor
   - Rcomp target
2. Add configurations for vref_ca & interleaved memory
3. Add EHL CRB on board LPDDR4X SPD data bin file
4. Update mainboard related FSPM UPDs as part of memory
   initialization

Signed-off-by: Tan, Lean Sheng <lean.sheng.tan@intel.com>
Change-Id: Ifd85caa9ac1c9baf443734eb17ad5683ee92ca3b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48127
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
This commit is contained in:
Tan, Lean Sheng 2020-11-27 05:33:08 -08:00 committed by Werner Zeh
parent ed42c7ef51
commit 344f68be10
6 changed files with 114 additions and 5 deletions

View File

@ -7,5 +7,15 @@
void mainboard_memory_init_params(FSPM_UPD *memupd)
{
/* ToDo : Fill FSP-M spd related memory params */
static struct spd_info ehlcrb_spd_info;
const struct mb_cfg *board_cfg = variant_memcfg_config();
/* TODO: Read the resistor strap to get number of memory segments */
bool half_populated = false;
/* Initialize spd information for LPDDR4x board */
ehlcrb_spd_info.read_type = READ_SPD_CBFS;
ehlcrb_spd_info.spd_spec.spd_index = 0x00;
/* Initialize variant specific configurations */
memcfg_init(&memupd->FspmConfig, board_cfg, &ehlcrb_spd_info, half_populated);
}

View File

@ -1,3 +1,3 @@
## SPDX-License-Identifier: GPL-2.0-only
SPD_SOURCES = empty # 0b000
SPD_SOURCES = ehlcrb # 0b000

View File

@ -0,0 +1,32 @@
23 11 11 0E 15 21 90 08 00 40 00 00 02 22 00 00
00 00 04 0F 92 54 05 00 87 00 90 A8 90 C0 08 60
04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 E1 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 20 00 00 00 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

View File

@ -5,4 +5,55 @@
#include <soc/meminit.h>
#include <soc/romstage.h>
/* ToDo : Fill EHL related memory configs */
static const struct mb_cfg ehlcrb_lpddr4x_memcfg_cfg = {
.dq_map[DDR_CH0] = {
{0xf, 0xf0},
{0xf, 0xf0},
{0xff, 0x0},
{0x0, 0x0},
{0x0, 0x0},
{0x0, 0x0}
},
.dq_map[DDR_CH1] = {
{0xf, 0xf0},
{0xf, 0xf0},
{0xff, 0x0},
{0x0, 0x0},
{0x0, 0x0},
{0x0, 0x0}
},
/*
* The dqs_map arrays map the ddr4 pins to the SoC pins
* for both channels.
*
* the index = pin number on ddr4 part
* the value = pin number on SoC
*/
.dqs_map[DDR_CH0] = {3, 0, 1, 2, 7, 4, 5, 6},
.dqs_map[DDR_CH1] = {3, 0, 1, 2, 7, 4, 5, 6},
/* Baseboard uses 100, 100 and 100 rcomp resistors */
.rcomp_resistor = {100, 100, 100},
.rcomp_targets = {60, 40, 30, 20, 30},
/* LPDDR4x does not allow interleaved memory */
.dq_pins_interleaved = 0,
/* Baseboard is using config 2 for vref_ca */
.vref_ca_config = 2,
/* Enable Early Command Training */
.ect = 1,
/* Set Board Type */
.UserBd = BOARD_TYPE_MOBILE,
};
const struct mb_cfg *variant_memcfg_config(void)
{
return &ehlcrb_lpddr4x_memcfg_cfg;
}

View File

@ -88,10 +88,25 @@ struct mb_cfg {
/*
* Rcomp target values. These will typically be the following
* values for Elkhart Lake : { 80, 40, 40, 40, 30 }
* values for Elkhart Lake : { 60, 40, 30, 20, 30 }
*/
uint16_t rcomp_targets[5];
/*
* Indicates whether memory is interleaved.
* Set to 1 for an interleaved design,
* set to 0 for non-interleaved design.
*/
uint8_t dq_pins_interleaved;
/*
* VREF_CA configuration.
* Set to 0 VREF_CA goes to both CH_A and CH_B,
* set to 1 VREF_CA goes to CH_A and VREF_DQ_A goes to CH_B,
* set to 2 VREF_CA goes to CH_A and VREF_DQ_B goes to CH_B.
*/
uint8_t vref_ca_config;
/*
* Early Command Training Enable/Disable Control
* 1 = enable, 0 = disable

View File

@ -109,6 +109,7 @@ void memcfg_init(FSP_M_CONFIG *mem_cfg, const struct mb_cfg *board_cfg,
/* Early Command Training Enabled */
mem_cfg->ECT = board_cfg->ect;
mem_cfg->DqPinsInterleaved = board_cfg->dq_pins_interleaved;
mem_cfg->CaVrefConfig = board_cfg->vref_ca_config;
mem_cfg->UserBd = board_cfg->UserBd;
}