diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-23 00:40:54 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-23 00:40:54 +0000 |
commit | 529c593ece216e4aaffd36bd940cb94f1fa63129 (patch) | |
tree | 78f1c0b805f5656aa7b0417a043c5346f700a2cf /include/asm-arm | |
parent | 0bd079751d25808d1972baee5c4eaa1db2227257 (diff) |
Merge with 2.3.43. I did ignore all modifications to the qlogicisp.c
driver due to the Origin A64 hacks.
Diffstat (limited to 'include/asm-arm')
-rw-r--r-- | include/asm-arm/arch-arc/time.h | 182 | ||||
-rw-r--r-- | include/asm-arm/arch-cl7500/time.h | 97 | ||||
-rw-r--r-- | include/asm-arm/arch-ebsa110/time.h | 55 | ||||
-rw-r--r-- | include/asm-arm/arch-ebsa285/time.h | 118 | ||||
-rw-r--r-- | include/asm-arm/arch-nexuspci/time.h | 25 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/time.h | 190 | ||||
-rw-r--r-- | include/asm-arm/arch-sa1100/system.h | 1 | ||||
-rw-r--r-- | include/asm-arm/checksum.h | 4 | ||||
-rw-r--r-- | include/asm-arm/mmu_context.h | 3 | ||||
-rw-r--r-- | include/asm-arm/pgalloc.h | 6 | ||||
-rw-r--r-- | include/asm-arm/proc-armv/system.h | 81 | ||||
-rw-r--r-- | include/asm-arm/types.h | 4 |
12 files changed, 105 insertions, 661 deletions
diff --git a/include/asm-arm/arch-arc/time.h b/include/asm-arm/arch-arc/time.h index 5e7f3c863..95c8ae14f 100644 --- a/include/asm-arm/arch-arc/time.h +++ b/include/asm-arm/arch-arc/time.h @@ -1,196 +1,30 @@ /* * linux/include/asm-arm/arch-arc/time.h * - * Copyright (c) 1996 Russell King. + * Copyright (c) 1996-2000 Russell King. * * Changelog: * 24-Sep-1996 RMK Created * 10-Oct-1996 RMK Brought up to date with arch-sa110eval * 04-Dec-1997 RMK Updated for new arch/arm/time.c */ -#include <asm/ioc.h> - -static long last_rtc_update = 0; /* last time the cmos clock got updated */ - -extern __inline__ unsigned long gettimeoffset (void) -{ - unsigned int count1, count2, status1, status2; - unsigned long offset = 0; - - status1 = inb(IOC_IRQREQA); - barrier (); - outb (0, IOC_T0LATCH); - barrier (); - count1 = inb(IOC_T0CNTL) | (inb(IOC_T0CNTH) << 8); - barrier (); - status2 = inb(IOC_IRQREQA); - barrier (); - outb (0, IOC_T0LATCH); - barrier (); - count2 = inb(IOC_T0CNTL) | (inb(IOC_T0CNTH) << 8); - - if (count2 < count1) { - /* - * This means that we haven't just had an interrupt - * while reading into status2. - */ - if (status2 & (1 << 5)) - offset = tick; - count1 = count2; - } else if (count2 > count1) { - /* - * We have just had another interrupt while reading - * status2. - */ - offset += tick; - count1 = count2; - } - - count1 = LATCH - count1; - /* - * count1 = number of clock ticks since last interrupt - */ - offset += count1 * tick / LATCH; - return offset; -} - -extern int iic_control (unsigned char, int, char *, int); - -static int set_rtc_time(unsigned long nowtime) -{ - char buf[5], ctrl; - - if (iic_control(0xa1, 0, &ctrl, 1) != 0) - printk("RTC: failed to read control reg\n"); - - /* - * Reset divider - */ - ctrl |= 0x80; - - if (iic_control(0xa0, 0, &ctrl, 1) != 0) - printk("RTC: failed to stop the clock\n"); - - /* - * We only set the time - we don't set the date. - * This means that there is the possibility once - * a day for the correction to disrupt the date. - * We really ought to write the time and date, or - * nothing at all. - */ - buf[0] = 0; - buf[1] = nowtime % 60; nowtime /= 60; - buf[2] = nowtime % 60; nowtime /= 60; - buf[3] = nowtime % 24; - - BIN_TO_BCD(buf[1]); - BIN_TO_BCD(buf[2]); - BIN_TO_BCD(buf[3]); - - if (iic_control(0xa0, 1, buf, 4) != 0) - printk("RTC: Failed to set the time\n"); - - /* - * Re-enable divider - */ - ctrl &= ~0x80; - - if (iic_control(0xa0, 0, &ctrl, 1) != 0) - printk("RTC: failed to start the clock\n"); - - return 0; -} - -extern __inline__ unsigned long get_rtc_time(void) -{ - unsigned int year, i; - char buf[8]; - - /* - * The year is not part of the RTC counter - * registers, and is stored in RAM. This - * means that it will not be automatically - * updated. - */ - if (iic_control(0xa1, 0xc0, buf, 1) != 0) - printk("RTC: failed to read the year\n"); - - /* - * If the year is before 1970, then the year - * is actually 100 in advance. This gives us - * a year 2070 bug... - */ - year = 1900 + buf[0]; - if (year < 1970) - year += 100; - - /* - * Read the time and date in one go - this - * will ensure that we don't get any effects - * due to carry (the RTC latches the counters - * during a read). - */ - if (iic_control(0xa1, 2, buf, 5) != 0) { - printk("RTC: failed to read the time and date\n"); - memset(buf, 0, sizeof(buf)); - } - - /* - * The RTC combines years with date and weekday - * with month. We need to mask off this extra - * information before converting the date to - * binary. - */ - buf[4] &= 0x1f; - buf[3] &= 0x3f; - - for (i = 0; i < 5; i++) - BCD_TO_BIN(buf[i]); - - return mktime(year, buf[4], buf[3], buf[2], buf[1], buf[0]); -} +extern void ioctime_init(void); static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_timer(regs); - - /* If we have an externally synchronized linux clock, then update - * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be - * called as close as possible to 500 ms before the new second starts. - */ - if ((time_status & STA_UNSYNC) == 0 && - xtime.tv_sec > last_rtc_update + 660 && - xtime.tv_usec >= 50000 - (tick >> 1) && - xtime.tv_usec < 50000 + (tick >> 1)) { - if (set_rtc_time(xtime.tv_sec) == 0) - last_rtc_update = xtime.tv_sec; - else - last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ - } - - if (!user_mode(regs)) - do_profile(instruction_pointer(regs)); + do_set_rtc(); + do_profile(regs); } -static struct irqaction timerirq = { - timer_interrupt, - 0, - 0, - "timer", - NULL, - NULL -}; - /* - * Set up timer interrupt, and return the current time in seconds. + * Set up timer interrupt. */ extern __inline__ void setup_timer(void) { - outb(LATCH & 255, IOC_T0LTCHL); - outb(LATCH >> 8, IOC_T0LTCHH); - outb(0, IOC_T0GO); + ioctime_init(); - xtime.tv_sec = get_rtc_time(); + timer_irq.handler = timer_interrupt; - setup_arm_irq(IRQ_TIMER, &timerirq); + setup_arm_irq(IRQ_TIMER, &timer_irq); } diff --git a/include/asm-arm/arch-cl7500/time.h b/include/asm-arm/arch-cl7500/time.h index 19b388682..59cb2d6fd 100644 --- a/include/asm-arm/arch-cl7500/time.h +++ b/include/asm-arm/arch-cl7500/time.h @@ -1,88 +1,19 @@ /* * linux/include/asm-arm/arch-cl7500/time.h * - * Copyright (c) 1996 Russell King. - * Copyright (C) 1999 Nexus Electronics Ltd. + * Copyright (c) 1996-2000 Russell King. * * Changelog: * 24-Sep-1996 RMK Created * 10-Oct-1996 RMK Brought up to date with arch-sa110eval * 04-Dec-1997 RMK Updated for new arch/arm/time.c - * 10-Aug-1999 PJB Converted for CL7500 */ -#include <asm/iomd.h> - -static long last_rtc_update = 0; /* last time the cmos clock got updated */ - -extern __inline__ unsigned long gettimeoffset (void) -{ - unsigned long offset = 0; - unsigned int count1, count2, status1, status2; - - status1 = IOMD_IRQREQA; - barrier (); - outb(0, IOMD_T0LATCH); - barrier (); - count1 = inb(IOMD_T0CNTL) | (inb(IOMD_T0CNTH) << 8); - barrier (); - status2 = inb(IOMD_IRQREQA); - barrier (); - outb(0, IOMD_T0LATCH); - barrier (); - count2 = inb(IOMD_T0CNTL) | (inb(IOMD_T0CNTH) << 8); - - if (count2 < count1) { - /* - * This means that we haven't just had an interrupt - * while reading into status2. - */ - if (status2 & (1 << 5)) - offset = tick; - count1 = count2; - } else if (count2 > count1) { - /* - * We have just had another interrupt while reading - * status2. - */ - offset += tick; - count1 = count2; - } - - count1 = LATCH - count1; - /* - * count1 = number of clock ticks since last interrupt - */ - offset += count1 * tick / LATCH; - return offset; -} - -extern __inline__ unsigned long get_rtc_time(void) -{ - return mktime(1976, 06, 24, 0, 0, 0); -} - -static int set_rtc_time(unsigned long nowtime) -{ - return 0; -} +extern void ioctime_init(void); static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_timer(regs); - - /* If we have an externally synchronized linux clock, then update - * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be - * called as close as possible to 500 ms before the new second starts. - */ - if ((time_status & STA_UNSYNC) == 0 && - xtime.tv_sec > last_rtc_update + 660 && - xtime.tv_usec >= 50000 - (tick >> 1) && - xtime.tv_usec < 50000 + (tick >> 1)) { - if (set_rtc_time(xtime.tv_sec) == 0) - last_rtc_update = xtime.tv_sec; - else - last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ - } + do_set_rtc(); { /* Twinkle the lights. */ @@ -95,29 +26,17 @@ static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) } } - if (!user_mode(regs)) - do_profile(instruction_pointer(regs)); + do_profile(regs); } -static struct irqaction timerirq = { - timer_interrupt, - 0, - 0, - "timer", - NULL, - NULL -}; - /* - * Set up timer interrupt, and return the current time in seconds. + * Set up timer interrupt. */ extern __inline__ void setup_timer(void) { - outb(LATCH & 255, IOMD_T0LTCHL); - outb(LATCH >> 8, IOMD_T0LTCHH); - outb(0, IOMD_T0GO); + ioctime_init(); - xtime.tv_sec = get_rtc_time(); + timer_irq.handler = timer_interrupt; - setup_arm_irq(IRQ_TIMER, &timerirq); + setup_arm_irq(IRQ_TIMER, &timer_irq); } diff --git a/include/asm-arm/arch-ebsa110/time.h b/include/asm-arm/arch-ebsa110/time.h index dfb62984c..dbddeb1b9 100644 --- a/include/asm-arm/arch-ebsa110/time.h +++ b/include/asm-arm/arch-ebsa110/time.h @@ -12,11 +12,8 @@ * 28-Dec-1998 APH Made leds code optional */ -#include <linux/config.h> #include <asm/leds.h> -#define IRQ_TIMER IRQ_EBSA110_TIMER0 - #define MCLK_47_8 #if defined(MCLK_42_3) @@ -32,52 +29,27 @@ #define PIT1_COUNT 0x85A1 #define DIVISOR 2 #endif - -extern __inline__ unsigned long gettimeoffset (void) -{ - return 0; -} static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { *PIT_T1 = (PIT1_COUNT) & 0xff; *PIT_T1 = (PIT1_COUNT) >> 8; -#ifdef CONFIG_LEDS - { - static int count = 50; - if (--count == 0) { - count = 50; - leds_event(led_timer); - } - } -#endif - - { #ifdef DIVISOR + { static unsigned int divisor; - if (divisor-- == 0) { - divisor = DIVISOR - 1; -#else - { -#endif - do_timer(regs); - } + if (divisor--) + return; + divisor = DIVISOR - 1; } +#endif + do_leds(); + do_timer(regs); } -static struct irqaction timerirq = { - timer_interrupt, - 0, - 0, - "timer", - NULL, - NULL -}; - /* - * Set up timer interrupt, and return the current time in seconds. + * Set up timer interrupt. */ extern __inline__ void setup_timer(void) { @@ -93,12 +65,9 @@ extern __inline__ void setup_timer(void) *PIT_T1 = (PIT1_COUNT) & 0xff; *PIT_T1 = (PIT1_COUNT) >> 8; - /* - * Default the date to 1 Jan 1970 0:0:0 - * You will have to run a time daemon to set the - * clock correctly at bootup - */ - xtime.tv_sec = mktime(1970, 1, 1, 0, 0, 0); + timer_irq.handler = timer_interrupt; - setup_arm_irq(IRQ_TIMER, &timerirq); + setup_arm_irq(IRQ_EBSA110_TIMER0, &timer_irq); } + + diff --git a/include/asm-arm/arch-ebsa285/time.h b/include/asm-arm/arch-ebsa285/time.h index 3c5bcca3b..b10bdd324 100644 --- a/include/asm-arm/arch-ebsa285/time.h +++ b/include/asm-arm/arch-ebsa285/time.h @@ -17,7 +17,6 @@ #define RTC_PORT(x) (rtc_base+(x)) #define RTC_ALWAYS_BCD 0 -#include <linux/config.h> #include <linux/mc146818rtc.h> #include <asm/dec21285.h> @@ -25,32 +24,6 @@ #include <asm/system.h> static int rtc_base; -static unsigned long (*gettimeoffset)(void); -static int (*set_rtc_mmss)(unsigned long nowtime); -static long last_rtc_update = 0; /* last time the cmos clock got updated */ - -#ifdef CONFIG_LEDS -static void do_leds(void) -{ - static unsigned int count = 50; - static int last_pid; - - if (current->pid != last_pid) { - last_pid = current->pid; - if (last_pid) - leds_event(led_idle_end); - else - leds_event(led_idle_start); - } - - if (--count == 0) { - count = 50; - leds_event(led_timer); - } -} -#else -#define do_leds() -#endif #define mSEC_10_from_14 ((14318180 + 100) / 200) @@ -101,34 +74,10 @@ static void isa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) do_leds(); do_timer(regs); - - /* If we have an externally synchronized linux clock, then update - * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be - * called as close as possible to 500 ms before the new second starts. - */ - if ((time_status & STA_UNSYNC) == 0 && - xtime.tv_sec > last_rtc_update + 660 && - xtime.tv_usec > 50000 - (tick >> 1) && - xtime.tv_usec < 50000 + (tick >> 1)) { - if (set_rtc_mmss(xtime.tv_sec) == 0) - last_rtc_update = xtime.tv_sec; - else - last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ - } - - if (!user_mode(regs)) - do_profile(instruction_pointer(regs)); + do_set_rtc(); + do_profile(regs); } -static struct irqaction isa_timer_irq = { - isa_timer_interrupt, - 0, - 0, - "timer", - NULL, - NULL -}; - static unsigned long __init get_isa_cmos_time(void) { unsigned int year, mon, day, hour, min, sec; @@ -175,11 +124,12 @@ static unsigned long __init get_isa_cmos_time(void) } static int -set_isa_cmos_time(unsigned long nowtime) +set_isa_cmos_time(void) { int retval = 0; int real_seconds, real_minutes, cmos_minutes; unsigned char save_control, save_freq_select; + unsigned long nowtime = xtime.tv_sec; save_control = CMOS_READ(RTC_CONTROL); /* tell the clock it's being set */ CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL); @@ -228,60 +178,31 @@ set_isa_cmos_time(unsigned long nowtime) -static unsigned long __ebsa285_text timer1_gettimeoffset (void) +static unsigned long timer1_gettimeoffset (void) { unsigned long value = LATCH - *CSR_TIMER1_VALUE; return (tick * value) / LATCH; } -static void __ebsa285_text timer1_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static void timer1_interrupt(int irq, void *dev_id, struct pt_regs *regs) { *CSR_TIMER1_CLR = 0; /* Do the LEDs things */ do_leds(); - do_timer(regs); - - /* If we have an externally synchronized linux clock, then update - * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be - * called as close as possible to 500 ms before the new second starts. - */ - if ((time_status & STA_UNSYNC) == 0 && - xtime.tv_sec > last_rtc_update + 660 && - xtime.tv_usec > 50000 - (tick >> 1) && - xtime.tv_usec < 50000 + (tick >> 1)) { - if (set_rtc_mmss(xtime.tv_sec) == 0) - last_rtc_update = xtime.tv_sec; - else - last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ - } - - if (!user_mode(regs)) - do_profile(instruction_pointer(regs)); -} - -static struct irqaction __ebsa285_data timer1_irq = { - timer1_interrupt, - 0, - 0, - "timer", - NULL, - NULL -}; - -static int -set_dummy_time(unsigned long secs) -{ - return 1; + do_set_rtc(); + do_profile(regs); } /* - * Set up timer interrupt, and return the current time in seconds. + * Set up timer interrupt. */ extern __inline__ void setup_timer(void) { + int irq; + if (machine_is_co285()) /* * Add-in 21285s shouldn't access the RTC @@ -321,18 +242,11 @@ extern __inline__ void setup_timer(void) printk(KERN_WARNING "RTC: *** warning: CMOS battery bad\n"); xtime.tv_sec = get_isa_cmos_time(); - set_rtc_mmss = set_isa_cmos_time; + set_rtc = set_isa_cmos_time; } else rtc_base = 0; } - if (!rtc_base) { - /* - * Default the date to 1 Jan 1970 0:0:0 - */ - xtime.tv_sec = mktime(1970, 1, 1, 0, 0, 0); - set_rtc_mmss = set_dummy_time; - } if (machine_is_ebsa285() || machine_is_co285()) { gettimeoffset = timer1_gettimeoffset; @@ -340,7 +254,8 @@ extern __inline__ void setup_timer(void) *CSR_TIMER1_LOAD = LATCH; *CSR_TIMER1_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16; - setup_arm_irq(IRQ_TIMER1, &timer1_irq); + timer_irq.handler = timer1_interrupt; + irq = IRQ_TIMER1; } else { /* enable PIT timer */ /* set for periodic (4) and LSB/MSB write (0x30) */ @@ -349,7 +264,8 @@ extern __inline__ void setup_timer(void) outb((mSEC_10_from_14/6) >> 8, 0x40); gettimeoffset = isa_gettimeoffset; - - setup_arm_irq(IRQ_ISA_TIMER, &isa_timer_irq); + timer_irq.handler = isa_timer_interrupt; + irq = IRQ_ISA_TIMER; } + setup_arm_irq(IRQ_ISA_TIMER, &timer_irq); } diff --git a/include/asm-arm/arch-nexuspci/time.h b/include/asm-arm/arch-nexuspci/time.h index 17f0ae472..fbf53e887 100644 --- a/include/asm-arm/arch-nexuspci/time.h +++ b/include/asm-arm/arch-nexuspci/time.h @@ -10,13 +10,6 @@ #define UART_BASE 0xfff00000 #define INTCONT 0xffe00000 -#define update_rtc() - -extern __inline__ unsigned long gettimeoffset (void) -{ - return 0; -} - static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { static int count = 50; @@ -40,15 +33,6 @@ static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) do_timer(regs); } -static struct irqaction timerirq = { - timer_interrupt, - 0, - 0, - "timer", - NULL, - NULL -}; - extern __inline__ void setup_timer(void) { int tick = 3686400 / 16 / 2 / 100; @@ -58,12 +42,7 @@ extern __inline__ void setup_timer(void) writeb(0x80, UART_BASE + 8); writeb(0x10, UART_BASE + 0x14); - /* - * Default the date to 1 Jan 1970 0:0:0 - * You will have to run a time daemon to set the - * clock correctly at bootup - */ - xtime.tv_sec = mktime(1970, 1, 1, 0, 0, 0); + timer_irq.handler = timer_interrupt; - setup_arm_irq(IRQ_TIMER, &timerirq); + setup_arm_irq(IRQ_TIMER, &timer_irq); } diff --git a/include/asm-arm/arch-rpc/time.h b/include/asm-arm/arch-rpc/time.h index 0ac40356a..94974241f 100644 --- a/include/asm-arm/arch-rpc/time.h +++ b/include/asm-arm/arch-rpc/time.h @@ -1,204 +1,30 @@ /* * linux/include/asm-arm/arch-rpc/time.h * - * Copyright (c) 1996 Russell King. + * Copyright (c) 1996-2000 Russell King. * * Changelog: * 24-Sep-1996 RMK Created * 10-Oct-1996 RMK Brought up to date with arch-sa110eval * 04-Dec-1997 RMK Updated for new arch/arm/time.c */ -#include <asm/iomd.h> - -static long last_rtc_update = 0; /* last time the cmos clock got updated */ - -extern __inline__ unsigned long gettimeoffset (void) -{ - unsigned long offset = 0; - unsigned int count1, count2, status1, status2; - - status1 = IOMD_IRQREQA; - barrier (); - outb(0, IOMD_T0LATCH); - barrier (); - count1 = inb(IOMD_T0CNTL) | (inb(IOMD_T0CNTH) << 8); - barrier (); - status2 = inb(IOMD_IRQREQA); - barrier (); - outb(0, IOMD_T0LATCH); - barrier (); - count2 = inb(IOMD_T0CNTL) | (inb(IOMD_T0CNTH) << 8); - - if (count2 < count1) { - /* - * This means that we haven't just had an interrupt - * while reading into status2. - */ - if (status2 & (1 << 5)) - offset = tick; - count1 = count2; - } else if (count2 > count1) { - /* - * We have just had another interrupt while reading - * status2. - */ - offset += tick; - count1 = count2; - } - - count1 = LATCH - count1; - /* - * count1 = number of clock ticks since last interrupt - */ - offset += count1 * tick / LATCH; - return offset; -} - -extern int iic_control(unsigned char, int, char *, int); - -static int set_rtc_time(unsigned long nowtime) -{ - char buf[5], ctrl; - - if (iic_control(0xa1, 0, &ctrl, 1) != 0) - printk("RTC: failed to read control reg\n"); - - /* - * Reset divider - */ - ctrl |= 0x80; - - if (iic_control(0xa0, 0, &ctrl, 1) != 0) - printk("RTC: failed to stop the clock\n"); - - /* - * We only set the time - we don't set the date. - * This means that there is the possibility once - * a day for the correction to disrupt the date. - * We really ought to write the time and date, or - * nothing at all. - */ - buf[0] = 0; - buf[1] = nowtime % 60; nowtime /= 60; - buf[2] = nowtime % 60; nowtime /= 60; - buf[3] = nowtime % 24; - - BIN_TO_BCD(buf[1]); - BIN_TO_BCD(buf[2]); - BIN_TO_BCD(buf[3]); - - if (iic_control(0xa0, 1, buf, 4) != 0) - printk("RTC: Failed to set the time\n"); - - /* - * Re-enable divider - */ - ctrl &= ~0x80; - - if (iic_control(0xa0, 0, &ctrl, 1) != 0) - printk("RTC: failed to start the clock\n"); - - return 0; -} - -extern __inline__ unsigned long get_rtc_time(void) -{ - unsigned int year, i; - char buf[8]; - - /* - * The year is not part of the RTC counter - * registers, and is stored in RAM. This - * means that it will not be automatically - * updated. - */ - if (iic_control(0xa1, 0xc0, buf, 1) != 0) - printk("RTC: failed to read the year\n"); - - /* - * If the year is before 1970, then the year - * is actually 100 in advance. This gives us - * a year 2070 bug... - */ - year = 1900 + buf[0]; - if (year < 1970) - year += 100; - - /* - * Read the time and date in one go - this - * will ensure that we don't get any effects - * due to carry (the RTC latches the counters - * during a read). - */ - if (iic_control(0xa1, 2, buf, 5) != 0) { - printk("RTC: failed to read the time and date\n"); - memset(buf, 0, sizeof(buf)); - } - - /*FIXME: - * This doesn't seem to work. Does RISC OS - * actually use the RTC year? It doesn't - * seem to. In that case, how does it update - * the CMOS year? - */ - /*year += (buf[3] >> 6) & 3;*/ - - /* - * The RTC combines years with date and weekday - * with month. We need to mask off this extra - * information before converting the date to - * binary. - */ - buf[4] &= 0x1f; - buf[3] &= 0x3f; - - for (i = 0; i < 5; i++) - BCD_TO_BIN(buf[i]); - - return mktime(year, buf[4], buf[3], buf[2], buf[1], buf[0]); -} +extern void ioctime_init(void); static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_timer(regs); - - /* If we have an externally synchronized linux clock, then update - * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be - * called as close as possible to 500 ms before the new second starts. - */ - if ((time_status & STA_UNSYNC) == 0 && - xtime.tv_sec > last_rtc_update + 660 && - xtime.tv_usec >= 50000 - (tick >> 1) && - xtime.tv_usec < 50000 + (tick >> 1)) { - if (set_rtc_time(xtime.tv_sec) == 0) - last_rtc_update = xtime.tv_sec; - else - last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ - } - - if (!user_mode(regs)) - do_profile(instruction_pointer(regs)); + do_set_rtc(); + do_profile(regs); } -static struct irqaction timerirq = { - timer_interrupt, - 0, - 0, - "timer", - NULL, - NULL -}; - /* - * Set up timer interrupt, and return the current time in seconds. + * Set up timer interrupt. */ extern __inline__ void setup_timer(void) { - outb(LATCH & 255, IOMD_T0LTCHL); - outb(LATCH >> 8, IOMD_T0LTCHH); - outb(0, IOMD_T0GO); + ioctime_init(); - xtime.tv_sec = get_rtc_time(); + timer_irq.handler = timer_interrupt; - setup_arm_irq(IRQ_TIMER, &timerirq); + setup_arm_irq(IRQ_TIMER, &timer_irq); } diff --git a/include/asm-arm/arch-sa1100/system.h b/include/asm-arm/arch-sa1100/system.h index 49b4bdca2..3ec5c9074 100644 --- a/include/asm-arm/arch-sa1100/system.h +++ b/include/asm-arm/arch-sa1100/system.h @@ -41,6 +41,7 @@ " b 1f @ Seems we must align the next \n" \ " .align 5 @ instruction on a cache line \n" \ "1: mcr p15, 0, %0, c15, c8, 2 @ Wait for interrupts \n" \ +" mov r0, r0 @ insert NOP to ensure SA1100 re-awakes\n" \ " mcr p15, 0, %0, c15, c1, 2 @ Reenable clock switching \n" \ : : "r" (&ICIP) : "cc" ); \ } while (0) diff --git a/include/asm-arm/checksum.h b/include/asm-arm/checksum.h index 5f1e0f695..9d048a3ba 100644 --- a/include/asm-arm/checksum.h +++ b/include/asm-arm/checksum.h @@ -55,9 +55,9 @@ ip_fast_csum(unsigned char * iph, unsigned int ihl) unsigned int sum, tmp1; __asm__ __volatile__( - "sub %2, %2, #5 @ ip_fast_csum - ldr %0, [%1], #4 + "ldr %0, [%1], #4 @ ip_fast_csum ldr %3, [%1], #4 + sub %2, %2, #5 adds %0, %0, %3 ldr %3, [%1], #4 adcs %0, %0, %3 diff --git a/include/asm-arm/mmu_context.h b/include/asm-arm/mmu_context.h index 4b8125cba..6ebf76a6c 100644 --- a/include/asm-arm/mmu_context.h +++ b/include/asm-arm/mmu_context.h @@ -17,6 +17,9 @@ #define destroy_context(mm) do { } while(0) #define init_new_context(tsk,mm) do { } while(0) +static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu) +{ +} /* * This is the actual mm switch as far as the scheduler * is concerned. No registers are touched. diff --git a/include/asm-arm/pgalloc.h b/include/asm-arm/pgalloc.h index 841855ef8..12b2f3390 100644 --- a/include/asm-arm/pgalloc.h +++ b/include/asm-arm/pgalloc.h @@ -14,6 +14,12 @@ */ #include <asm/proc/cache.h> +extern __inline__ void flush_tlb_pgtables(struct mm_struct *mm, + unsigned long start, + unsigned long end) +{ +} + /* * Page table cache stuff */ diff --git a/include/asm-arm/proc-armv/system.h b/include/asm-arm/proc-armv/system.h index a7551ec93..d0e334813 100644 --- a/include/asm-arm/proc-armv/system.h +++ b/include/asm-arm/proc-armv/system.h @@ -16,7 +16,6 @@ extern __inline__ unsigned long __xchg(unsigned long x, volatile void *ptr, int switch (size) { case 1: __asm__ __volatile__ ("swpb %0, %1, [%2]" : "=r" (x) : "r" (x), "r" (ptr) : "memory"); break; - case 2: abort (); case 4: __asm__ __volatile__ ("swp %0, %1, [%2]" : "=r" (x) : "r" (x), "r" (ptr) : "memory"); break; default: arm_invalidptr(xchg_str, size); @@ -25,11 +24,9 @@ extern __inline__ unsigned long __xchg(unsigned long x, volatile void *ptr, int } #define set_cr(x) \ - do { \ __asm__ __volatile__( \ "mcr p15, 0, %0, c1, c0 @ set CR" \ - : : "r" (x)); \ - } while (0) + : : "r" (x)) extern unsigned long cr_no_alignment; /* defined in entry-armv.S */ extern unsigned long cr_alignment; /* defined in entry-armv.S */ @@ -42,76 +39,66 @@ extern unsigned long cr_alignment; /* defined in entry-armv.S */ * Save the current interrupt enable state & disable IRQs */ #define __save_flags_cli(x) \ - do { \ - unsigned long temp; \ - __asm__ __volatile__( \ - "mrs %1, cpsr @ save_flags_cli\n" \ -" and %0, %1, #192\n" \ -" orr %1, %1, #128\n" \ -" msr cpsr, %1" \ - : "=r" (x), "=r" (temp) \ - : \ - : "memory"); \ - } while (0) + ({ \ + unsigned long temp; \ + __asm__ __volatile__( \ + "mrs %0, cpsr @ save_flags_cli\n" \ +" orr %1, %0, #128\n" \ +" msr cpsr_c, %1" \ + : "=r" (x), "=r" (temp) \ + : \ + : "memory"); \ + }) /* * Enable IRQs */ #define __sti() \ - do { \ - unsigned long temp; \ - __asm__ __volatile__( \ + ({ \ + unsigned long temp; \ + __asm__ __volatile__( \ "mrs %0, cpsr @ sti\n" \ " bic %0, %0, #128\n" \ -" msr cpsr, %0" \ - : "=r" (temp) \ - : \ - : "memory"); \ - } while(0) +" msr cpsr_c, %0" \ + : "=r" (temp) \ + : \ + : "memory"); \ + }) /* * Disable IRQs */ #define __cli() \ - do { \ - unsigned long temp; \ - __asm__ __volatile__( \ + ({ \ + unsigned long temp; \ + __asm__ __volatile__( \ "mrs %0, cpsr @ cli\n" \ " orr %0, %0, #128\n" \ -" msr cpsr, %0" \ - : "=r" (temp) \ - : \ - : "memory"); \ - } while(0) +" msr cpsr_c, %0" \ + : "=r" (temp) \ + : \ + : "memory"); \ + }) /* * save current IRQ & FIQ state */ #define __save_flags(x) \ - do { \ - __asm__ __volatile__( \ + __asm__ __volatile__( \ "mrs %0, cpsr @ save_flags\n" \ -" and %0, %0, #192" \ : "=r" (x) \ : \ - : "memory"); \ - } while (0) + : "memory") /* * restore saved IRQ & FIQ state */ #define __restore_flags(x) \ - do { \ - unsigned long temp; \ - __asm__ __volatile__( \ - "mrs %0, cpsr @ restore_flags\n" \ -" bic %0, %0, #192\n" \ -" orr %0, %0, %1\n" \ -" msr cpsr, %0" \ - : "=&r" (temp) \ - : "r" (x) \ - : "memory"); \ - } while (0) + __asm__ __volatile__( \ + "msr cpsr_c, %0 @ restore_flags\n" \ + : \ + : "r" (x) \ + : "memory") /* For spinlocks etc */ #define local_irq_save(x) __save_flags_cli(x) diff --git a/include/asm-arm/types.h b/include/asm-arm/types.h index a1e76285a..39d5290f5 100644 --- a/include/asm-arm/types.h +++ b/include/asm-arm/types.h @@ -41,6 +41,10 @@ typedef unsigned long long u64; #define BITS_PER_LONG 32 +/* Dma addresses are 32-bits wide. */ + +typedef u32 dma_addr_t; + #endif /* __KERNEL__ */ #endif |