Aaron Durbin (adurbin(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3135
-gerrit
commit 068b03d9b072fdf0b86dadf1d2777798d1e46219
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Wed Apr 24 16:28:52 2013 -0500
coverage: use boot state callbacks
Utilize the static boot state callback scheduling to initialize
and tear down the coverage infrastructure at the appropriate points.
The coverage initialization is performed at BS_PRE_DEVICE which is the
earliest point a callback can be called. The tear down occurs at the
2 exit points of ramstage: OS resume and payload boot.
Change-Id: Ie5ee51268e1f473f98fa517710a266e38dc01b6d
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/arch/x86/boot/acpi.c | 4 ----
src/include/coverage.h | 21 ---------------------
src/lib/gcov-glue.c | 12 ++++++++----
src/lib/hardwaremain.c | 5 -----
src/lib/selfboot.c | 4 ----
5 files changed, 8 insertions(+), 38 deletions(-)
diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c
index 1c373ac..a3bf718 100644
--- a/src/arch/x86/boot/acpi.c
+++ b/src/arch/x86/boot/acpi.c
@@ -36,7 +36,6 @@
#if CONFIG_COLLECT_TIMESTAMPS
#include <timestamp.h>
#endif
-#include <coverage.h>
/* FIXME: Kconfig doesn't support overridable defaults :-( */
#ifndef CONFIG_HPET_MIN_TICKS
@@ -638,9 +637,6 @@ void acpi_resume(void *wake_vec)
/* Call mainboard resume handler first, if defined. */
if (mainboard_suspend_resume)
mainboard_suspend_resume();
-#if CONFIG_COVERAGE
- coverage_exit();
-#endif
/* Tear down the caching of the ROM. */
if (disable_cache_rom)
disable_cache_rom();
diff --git a/src/include/coverage.h b/src/include/coverage.h
deleted file mode 100644
index e1c50c5..0000000
--- a/src/include/coverage.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2012 Google, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
- */
-
-void coverage_init(void);
-void coverage_exit(void);
diff --git a/src/lib/gcov-glue.c b/src/lib/gcov-glue.c
index 4e2b290..ab9062b 100644
--- a/src/lib/gcov-glue.c
+++ b/src/lib/gcov-glue.c
@@ -18,8 +18,8 @@
*/
#include <stdint.h>
+#include <bootstate.h>
#include <cbmem.h>
-#include <coverage.h>
typedef struct file {
uint32_t magic;
@@ -128,7 +128,7 @@ static void setbuf(FILE *stream, char *buf)
gcc_assert(buf == 0);
}
-void coverage_init(void)
+static void coverage_init(void *unused)
{
extern long __CTOR_LIST__;
typedef void (*func_ptr)(void) ;
@@ -142,7 +142,7 @@ void coverage_init(void)
}
void __gcov_flush(void);
-void coverage_exit(void)
+static void coverage_exit(void *unused)
{
#if CONFIG_DEBUG_COVERAGE
printk(BIOS_DEBUG, "Syncing coverage data.\n");
@@ -150,4 +150,8 @@ void coverage_exit(void)
__gcov_flush();
}
-
+BOOT_STATE_INIT_ENTRIES(gcov_bscb) = {
+ BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_ENTRY, coverage_init, NULL),
+ BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, coverage_exit, NULL),
+ BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_EXIT, coverage_exit, NULL),
+};
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index d8b9d43..e4b2659 100644
--- a/src/lib/hardwaremain.c
+++ b/src/lib/hardwaremain.c
@@ -38,7 +38,6 @@
#include <arch/acpi.h>
#endif
#include <cbmem.h>
-#include <coverage.h>
#include <timestamp.h>
#if BOOT_STATE_DEBUG
@@ -331,10 +330,6 @@ void hardwaremain(int boot_complete)
timestamp_stash(TS_START_RAMSTAGE);
post_code(POST_ENTRY_RAMSTAGE);
-#if CONFIG_COVERAGE
- coverage_init();
-#endif
-
/* console_init() MUST PRECEDE ALL printk()! */
console_init();
diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c
index be03b85..934c131 100644
--- a/src/lib/selfboot.c
+++ b/src/lib/selfboot.c
@@ -33,7 +33,6 @@
#if CONFIG_COLLECT_TIMESTAMPS
#include <timestamp.h>
#endif
-#include <coverage.h>
/* Maximum physical address we can use for the coreboot bounce buffer. */
#ifndef MAX_ADDR
@@ -537,9 +536,6 @@ int selfboot(struct lb_memory *mem, struct cbfs_payload *payload)
#if CONFIG_COLLECT_TIMESTAMPS
timestamp_add_now(TS_SELFBOOT_JUMP);
#endif
-#if CONFIG_COVERAGE
- coverage_exit();
-#endif
/* Tear down the caching of the ROM. */
if (disable_cache_rom)
the following patch was just integrated into master:
commit 526a46ed7e4feb9e2cb02dffccbf40182c8cc014
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Tue Apr 23 13:00:34 2013 +0200
Intel 82801gx: Use 2 << 24 to clarify that I/O APIC ID is 2
Commit »Support for the Intel ICH7 southbridge.« (debb11fc) [1] used
`1 << 25` to set the I/O APIC ID of 2. Instead using `2 << 24`, which
is the same value, makes it clear, that the I/O APIC ID is 2.
Commit »Intel Panther Point PCH: Use 2 << 24 to clarify that APIC ID
is 2« (8c937c7e) [2] is used as a template.
[1] http://review.coreboot.org/gitweb?p=coreboot.git;a=commit;h=debb11fc1fe5f55…
[2] http://review.coreboot.org/3100
Change-Id: Ib688500944cd78a1cc1c8082bb138fa9468bdbfb
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-on: http://review.coreboot.org/3122
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich(a)gmail.com>
Build-Tested: build bot (Jenkins) at Fri Apr 26 17:48:31 2013, giving +1
Reviewed-By: Ronald G. Minnich <rminnich(a)gmail.com> at Fri Apr 26 18:36:58 2013, giving +2
See http://review.coreboot.org/3122 for details.
-gerrit
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3142
-gerrit
commit 835aebf9dbdf770d0b3d3430ca8e577cee603d91
Author: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org>
Date: Fri Apr 26 12:21:41 2013 +0200
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(a)no-log.org>
---
src/mainboard/lenovo/x60/Kconfig | 1 +
src/mainboard/lenovo/x60/romstage.c | 14 ++++++++++----
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/mainboard/lenovo/x60/Kconfig b/src/mainboard/lenovo/x60/Kconfig
index 611f932..1431a2f 100644
--- a/src/mainboard/lenovo/x60/Kconfig
+++ b/src/mainboard/lenovo/x60/Kconfig
@@ -24,6 +24,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_ACPI_RESUME
select USE_OPTION_TABLE
select MAINBOARD_HAS_NATIVE_VGA_INIT
+ select EARLY_CBMEM_INIT
config MAINBOARD_DIR
string
diff --git a/src/mainboard/lenovo/x60/romstage.c b/src/mainboard/lenovo/x60/romstage.c
index 8d5f922..d3c1d8a 100644
--- a/src/mainboard/lenovo/x60/romstage.c
+++ b/src/mainboard/lenovo/x60/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>
@@ -216,6 +217,7 @@ void main(unsigned long bist)
{
u32 reg32;
int boot_mode = 0;
+ int cbmem_was_initted;
const u8 spd_addrmap[2 * DIMM_SOCKETS] = { 0x50, 0x52, 0x51, 0x53 };
if (bist == 0)
@@ -314,14 +316,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 +337,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
}
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3143
-gerrit
commit 5f07c215f9afaa0deaa7b5cacf95c02191768853
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Fri Apr 26 17:15:07 2013 +0200
Kconfig: Capitalize CBMEM in description of `EARLY_CBMEM_INIT`
Capitalizing CBMEM seems to be the official spelling as can be seen
in the descriptions around the `EARLY_CBMEM_INIT` Kconfig option.
Change-Id: I046a678c3b04ef7e681de46aa137cedc405d546f
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
src/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Kconfig b/src/Kconfig
index c3cc6bf..8ff59d0 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -174,7 +174,7 @@ config EARLY_CBMEM_INIT
bool
default n
help
- Make coreboot initialize the cbmem structures while running in ROM
+ Make coreboot initialize the CBMEM structures while running in ROM
stage. This is useful when the ROM stage wants to communicate
some, for instance, execution timestamps. It needs support in
romstage.c and should be enabled by the board's Kconfig.
Ronald G. Minnich (rminnich(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3122
-gerrit
commit cda62461ca4fbe709befda9bd28b6c1be7cc4164
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Tue Apr 23 13:00:34 2013 +0200
Intel 82801gx: Use 2 << 24 to clarify that I/O APIC ID is 2
Commit »Support for the Intel ICH7 southbridge.« (debb11fc) [1] used
`1 << 25` to set the I/O APIC ID of 2. Instead using `2 << 24`, which
is the same value, makes it clear, that the I/O APIC ID is 2.
Commit »Intel Panther Point PCH: Use 2 << 24 to clarify that APIC ID
is 2« (8c937c7e) [2] is used as a template.
[1] http://review.coreboot.org/gitweb?p=coreboot.git;a=commit;h=debb11fc1fe5f55…
[2] http://review.coreboot.org/3100
Change-Id: Ib688500944cd78a1cc1c8082bb138fa9468bdbfb
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
src/southbridge/intel/i82801gx/lpc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/southbridge/intel/i82801gx/lpc.c b/src/southbridge/intel/i82801gx/lpc.c
index 3a94e84..777a6d7 100644
--- a/src/southbridge/intel/i82801gx/lpc.c
+++ b/src/southbridge/intel/i82801gx/lpc.c
@@ -52,12 +52,12 @@ static void i82801gx_enable_apic(struct device *dev)
pci_write_config8(dev, ACPI_CNTL, ACPI_EN);
*ioapic_index = 0;
- *ioapic_data = (1 << 25);
+ *ioapic_data = (2 << 24);
*ioapic_index = 0;
reg32 = *ioapic_data;
printk(BIOS_DEBUG, "Southbridge APIC ID = %x\n", (reg32 >> 24) & 0x0f);
- if (reg32 != (1 << 25))
+ if (reg32 != (2 << 24))
die("APIC Error\n");
printk(BIOS_SPEW, "Dumping IOAPIC registers\n");
Hung-Te Lin (hungte(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3102
-gerrit
commit 5c73a09e9efda36b7983238ed1343eb3b4d3381f
Author: Hung-Te Lin <hungte(a)chromium.org>
Date: Thu Apr 25 19:49:40 2013 +0800
Google/Snow: Enable suspend/resume.
Add the suspend/resume feature into bootblock and romstage.
Note, resuming with X and touchpad driver may be still unstable.
Verified by building and booting successfully on Google/Snow, and then executing
the "suspend_stress_test" in text mode ("stop ui; suspend_stress_test") in
Chromium OS, passed at least 20 iterations.
Change-Id: I65681c42eeef2736e55bb906595f42a5b1dfdf11
Signed-off-by: Hung-Te Lin <hungte(a)chromium.org>
---
src/mainboard/google/snow/bootblock.c | 17 ++++++++++++-----
src/mainboard/google/snow/romstage.c | 13 ++++++++++---
2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/src/mainboard/google/snow/bootblock.c b/src/mainboard/google/snow/bootblock.c
index d2e0b50..6fca69c 100644
--- a/src/mainboard/google/snow/bootblock.c
+++ b/src/mainboard/google/snow/bootblock.c
@@ -25,16 +25,23 @@
#include <console/console.h>
#include <cpu/samsung/exynos5250/periph.h>
#include <cpu/samsung/exynos5250/pinmux.h>
+#include "mainboard.h"
void bootblock_mainboard_init(void);
void bootblock_mainboard_init(void)
{
- /* kick off the microsecond timer. We want to do this as early
- * as we can.
- */
- timer_start();
+ switch (snow_get_wakeup_state()) {
+ case SNOW_WAKEUP_DIRECT:
+ snow_wakeup();
+ break;
- exynos_pinmux_config(PERIPH_ID_SPI1, PINMUX_FLAG_NONE);
+ case SNOW_IS_NOT_WAKEUP:
+ /* kick off the microsecond timer.
+ * We want to do this as early as we can.
+ */
+ timer_start();
+ break;
+ }
#if CONFIG_EARLY_CONSOLE
exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
console_init();
diff --git a/src/mainboard/google/snow/romstage.c b/src/mainboard/google/snow/romstage.c
index fd5cfce..f131e81 100644
--- a/src/mainboard/google/snow/romstage.c
+++ b/src/mainboard/google/snow/romstage.c
@@ -170,15 +170,22 @@ void main(void)
{
struct mem_timings *mem;
void *entry;
+ int is_resume = (snow_get_wakeup_state() != SNOW_IS_NOT_WAKEUP);
/* Clock must be initialized before console_init, otherwise you may need
* to re-initialize serial console drivers again. */
mem = snow_setup_clock();
- console_init();
- snow_setup_power();
+ if (!is_resume) {
+ console_init();
+ snow_setup_power();
+ }
+
+ snow_setup_memory(mem, is_resume);
- snow_setup_memory(mem, 0);
+ if (is_resume) {
+ snow_wakeup();
+ }
snow_setup_storage();
snow_setup_gpio();