blob: b525a0bc4b4037dbcfbe010c89109e043e4401c0 [file] [log] [blame]
Angel Pons89ab2502020-04-03 01:22:28 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Alexander Couzensdb508562016-10-12 04:44:19 +02002
Alexander Couzensdb508562016-10-12 04:44:19 +02003#include <console/console.h>
Keith Hui45e4ab42023-07-22 12:49:05 -04004#include <northbridge/intel/sandybridge/raminit.h>
Alexander Couzensdb508562016-10-12 04:44:19 +02005#include <southbridge/intel/bd82x6x/pch.h>
6#include <southbridge/intel/common/gpio.h>
Alexander Couzensdb508562016-10-12 04:44:19 +02007
Alexander Couzensdb508562016-10-12 04:44:19 +02008const 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 */
24};
25
Keith Hui45e4ab42023-07-22 12:49:05 -040026static unsigned int get_spd_index(void)
Alexander Couzensdb508562016-10-12 04:44:19 +020027{
Alexander Couzensdb508562016-10-12 04:44:19 +020028 const int spd_gpio_vector[] = {25, 45, -1};
Keith Hui45e4ab42023-07-22 12:49:05 -040029 unsigned int spd_index = get_gpios(spd_gpio_vector);
Alexander Couzensdb508562016-10-12 04:44:19 +020030
31 /* 4gb model = 0, 8gb model = 1 */
32 /* int extended_memory_version = get_gpio(44); */
Alexander Couzens532e8a92018-08-01 18:59:50 +020033
34 /*
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.
39 */
Alexander Couzensdb508562016-10-12 04:44:19 +020040
41 /*
42 * GPIO45 GPIO25
43 * 0 0 elpida
44 * 0 1 hynix
45 * 1 0 samsung
46 * 1 1 reserved
47 */
48
Alexander Couzens532e8a92018-08-01 18:59:50 +020049 if (spd_index == 3)
50 die("Unsupported Memory. (detected 'reserved' memory configuration).");
Alexander Couzensdb508562016-10-12 04:44:19 +020051
Keith Hui45e4ab42023-07-22 12:49:05 -040052 return spd_index;
53}
54
55void mb_get_spd_map(struct spd_info *spdi)
56{
57 spdi->addresses[0] = SPD_MEMORY_DOWN;
58 spdi->addresses[2] = SPD_MEMORY_DOWN;
59 spdi->spd_index = get_spd_index();
Alexander Couzensdb508562016-10-12 04:44:19 +020060}