Denis Carikli (GNUtoo(a)no-log.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3991
-gerrit
commit 47bf9fe4362ffb7ceab33f012fb693c6aa25a0a8
Author: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org>
Date: Sun Oct 20 23:37:35 2013 +0200
lenovo/x60: Require only one failed boot to switch to fallback in X86_BOOTBLOCK_NORMAL mode.
src/arch/x86/Kconfig defines MAX_REBOOT_CNT as 3.
If that value is not overrided, then the Lenovo X60 coreboot image gets it too.
At the end of a successfull boot, with CONFIG_KEEP_BOOT_COUNT,
the Lenovo X60 increments its reboot_bits cmos option by one.
In case of a failed boot, the user probably doesn't know that coreboot will
only switch to fallback after 3 failed boots, and will act as if the laptop
will not boot anymore with its current coreboot image.
Change-Id: I746df11c933dfe62e01e1591479ca96a84907dc0
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org>
---
src/mainboard/lenovo/x60/Kconfig | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/mainboard/lenovo/x60/Kconfig b/src/mainboard/lenovo/x60/Kconfig
index 7ed2665..3b96a32 100644
--- a/src/mainboard/lenovo/x60/Kconfig
+++ b/src/mainboard/lenovo/x60/Kconfig
@@ -55,6 +55,10 @@ config MAX_CPUS
int
default 2
+config MAX_REBOOT_CNT
+ int
+ default 1
+
config MAINBOARD_SMBIOS_MANUFACTURER
string
default "LENOVO"
Denis Carikli (GNUtoo(a)no-log.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3990
-gerrit
commit 5b074806c26dba6c0125672508dc03ca4e506895
Author: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org>
Date: Mon Oct 21 01:56:47 2013 +0200
Add a KEEP_BOOT_COUNT Kconfig option.
The use case of that option is to inform coreboot (trough the nvram) at the
next boot, that the computer could not fully boot to boot to an usable state.
In that case, the boot count is incremented by one.
Previously there was no way to tell coreboot that the computer really booted
successfully, because it was assumed that if set_boot_successful was called
in ramstage, then the computer would have booted successfully.
However many things can go wrong after that point, for instance the payload
could fail to boot, or the operating system's kernel could fail to boot too,
due to the wrong configurations passed to it by coreboot and the payload.
Change-Id: I01af053455eb6bd2f7a4f9d37e8c234ba8d55250
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org>
---
src/arch/x86/Kconfig | 8 ++++++++
src/arch/x86/boot/acpi.c | 12 ++++++++++++
src/lib/fallback_boot.c | 4 ++++
3 files changed, 24 insertions(+)
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index 0a21fcc..b4e8eb0 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -72,6 +72,14 @@ config X86_BOOTBLOCK_NORMAL
endchoice
+config KEEP_BOOT_COUNT
+ bool "Keep boot count"
+ default n
+ depends on PC80_SYSTEM && X86_BOOTBLOCK_NORMAL
+ help
+ If enabled, the boot count is not reset anymore in the ramstage.
+ This delegates that task to the software running after the ramstage.
+
config BOOTBLOCK_SOURCE
string
default "bootblock_simple.c" if X86_BOOTBLOCK_SIMPLE
diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c
index 0e09ec5..57115f9 100644
--- a/src/arch/x86/boot/acpi.c
+++ b/src/arch/x86/boot/acpi.c
@@ -33,6 +33,9 @@
#include <cbmem.h>
#include <cpu/x86/lapic_def.h>
#include <cpu/cpu.h>
+#if CONFIG_KEEP_BOOT_COUNT
+#include <fallback.h>
+#endif
#if CONFIG_COLLECT_TIMESTAMPS
#include <timestamp.h>
#endif
@@ -638,6 +641,15 @@ void acpi_resume(void *wake_vec)
if (mainboard_suspend_resume)
mainboard_suspend_resume();
+#if CONFIG_KEEP_BOOT_COUNT
+ /* we don't want to resume with the wrong prefix next time.
+ * And doing it in the bootblock seems counterintuitive:
+ * the bootblock would then need to know it's resuming...
+ */
+ if (strncmp(CONFIG_CBFS_PREFIX, "fallback", sizeof("fallback")))
+ set_boot_successful();
+#endif
+
post_code(POST_OS_RESUME);
acpi_jump_to_wakeup(wake_vec);
}
diff --git a/src/lib/fallback_boot.c b/src/lib/fallback_boot.c
index b956c94..042db08 100644
--- a/src/lib/fallback_boot.c
+++ b/src/lib/fallback_boot.c
@@ -40,8 +40,12 @@ void boot_successful(void)
vbe_textmode_console();
#endif
+
+/* We want to only do it at resume in the case of CONFIG_KEEP_BOOT_COUNT */
+#if !CONFIG_KEEP_BOOT_COUNT
/* Remember this was a successful boot */
set_boot_successful();
+#endif
/* turn off the boot watchdog */
watchdog_off();
the following patch was just integrated into master:
commit f26decb8acd759445758595c955e793ed702dca1
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Sun Feb 2 21:48:18 2014 -0600
cbfstool: remove unused function create_cbfs_image()
It's not used anymore. Instead, we have the better replacements
cbfs_image_create() and cbfs_image_from_file().
Change-Id: I7835f339805f6b41527fe3550028b29f79e35d13
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
See http://review.coreboot.org/5103 for details.
-gerrit
Aaron Durbin (adurbin(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4864
-gerrit
commit 96aaaad8ac0b6f885a1d018be4f56dffea929655
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Fri Oct 4 11:17:45 2013 -0500
baytrail: initialize punit
The punit is responsible for a number of things. Without
performing the sequence included it won't change processor
frequency when requested and apparently there are some bizarre
hangs introduced if this sequence isn't included either. Lastly,
this needs to come after microcode has been loaded. As that is
done in bootblock the ordering is correct.
One other side effect is that this fixes the graphics devices'
device id. Before it was showing up as the same device id of the
SoC transaction router.
BUG=chrome-os-partner:22880
BUG=chrome-os-partner:23085
BUG=chrome-os-partner:22876
BRANCH=None
TEST=Built and booted.
Change-Id: Ib7be1d4b365e9a45647c778ee5f91de497c55bf1
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171862
Reviewed-by: Shawn Nematbakhsh <shawnn(a)chromium.org>
---
src/soc/intel/baytrail/baytrail/romstage.h | 1 +
src/soc/intel/baytrail/romstage/pmc.c | 20 ++++++++++++++++++++
src/soc/intel/baytrail/romstage/romstage.c | 2 ++
3 files changed, 23 insertions(+)
diff --git a/src/soc/intel/baytrail/baytrail/romstage.h b/src/soc/intel/baytrail/baytrail/romstage.h
index 760905c..4918a02 100644
--- a/src/soc/intel/baytrail/baytrail/romstage.h
+++ b/src/soc/intel/baytrail/baytrail/romstage.h
@@ -48,6 +48,7 @@ void asmlinkage romstage_after_car(void);
void raminit(struct mrc_params *mp, int prev_sleep_state);
void gfx_init(void);
void tco_disable(void);
+void punit_init(void);
#if CONFIG_ENABLE_BUILTIN_COM1
void byt_config_com1_and_enable(void);
diff --git a/src/soc/intel/baytrail/romstage/pmc.c b/src/soc/intel/baytrail/romstage/pmc.c
index e689ccd..49a8011 100644
--- a/src/soc/intel/baytrail/romstage/pmc.c
+++ b/src/soc/intel/baytrail/romstage/pmc.c
@@ -33,3 +33,23 @@ void tco_disable(void)
reg |= TCO_TMR_HALT;
outl(reg, ACPI_BASE_ADDRESS + TCO1_CNT);
}
+
+/* This sequence signals the PUNIT to start running. */
+void punit_init(void)
+{
+ uint32_t reg;
+
+ /* Write bits 17:16 of SB_BIOS_CONFIG in the PUNIT. */
+ reg = SB_BIOS_CONFIG_PERF_MODE | SB_BIOS_CONFIG_PDM_MODE;
+ pci_write_config32(IOSF_PCI_DEV, MDR_REG, reg);
+ reg = IOSF_OPCODE(IOSF_OP_WRITE_PMC) | IOSF_PORT(IOSF_PORT_PMC) |
+ IOSF_REG(SB_BIOS_CONFIG) | IOSF_BYTE_EN_2;
+ pci_write_config32(IOSF_PCI_DEV, MCR_REG, reg);
+
+ /* Write bits 1:0 of BIOS_RESET_CPL in the PUNIT. */
+ reg = BIOS_RESET_CPL_ALL_DONE | BIOS_RESET_CPL_RESET_DONE;
+ pci_write_config32(IOSF_PCI_DEV, MDR_REG, reg);
+ reg = IOSF_OPCODE(IOSF_OP_WRITE_PMC) | IOSF_PORT(IOSF_PORT_PMC) |
+ IOSF_REG(BIOS_RESET_CPL) | IOSF_BYTE_EN_0;
+ pci_write_config32(IOSF_PCI_DEV, MCR_REG, reg);
+}
diff --git a/src/soc/intel/baytrail/romstage/romstage.c b/src/soc/intel/baytrail/romstage/romstage.c
index 3704069..6e965bc 100644
--- a/src/soc/intel/baytrail/romstage/romstage.c
+++ b/src/soc/intel/baytrail/romstage/romstage.c
@@ -126,6 +126,8 @@ void romstage_common(struct romstage_params *params)
console_init();
+ punit_init();
+
gfx_init();
mark_ts(params, timestamp_get());