Angel Pons | 89ab250 | 2020-04-03 01:22:28 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Alexander Couzens | db50856 | 2016-10-12 04:44:19 +0200 | [diff] [blame] | 2 | |
Alexander Couzens | db50856 | 2016-10-12 04:44:19 +0200 | [diff] [blame] | 3 | #include <console/console.h> |
Keith Hui | 45e4ab4 | 2023-07-22 12:49:05 -0400 | [diff] [blame] | 4 | #include <northbridge/intel/sandybridge/raminit.h> |
Alexander Couzens | db50856 | 2016-10-12 04:44:19 +0200 | [diff] [blame] | 5 | #include <southbridge/intel/bd82x6x/pch.h> |
| 6 | #include <southbridge/intel/common/gpio.h> |
Alexander Couzens | db50856 | 2016-10-12 04:44:19 +0200 | [diff] [blame] | 7 | |
Alexander Couzens | db50856 | 2016-10-12 04:44:19 +0200 | [diff] [blame] | 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 */ |
| 24 | }; |
| 25 | |
Keith Hui | 45e4ab4 | 2023-07-22 12:49:05 -0400 | [diff] [blame] | 26 | static unsigned int get_spd_index(void) |
Alexander Couzens | db50856 | 2016-10-12 04:44:19 +0200 | [diff] [blame] | 27 | { |
Alexander Couzens | db50856 | 2016-10-12 04:44:19 +0200 | [diff] [blame] | 28 | const int spd_gpio_vector[] = {25, 45, -1}; |
Keith Hui | 45e4ab4 | 2023-07-22 12:49:05 -0400 | [diff] [blame] | 29 | unsigned int spd_index = get_gpios(spd_gpio_vector); |
Alexander Couzens | db50856 | 2016-10-12 04:44:19 +0200 | [diff] [blame] | 30 | |
| 31 | /* 4gb model = 0, 8gb model = 1 */ |
| 32 | /* int extended_memory_version = get_gpio(44); */ |
Alexander Couzens | 532e8a9 | 2018-08-01 18:59:50 +0200 | [diff] [blame] | 33 | |
| 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 Couzens | db50856 | 2016-10-12 04:44:19 +0200 | [diff] [blame] | 40 | |
| 41 | /* |
| 42 | * GPIO45 GPIO25 |
| 43 | * 0 0 elpida |
| 44 | * 0 1 hynix |
| 45 | * 1 0 samsung |
| 46 | * 1 1 reserved |
| 47 | */ |
| 48 | |
Alexander Couzens | 532e8a9 | 2018-08-01 18:59:50 +0200 | [diff] [blame] | 49 | if (spd_index == 3) |
| 50 | die("Unsupported Memory. (detected 'reserved' memory configuration)."); |
Alexander Couzens | db50856 | 2016-10-12 04:44:19 +0200 | [diff] [blame] | 51 | |
Keith Hui | 45e4ab4 | 2023-07-22 12:49:05 -0400 | [diff] [blame] | 52 | return spd_index; |
| 53 | } |
| 54 | |
| 55 | void 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 Couzens | db50856 | 2016-10-12 04:44:19 +0200 | [diff] [blame] | 60 | } |