1 /* SPDX-License-Identifier: GPL-2.0-only */
5 #include <console/console.h>
6 #include <northbridge/intel/sandybridge/raminit_native.h>
7 #include <southbridge/intel/bd82x6x/pch.h>
8 #include <southbridge/intel/common/gpio.h>
11 const struct southbridge_usb_port mainboard_usb_ports
[] = {
12 /* enabled, current, OC pin */
13 { 0, 3, 0 }, /* P00 disconnected */
14 { 1, 1, 1 }, /* P01 left or right */
15 { 0, 1, 3 }, /* P02 disconnected */
16 { 1, 3, -1 },/* P03 WWAN */
17 { 0, 1, 2 }, /* P04 disconnected */
18 { 0, 1, -1 },/* P05 disconnected */
19 { 0, 1, -1 },/* P06 disconnected */
20 { 0, 2, -1 },/* P07 disconnected */
21 { 0, 1, -1 },/* P08 disconnected */
22 { 1, 2, 5 }, /* P09 left or right */
23 { 1, 3, -1 },/* P10 FPR */
24 { 1, 3, -1 },/* P11 Bluetooth */
25 { 1, 1, -1 },/* P12 WLAN */
26 { 1, 1, -1 },/* P13 Camera */
29 static uint8_t *get_spd_data(int spd_index
)
34 printk(BIOS_DEBUG
, "spd index %d\n", spd_index
);
35 spd_file
= cbfs_map("spd.bin", &spd_file_len
);
37 die("SPD data not found.");
39 if (spd_file_len
< spd_index
* 256)
40 die("Missing SPD data.");
42 return spd_file
+ spd_index
* 256;
45 void mainboard_get_spd(spd_raw_data
*spd
, bool id_only
)
48 const int spd_gpio_vector
[] = {25, 45, -1};
49 int spd_index
= get_gpios(spd_gpio_vector
);
51 /* 4gb model = 0, 8gb model = 1 */
52 /* int extended_memory_version = get_gpio(44); */
55 * So far there is no need to parse gpio 44, as the 4GiB use
56 * the hynix or elpida memory and 8 GiB versions use samsung.
57 * All version use both channels.
58 * But we might miss some versions.
70 die("Unsupported Memory. (detected 'reserved' memory configuration).");
72 memory
= get_spd_data(spd_index
);
73 memcpy(&spd
[0], memory
, 256);
74 memcpy(&spd
[2], memory
, 256);