1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/pci_ops.h>
4 #include <console/console.h>
5 #include <northbridge/intel/sandybridge/raminit.h>
6 #include <southbridge/intel/bd82x6x/pch.h>
7 #include <southbridge/intel/common/gpio.h>
10 void mainboard_pch_lpc_setup(void)
12 /* Memory map KB9012 EC registers */
15 CONFIG_EC_BASE_ADDRESS
| 1);
16 pci_write_config16(PCH_LPC_DEV
, BIOS_DEC_EN1
, 0xffc0);
18 /* Enable external USB port power. */
20 ec_mm_set_bit(0x3b, 4);
23 static const char *mainboard_spd_names
[9] = {
35 static unsigned int get_spd_index(void)
37 const int spd_gpios
[] = {71, 70, 16, 48, -1};
39 unsigned int spd_index
= get_gpios(spd_gpios
);
40 if (spd_index
>= ARRAY_SIZE(mainboard_spd_names
)) {
41 /* Fallback to pessimistic 2GB image (ELPIDA 2GB) */
48 void mb_get_spd_map(struct spd_info
*spdi
)
50 unsigned int spd_index
= get_spd_index();
52 printk(BIOS_INFO
, "SPD index %d (%s)\n",
53 spd_index
, mainboard_spd_names
[spd_index
]);
55 /* C0S0 is a soldered RAM with no real SPD. Use stored SPD. */
56 spdi
->addresses
[0] = SPD_MEMORY_DOWN
;
57 spdi
->spd_index
= spd_index
;