diff options
author | Paul Menzel <paulepanter@users.sourceforge.net> | 2013-04-29 23:21:07 +0200 |
---|---|---|
committer | Nico Huber <nico.huber@secunet.com> | 2013-05-26 18:01:22 +0200 |
commit | ac6ea04b627e9a045a1600fa36e44150e9e5622b (patch) | |
tree | 0fd7e9b0fc3eec93c71e9b4bc3177976d5a38928 /src | |
parent | c6d1da0b18a35470c5cf5d366d33fac957ae7974 (diff) | |
download | coreboot-ac6ea04b627e9a045a1600fa36e44150e9e5622b.tar.xz |
Lenovo ThinkPad T60: Add support for `EARLY_CBMEM_INIT` needed for CBMEM console
Add code to support `EARLY_CBMEM_INIT` needed for CBMEM console
support by copying GNUtoo’s commit for the Lenovo ThinkPad X60.
commit 4560ca5003fe38a066616e8de1a8a414284750fd
Author: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Date: Fri Apr 26 12:21:41 2013 +0200
Lenovo ThinkPad X60: Init CBMEM early for CBMEM console support.
Reviewed-on: http://review.coreboot.org/3142
Change-Id: I0c4ca5a5e60f4bb3b91653a133ec71039fcca6ab
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: http://review.coreboot.org/3187
Tested-by: build bot (Jenkins)
Reviewed-by: Denis Carikli <GNUtoo@no-log.org>
Reviewed-by: Aaron Durbin <adurbin@google.com>
Reviewed-by: Nico Huber <nico.huber@secunet.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mainboard/lenovo/t60/Kconfig | 1 | ||||
-rw-r--r-- | src/mainboard/lenovo/t60/romstage.c | 16 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/mainboard/lenovo/t60/Kconfig b/src/mainboard/lenovo/t60/Kconfig index 379d1ec27f..952004bb38 100644 --- a/src/mainboard/lenovo/t60/Kconfig +++ b/src/mainboard/lenovo/t60/Kconfig @@ -22,6 +22,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select CHANNEL_XOR_RANDOMIZATION select HAVE_ACPI_TABLES select HAVE_ACPI_RESUME + select EARLY_CBMEM_INIT config MAINBOARD_DIR string default lenovo/t60 diff --git a/src/mainboard/lenovo/t60/romstage.c b/src/mainboard/lenovo/t60/romstage.c index 5e11613c5c..16971fc44f 100644 --- a/src/mainboard/lenovo/t60/romstage.c +++ b/src/mainboard/lenovo/t60/romstage.c @@ -29,6 +29,7 @@ #include <device/pnp_def.h> #include <cpu/x86/lapic.h> #include <lib.h> +#include <cbmem.h> #include <pc80/mc146818rtc.h> #include <console/console.h> #include <cpu/x86/bist.h> @@ -203,12 +204,11 @@ static void early_ich7_init(void) RCBA32(0x2034) = reg32; } -#include <cbmem.h> - void main(unsigned long bist) { u32 reg32; int boot_mode = 0, dock_err; + int cbmem_was_initted; const u8 spd_addrmap[2 * DIMM_SOCKETS] = { 0x50, 0x52, 0x51, 0x53 }; if (bist == 0) @@ -314,14 +314,13 @@ void main(unsigned long bist) MCHBAR16(SSKPD) = 0xCAFE; -#if CONFIG_HAVE_ACPI_RESUME - /* Start address of high memory tables */ - unsigned long high_ram_base = get_top_of_ram() - HIGH_MEMORY_SIZE; + cbmem_was_initted = !cbmem_initialize(); +#if CONFIG_HAVE_ACPI_RESUME /* 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. */ - 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); /* 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); } #endif + +#if CONFIG_CONSOLE_CBMEM + /* Keep this the last thing this function does. */ + cbmemc_reinit(); +#endif } |