summaryrefslogtreecommitdiffstats
path: root/include/asm-arm
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-05-12 23:48:34 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-05-12 23:48:34 +0000
commit7fd36ebeeec9244a7431bb010e6e3c5e4848a0d5 (patch)
tree5fb03a9aafdd1cec5f4f6ff7f1873174cb89b66c /include/asm-arm
parentba2dacab305c598cd4c34a604f8e276bf5bab5ff (diff)
Merge with Linux 2.3.99-pre8. Linus must hate me, too man patches ;-)
Diffstat (limited to 'include/asm-arm')
-rw-r--r--include/asm-arm/arch-sa1100/time.h60
-rw-r--r--include/asm-arm/bitops.h29
-rw-r--r--include/asm-arm/iomd.h8
-rw-r--r--include/asm-arm/proc-fns.h8
-rw-r--r--include/asm-arm/system.h73
5 files changed, 138 insertions, 40 deletions
diff --git a/include/asm-arm/arch-sa1100/time.h b/include/asm-arm/arch-sa1100/time.h
new file mode 100644
index 000000000..205a317a0
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/time.h
@@ -0,0 +1,60 @@
+/*
+ * linux/include/asm-arm/arch-sa1100/time.h
+ *
+ * Copyright (C) 1998 Deborah Wallach.
+ * Twiddles (C) 1999 Hugo Fiennes <hugo@empeg.com>
+ *
+ * 2000/03/29 (C) Nicolas Pitre <nico@cam.org>
+ * Rewritten: big cleanup, much simpler, better HZ acuracy.
+ *
+ */
+
+#include <asm/arch/hardware.h>
+#include <asm/arch/irqs.h>
+
+
+/* IRQs are disabled before entering here from do_gettimeofday() */
+static unsigned long sa1100_gettimeoffset (void)
+{
+ unsigned long ticks_to_match, elapsed, usec;
+
+ /* Get ticks before next timer match */
+ ticks_to_match = OSMR0 - OSCR;
+
+ /* We need elapsed ticks since last match */
+ elapsed = LATCH - ticks_to_match;
+
+ /* Now convert them to usec */
+ usec = (unsigned long)(elapsed*tick)/LATCH;
+
+ return usec;
+}
+
+
+static void sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+ int next_match;
+
+ /* Loop until we get ahead of the free running timer.
+ * This ensures an exact clock tick count and time acuracy.
+ * Should be IRQ race free.
+ */
+ do {
+ do_timer(regs);
+ OSSR = OSSR_M0; /* Clear match on timer 0 */
+ next_match = (OSMR0 += LATCH);
+ } while( (signed long)(next_match - OSCR) <= 0 );
+}
+
+
+extern inline void setup_timer (void)
+{
+ gettimeoffset = sa1100_gettimeoffset;
+ timer_irq.handler = sa1100_timer_interrupt;
+ OSMR0 = 0; /* set initial match at 0 */
+ OSSR = 0xf; /* clear status on all timers */
+ setup_arm_irq(IRQ_OST0, &timer_irq);
+ OIER |= OIER_E0; /* enable match on timer 0 to cause interrupts */
+ OSCR = 0; /* initialize free-running timer, force first match */
+}
+
diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
index 5dcfe966f..666efc117 100644
--- a/include/asm-arm/bitops.h
+++ b/include/asm-arm/bitops.h
@@ -1,26 +1,29 @@
-#ifndef __ASM_ARM_BITOPS_H
-#define __ASM_ARM_BITOPS_H
-
/*
* Copyright 1995, Russell King.
* Various bits and pieces copyrights include:
* Linus Torvalds (test_bit).
- */
-
-/*
- * These should be done with inline assembly.
- * All bit operations return 0 if the bit
- * was cleared before the operation and != 0 if it was not.
*
* bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
+ *
+ * Please note that the code in this file should never be included
+ * from user space. Many of these are not implemented in assembler
+ * since they would be too costly. Also, they require priviledged
+ * instructions (which are not available from user mode) to ensure
+ * that they are atomic.
*/
+#ifndef __ASM_ARM_BITOPS_H
+#define __ASM_ARM_BITOPS_H
+
+#ifdef __KERNEL__
+
/*
- * Function prototypes to keep gcc -Wall happy
+ * Function prototypes to keep gcc -Wall happy.
*/
extern void set_bit(int nr, volatile void * addr);
extern void clear_bit(int nr, volatile void * addr);
extern void change_bit(int nr, volatile void * addr);
+
extern int test_and_set_bit(int nr, volatile void * addr);
extern int test_and_clear_bit(int nr, volatile void * addr);
extern int test_and_change_bit(int nr, volatile void * addr);
@@ -53,8 +56,6 @@ extern __inline__ unsigned long ffz(unsigned long word)
return k;
}
-#ifdef __KERNEL__
-
/*
* ffs: find first bit set. This is defined the same way as
* the libc and compiler builtin ffs routines, therefore
@@ -72,10 +73,6 @@ extern __inline__ unsigned long ffz(unsigned long word)
#define hweight16(x) generic_hweight16(x)
#define hweight8(x) generic_hweight8(x)
-#endif /* __KERNEL__ */
-
-#ifdef __KERNEL__
-
#define ext2_set_bit test_and_set_bit
#define ext2_clear_bit test_and_clear_bit
#define ext2_test_bit test_bit
diff --git a/include/asm-arm/iomd.h b/include/asm-arm/iomd.h
index 9726cd55d..3a1e09dfe 100644
--- a/include/asm-arm/iomd.h
+++ b/include/asm-arm/iomd.h
@@ -1,3 +1,11 @@
+/*
+ * linux/include/asm-arm/iomd.h
+ *
+ * Copyright (C) 1999 Russell King
+ *
+ * This file contains information out the IOMD ASIC used in the
+ * Acorn RiscPC and subsequently integrated into the CLPS7500 chips.
+ */
#include <linux/config.h>
#ifndef __ASSEMBLY__
diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h
index 703f653b8..5e5f1e623 100644
--- a/include/asm-arm/proc-fns.h
+++ b/include/asm-arm/proc-fns.h
@@ -55,6 +55,14 @@
# define CPU_NAME sa1100
# endif
# endif
+# ifdef CONFIG_CPU_ARM720
+# ifdef CPU_NAME
+# undef MULTI_CPU
+# define MULTI_CPU
+# else
+# define CPU_NAME arm720
+# endif
+# endif
#endif
#ifndef MULTI_CPU
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 40ab75a29..0283a7f23 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -34,11 +34,18 @@ extern unsigned int __machine_arch_type;
#define MACH_TYPE_SHARK 15
#define MACH_TYPE_BRUTUS 16
#define MACH_TYPE_PERSONAL_SERVER 17
+#define MACH_TYPE_SA1100 18 /* unused/too general */
+#define MACH_TYPE_L7200 19
+#define MACH_TYPE_SA1110 20 /* unused/too general */
+#define MACH_TYPE_INTEGRATOR 21
#define MACH_TYPE_BITSY 22
+#define MACH_TYPE_IXP1200 23
#define MACH_TYPE_THINCLIENT 24
#define MACH_TYPE_ASSABET 25
#define MACH_TYPE_VICTOR 26
#define MACH_TYPE_LART 27
+#define MACH_TYPE_RANGER 28
+#define MACH_TYPE_GRAPHICSCLIENT 29
/*
* Sort out a definition for machine_arch_type
@@ -53,6 +60,9 @@ extern unsigned int __machine_arch_type;
* - switch (machine_arch_type) { }
* - if (machine_arch_type = xxxx)
* - __machine_arch_type
+ *
+ * Please note that these are kept in numeric order (ie, the same
+ * order as the list above).
*/
#ifdef CONFIG_ARCH_EBSA110
# ifdef machine_arch_type
@@ -198,28 +208,40 @@ extern unsigned int __machine_arch_type;
# define machine_is_personal_server() (0)
#endif
-#ifdef CONFIG_SA1100_ITSY
+#ifdef CONFIG_ARCH_L7200
# ifdef machine_arch_type
# undef machine_arch_type
# define machine_arch_type __machine_arch_type
# else
-# define machine_arch_type MACH_TYPE_ITSY
+# define machine_arch_type MACH_TYPE_L7200
# endif
-# define machine_is_itsy() (machine_arch_type == MACH_TYPE_ITSY)
+# define machine_is_l7200() (machine_arch_type == MACH_TYPE_L7200)
#else
-# define machine_is_itsy() (0)
+# define machine_is_l7200() (0)
#endif
-#ifdef CONFIG_SA1100_EMPEG
+#ifdef CONFIG_SA1100_BITSY
# ifdef machine_arch_type
# undef machine_arch_type
# define machine_arch_type __machine_arch_type
# else
-# define machine_arch_type MACH_TYPE_EMPEG
+# define machine_arch_type MACH_TYPE_BITSY
# endif
-# define machine_is_empeg() (machine_arch_type == MACH_TYPE_EMPEG)
+# define machine_is_bitsy() (machine_arch_type == MACH_TYPE_BITSY)
#else
-# define machine_is_empeg() (0)
+# define machine_is_bitsy() (0)
+#endif
+
+#ifdef CONFIG_SA1100_THINCLIENT
+# ifdef machine_arch_type
+# undef machine_arch_type
+# define machine_arch_type __machine_arch_type
+# else
+# define machine_arch_type MACH_TYPE_THINCLIENT
+# endif
+# define machine_is_thinclient() (machine_arch_type == MACH_TYPE_THINCLIENT)
+#else
+# define machine_is_thinclient() (0)
#endif
#ifdef CONFIG_SA1100_ASSABET
@@ -258,52 +280,55 @@ extern unsigned int __machine_arch_type;
# define machine_is_lart() (0)
#endif
-#ifdef CONFIG_SA1100_BITSY
+/*
+ * The following are currently unregistered
+ */
+#ifdef CONFIG_SA1100_ITSY
# ifdef machine_arch_type
# undef machine_arch_type
# define machine_arch_type __machine_arch_type
# else
-# define machine_arch_type MACH_TYPE_BITSY
+# define machine_arch_type MACH_TYPE_ITSY
# endif
-# define machine_is_bitsy() (machine_arch_type == MACH_TYPE_BITSY)
+# define machine_is_itsy() (machine_arch_type == MACH_TYPE_ITSY)
#else
-# define machine_is_bitsy() (0)
+# define machine_is_itsy() (0)
#endif
-#ifdef CONFIG_SA1100_TIFON
+#ifdef CONFIG_SA1100_EMPEG
# ifdef machine_arch_type
# undef machine_arch_type
# define machine_arch_type __machine_arch_type
# else
-# define machine_arch_type MACH_TYPE_TIFON
+# define machine_arch_type MACH_TYPE_EMPEG
# endif
-# define machine_is_tifon() (machine_arch_type == MACH_TYPE_TIFON)
+# define machine_is_empeg() (machine_arch_type == MACH_TYPE_EMPEG)
#else
-# define machine_is_tifon() (0)
+# define machine_is_empeg() (0)
#endif
-#ifdef CONFIG_SA1100_PLEB
+#ifdef CONFIG_SA1100_TIFON
# ifdef machine_arch_type
# undef machine_arch_type
# define machine_arch_type __machine_arch_type
# else
-# define machine_arch_type MACH_TYPE_PLEB
+# define machine_arch_type MACH_TYPE_TIFON
# endif
-# define machine_is_pleb() (machine_arch_type == MACH_TYPE_PLEB)
+# define machine_is_tifon() (machine_arch_type == MACH_TYPE_TIFON)
#else
-# define machine_is_pleb() (0)
+# define machine_is_tifon() (0)
#endif
-#ifdef CONFIG_SA1100_THINCLIENT
+#ifdef CONFIG_SA1100_PLEB
# ifdef machine_arch_type
# undef machine_arch_type
# define machine_arch_type __machine_arch_type
# else
-# define machine_arch_type MACH_TYPE_THINCLIENT
+# define machine_arch_type MACH_TYPE_PLEB
# endif
-# define machine_is_thinclient() (machine_arch_type == MACH_TYPE_THINCLIENT)
+# define machine_is_pleb() (machine_arch_type == MACH_TYPE_PLEB)
#else
-# define machine_is_thinclient() (0)
+# define machine_is_pleb() (0)
#endif
#ifdef CONFIG_SA1100_PENNY