--- linux-2.1.110/arch/alpha/kernel/time.c Tue Dec 29 12:08:51 1998 +++ linux/arch/alpha/kernel/time.c Tue Dec 29 14:03:17 1998 @@ -25,7 +25,7 @@ #include #include #include -#include +/* #include */ #include #include @@ -37,6 +37,8 @@ #include "proto.h" #include "irq.h" +extern struct hwrpb_struct *hwrpb; + static int set_rtc_mmss(unsigned long); @@ -153,91 +155,6 @@ )*60 + sec; /* finally seconds */ } -/* - * Initialize Programmable Interval Timers with standard values. Some - * drivers depend on them being initialized (e.g., joystick driver). - */ - -/* It is (normally) only counter 0 that presents config problems, so - provide this support function to do the rest of the job. */ - -void inline -init_pit_rest(void) -{ -#if 0 - /* Leave refresh timer alone---nobody should depend on a - particular value anyway. */ - outb(0x54, 0x43); /* counter 1: refresh timer */ - outb(0x18, 0x41); -#endif - - outb(0xb6, 0x43); /* counter 2: speaker */ - outb(0x31, 0x42); - outb(0x13, 0x42); -} - -#ifdef CONFIG_RTC -static inline void -rtc_init_pit (void) -{ - unsigned char control; - - /* Setup interval timer if /dev/rtc is being used */ - outb(0x34, 0x43); /* binary, mode 2, LSB/MSB, ch 0 */ - outb(LATCH & 0xff, 0x40); /* LSB */ - outb(LATCH >> 8, 0x40); /* MSB */ - request_region(0x40, 0x20, "timer"); /* reserve pit */ - - /* Turn off RTC interrupts before /dev/rtc is initialized */ - control = CMOS_READ(RTC_CONTROL); - control &= ~(RTC_PIE | RTC_AIE | RTC_UIE); - CMOS_WRITE(control, RTC_CONTROL); - CMOS_READ(RTC_INTR_FLAGS); - - init_pit_rest(); -} -#endif - -void -generic_init_pit (void) -{ - unsigned char x; - - /* Reset periodic interrupt frequency. */ - x = CMOS_READ(RTC_FREQ_SELECT) & 0x3f; - if (x != 0x26 && x != 0x19 && x != 0x06) { - printk("Setting RTC_FREQ to 1024 Hz (%x)\n", x); - CMOS_WRITE(0x26, RTC_FREQ_SELECT); - } - - /* Turn on periodic interrupts. */ - x = CMOS_READ(RTC_CONTROL); - if (!(x & RTC_PIE)) { - printk("Turning on RTC interrupts.\n"); - x |= RTC_PIE; - x &= ~(RTC_AIE | RTC_UIE); - CMOS_WRITE(x, RTC_CONTROL); - } - CMOS_READ(RTC_INTR_FLAGS); - - request_region(RTC_PORT(0), 0x10, "timer"); /* reserve rtc */ - - /* Turn off the PIT. */ - outb(0x36, 0x43); /* counter 0: system timer */ - outb(0x00, 0x40); - outb(0x00, 0x40); - - init_pit_rest(); -} - -/* This probably isn't Right, but it is what the old code did. */ -#if defined(CONFIG_RTC) -# define init_pit rtc_init_pit -#else -# define init_pit alpha_mv.init_pit -#endif - - void time_init(void) { @@ -246,7 +163,7 @@ unsigned long cycle_freq; /* Initialize the timers. */ - init_pit(); + /* init_pit(); */ /* * The Linux interpretation of the CMOS clock register contents: --- linux-2.1.110/arch/alpha/kernel/setup.c Sun Dec 6 12:37:48 1998 +++ linux/arch/alpha/kernel/setup.c Sun Dec 6 12:38:46 1998 @@ -20,6 +20,7 @@ #include #include #include /* CONFIG_ALPHA_LCA etc */ +#include #include #include #include @@ -90,6 +91,90 @@ orig_video_points: 16 }; + +/* + * Initialize Programmable Interval Timers with standard values. Some + * drivers depend on them being initialized (e.g., joystick driver). + */ + +/* It is (normally) only counter 0 that presents config problems, so + provide this support function to do the rest of the job. */ + +void inline +init_pit_rest(void) +{ + unsigned char x; + +#if 0 + /* Leave refresh timer alone---nobody should depend on a + particular value anyway. */ + outb(0x54, 0x43); /* counter 1: refresh timer */ + outb(0x18, 0x41); +#endif + + outb(0xb6, 0x43); /* counter 2: speaker */ + outb(0x31, 0x42); + outb(0x13, 0x42); + + /* Reset periodic interrupt frequency. */ + x = CMOS_READ(RTC_FREQ_SELECT) & 0x3f; + if (x != 0x26 && x != 0x19 && x != 0x06) { + printk("Setting RTC_FREQ to 1024 Hz (%x)\n", x); + CMOS_WRITE(0x26, RTC_FREQ_SELECT); + } + + /* Turn on periodic interrupts. */ + x = CMOS_READ(RTC_CONTROL); + if (!(x & RTC_PIE)) { + printk("Turning on RTC interrupts.\n"); + x |= RTC_PIE; + x &= ~(RTC_AIE | RTC_UIE); + CMOS_WRITE(x, RTC_CONTROL); + } + CMOS_READ(RTC_INTR_FLAGS); +} + +#ifdef CONFIG_RTC +static inline void +rtc_init_pit (void) +{ + unsigned char control; + + /* Setup interval timer if /dev/rtc is being used */ + outb(0x34, 0x43); /* binary, mode 2, LSB/MSB, ch 0 */ + outb(LATCH & 0xff, 0x40); /* LSB */ + outb(LATCH >> 8, 0x40); /* MSB */ + request_region(0x40, 0x20, "timer"); /* reserve pit */ + + /* Turn off RTC interrupts before /dev/rtc is initialized */ + control = CMOS_READ(RTC_CONTROL); + control &= ~(RTC_PIE | RTC_AIE | RTC_UIE); + CMOS_WRITE(control, RTC_CONTROL); + CMOS_READ(RTC_INTR_FLAGS); + + init_pit_rest(); +} +#endif + +void +generic_init_pit (void) +{ + outb(0x36, 0x43); /* counter 0: system timer */ + outb(0x00, 0x40); + outb(0x00, 0x40); + request_region(RTC_PORT(0), 0x10, "timer"); /* reserve rtc */ + + init_pit_rest(); +} + +/* This probably isn't Right, but it is what the old code did. */ +#if defined(CONFIG_RTC) +# define init_pit rtc_init_pit +#else +# define init_pit alpha_mv.init_pit +#endif + + /* * Declare all of the machine vectors. */ @@ -274,6 +359,9 @@ DMA windows and the like. */ if (alpha_mv.init_arch) alpha_mv.init_arch(memory_start_p, memory_end_p); + + /* Initialize the timers. */ + init_pit(); /* * Give us a default console. TGA users will see nothing until