mb/ocp/tiogapass: Fix GPIOs
[coreboot2.git] / src / mainboard / lenovo / x1_carbon_gen1 / early_init.c
blobb525a0bc4b4037dbcfbe010c89109e043e4401c0
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <northbridge/intel/sandybridge/raminit.h>
5 #include <southbridge/intel/bd82x6x/pch.h>
6 #include <southbridge/intel/common/gpio.h>
8 const struct southbridge_usb_port mainboard_usb_ports[] = {
9 /* enabled, current, OC pin */
10 { 0, 3, 0 }, /* P00 disconnected */
11 { 1, 1, 1 }, /* P01 left or right */
12 { 0, 1, 3 }, /* P02 disconnected */
13 { 1, 3, -1 },/* P03 WWAN */
14 { 0, 1, 2 }, /* P04 disconnected */
15 { 0, 1, -1 },/* P05 disconnected */
16 { 0, 1, -1 },/* P06 disconnected */
17 { 0, 2, -1 },/* P07 disconnected */
18 { 0, 1, -1 },/* P08 disconnected */
19 { 1, 2, 5 }, /* P09 left or right */
20 { 1, 3, -1 },/* P10 FPR */
21 { 1, 3, -1 },/* P11 Bluetooth */
22 { 1, 1, -1 },/* P12 WLAN */
23 { 1, 1, -1 },/* P13 Camera */
26 static unsigned int get_spd_index(void)
28 const int spd_gpio_vector[] = {25, 45, -1};
29 unsigned int spd_index = get_gpios(spd_gpio_vector);
31 /* 4gb model = 0, 8gb model = 1 */
32 /* int extended_memory_version = get_gpio(44); */
35 * So far there is no need to parse gpio 44, as the 4GiB use
36 * the hynix or elpida memory and 8 GiB versions use samsung.
37 * All version use both channels.
38 * But we might miss some versions.
42 * GPIO45 GPIO25
43 * 0 0 elpida
44 * 0 1 hynix
45 * 1 0 samsung
46 * 1 1 reserved
49 if (spd_index == 3)
50 die("Unsupported Memory. (detected 'reserved' memory configuration).");
52 return spd_index;
55 void mb_get_spd_map(struct spd_info *spdi)
57 spdi->addresses[0] = SPD_MEMORY_DOWN;
58 spdi->addresses[2] = SPD_MEMORY_DOWN;
59 spdi->spd_index = get_spd_index();