1 #include <console/console.h>
2 #include <part/fallback_boot.h>
3 #include <part/watchdog.h>
4 #include <pc80/mc146818rtc.h>
8 #if CONFIG_HAVE_FALLBACK_BOOT == 1
9 void set_boot_successful(void)
11 /* Remember I succesfully booted by setting
12 * the initial boot direction
13 * to the direction that I booted.
15 unsigned char index, byte;
16 index = inb(RTC_PORT(0)) & 0x80;
17 index |= RTC_BOOT_BYTE;
18 outb(index, RTC_PORT(0));
20 byte = inb(RTC_PORT(1));
22 byte |= (byte & (1 << 1)) >> 1;
24 /* If we are in normal mode set the boot count to 0 */
27 outb(byte, RTC_PORT(1));
31 void boot_successful(void)
33 /* Remember this was a successful boot */
34 set_boot_successful();
36 /* turn off the boot watchdog */