coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
meminit.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#ifndef _SOC_JASPERLAKE_MEMINIT_H_
4
#define _SOC_JASPERLAKE_MEMINIT_H_
5
6
#include <types.h>
7
#include <fsp/soc_binding.h>
8
9
/* Number of dq bits controlled per dqs */
10
#define DQ_BITS_PER_DQS 8
11
12
/* Number of memory packages, where a "package" represents a 64-bit solution */
13
#define DDR_NUM_PACKAGES 2
14
15
/* Number of DQ byte mappings */
16
#define DDR_NUM_BYTE_MAPPINGS 6
17
18
/* Number of memory DIMM slots available on Jasper Lake */
19
#define NUM_DIMM_SLOT 4
20
21
/* 64-bit Channel identification */
22
enum
{
23
DDR_CH0
,
24
DDR_CH1
,
25
DDR_NUM_CHANNELS
26
};
27
28
struct
spd_by_pointer
{
29
size_t
spd_data_len
;
30
uintptr_t
spd_data_ptr
;
31
};
32
33
enum
mem_info_read_type
{
34
READ_SPD_CBFS
,
/* Find SPD file in CBFS. */
35
READ_SMBUS
,
/* Read on-module SPD by SMBUS. */
36
READ_SPD_MEMPTR
/* Find SPD data from pointer. */
37
};
38
39
struct
spd_info
{
40
enum
mem_info_read_type
read_type
;
41
union
spd_data_by {
42
/* To read on-module SPD when read_type is READ_SMBUS. */
43
uint8_t
spd_smbus_address
[
NUM_DIMM_SLOT
];
44
45
/* To identify SPD file when read_type is READ_SPD_CBFS. */
46
int
spd_index
;
47
48
/* To find SPD data when read_type is READ_SPD_MEMPTR. */
49
struct
spd_by_pointer
spd_data_ptr_info
;
50
}
spd_spec
;
51
};
52
53
/* Board-specific memory dq mapping information */
54
struct
mb_cfg
{
55
56
/*
57
* For each channel, there are 6 sets of DQ byte mappings,
58
* where each set has a package 0 and a package 1 value (package 0
59
* represents the first 64-bit lpddr4 chip combination, and package 1
60
* represents the second 64-bit lpddr4 chip combination).
61
* The first three sets are for CLK, CMD, and CTL.
62
* The fsp package actually expects 6 sets, even though the last 3 sets
63
* are not used in JSL.
64
* We let the meminit_dq_dqs_map routine take care of clearing the
65
* unused fields for the caller.
66
* Note that dq_map is only used by LPDDR; it does not need to be
67
* initialized for designs using DDR4.
68
*/
69
uint8_t
dq_map
[
DDR_NUM_CHANNELS
][
DDR_NUM_BYTE_MAPPINGS
][
DDR_NUM_PACKAGES
];
70
71
/*
72
* DQS CPU<>DRAM map Ch0 and Ch1. Each array entry represents a
73
* mapping of a dq bit on the CPU to the bit it's connected to on
74
* the memory part. The array index represents the dqs bit number
75
* on the memory part, and the values in the array represent which
76
* pin on the CPU that DRAM pin connects to.
77
* dqs_map is only used by LPDDR; same comments apply as for dq_map
78
* above.
79
*/
80
uint8_t
dqs_map
[
DDR_NUM_CHANNELS
][
DQ_BITS_PER_DQS
];
81
82
/*
83
* Rcomp resistor values. These values represent the resistance in
84
* ohms of the three rcomp resistors attached to the DDR_COMP_0,
85
* DDR_COMP_1, and DDR_COMP_2 pins on the DRAM.
86
*/
87
uint16_t
rcomp_resistor
[3];
88
89
/*
90
* Rcomp target values. These will typically be the following
91
* values for Jasper Lake : { 80, 40, 40, 40, 30 }
92
*/
93
uint16_t
rcomp_targets
[5];
94
95
/*
96
* Early Command Training Enable/Disable Control
97
* 1 = enable, 0 = disable
98
*/
99
uint8_t
ect
;
100
101
/* Board type */
102
uint8_t
UserBd
;
103
};
104
105
/*
106
* Initialize default memory configurations for Jasper Lake.
107
*/
108
109
void
memcfg_init
(
FSP_M_CONFIG
*mem_cfg,
const
struct
mb_cfg
*
board_cfg
,
110
const
struct
spd_info
*
spd_info
,
bool
half_populated);
111
112
#endif
/* _SOC_JASPERLAKE_MEMINIT_H_ */
memcfg_init
void memcfg_init(FSPM_UPD *memupd, const struct mb_cfg *mb_cfg, const struct mem_spd *spd_info, bool half_populated)
Definition:
meminit.c:238
mem_info_read_type
mem_info_read_type
Definition:
cnl_memcfg_init.h:33
DDR_CH0
@ DDR_CH0
Definition:
meminit.h:23
DDR_NUM_CHANNELS
@ DDR_NUM_CHANNELS
Definition:
meminit.h:25
DDR_CH1
@ DDR_CH1
Definition:
meminit.h:24
READ_SPD_MEMPTR
@ READ_SPD_MEMPTR
Definition:
meminit.h:36
READ_SMBUS
@ READ_SMBUS
Definition:
meminit.h:35
READ_SPD_CBFS
@ READ_SPD_CBFS
Definition:
meminit.h:34
FSP_M_CONFIG
#define FSP_M_CONFIG
Definition:
fsp_upd.h:8
DDR_NUM_PACKAGES
#define DDR_NUM_PACKAGES
Definition:
meminit.h:13
DQ_BITS_PER_DQS
#define DQ_BITS_PER_DQS
Definition:
meminit.h:10
DDR_NUM_BYTE_MAPPINGS
#define DDR_NUM_BYTE_MAPPINGS
Definition:
meminit.h:16
NUM_DIMM_SLOT
#define NUM_DIMM_SLOT
Definition:
meminit.h:19
board_cfg
static const struct mb_cfg board_cfg
Definition:
romstage.c:8
uint16_t
unsigned short uint16_t
Definition:
stdint.h:11
uintptr_t
unsigned long uintptr_t
Definition:
stdint.h:21
uint8_t
unsigned char uint8_t
Definition:
stdint.h:8
mb_cfg
Definition:
meminit.h:71
mb_cfg::rcomp_targets
uint16_t rcomp_targets[5]
Definition:
meminit.h:93
mb_cfg::ect
bool ect
Definition:
meminit.h:100
mb_cfg::dqs_map
uint8_t dqs_map[CONFIG_DATA_BUS_WIDTH/BITS_PER_BYTE]
Definition:
meminit.h:90
mb_cfg::UserBd
uint8_t UserBd
Definition:
meminit.h:103
mb_cfg::rcomp_resistor
uint16_t rcomp_resistor[3]
Definition:
meminit.h:87
mb_cfg::dq_map
uint8_t dq_map[CONFIG_DATA_BUS_WIDTH]
Definition:
meminit.h:80
spd_by_pointer
Definition:
cnl_memcfg_init.h:28
spd_by_pointer::spd_data_ptr
uintptr_t spd_data_ptr
Definition:
cnl_memcfg_init.h:30
spd_by_pointer::spd_data_len
size_t spd_data_len
Definition:
cnl_memcfg_init.h:29
spd_info
Definition:
spd.h:11
spd_info::spd_spec
union spd_info::spd_data_by spd_spec
spd_info::read_type
enum mem_info_read_type read_type
Definition:
cnl_memcfg_init.h:41
spd_info::spd_data_by::spd_index
int spd_index
Definition:
cnl_memcfg_init.h:47
spd_info::spd_data_by::spd_data_ptr_info
struct spd_by_pointer spd_data_ptr_info
Definition:
cnl_memcfg_init.h:50
spd_info::spd_data_by::spd_smbus_address
uint8_t spd_smbus_address
Definition:
cnl_memcfg_init.h:44
src
soc
intel
jasperlake
include
soc
meminit.h
Generated by
1.9.1