- Updates for the supermicro p4dc6 motherboard
- Code to initialize sdram from C on the l440gx - cache as ram code fro the p6 it works except conflict misses occur with addresses that are not cached so writing to ram does not work. Which makes it to brittle to count on. - Initial implementation of a fallback booting scheme where we can have two copies of linuxbios in rom at once. - Movement of 32 bit entry code from entry16.inc to entry32.inc - Update of all config files so they now also include entry32.inc - Fix for start_stop.c & entry16.inc so I can fairly arbitrarily relocate the 16bit entry code in SMP. - A small number of fixes for warnings
This commit is contained in:
parent
0ddd8a6f16
commit
2beb0a1bcc
97 changed files with 2517 additions and 291 deletions
|
|
@ -1,7 +1,6 @@
|
|||
#include <arch/io.h>
|
||||
#include <printk.h>
|
||||
|
||||
#define RTC_PORT(x) (0x70 + (x))
|
||||
#include <pc80/mc146818rtc.h>
|
||||
|
||||
#define CMOS_READ(addr) ({ \
|
||||
outb_p((addr),RTC_PORT(0)); \
|
||||
|
|
@ -83,10 +82,6 @@ outb_p((val),RTC_PORT(1)); \
|
|||
/**********************************************************************/
|
||||
|
||||
|
||||
/* On PCs, the checksum is built only over bytes 16..45 */
|
||||
#define PC_CKS_RANGE_START 16
|
||||
#define PC_CKS_RANGE_END 45
|
||||
#define PC_CKS_LOC 46
|
||||
|
||||
static int rtc_checksum_valid(void)
|
||||
{
|
||||
|
|
@ -123,32 +118,40 @@ static void rtc_set_checksum(void)
|
|||
#define RTC_CONTROL_DEFAULT (RTC_SQWE | RTC_24H)
|
||||
#define RTC_FREQ_SELECT_DEFAULT (RTC_REF_CLCK_32KHZ | RTC_RATE_1024HZ)
|
||||
#endif
|
||||
void rtc_init(void)
|
||||
void rtc_init(int invalid)
|
||||
{
|
||||
unsigned char x;
|
||||
int cmos_valid;
|
||||
int cmos_invalid, checksum_invalid;
|
||||
/* See if there has been a CMOS power problem. */
|
||||
x = CMOS_READ(RTC_VALID);
|
||||
cmos_valid = !(x & RTC_VRT);
|
||||
cmos_invalid = !(x & RTC_VRT);
|
||||
|
||||
/* See if there is a CMOS checksum error */
|
||||
cmos_valid = rtc_checksum_valid();
|
||||
checksum_invalid = !rtc_checksum_valid();
|
||||
|
||||
if (!cmos_valid) {
|
||||
if (invalid || cmos_invalid || checksum_invalid) {
|
||||
int i;
|
||||
printk_warning("RTC power problem, zeroing cmos\n");
|
||||
for(i = 0x0; i < 128; i++) {
|
||||
printk_warning("RTC:%s%s%s zeroing cmos\n",
|
||||
invalid?" Clear requested":"",
|
||||
cmos_invalid?" Power Problem":"",
|
||||
checksum_invalid?" Checksum invalid":"");
|
||||
CMOS_WRITE(0, 0x01);
|
||||
CMOS_WRITE(0, 0x03);
|
||||
CMOS_WRITE(0, 0x05);
|
||||
for(i = 10; i < 128; i++) {
|
||||
CMOS_WRITE(0, i);
|
||||
}
|
||||
|
||||
/* Now setup a default date of Sat 1 January 2000 */
|
||||
CMOS_WRITE(0, 0x00); /* seconds */
|
||||
CMOS_WRITE(0, 0x02); /* minutes */
|
||||
CMOS_WRITE(1, 0x04); /* hours */
|
||||
CMOS_WRITE(7, 0x06); /* day of week */
|
||||
CMOS_WRITE(1, 0x07); /* day of month */
|
||||
CMOS_WRITE(1, 0x08); /* month */
|
||||
CMOS_WRITE(0, 0x09); /* year */
|
||||
if (cmos_invalid) {
|
||||
/* Now setup a default date of Sat 1 January 2000 */
|
||||
CMOS_WRITE(0, 0x00); /* seconds */
|
||||
CMOS_WRITE(0, 0x02); /* minutes */
|
||||
CMOS_WRITE(1, 0x04); /* hours */
|
||||
CMOS_WRITE(7, 0x06); /* day of week */
|
||||
CMOS_WRITE(1, 0x07); /* day of month */
|
||||
CMOS_WRITE(1, 0x08); /* month */
|
||||
CMOS_WRITE(0, 0x09); /* year */
|
||||
}
|
||||
}
|
||||
/* Setup the real time clock */
|
||||
CMOS_WRITE(RTC_CONTROL_DEFAULT, RTC_CONTROL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue