Disable CMOS recovery code for ROMCC boards as the CBFS code used for
that feature is not ROMCC compatible. Fixes build errors introduced in r6253. Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Acked-by: Patrick Georgi <patrick.georgi@secunet.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6255 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
ef3296542a
commit
c3dc8f8ebc
|
@ -91,8 +91,14 @@ config PC80_SYSTEM
|
||||||
config BOOTBLOCK_NORTHBRIDGE_INIT
|
config BOOTBLOCK_NORTHBRIDGE_INIT
|
||||||
string
|
string
|
||||||
|
|
||||||
|
config USE_CMOS_RECOVERY
|
||||||
|
bool
|
||||||
|
default n if ROMCC
|
||||||
|
default y
|
||||||
|
|
||||||
config HAVE_CMOS_DEFAULT
|
config HAVE_CMOS_DEFAULT
|
||||||
def_bool n
|
def_bool n
|
||||||
|
depends on USE_CMOS_RECOVERY
|
||||||
|
|
||||||
config CMOS_DEFAULT_FILE
|
config CMOS_DEFAULT_FILE
|
||||||
string
|
string
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include <pc80/mc146818rtc.h>
|
#include <pc80/mc146818rtc.h>
|
||||||
#include <fallback.h>
|
#include <fallback.h>
|
||||||
#include <cbfs.h>
|
|
||||||
#if CONFIG_USE_OPTION_TABLE
|
#if CONFIG_USE_OPTION_TABLE
|
||||||
#include "option_table.h"
|
#include "option_table.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -12,18 +11,20 @@
|
||||||
#error "CONFIG_MAX_REBOOT_CNT too high"
|
#error "CONFIG_MAX_REBOOT_CNT too high"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if CONFIG_USE_CMOS_RECOVERY
|
||||||
|
#include <cbfs.h>
|
||||||
#include <console/loglevel.h>
|
#include <console/loglevel.h>
|
||||||
|
|
||||||
int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
|
int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
|
||||||
#define printk_warning(fmt, arg...) do_printk(BIOS_WARNING ,fmt, ##arg)
|
#define printk_warning(fmt, arg...) do_printk(BIOS_WARNING ,fmt, ##arg)
|
||||||
#define printk_debug(fmt, arg...) do_printk(BIOS_DEBUG ,fmt, ##arg)
|
#define printk_debug(fmt, arg...) do_printk(BIOS_DEBUG ,fmt, ##arg)
|
||||||
|
#endif
|
||||||
|
|
||||||
static int cmos_error(void)
|
static int cmos_error(void)
|
||||||
{
|
{
|
||||||
unsigned char reg_d;
|
unsigned char reg_d;
|
||||||
/* See if the cmos error condition has been flagged */
|
/* See if the cmos error condition has been flagged */
|
||||||
reg_d = cmos_read(RTC_REG_D);
|
reg_d = cmos_read(RTC_REG_D);
|
||||||
printk_debug("CMOS_REG_D(VRT): %x\n", reg_d & RTC_VRT);
|
|
||||||
return (reg_d & RTC_VRT) == 0;
|
return (reg_d & RTC_VRT) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +44,6 @@ static int cmos_chksum_valid(void)
|
||||||
old_sum = cmos_read(LB_CKS_LOC) << 8;
|
old_sum = cmos_read(LB_CKS_LOC) << 8;
|
||||||
old_sum |= cmos_read(LB_CKS_LOC+1);
|
old_sum |= cmos_read(LB_CKS_LOC+1);
|
||||||
|
|
||||||
printk_debug("CMOS checksum: old = %lx, new=%lx\n", old_sum, sum);
|
|
||||||
return sum == old_sum;
|
return sum == old_sum;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -60,11 +60,12 @@ static inline int last_boot_normal(void)
|
||||||
|
|
||||||
static inline int do_normal_boot(void)
|
static inline int do_normal_boot(void)
|
||||||
{
|
{
|
||||||
char *cmos_default = cbfs_find_file("cmos.default", 0xaa);
|
|
||||||
unsigned char byte;
|
unsigned char byte;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (cmos_error() || !cmos_chksum_valid()) {
|
if (cmos_error() || !cmos_chksum_valid()) {
|
||||||
|
#if CONFIG_USE_CMOS_RECOVERY
|
||||||
|
char *cmos_default = cbfs_find_file("cmos.default", 0xaa);
|
||||||
if (cmos_default) {
|
if (cmos_default) {
|
||||||
printk_warning("WARNING - CMOS CORRUPTED. RESTORING DEFAULTS.\n");
|
printk_warning("WARNING - CMOS CORRUPTED. RESTORING DEFAULTS.\n");
|
||||||
/* First 14 bytes are reserved for
|
/* First 14 bytes are reserved for
|
||||||
|
@ -79,6 +80,7 @@ static inline int do_normal_boot(void)
|
||||||
outb(0x06, 0xcf9);
|
outb(0x06, 0xcf9);
|
||||||
for (;;) asm("hlt"); /* Wait for reset! */
|
for (;;) asm("hlt"); /* Wait for reset! */
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* There are no impossible values, no checksums so just
|
/* There are no impossible values, no checksums so just
|
||||||
* trust whatever value we have in the the cmos,
|
* trust whatever value we have in the the cmos,
|
||||||
|
|
Loading…
Reference in New Issue