Debian Codegraph @

src/mainboard/lenovo/x1_carbon_gen1/early_init.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <console/console.h>
4 #include <gpio.h>
5 #include <northbridge/intel/sandybridge/raminit.h>
6
7 static unsigned int get_spd_index(void)
8 {
9 const gpio_t spd_gpio_vector[] = {25, 45};
10 unsigned int spd_index = gpio_base2_value(spd_gpio_vector,
11 ARRAY_SIZE(spd_gpio_vector));
12
13 /* 4gb model = 0, 8gb model = 1 */
14 /* int extended_memory_version = gpio_get(44); */
15
16 /*
17 * So far there is no need to parse gpio 44, as the 4GiB use
18 * the hynix or elpida memory and 8 GiB versions use samsung.
19 * All version use both channels.
20 * But we might miss some versions.
21 */
22
23 /*
24 * GPIO45 GPIO25
25 * 0 0 elpida
26 * 0 1 hynix
27 * 1 0 samsung
28 * 1 1 reserved
29 */
30
31 if (spd_index == 3)
32 die("Unsupported Memory. (detected 'reserved' memory configuration).");
33
34 return spd_index;
35 }
36
37 void mb_get_spd_map(struct spd_info *spdi)
38 {
39 spdi->addresses[0] = SPD_MEMORY_DOWN;
40 spdi->addresses[2] = SPD_MEMORY_DOWN;
41 spdi->spd_index = get_spd_index();
42 }