outb(val, RTC_BASE_PORT + offs + 1);
}
+#if CONFIG_HAVE_OPTION_TABLE
static int rtc_checksum_valid(int range_start, int range_end, int cks_loc)
{
int i;
cmos_write(((sum >> 8) & 0x0ff), cks_loc);
cmos_write(((sum >> 0) & 0x0ff), cks_loc+1);
}
+#endif
+#if CONFIG_ARCH_X86
#define RTC_CONTROL_DEFAULT (RTC_24H)
#define RTC_FREQ_SELECT_DEFAULT (RTC_REF_CLCK_32KHZ | RTC_RATE_1024HZ)
-
-#if 0 /* alpha setup */
-#undef RTC_CONTROL_DEFAULT
-#undef RTC_FREQ_SELECT_DEFAULT
+#else
+#if CONFIG_ARCH_ALPHA
#define RTC_CONTROL_DEFAULT (RTC_SQWE | RTC_24H)
#define RTC_FREQ_SELECT_DEFAULT (RTC_REF_CLCK_32KHZ | RTC_RATE_1024HZ)
#endif
+#endif
void rtc_init(int invalid)
{
+#if CONFIG_HAVE_OPTION_TABLE
unsigned char x;
int cmos_invalid, checksum_invalid;
+#endif
- printk_debug("RTC Init\n");
+ printk(BIOS_DEBUG, "RTC Init\n");
#if CONFIG_HAVE_OPTION_TABLE
/* See if there has been a CMOS power problem. */
PC_CKS_RANGE_END,PC_CKS_LOC);
if (invalid || cmos_invalid || checksum_invalid) {
- printk_warning("RTC:%s%s%s zeroing cmos\n",
+ printk(BIOS_WARNING, "RTC:%s%s%s zeroing cmos\n",
invalid?" Clear requested":"",
cmos_invalid?" Power Problem":"",
checksum_invalid?" Checksum invalid":"");
#if CONFIG_HAVE_OPTION_TABLE
/* See if there is a LB CMOS checksum error */
- checksum_invalid = !rtc_checksum_valid(CONFIG_LB_CKS_RANGE_START,
- CONFIG_LB_CKS_RANGE_END,CONFIG_LB_CKS_LOC);
+ checksum_invalid = !rtc_checksum_valid(LB_CKS_RANGE_START,
+ LB_CKS_RANGE_END,LB_CKS_LOC);
if(checksum_invalid)
- printk_debug("Invalid CMOS LB checksum\n");
+ printk(BIOS_DEBUG, "Invalid CMOS LB checksum\n");
/* Make certain we have a valid checksum */
rtc_set_checksum(PC_CKS_RANGE_START,
return 0;
}
-int get_option(void *dest, char *name)
+int get_option(void *dest, const char *name)
{
extern struct cmos_option_table option_table;
struct cmos_option_table *ct;
}
}
if(!found) {
- printk_err("ERROR: No cmos option '%s'\n", name);
+ printk(BIOS_DEBUG, "WARNING: No cmos option '%s'\n", name);
return(-2);
}
if(get_cmos_value(ce->bit, ce->length, dest))
return(-3);
- if(!rtc_checksum_valid(CONFIG_LB_CKS_RANGE_START,
- CONFIG_LB_CKS_RANGE_END,CONFIG_LB_CKS_LOC))
+ if(!rtc_checksum_valid(LB_CKS_RANGE_START,
+ LB_CKS_RANGE_END,LB_CKS_LOC))
return(-4);
return(0);
}