diff options
author | Felix Singer <felixsinger@posteo.net> | 2021-01-06 03:54:47 +0000 |
---|---|---|
committer | Michael Niewöhner <foss@mniewoehner.de> | 2021-04-19 10:11:09 +0000 |
commit | 7dc57159fe819acb9280522528fb68f3e9befacc (patch) | |
tree | 788fbb3bdc345098940edecfb89277bd6b4908e8 /src/mainboard/clevo/kbl-u/variants | |
parent | 8434d92c305b2c04a61e42cbb2882a829cfb4f67 (diff) |
mb/clevo/kbl-u: Move memory init config to variant level
Memory init config is board specific. Thus, move it to variant level and
hook up variant romstage.c.
Change-Id: Id78788815ad9c4ed64f0172fb746ff6e50d608ef
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49132
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
Diffstat (limited to 'src/mainboard/clevo/kbl-u/variants')
-rw-r--r-- | src/mainboard/clevo/kbl-u/variants/n13xwu/romstage.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/mainboard/clevo/kbl-u/variants/n13xwu/romstage.c b/src/mainboard/clevo/kbl-u/variants/n13xwu/romstage.c new file mode 100644 index 0000000000..4e9d57c21a --- /dev/null +++ b/src/mainboard/clevo/kbl-u/variants/n13xwu/romstage.c @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <fsp/api.h> +#include <spd_bin.h> +#include <string.h> +#include <variant/romstage.h> + +static void mainboard_fill_rcomp_res_data(void *rcomp_ptr) +{ + const u16 RcompResistor[3] = {121, 81, 100}; + memcpy(rcomp_ptr, RcompResistor, sizeof(RcompResistor)); +} + +static void mainboard_fill_rcomp_strength_data(void *rcomp_strength_ptr) +{ + const u16 RcompTarget[5] = {100, 40, 20, 20, 26}; + memcpy(rcomp_strength_ptr, RcompTarget, sizeof(RcompTarget)); +} + +void variant_configure_fspm(FSPM_UPD *mupd) +{ + FSP_M_CONFIG *mem_cfg = &mupd->FspmConfig; + + struct spd_block blk = { + .addr_map = {0x50, 0x52}, + }; + + get_spd_smbus(&blk); + dump_spd_info(&blk); + + mainboard_fill_rcomp_res_data(&mem_cfg->RcompResistor); + mainboard_fill_rcomp_strength_data(&mem_cfg->RcompTarget); + + mem_cfg->DqPinsInterleaved = TRUE; + mem_cfg->MemorySpdDataLen = blk.len; + mem_cfg->MemorySpdPtr00 = (uintptr_t)blk.spd_array[0]; + mem_cfg->MemorySpdPtr10 = (uintptr_t)blk.spd_array[1]; +} |