Denis Carikli (GNUtoo(a)no-log.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3992
-gerrit
commit 90614379365790f82a6778e331f4cbe4311c0a13
Author: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org>
Date: Sat Oct 26 22:35:46 2013 +0200
lenovo/x60: export reboot_bits nvram configuration.
This permits any software running after the ramstage to tell coreboot that the
boot was successfull.
Change-Id: I6b19160dcf1ea1948360db71d02e344a3bcb44ef
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org>
---
src/mainboard/lenovo/x60/cmos.layout | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mainboard/lenovo/x60/cmos.layout b/src/mainboard/lenovo/x60/cmos.layout
index ab51a84..a6e1a4c 100644
--- a/src/mainboard/lenovo/x60/cmos.layout
+++ b/src/mainboard/lenovo/x60/cmos.layout
@@ -71,7 +71,7 @@ entries
# RTC_BOOT_BYTE (coreboot hardcoded)
384 1 e 4 boot_option
385 1 e 4 last_boot
-388 4 r 0 reboot_bits
+388 4 h 0 reboot_bits
#390 2 r 0 unused?
# -----------------------------------------------------------------
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 d74ecb89b9b321c3e99c7b3b121e6fc06ee44046
Author: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org>
Date: Sun Oct 20 23:37:35 2013 +0200
X86 Kconfig: Make the MAX_REBOOT_CNT selectable in X86_BOOTBLOCK_NORMAL mode.
src/arch/x86/Kconfig defined MAX_REBOOT_CNT as 3.
In the bootblock, the reboot_bits cmos option is increased by one at each boot.
If the boot is successful, the respective nvram settings have to be reset to
boot on the normal/ prefix next time.
If KEEP_BOOT_COUNT is selected, it has to be done after the ramstage,
if not, it's done in the ramstage.
In case of a failed boot, the reboot_bits keeps increasing until it reach
KEEP_BOOT_COUNT. Once it is reached, it will swtich to fallback/ at next boot.
With KEEP_BOOT_COUNT beeing hidden in make menuconfig, and set to 3,
the user probably won't know that coreboot will only switch to fallback after
3 failed boots, and will act as if the computer will not boot anymore with its
current coreboot image.
This patch makes KEEP_BOOT_COUNT with a default of 1.
This patch was tested on the Lenovo X60.
Change-Id: I746df11c933dfe62e01e1591479ca96a84907dc0
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org>
---
src/arch/x86/Kconfig | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index b4e8eb0..f643218 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -43,10 +43,18 @@ config STACK_SIZE
default 0x1000
# Maximum reboot count
-# TODO: Improve description.
config MAX_REBOOT_CNT
- int
- default 3
+ int "Number of failed boot attempts before switching back to fallback/"
+ default 1
+ depends on X86_BOOTBLOCK_NORMAL
+ help
+ Note that the minimum number of reset a machine has to do to boot
+ can vary across machines.
+ If you set it to a number that is less that the machine minimum,
+ the machine will then switch to fallback/ during the next boot.
+ Once in fallback/, the machine will keep that settings unless
+ the nvram is reset, which will make it switch to fallback/
+ again during the next boot.
# This is something you almost certainly don't want to mess with.
# How many SIPIs do we send when starting up APs and cores?
Denis Carikli (GNUtoo(a)no-log.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3992
-gerrit
commit 808c2e5d8b547cfefa6d71a688a183a820bca526
Author: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org>
Date: Sat Oct 26 22:35:46 2013 +0200
lenovo/x60: export reboot_bits nvram configuration.
This permits any software running after the ramstage to tell coreboot that the
boot was successfull.
Change-Id: I6b19160dcf1ea1948360db71d02e344a3bcb44ef
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org>
---
src/mainboard/lenovo/x60/cmos.layout | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mainboard/lenovo/x60/cmos.layout b/src/mainboard/lenovo/x60/cmos.layout
index ab51a84..a6e1a4c 100644
--- a/src/mainboard/lenovo/x60/cmos.layout
+++ b/src/mainboard/lenovo/x60/cmos.layout
@@ -71,7 +71,7 @@ entries
# RTC_BOOT_BYTE (coreboot hardcoded)
384 1 e 4 boot_option
385 1 e 4 last_boot
-388 4 r 0 reboot_bits
+388 4 h 0 reboot_bits
#390 2 r 0 unused?
# -----------------------------------------------------------------
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 9ecee8736fbbabd54fb5e87107efee4d44ebf3f7
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 72aeef8..90d472c 100644
--- a/src/mainboard/lenovo/x60/Kconfig
+++ b/src/mainboard/lenovo/x60/Kconfig
@@ -54,6 +54,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 0a06d529ef12bbd996969990cf2fdf2c314c0d0a
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 96cb270..2b1e764 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 0c49d5c..3e274f4 100644
--- a/src/lib/fallback_boot.c
+++ b/src/lib/fallback_boot.c
@@ -10,8 +10,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();
Marc Jones (marc.jones(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4022
-gerrit
commit 52ef0f34956f094e76bbfa104b78710412fbfd45
Author: Marc Jones <marc.jones(a)se-eng.com>
Date: Fri Nov 1 23:55:16 2013 -0600
make reset_system() public
Move reset_system() into reset.h. It will by used by other
chipsets in the future.
Change-Id: I87964b77ce64fbff97423fb51170d1b439ef722e
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
---
src/cpu/intel/haswell/romstage.c | 2 +-
src/include/reset.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/cpu/intel/haswell/romstage.c b/src/cpu/intel/haswell/romstage.c
index 757cc34..89edf84 100644
--- a/src/cpu/intel/haswell/romstage.c
+++ b/src/cpu/intel/haswell/romstage.c
@@ -48,7 +48,7 @@
#include "southbridge/intel/lynxpoint/me.h"
-static inline void reset_system(void)
+void reset_system(void)
{
hard_reset();
while (1) {
diff --git a/src/include/reset.h b/src/include/reset.h
index 9f117db..ba5401d 100644
--- a/src/include/reset.h
+++ b/src/include/reset.h
@@ -3,8 +3,10 @@
#if CONFIG_HAVE_HARD_RESET
void hard_reset(void);
+void reset_system(void);
#else
#define hard_reset() do {} while(0)
+#define reset_system() do {} while(0)
#endif
void soft_reset(void);