coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
spd_util.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#include <
console/console.h
>
4
#include <
mainboard/google/cyan/spd/spd_util.h
>
5
6
/*
7
* 0b0000 - 4GiB total - 2 x 2GiB Samsung K4B4G1646Q-HYK0 1600MHz
8
* 0b0001 - 4GiB total - 2 x 2GiB Hynix H5TC4G63CFR-PBA 1600MHz
9
* 0b0010 - 2GiB total - 1 x 2GiB Samsung K4B4G1646Q-HYK0 1600MHz
10
* 0b0011 - 2GiB total - 1 x 2GiB Hynix H5TC4G63CFR-PBA 1600MHz
11
* 0b0100 - 4GiB total - 2 x 2GiB Samsung K4B4G1646E-BYK0 1600MHz
12
* 0b0101 - 4GiB total - 2 x 2GiB Micron MT41K256M16TW-107 1600MHz
13
* 0b0110 - 2GiB total - 1 x 2GiB Samsung K4B4G1646E-BYK0 1600MHz
14
* 0b0111 - 2GiB total - 1 x 2GiB Micron MT41K256M16TW-107 1600MHz
15
*/
16
17
int
get_variant_spd_index
(
int
ram_id,
int
*dual)
18
{
19
/* Determine if single or dual channel memory system */
20
/* RAMID1 is deterministic for cyan */
21
*dual = ((ram_id >> 1) & 0x1) ? 0 : 1;
22
23
/* Display the RAM type */
24
switch
(ram_id) {
25
case
0:
26
printk
(
BIOS_DEBUG
,
"4GiB Samsung K4B4G1646Q-HYK0 1600MHz\n"
);
27
break
;
28
case
1:
29
printk
(
BIOS_DEBUG
,
"4GiB Hynix H5TC4G63CFR-PBA 1600MHz\n"
);
30
break
;
31
case
2:
32
printk
(
BIOS_DEBUG
,
"2GiB Samsung K4B4G1646Q-HYK0 1600MHz\n"
);
33
break
;
34
case
3:
35
printk
(
BIOS_DEBUG
,
"2GiB Hynix H5TC4G63CFR-PBA 1600MHz\n"
);
36
break
;
37
case
4:
38
printk
(
BIOS_DEBUG
,
"4GiB Samsung K4B4G1646E-BYK0 1600MHz\n"
);
39
break
;
40
case
5:
41
printk
(
BIOS_DEBUG
,
"4GiB Micron MT41K256M16TW-107 1600MHz\n"
);
42
break
;
43
case
6:
44
printk
(
BIOS_DEBUG
,
"2GiB Samsung K4B4G1646E-BYK0 1600MHz\n"
);
45
break
;
46
case
7:
47
printk
(
BIOS_DEBUG
,
"2GiB Micron MT41K256M16TW-107 1600MHz\n"
);
48
break
;
49
}
50
51
/* 1:1 mapping between ram_id and spd_index for cyan */
52
return
ram_id;
53
}
printk
#define printk(level,...)
Definition:
stdlib.h:16
console.h
spd_util.h
get_variant_spd_index
int get_variant_spd_index(int ram_id, int *dual)
Definition:
spd_util.c:21
BIOS_DEBUG
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition:
loglevel.h:128
src
mainboard
google
cyan
variants
cyan
spd_util.c
Generated by
1.9.1