coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
variant.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <stdint.h>
4 #include <string.h>
5 #include <baseboard/variant.h>
6 #include <fsp/soc_binding.h>
7 
8 #define K4E6E304EE_MEM_ID 0x3
9 
10 void variant_memory_init_params(FSPM_UPD *mupd, const int spd_index)
11 {
12  FSP_M_CONFIG *mem_cfg;
13  mem_cfg = &mupd->FspmConfig;
14 
15  /* DQ byte map */
16  const u8 dq_map[2][12] = {
17  { 0x0F, 0xF0, 0x00, 0xF0, 0x0F, 0xF0,
18  0x0F, 0x00, 0xFF, 0x00, 0xFF, 0x00 },
19  { 0x0F, 0xF0, 0x00, 0xF0, 0x0F, 0xF0,
20  0x0F, 0x00, 0xFF, 0x00, 0xFF, 0x00 } };
21  /* DQS CPU<>DRAM map */
22  const u8 dqs_map[2][8] = {
23  { 0, 1, 3, 2, 6, 5, 4, 7 },
24  { 2, 3, 0, 1, 6, 7, 4, 5 } };
25 
26  /* Rcomp resistor */
27  const u16 RcompResistor[3] = { 200, 81, 162 };
28 
29  /* Rcomp target */
30  const u16 RcompTarget[5] = { 100, 40, 40, 23, 40 };
31 
32  /* Strengthen the Rcomp Target Ctrl for K4E6E304EE_MEM_ID */
33  const u16 StrengthendRcompTarget[5] = { 100, 40, 40, 21, 40 };
34 
35  /* Default Rcomp Target assignment */
36  const u16 *targeted_rcomp = RcompTarget;
37 
38  /* Override Rcomp Target assignment for specific SKU(s) */
40  targeted_rcomp = StrengthendRcompTarget;
41 
42  memcpy(mem_cfg->DqByteMapCh0, dq_map[0], sizeof(mem_cfg->DqByteMapCh0));
43  memcpy(mem_cfg->DqByteMapCh1, dq_map[1], sizeof(mem_cfg->DqByteMapCh1));
44  memcpy(mem_cfg->DqsMapCpu2DramCh0, dqs_map[0], sizeof(mem_cfg->DqsMapCpu2DramCh0));
45  memcpy(mem_cfg->DqsMapCpu2DramCh1, dqs_map[1], sizeof(mem_cfg->DqsMapCpu2DramCh1));
46  memcpy(mem_cfg->RcompResistor, RcompResistor, sizeof(mem_cfg->RcompResistor));
47  memcpy(mem_cfg->RcompTarget, RcompTarget, sizeof(mem_cfg->RcompTarget));
48 }
void * memcpy(void *dest, const void *src, size_t n)
Definition: memcpy.c:7
#define FSP_M_CONFIG
Definition: fsp_upd.h:8
void variant_memory_init_params(FSPM_UPD *mupd, const int spd_index)
Definition: variant.c:9
#define K4E6E304EE_MEM_ID
Definition: variant.c:8
static const int spd_index[32]
Definition: memory.c:10
static const u8 dqs_map[][8]
Definition: memory.c:17
static const u8 dq_map[][12]
Definition: memory.c:9
uint16_t u16
Definition: stdint.h:48
uint8_t u8
Definition: stdint.h:45