diff -urN 2.2.14/Documentation/Configure.help 2.2.14-rtclight/Documentation/Configure.help --- 2.2.14/Documentation/Configure.help Wed Jan 5 14:16:51 2000 +++ 2.2.14-rtclight/Documentation/Configure.help Fri Jan 7 13:47:04 2000 @@ -9278,6 +9278,20 @@ If you think you have a use for such a device (such as periodic data sampling), then say Y here, and read Documentation/rtc.txt for details. + For DEC Alpha users it is highly recommended to say Y here; if you + don't need all the features, you can choose the lightweight version + afterwards. + +Use only lightweight version (no interrupts) +CONFIG_RTC_LIGHT + This option turns off extended features of the RTC driver that deal + with interrupts (periodic signals and alarm). If you only need this + driver to read and set your system hardware clock, say Y here. + If you are on DEC Alpha, enabling this option will allow the kernel + to receive system clock interrupts in the standard, traditional + manner (that is, from the RTC device). Fully featured RTC driver + would move the clock signal source to the PIT (Programmable + Interrupt Timer), like on a PC. Tadpole ANA H8 Support CONFIG_H8 diff -urN 2.2.14/arch/alpha/defconfig 2.2.14-rtclight/arch/alpha/defconfig --- 2.2.14/arch/alpha/defconfig Wed Jan 5 14:16:51 2000 +++ 2.2.14-rtclight/arch/alpha/defconfig Fri Jan 7 13:47:04 2000 @@ -255,7 +255,8 @@ # CONFIG_QIC02_TAPE is not set # CONFIG_WATCHDOG is not set # CONFIG_NVRAM is not set -# CONFIG_RTC is not set +CONFIG_RTC=y +CONFIG_RTC_LIGHT=y # # Video For Linux diff -urN 2.2.14/arch/alpha/kernel/irq.h 2.2.14-rtclight/arch/alpha/kernel/irq.h --- 2.2.14/arch/alpha/kernel/irq.h Wed Jan 5 14:16:51 2000 +++ 2.2.14-rtclight/arch/alpha/kernel/irq.h Fri Jan 7 13:48:44 2000 @@ -44,7 +44,7 @@ } #define RTC_IRQ 8 -#ifdef CONFIG_RTC +#if defined(CONFIG_RTC) && !defined(CONFIG_RTC_LIGHT) #define TIMER_IRQ 0 /* timer is the pit */ #else #define TIMER_IRQ RTC_IRQ /* timer is the rtc */ diff -urN 2.2.14/arch/alpha/kernel/process.c 2.2.14-rtclight/arch/alpha/kernel/process.c --- 2.2.14/arch/alpha/kernel/process.c Wed Jan 5 14:16:51 2000 +++ 2.2.14-rtclight/arch/alpha/kernel/process.c Fri Jan 7 13:47:04 2000 @@ -30,7 +30,7 @@ #include #include -#ifdef CONFIG_RTC +#if defined(CONFIG_RTC) && !defined(CONFIG_RTC_LIGHT) #include #endif @@ -150,7 +150,7 @@ } #endif /* __SMP__ */ -#ifdef CONFIG_RTC +#if defined(CONFIG_RTC) && !defined(CONFIG_RTC_LIGHT) /* Reset rtc to defaults. */ { unsigned char control; diff -urN 2.2.14/arch/alpha/kernel/setup.c 2.2.14-rtclight/arch/alpha/kernel/setup.c --- 2.2.14/arch/alpha/kernel/setup.c Wed Jan 5 14:16:51 2000 +++ 2.2.14-rtclight/arch/alpha/kernel/setup.c Fri Jan 7 13:47:04 2000 @@ -26,7 +26,7 @@ #include #include -#ifdef CONFIG_RTC +#if defined(CONFIG_RTC) && !defined(CONFIG_RTC_LIGHT) #include #endif #ifdef CONFIG_BLK_DEV_INITRD @@ -292,7 +292,7 @@ /* ??? There is some circumstantial evidence that this needs to be done now rather than later in time_init, which would be more natural. Someone please explain or refute. */ -#if defined(CONFIG_RTC) +#if defined(CONFIG_RTC) && !defined(CONFIG_RTC_LIGHT) rtc_init_pit(); #else alpha_mv.init_pit(); diff -urN 2.2.14/arch/alpha/kernel/sys_nautilus.c 2.2.14-rtclight/arch/alpha/kernel/sys_nautilus.c --- 2.2.14/arch/alpha/kernel/sys_nautilus.c Wed Jan 5 14:16:51 2000 +++ 2.2.14-rtclight/arch/alpha/kernel/sys_nautilus.c Fri Jan 7 13:50:29 2000 @@ -83,7 +83,7 @@ nautilus_kill_arch (int mode, char *restart_cmd) { -#ifdef CONFIG_RTC +#if defined(CONFIG_RTC) && !defined(CONFIG_RTC_LIGHT) /* Reset rtc to defaults. */ { unsigned char control; diff -urN 2.2.14/arch/alpha/kernel/time.c 2.2.14-rtclight/arch/alpha/kernel/time.c --- 2.2.14/arch/alpha/kernel/time.c Sun Jan 2 18:26:32 2000 +++ 2.2.14-rtclight/arch/alpha/kernel/time.c Fri Jan 7 13:47:04 2000 @@ -173,7 +173,7 @@ * drivers depend on them being initialized (e.g., joystick driver). */ -#ifdef CONFIG_RTC +#if defined(CONFIG_RTC) && !defined(CONFIG_RTC_LIGHT) void rtc_init_pit (void) { diff -urN 2.2.14/drivers/char/Config.in 2.2.14-rtclight/drivers/char/Config.in --- 2.2.14/drivers/char/Config.in Wed Jan 5 14:16:52 2000 +++ 2.2.14-rtclight/drivers/char/Config.in Fri Jan 7 13:47:04 2000 @@ -112,6 +112,9 @@ tristate '/dev/nvram support' CONFIG_NVRAM bool 'Enhanced Real Time Clock Support' CONFIG_RTC +if [ "$CONFIG_RTC" = "y" -a "$ARCH" = "alpha" ]; then + bool ' Use only lightweight version (no interrupts)' CONFIG_RTC_LIGHT +fi if [ "$CONFIG_ALPHA_BOOK1" = "y" ]; then bool 'Tadpole ANA H8 Support' CONFIG_H8 fi diff -urN 2.2.14/drivers/char/rtc.c 2.2.14-rtclight/drivers/char/rtc.c --- 2.2.14/drivers/char/rtc.c Sun Jan 2 18:26:37 2000 +++ 2.2.14-rtclight/drivers/char/rtc.c Fri Jan 7 13:47:04 2000 @@ -120,6 +120,7 @@ * (See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.) */ +#ifndef CONFIG_RTC_LIGHT static void rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) { /* @@ -137,6 +138,7 @@ if (rtc_status & RTC_TIMER_ON) mod_timer(&rtc_irq_timer, jiffies + HZ/rtc_freq + 2*HZ/100); } +#endif /* * Now all the various file operations that we export. @@ -150,6 +152,9 @@ static ssize_t rtc_read(struct file *file, char *buf, size_t count, loff_t *ppos) { +#ifdef CONFIG_RTC_LIGHT + return -EIO; +#else struct wait_queue wait = { current, NULL }; unsigned long data; ssize_t retval; @@ -181,6 +186,7 @@ remove_wait_queue(&rtc_wait, &wait); return retval; +#endif } static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, @@ -191,6 +197,7 @@ struct rtc_time wtime; switch (cmd) { +#ifndef CONFIG_RTC_LIGHT case RTC_AIE_OFF: /* Mask alarm int. enab. bit */ { mask_rtc_irq_bit(RTC_AIE); @@ -238,6 +245,7 @@ set_rtc_irq_bit(RTC_UIE); return 0; } +#endif case RTC_ALM_READ: /* Read the present alarm time */ { /* @@ -377,6 +385,7 @@ { return put_user(rtc_freq, (unsigned long *)arg); } +#ifndef CONFIG_RTC_LIGHT case RTC_IRQP_SET: /* Set periodic IRQ rate. */ { int tmp = 0; @@ -413,6 +422,7 @@ restore_flags(flags); return 0; } +#endif #ifdef __alpha__ case RTC_EPOCH_READ: /* Read the epoch. */ { @@ -462,6 +472,7 @@ * in use, and clear the data. */ +#ifndef CONFIG_RTC_LIGHT unsigned char tmp; unsigned long flags; @@ -481,10 +492,12 @@ } rtc_irq_data = 0; +#endif rtc_status &= ~RTC_IS_OPEN; return 0; } +#ifndef CONFIG_RTC_LIGHT static unsigned int rtc_poll(struct file *file, poll_table *wait) { poll_wait(file, &rtc_wait, wait); @@ -492,6 +505,7 @@ return POLLIN | POLLRDNORM; return 0; } +#endif /* * The various file operations we support. @@ -502,7 +516,11 @@ rtc_read, NULL, /* No write */ NULL, /* No readdir */ +#ifdef CONFIG_RTC_LIGHT + NULL, +#else rtc_poll, +#endif rtc_ioctl, NULL, /* No mmap */ rtc_open, @@ -526,12 +544,14 @@ char *guess = NULL; #endif printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION); +#ifndef CONFIG_RTC_LIGHT if(request_irq(RTC_IRQ, rtc_interrupt, SA_INTERRUPT, "rtc", NULL)) { /* Yeah right, seeing as irq 8 doesn't even hit the bus. */ printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ); return -EIO; } +#endif misc_register(&rtc_dev); /* Check region? Naaah! Just snarf it up. */ request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc"); @@ -565,6 +585,7 @@ if (guess) printk("rtc: %s epoch (%lu) detected\n", guess, epoch); #endif +#ifndef CONFIG_RTC_LIGHT init_timer(&rtc_irq_timer); rtc_irq_timer.function = rtc_dropped_irq; rtc_wait = NULL; @@ -573,6 +594,7 @@ /* Initialize periodic freq. to CMOS reset default, which is 1024Hz */ CMOS_WRITE(((CMOS_READ(RTC_FREQ_SELECT) & 0xF0) | 0x06), RTC_FREQ_SELECT); restore_flags(flags); +#endif rtc_freq = 1024; return 0; } @@ -589,6 +611,7 @@ * for something that requires a steady > 1KHz signal anyways.) */ +#ifndef CONFIG_RTC_LIGHT void rtc_dropped_irq(unsigned long data) { unsigned long flags; @@ -603,6 +626,7 @@ rtc_irq_data |= (CMOS_READ(RTC_INTR_FLAGS) & 0xF0); /* restart */ restore_flags(flags); } +#endif /* * Info exported via "/proc/rtc". @@ -789,6 +813,7 @@ * meddles with the interrupt enable/disable bits. */ +#ifndef CONFIG_RTC_LIGHT void mask_rtc_irq_bit(unsigned char bit) { unsigned char val; @@ -818,3 +843,4 @@ rtc_irq_data = 0; restore_flags(flags); } +#endif