Denis Carikli (GNUtoo@no-log.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3996
-gerrit
commit 0ba9071090a07df313d758e026f8c6a577fc2841 Author: Denis 'GNUtoo' Carikli GNUtoo@no-log.org Date: Sun Oct 27 17:58:11 2013 +0100
Move set_boot_successful to drivers/pc80/mc146818rtc.c
set_boot_successful depends on CONFIG_PC80_SYSTEM, it also is specific to the mc146818 rtc.
Change-Id: I57d28d7c81ea595ce06bd4ec9c4981fa71566db9 Signed-off-by: Denis 'GNUtoo' Carikli GNUtoo@no-log.org --- src/drivers/pc80/mc146818rtc.c | 22 ++++++++++++++++++++++ src/lib/fallback_boot.c | 25 +------------------------ 2 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/src/drivers/pc80/mc146818rtc.c b/src/drivers/pc80/mc146818rtc.c index be52454..55817b4 100644 --- a/src/drivers/pc80/mc146818rtc.c +++ b/src/drivers/pc80/mc146818rtc.c @@ -322,3 +322,25 @@ void rtc_check_update_cmos_date(u8 has_century) rtc_update_cmos_date(has_century); } } + +/* Reset the boot count if the boot is considered successfull */ +void set_boot_successful(void) +{ + /* Remember I successfully booted by setting + * the initial boot direction + * to the direction that I booted. + */ + unsigned char index, byte; + index = inb(RTC_PORT(0)) & 0x80; + index |= RTC_BOOT_BYTE; + outb(index, RTC_PORT(0)); + + byte = inb(RTC_PORT(1)); + byte &= 0xfe; + byte |= (byte & (1 << 1)) >> 1; + + /* If we are in normal mode set the boot count to 0 */ + if(byte & 1) + byte &= 0x0f; + outb(byte, RTC_PORT(1)); +} diff --git a/src/lib/fallback_boot.c b/src/lib/fallback_boot.c index b956c94..a34090e 100644 --- a/src/lib/fallback_boot.c +++ b/src/lib/fallback_boot.c @@ -3,30 +3,7 @@ #include <watchdog.h> #include <arch/io.h>
-#if CONFIG_PC80_SYSTEM -#include <pc80/mc146818rtc.h> - -static void set_boot_successful(void) -{ - /* Remember I successfully booted by setting - * the initial boot direction - * to the direction that I booted. - */ - unsigned char index, byte; - index = inb(RTC_PORT(0)) & 0x80; - index |= RTC_BOOT_BYTE; - outb(index, RTC_PORT(0)); - - byte = inb(RTC_PORT(1)); - byte &= 0xfe; - byte |= (byte & (1 << 1)) >> 1; - - /* If we are in normal mode set the boot count to 0 */ - if(byte & 1) - byte &= 0x0f; - outb(byte, RTC_PORT(1)); -} -#else +#if !CONFIG_PC80_SYSTEM static void set_boot_successful(void) { /* To be implemented */