diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-06-13 16:29:25 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-06-13 16:29:25 +0000 |
commit | db7d4daea91e105e3859cf461d7e53b9b77454b2 (patch) | |
tree | 9bb65b95440af09e8aca63abe56970dd3360cc57 /include/asm-arm/arch-rpc | |
parent | 9c1c01ead627bdda9211c9abd5b758d6c687d8ac (diff) |
Merge with Linux 2.2.8.
Diffstat (limited to 'include/asm-arm/arch-rpc')
-rw-r--r-- | include/asm-arm/arch-rpc/a.out.h | 11 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/hardware.h | 20 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/irq.h | 3 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/keyboard.h | 17 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/memory.h (renamed from include/asm-arm/arch-rpc/mmu.h) | 24 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/oldlatches.h | 9 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/processor.h | 15 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/system.h | 2 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/time.h | 167 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/uncompress.h | 1 |
10 files changed, 180 insertions, 89 deletions
diff --git a/include/asm-arm/arch-rpc/a.out.h b/include/asm-arm/arch-rpc/a.out.h index 598614f23..56b2f4f7a 100644 --- a/include/asm-arm/arch-rpc/a.out.h +++ b/include/asm-arm/arch-rpc/a.out.h @@ -1,15 +1,16 @@ /* * linux/include/asm-arm/arch-rpc/a.out.h * - * Copyright (C) 1996 Russell King + * Copyright (C) 1996-1999 Russell King */ - #ifndef __ASM_ARCH_A_OUT_H #define __ASM_ARCH_A_OUT_H -#ifdef __KERNEL__ -#define STACK_TOP ((current->personality==PER_LINUX_32BIT)? 0xc0000000 : 0x04000000) -#endif +#include <asm/arch/memory.h> + +#define STACK_TOP \ + ((current->personality == PER_LINUX_32BIT) ? \ + TASK_SIZE : 0x04000000) #endif diff --git a/include/asm-arm/arch-rpc/hardware.h b/include/asm-arm/arch-rpc/hardware.h index 8ca6273ff..0e3002f85 100644 --- a/include/asm-arm/arch-rpc/hardware.h +++ b/include/asm-arm/arch-rpc/hardware.h @@ -1,19 +1,19 @@ /* * linux/include/asm-arm/arch-rpc/hardware.h * - * Copyright (C) 1996 Russell King. + * Copyright (C) 1996-1999 Russell King. * * This file contains the hardware definitions of the RiscPC series machines. */ - #ifndef __ASM_ARCH_HARDWARE_H #define __ASM_ARCH_HARDWARE_H +#include <asm/arch/memory.h> + /* * What hardware must be present */ #define HAS_IOMD -#include <asm/iomd.h> #define HAS_VIDC20 /* Hardware addresses of major areas. @@ -26,7 +26,7 @@ #define EASI_SIZE 0x08000000 /* EASI I/O */ #define EASI_START 0x08000000 -#define EASI_BASE 0xe8000000 +#define EASI_BASE 0xe5000000 #define IO_START 0x03000000 /* I/O */ #define IO_SIZE 0x01000000 @@ -38,6 +38,8 @@ #define SCREEN1_END 0xd8000000 #define SCREEN1_BASE 0xd0000000 +#define FLUSH_BASE 0xdf000000 + #ifndef __ASSEMBLER__ @@ -47,8 +49,9 @@ #define IO_VIDC_AUDIO_BASE 0x80140000 #define IO_VIDC_BASE 0x80100000 #define IO_IOMD_BASE 0x80080000 +#define IOC_BASE 0x80080000 -#define IO_EC_EASI_BASE 0x82000000 +#define IO_EC_EASI_BASE 0x81400000 #define IO_EC_IOC4_BASE 0x8009c000 #define IO_EC_IOC_BASE 0x80090000 #define IO_EC_MEMC8_BASE 0x8000ac00 @@ -59,7 +62,6 @@ */ #define EXPMASK_BASE ((volatile unsigned char *)0xe0360000) #define IOEB_BASE ((volatile unsigned char *)0xe0350050) -#define IOC_BASE ((volatile unsigned char *)0xe0200000) #define PCIO_FLOPPYDMABASE ((volatile unsigned char *)0xe002a000) #define PCIO_BASE 0xe0010000 @@ -67,23 +69,19 @@ * Offsets from RAM base */ #define PARAMS_OFFSET 0x0100 -#define KERNEL_OFFSET 0x8000 /* * RAM definitions */ -#define MAPTOPHYS(x) (x) -#define KERNTOPHYS(x) ((unsigned long)(&x)) #define GET_MEMORY_END(p) (PAGE_OFFSET + p->u1.s.page_size * \ (p->u1.s.pages_in_bank[0] + \ p->u1.s.pages_in_bank[1] + \ p->u1.s.pages_in_bank[2] + \ p->u1.s.pages_in_bank[3])) -#define KERNEL_BASE (PAGE_OFFSET + KERNEL_OFFSET) #define PARAMS_BASE (PAGE_OFFSET + PARAMS_OFFSET) #define Z_PARAMS_BASE (RAM_START + PARAMS_OFFSET) -#define SAFE_ADDR 0x00000000 /* ROM */ +#define FLUSH_BASE_PHYS 0x00000000 /* ROM */ #else diff --git a/include/asm-arm/arch-rpc/irq.h b/include/asm-arm/arch-rpc/irq.h index a65f487d4..ea284b9a5 100644 --- a/include/asm-arm/arch-rpc/irq.h +++ b/include/asm-arm/arch-rpc/irq.h @@ -7,6 +7,9 @@ * 10-10-1996 RMK Brought up to date with arch-sa110eval * 22-08-1998 RMK Restructured IRQ routines */ +#include <asm/iomd.h> + +#define fixup_irq(x) (x) static void rpc_mask_irq_ack_a(unsigned int irq) { diff --git a/include/asm-arm/arch-rpc/keyboard.h b/include/asm-arm/arch-rpc/keyboard.h index 6c04cf074..c083b08bb 100644 --- a/include/asm-arm/arch-rpc/keyboard.h +++ b/include/asm-arm/arch-rpc/keyboard.h @@ -10,8 +10,6 @@ #define NR_SCANCODES 128 -extern int ps2kbd_pretranslate(unsigned char scancode); -extern int ps2kbd_translate(unsigned char scancode, unsigned char *keycode_p, char *up_flag_p); extern void ps2kbd_leds(unsigned char leds); extern void ps2kbd_init_hw(void); extern unsigned char ps2kbd_sysrq_xlate[NR_SCANCODES]; @@ -19,20 +17,7 @@ extern unsigned char ps2kbd_sysrq_xlate[NR_SCANCODES]; #define kbd_setkeycode(sc,kc) (-EINVAL) #define kbd_getkeycode(sc) (-EINVAL) -/* Prototype: int kbd_pretranslate(scancode, raw_mode) - * Returns : 0 to ignore scancode - */ -#define kbd_pretranslate(sc,rm) ps2kbd_pretranslate(sc) - -/* Prototype: int kbd_translate(scancode, *keycode, *up_flag, raw_mode) - * Returns : 0 to ignore scancode, *keycode set to keycode, *up_flag - * set to 0200 if scancode indicates release - */ -#ifdef NEW_KEYBOARD -#define kbd_translate(sc, kcp, ufp, rm) ps2kbd_translate(sc, kcp, ufp) -#else -#define kbd_translate(sc, kcp, rm) ({ unsigned int up_flag; ps2kbd_translate(sc, kcp, &up_flag); }) -#endif +#define kbd_translate(sc, kcp, rm) ({ *(kcp) = (sc); 1; }) #define kbd_unexpected_up(kc) (0200) #define kbd_leds(leds) ps2kbd_leds(leds) #define kbd_init_hw() ps2kbd_init_hw() diff --git a/include/asm-arm/arch-rpc/mmu.h b/include/asm-arm/arch-rpc/memory.h index 7fca09aaa..6922cd0f3 100644 --- a/include/asm-arm/arch-rpc/mmu.h +++ b/include/asm-arm/arch-rpc/memory.h @@ -1,19 +1,33 @@ /* - * linux/include/asm-arm/arch-rpc/mmu.h + * linux/include/asm-arm/arch-rpc/memory.h * * Copyright (c) 1996,1997,1998 Russell King. * * Changelog: - * 20-10-1996 RMK Created - * 31-12-1997 RMK Fixed definitions to reduce warnings - * 11-01-1998 RMK Uninlined to reduce hits on cache - * 08-02-1998 RMK Added __virt_to_bus and __bus_to_virt + * 20-Oct-1996 RMK Created + * 31-Dec-1997 RMK Fixed definitions to reduce warnings + * 11-Jan-1998 RMK Uninlined to reduce hits on cache + * 08-Feb-1998 RMK Added __virt_to_bus and __bus_to_virt + * 21-Mar-1999 RMK Renamed to memory.h + * RMK Added TASK_SIZE and PAGE_OFFSET */ #ifndef __ASM_ARCH_MMU_H #define __ASM_ARCH_MMU_H +/* + * Task size: 3GB + */ +#define TASK_SIZE (0xc0000000UL) + +/* + * Page offset: 3GB + */ +#define PAGE_OFFSET (0xc0000000UL) + +#ifndef __ASSEMBLY__ extern unsigned long __virt_to_phys(unsigned long vpage); extern unsigned long __phys_to_virt(unsigned long ppage); +#endif /* * These are exactly the same on the RiscPC as the diff --git a/include/asm-arm/arch-rpc/oldlatches.h b/include/asm-arm/arch-rpc/oldlatches.h deleted file mode 100644 index 8ff6ebd67..000000000 --- a/include/asm-arm/arch-rpc/oldlatches.h +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Dummy oldlatches.h - * - * Copyright (C) 1996 Russell King - */ - -#ifdef __need_oldlatches -#error "Old latches not present in this (rpc) machine" -#endif diff --git a/include/asm-arm/arch-rpc/processor.h b/include/asm-arm/arch-rpc/processor.h index 2fd9155b2..b2b6aec12 100644 --- a/include/asm-arm/arch-rpc/processor.h +++ b/include/asm-arm/arch-rpc/processor.h @@ -1,15 +1,18 @@ /* * linux/include/asm-arm/arch-rpc/processor.h * - * Copyright (c) 1996 Russell King. + * Copyright (c) 1996-1999 Russell King. * * Changelog: - * 10-09-1996 RMK Created + * 10-Sep-1996 RMK Created + * 21-Mar-1999 RMK Added asm/arch/memory.h */ #ifndef __ASM_ARCH_PROCESSOR_H #define __ASM_ARCH_PROCESSOR_H +#include <asm/arch/memory.h> + /* * Bus types */ @@ -18,17 +21,9 @@ #define MCA_bus 0 #define MCA_bus__is_a_macro /* for versions in ksyms.c */ -/* - * User space: 3GB - */ -#define TASK_SIZE (0xc0000000UL) - /* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ #define TASK_UNMAPPED_BASE (TASK_SIZE / 3) -#define INIT_MMAP \ -{ &init_mm, 0, 0, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap } - #endif diff --git a/include/asm-arm/arch-rpc/system.h b/include/asm-arm/arch-rpc/system.h index e0a16f61d..bb220ced4 100644 --- a/include/asm-arm/arch-rpc/system.h +++ b/include/asm-arm/arch-rpc/system.h @@ -6,7 +6,7 @@ #ifndef __ASM_ARCH_SYSTEM_H #define __ASM_ARCH_SYSTEM_H -#include <asm/proc-fns.h> +#include <asm/iomd.h> #define arch_reset(mode) { \ extern void ecard_reset (int card); \ diff --git a/include/asm-arm/arch-rpc/time.h b/include/asm-arm/arch-rpc/time.h index 3d0f742da..b28666b37 100644 --- a/include/asm-arm/arch-rpc/time.h +++ b/include/asm-arm/arch-rpc/time.h @@ -8,6 +8,9 @@ * 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) { @@ -51,46 +54,148 @@ extern __inline__ unsigned long gettimeoffset (void) return offset; } -/* - * No need to reset the timer at every irq - */ -#define reset_timer() 1 +extern int iic_control(unsigned char, int, char *, int); -/* - * Updating of the RTC. We don't currently write the time to the - * CMOS clock. - */ -#define update_rtc() +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; +printk("Year %4d mon %02X day %02X hour %02X min %02X sec %02X\n", year, buf[4], buf[3], buf[2], buf[1], buf[0]); + for (i = 0; i < 5; i++) + BCD_TO_BIN(buf[i]); + + return mktime(year, buf[4], buf[3], buf[2], buf[1], buf[0]); +} + +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 */ + } +} + +static struct irqaction timerirq = { + timer_interrupt, + 0, + 0, + "timer", + NULL, + NULL +}; /* * Set up timer interrupt, and return the current time in seconds. */ -extern __inline__ unsigned long setup_timer (void) +extern __inline__ void setup_timer(void) { - extern int iic_control (unsigned char, int, char *, int); - unsigned int year, mon, day, hour, min, sec; - char buf[8]; - outb(LATCH & 255, IOMD_T0LTCHL); outb(LATCH >> 8, IOMD_T0LTCHH); outb(0, IOMD_T0GO); - iic_control (0xa0, 0xc0, buf, 1); - year = buf[0]; - if ((year += 1900) < 1970) - year += 100; + xtime.tv_sec = get_rtc_time(); - iic_control (0xa0, 2, buf, 5); - mon = buf[4] & 0x1f; - day = buf[3] & 0x3f; - hour = buf[2]; - min = buf[1]; - sec = buf[0]; - BCD_TO_BIN(mon); - BCD_TO_BIN(day); - BCD_TO_BIN(hour); - BCD_TO_BIN(min); - BCD_TO_BIN(sec); - - return mktime(year, mon, day, hour, min, sec); + setup_arm_irq(IRQ_TIMER, &timerirq); } diff --git a/include/asm-arm/arch-rpc/uncompress.h b/include/asm-arm/arch-rpc/uncompress.h index 7740f0c3f..21701094a 100644 --- a/include/asm-arm/arch-rpc/uncompress.h +++ b/include/asm-arm/arch-rpc/uncompress.h @@ -5,7 +5,6 @@ */ #define VIDMEM ((char *)SCREEN_START) -#include "../arch/arm/drivers/char/font.h" #include <asm/hardware.h> #include <asm/io.h> |