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 Hynix H9CCNNN8GTMLAR-NUD 1600MHz
8
* 0b0001 - 2GiB total - 1 x 2GiB Hynix H9CCNNN8GTMLAR-NUD 1600MHz
9
* 0b0010 - 4GiB total - 2 x 2GiB Micron MT52L256M32D1PF-107
10
* 0b0011 - 2GiB total - 1 x 2GiB Micron MT52L256M32D1PF-107
11
* 0b0100 - 4GiB total - 2 x 2GiB Samsung K4E8E324EB-EGCF 1600MHz
12
* 0b0101 - 2GiB total - 1 x 2GiB Samsung K4E8E324EB-EGCF 1600MHz
13
* 0b0110 - 4GiB total - 2 x 2GiB Hynix H9CCNNN8GTALAR-NUD
14
* 0b0111 - 2GiB total - 1 x 2GiB Hynix H9CCNNN8GTALAR-NUD
15
*
16
*/
17
18
static
const
uint32_t
dual_channel_config
=
19
(1 << 0) | (1 << 2) | (1 << 4) | (1 << 6);
20
21
int
get_variant_spd_index
(
int
ram_id,
int
*dual)
22
{
23
/* Determine if single or dual channel memory system */
24
*dual = (
dual_channel_config
& (1 << ram_id)) ? 1 : 0;
25
26
/* Display the RAM type */
27
switch
(ram_id) {
28
case
0:
29
printk
(
BIOS_DEBUG
,
"4GiB Hynix H9CCNNN8GTMLAR-NUD\n"
);
30
break
;
31
case
1:
32
printk
(
BIOS_DEBUG
,
"2GiB Hynix H9CCNNN8GTMLAR-NUD\n"
);
33
break
;
34
case
2:
35
printk
(
BIOS_DEBUG
,
"4GiB Micron MT52L256M32D1PF-107\n"
);
36
break
;
37
case
3:
38
printk
(
BIOS_DEBUG
,
"2GiB Micron MT52L256M32D1PF-107\n"
);
39
break
;
40
case
4:
41
printk
(
BIOS_DEBUG
,
"4GiB Samsung K4E8E324EB-EGCF\n"
);
42
break
;
43
case
5:
44
printk
(
BIOS_DEBUG
,
"2GiB Samsung K4E8E324EB-EGCF\n"
);
45
break
;
46
case
6:
47
printk
(
BIOS_DEBUG
,
"4GiB Hynix H9CCNNN8GTALAR-NUD\n"
);
48
break
;
49
case
7:
50
printk
(
BIOS_DEBUG
,
"2GiB Hynix H9CCNNN8GTALAR-NUD\n"
);
51
break
;
52
}
53
54
/* 1:1 mapping between ram_id and spd_index for kefka */
55
return
ram_id;
56
}
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
dual_channel_config
static const uint32_t dual_channel_config
Definition:
spd_util.c:18
BIOS_DEBUG
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition:
loglevel.h:128
uint32_t
unsigned int uint32_t
Definition:
stdint.h:14
src
mainboard
google
cyan
variants
kefka
spd_util.c
Generated by
1.9.1