Lenovo ThinkPad X60: Init CBMEM early for CBMEM console support.
Enable `EARLY_CBMEM_INIT` for CBMEM console support by looking how other boards do this. This commit is tested by enabling the CBMEM console (`CONSOLE_CBMEM` in Kconfig) and then in GRUB 2 (as a payload) with the cbmemc command from the cbmemc module and in userspace with ./cbmem -c. Both worked. Change-Id: I34618a55ded7292a411bc232eb76267eec17d91e Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> Reviewed-on: http://review.coreboot.org/3142 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Aaron Durbin <adurbin@google.com> Tested-by: build bot (Jenkins)
This commit is contained in:
parent
bf92b19b2a
commit
4560ca5003
|
@ -24,6 +24,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
|
||||||
select HAVE_ACPI_RESUME
|
select HAVE_ACPI_RESUME
|
||||||
select USE_OPTION_TABLE
|
select USE_OPTION_TABLE
|
||||||
select MAINBOARD_HAS_NATIVE_VGA_INIT
|
select MAINBOARD_HAS_NATIVE_VGA_INIT
|
||||||
|
select EARLY_CBMEM_INIT
|
||||||
|
|
||||||
config MAINBOARD_DIR
|
config MAINBOARD_DIR
|
||||||
string
|
string
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <device/pnp_def.h>
|
#include <device/pnp_def.h>
|
||||||
#include <cpu/x86/lapic.h>
|
#include <cpu/x86/lapic.h>
|
||||||
#include <lib.h>
|
#include <lib.h>
|
||||||
|
#include <cbmem.h>
|
||||||
#include <pc80/mc146818rtc.h>
|
#include <pc80/mc146818rtc.h>
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <cpu/x86/bist.h>
|
#include <cpu/x86/bist.h>
|
||||||
|
@ -210,12 +211,11 @@ static void early_ich7_init(void)
|
||||||
RCBA32(0x2034) = reg32;
|
RCBA32(0x2034) = reg32;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <cbmem.h>
|
|
||||||
|
|
||||||
void main(unsigned long bist)
|
void main(unsigned long bist)
|
||||||
{
|
{
|
||||||
u32 reg32;
|
u32 reg32;
|
||||||
int boot_mode = 0;
|
int boot_mode = 0;
|
||||||
|
int cbmem_was_initted;
|
||||||
const u8 spd_addrmap[2 * DIMM_SOCKETS] = { 0x50, 0x52, 0x51, 0x53 };
|
const u8 spd_addrmap[2 * DIMM_SOCKETS] = { 0x50, 0x52, 0x51, 0x53 };
|
||||||
|
|
||||||
if (bist == 0)
|
if (bist == 0)
|
||||||
|
@ -314,14 +314,13 @@ void main(unsigned long bist)
|
||||||
|
|
||||||
MCHBAR16(SSKPD) = 0xCAFE;
|
MCHBAR16(SSKPD) = 0xCAFE;
|
||||||
|
|
||||||
#if CONFIG_HAVE_ACPI_RESUME
|
cbmem_was_initted = !cbmem_initialize();
|
||||||
/* Start address of high memory tables */
|
|
||||||
unsigned long high_ram_base = get_top_of_ram() - HIGH_MEMORY_SIZE;
|
|
||||||
|
|
||||||
|
#if CONFIG_HAVE_ACPI_RESUME
|
||||||
/* If there is no high memory area, we didn't boot before, so
|
/* If there is no high memory area, we didn't boot before, so
|
||||||
* this is not a resume. In that case we just create the cbmem toc.
|
* this is not a resume. In that case we just create the cbmem toc.
|
||||||
*/
|
*/
|
||||||
if ((boot_mode == 2) && cbmem_reinit((u64)high_ram_base)) {
|
if ((boot_mode == 2) && cbmem_was_initted) {
|
||||||
void *resume_backup_memory = cbmem_find(CBMEM_ID_RESUME);
|
void *resume_backup_memory = cbmem_find(CBMEM_ID_RESUME);
|
||||||
|
|
||||||
/* copy 1MB - 64K to high tables ram_base to prevent memory corruption
|
/* copy 1MB - 64K to high tables ram_base to prevent memory corruption
|
||||||
|
@ -336,4 +335,9 @@ void main(unsigned long bist)
|
||||||
pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD, SKPAD_ACPI_S3_MAGIC);
|
pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD, SKPAD_ACPI_S3_MAGIC);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if CONFIG_CONSOLE_CBMEM
|
||||||
|
/* Keep this the last thing this function does. */
|
||||||
|
cbmemc_reinit();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue