summaryrefslogtreecommitdiffstats
path: root/include/asm-arm
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-02-15 02:15:32 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-02-15 02:15:32 +0000
commit86464aed71025541805e7b1515541aee89879e33 (patch)
treee01a457a4912a8553bc65524aa3125d51f29f810 /include/asm-arm
parent88f99939ecc6a95a79614574cb7d95ffccfc3466 (diff)
Merge with Linux 2.2.1.
Diffstat (limited to 'include/asm-arm')
-rw-r--r--include/asm-arm/a.out.h5
-rw-r--r--include/asm-arm/arch-arc/a.out.h1
-rw-r--r--include/asm-arm/arch-arc/dma.h23
-rw-r--r--include/asm-arm/arch-arc/hardware.h52
-rw-r--r--include/asm-arm/arch-arc/ide.h60
-rw-r--r--include/asm-arm/arch-arc/io.h32
-rw-r--r--include/asm-arm/arch-arc/keyboard.h2
-rw-r--r--include/asm-arm/arch-arc/processor.h5
-rw-r--r--include/asm-arm/arch-arc/system.h16
-rw-r--r--include/asm-arm/arch-ebsa110/a.out.h1
-rw-r--r--include/asm-arm/arch-ebsa110/dma.h9
-rw-r--r--include/asm-arm/arch-ebsa110/hardware.h5
-rw-r--r--include/asm-arm/arch-ebsa110/io.h28
-rw-r--r--include/asm-arm/arch-ebsa110/processor.h5
-rw-r--r--include/asm-arm/arch-ebsa110/system.h3
-rw-r--r--include/asm-arm/arch-ebsa110/time.h6
-rw-r--r--include/asm-arm/arch-ebsa285/a.out.h1
-rw-r--r--include/asm-arm/arch-ebsa285/dma.h9
-rw-r--r--include/asm-arm/arch-ebsa285/hardware.h70
-rw-r--r--include/asm-arm/arch-ebsa285/ide.h39
-rw-r--r--include/asm-arm/arch-ebsa285/io.h73
-rw-r--r--include/asm-arm/arch-ebsa285/irq.h111
-rw-r--r--include/asm-arm/arch-ebsa285/irqs.h15
-rw-r--r--include/asm-arm/arch-ebsa285/keyboard.h41
-rw-r--r--include/asm-arm/arch-ebsa285/mmu.h11
-rw-r--r--include/asm-arm/arch-ebsa285/processor.h5
-rw-r--r--include/asm-arm/arch-ebsa285/serial.h41
-rw-r--r--include/asm-arm/arch-ebsa285/system.h27
-rw-r--r--include/asm-arm/arch-ebsa285/time.h102
-rw-r--r--include/asm-arm/arch-ebsa285/uncompress.h30
-rw-r--r--include/asm-arm/arch-nexuspci/a.out.h1
-rw-r--r--include/asm-arm/arch-nexuspci/dma.h3
-rw-r--r--include/asm-arm/arch-nexuspci/hardware.h4
-rw-r--r--include/asm-arm/arch-nexuspci/processor.h5
-rw-r--r--include/asm-arm/arch-nexuspci/system.h3
-rw-r--r--include/asm-arm/arch-rpc/a.out.h1
-rw-r--r--include/asm-arm/arch-rpc/dma.h9
-rw-r--r--include/asm-arm/arch-rpc/hardware.h61
-rw-r--r--include/asm-arm/arch-rpc/ide.h55
-rw-r--r--include/asm-arm/arch-rpc/io.h28
-rw-r--r--include/asm-arm/arch-rpc/keyboard.h1
-rw-r--r--include/asm-arm/arch-rpc/processor.h5
-rw-r--r--include/asm-arm/arch-rpc/system.h4
-rw-r--r--include/asm-arm/arch-vnc/a.out.h1
-rw-r--r--include/asm-arm/arch-vnc/dma.h9
-rw-r--r--include/asm-arm/arch-vnc/hardware.h116
-rw-r--r--include/asm-arm/arch-vnc/ide.h43
-rw-r--r--include/asm-arm/arch-vnc/io.h20
-rw-r--r--include/asm-arm/arch-vnc/irq.h57
-rw-r--r--include/asm-arm/arch-vnc/irqs.h13
-rw-r--r--include/asm-arm/arch-vnc/keyboard.h44
-rw-r--r--include/asm-arm/arch-vnc/mmu.h4
-rw-r--r--include/asm-arm/arch-vnc/system.h35
-rw-r--r--include/asm-arm/arch-vnc/time.h206
-rw-r--r--include/asm-arm/atomic.h14
-rw-r--r--include/asm-arm/byteorder.h14
-rw-r--r--include/asm-arm/dec21285.h94
-rw-r--r--include/asm-arm/dma.h37
-rw-r--r--include/asm-arm/ecard.h102
-rw-r--r--include/asm-arm/elf.h9
-rw-r--r--include/asm-arm/hardware.h253
-rw-r--r--include/asm-arm/ide.h52
-rw-r--r--include/asm-arm/init.h5
-rw-r--r--include/asm-arm/io.h4
-rw-r--r--include/asm-arm/ioc.h56
-rw-r--r--include/asm-arm/iomd.h180
-rw-r--r--include/asm-arm/irq.h2
-rw-r--r--include/asm-arm/keyboard.h2
-rw-r--r--include/asm-arm/leds.h6
-rw-r--r--include/asm-arm/linux_logo.h5
-rw-r--r--include/asm-arm/md.h13
-rw-r--r--include/asm-arm/memc.h13
-rw-r--r--include/asm-arm/posix_types.h8
-rw-r--r--include/asm-arm/proc-armo/elf.h19
-rw-r--r--include/asm-arm/proc-armo/pgtable.h15
-rw-r--r--include/asm-arm/proc-armo/processor.h7
-rw-r--r--include/asm-arm/proc-armo/system.h97
-rw-r--r--include/asm-arm/proc-armv/elf.h21
-rw-r--r--include/asm-arm/proc-armv/io.h24
-rw-r--r--include/asm-arm/proc-armv/mm-init.h2
-rw-r--r--include/asm-arm/proc-armv/page.h5
-rw-r--r--include/asm-arm/proc-armv/processor.h7
-rw-r--r--include/asm-arm/proc-armv/semaphore.h92
-rw-r--r--include/asm-arm/proc-armv/system.h124
-rw-r--r--include/asm-arm/proc-armv/uaccess.h11
-rw-r--r--include/asm-arm/processor.h4
-rw-r--r--include/asm-arm/semaphore.h5
-rw-r--r--include/asm-arm/signal.h25
-rw-r--r--include/asm-arm/socket.h4
-rw-r--r--include/asm-arm/softirq.h6
-rw-r--r--include/asm-arm/spinlock.h21
-rw-r--r--include/asm-arm/system.h25
-rw-r--r--include/asm-arm/termbits.h19
-rw-r--r--include/asm-arm/termios.h2
-rw-r--r--include/asm-arm/timex.h9
-rw-r--r--include/asm-arm/unistd.h123
96 files changed, 1924 insertions, 1168 deletions
diff --git a/include/asm-arm/a.out.h b/include/asm-arm/a.out.h
index 12df46a9a..489d76eb5 100644
--- a/include/asm-arm/a.out.h
+++ b/include/asm-arm/a.out.h
@@ -27,4 +27,9 @@ struct exec
#define M_ARM 103
#include <asm/arch/a.out.h>
+
+#ifndef LIBRARY_START_TEXT
+#define LIBRARY_START_TEXT (0x00c00000)
+#endif
+
#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-arm/arch-arc/a.out.h b/include/asm-arm/arch-arc/a.out.h
index a8ef7645f..e00511463 100644
--- a/include/asm-arm/arch-arc/a.out.h
+++ b/include/asm-arm/arch-arc/a.out.h
@@ -10,7 +10,6 @@
#ifdef __KERNEL__
#define STACK_TOP (0x01a00000)
-#define LIBRARY_START_TEXT (0x00c00000)
#endif
#endif
diff --git a/include/asm-arm/arch-arc/dma.h b/include/asm-arm/arch-arc/dma.h
index 3420d7d6d..49e184769 100644
--- a/include/asm-arm/arch-arc/dma.h
+++ b/include/asm-arm/arch-arc/dma.h
@@ -16,22 +16,19 @@
#define MAX_DMA_ADDRESS 0x03000000
-/*
- * DMA modes - we have two, IN and OUT
- */
-typedef enum {
- DMA_MODE_READ,
- DMA_MODE_WRITE
-} dmamode_t;
-
-#define MAX_DMA_CHANNELS 4
+#ifdef CONFIG_ARCH_ARC
+#define MAX_DMA_CHANNELS 3
-#define DMA_0 0
-#define DMA_1 1
-#define DMA_VIRTUAL_FLOPPY 2
-#define DMA_VIRTUAL_SOUND 3
+#define DMA_VIRTUAL_FLOPPY0 0
+#define DMA_VIRTUAL_FLOPPY1 1
+#define DMA_VIRTUAL_SOUND 2
+#endif
#ifdef CONFIG_ARCH_A5K
+#define MAX_DMA_CHANNELS 2
+
+#define DMA_VIRTUAL_FLOPPY 0
+#define DMA_VIRTUAL_SOUND 1
#define DMA_FLOPPY DMA_VIRTUAL_FLOPPY
#endif
diff --git a/include/asm-arm/arch-arc/hardware.h b/include/asm-arm/arch-arc/hardware.h
index 4990ca132..c59007f3c 100644
--- a/include/asm-arm/arch-arc/hardware.h
+++ b/include/asm-arm/arch-arc/hardware.h
@@ -20,33 +20,51 @@
* source.
*/
#define HAS_IOC
+#include <asm/ioc.h>
#define HAS_MEMC
+#include <asm/memc.h>
#define HAS_MEMC1A
#define HAS_VIDC
-#ifdef CONFIG_ARCH_A5K
-#define HAS_PCIO
-#endif
-
/*
* Optional hardware
*/
#define HAS_EXPMASK
+/* Hardware addresses of major areas.
+ * *_START is the physical address
+ * *_SIZE is the size of the region
+ * *_BASE is the virtual address
+ */
+#define IO_START 0x03000000
+#define IO_SIZE 0x01000000
+#define IO_BASE 0x03000000
+
+/*
+ * Screen mapping information
+ */
+#define SCREEN_START 0x02000000
+#define SCREEN2_END 0x02078000
+#define SCREEN2_BASE 0x02000000
+#define SCREEN1_END 0x02000000
+#define SCREEN1_BASE 0x01f88000
+
+
#ifndef __ASSEMBLER__
/*
* for use with inb/outb
*/
-#define VIDC_BASE 0x80100000
-#define IOCEC4IO_BASE 0x8009c000
+#define IO_VIDC_BASE 0x80100000
#ifdef CONFIG_ARCH_ARC
#define LATCHAADDR 0x80094010
#define LATCHBADDR 0x80094006
#endif
-#define IOCECIO_BASE 0x80090000
#define IOC_BASE 0x80080000
-#define MEMCECIO_BASE 0x80000000
+
+#define IO_EC_IOC4_BASE 0x8009c000
+#define IO_EC_IOC_BASE 0x80090000
+#define IO_EC_MEMC_BASE 0x80000000
/*
* IO definitions
@@ -57,23 +75,6 @@
#define PCIO_BASE 0x03010000
/*
- * Mapping areas
- */
-#define IO_END 0x03ffffff
-#define IO_BASE 0x03000000
-#define IO_SIZE (IO_END - IO_BASE)
-#define IO_START 0x03000000
-
-/*
- * Screen mapping information
- */
-#define SCREEN2_END 0x02078000
-#define SCREEN2_BASE 0x02000000
-#define SCREEN1_END SCREEN2_BASE
-#define SCREEN1_BASE 0x01f88000
-#define SCREEN_START 0x02000000
-
-/*
* RAM definitions
*/
#define MAPTOPHYS(a) (((unsigned long)a & 0x007fffff) + PAGE_OFFSET)
@@ -88,7 +89,6 @@
#define IOC_BASE 0x03200000
#define PCIO_FLOPPYDMABASE 0x0302a000
#define PCIO_BASE 0x03010000
-#define IO_BASE 0x03000000
#endif
#endif
diff --git a/include/asm-arm/arch-arc/ide.h b/include/asm-arm/arch-arc/ide.h
index 24bc4899d..2fc6ce282 100644
--- a/include/asm-arm/arch-arc/ide.h
+++ b/include/asm-arm/arch-arc/ide.h
@@ -8,50 +8,44 @@
*
* Modifications:
* 04-04-1998 PJB Merged `arc' and `a5k' versions
+ * 01-07-1998 RMK Added new ide_ioregspec_t
+ * 29-07-1998 RMK Major re-work of IDE architecture specific code
*/
#include <linux/config.h>
#include <asm/irq.h>
-static __inline__ int
-ide_default_irq(ide_ioreg_t base)
+/*
+ * Set up a hw structure for a specified data port, control port and IRQ.
+ * This should follow whatever the default interface uses.
+ */
+static __inline__ void
+ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int irq)
{
-#ifdef CONFIG_ARCH_A5K
- if (base == 0x1f0)
- return IRQ_HARDDISK;
-#endif
- return 0;
-}
+ ide_ioreg_t reg = (ide_ioreg_t) data_port;
+ int i;
-static __inline__ ide_ioreg_t
-ide_default_io_base(int index)
-{
-#ifdef CONFIG_ARCH_A5K
- if (index == 0)
- return 0x1f0;
-#endif
- return 0;
-}
+ memset(hw, 0, sizeof(*hw));
-static __inline__ int
-ide_default_stepping(int index)
-{
- return 0;
+ for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
+ hw->io_ports[i] = reg;
+ reg += 1;
+ }
+ hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
+ hw->irq = irq;
}
+/*
+ * This registers the standard ports for this architecture with the IDE
+ * driver.
+ */
static __inline__ void
-ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int stepping, int *irq)
+ide_init_default_hwifs(void)
{
- ide_ioreg_t port = base;
- ide_ioreg_t ctrl = base + 0x206;
- int i;
+#ifdef CONFIG_ARCH_A5K
+ hw_regs_t hw;
- i = 8;
- while (i--) {
- *p++ = port;
- port += 1 << stepping;
- }
- *p++ = ctrl;
- if (irq != NULL)
- *irq = 0;
+ ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, IRQ_HARDDISK);
+ ide_register_hw(&hw, NULL);
+#endif
}
diff --git a/include/asm-arm/arch-arc/io.h b/include/asm-arm/arch-arc/io.h
index 0b77060c5..4e984bd3c 100644
--- a/include/asm-arm/arch-arc/io.h
+++ b/include/asm-arm/arch-arc/io.h
@@ -35,7 +35,7 @@ extern __inline__ void __outb (unsigned int value, unsigned int port)
"tst %2, #0x80000000\n\t"
"mov %0, %4\n\t"
"addeq %0, %0, %3\n\t"
- "strb %1, [%0, %2, lsl #2]"
+ "strb %1, [%0, %2, lsl #2] @ outb"
: "=&r" (temp)
: "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
: "cc");
@@ -48,7 +48,7 @@ extern __inline__ void __outw (unsigned int value, unsigned int port)
"tst %2, #0x80000000\n\t"
"mov %0, %4\n\t"
"addeq %0, %0, %3\n\t"
- "str %1, [%0, %2, lsl #2]"
+ "str %1, [%0, %2, lsl #2] @ outw"
: "=&r" (temp)
: "r" (value|value<<16), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
: "cc");
@@ -61,7 +61,7 @@ extern __inline__ void __outl (unsigned int value, unsigned int port)
"tst %2, #0x80000000\n\t"
"mov %0, %4\n\t"
"addeq %0, %0, %3\n\t"
- "str %1, [%0, %2, lsl #2]"
+ "str %1, [%0, %2, lsl #2] @ outl"
: "=&r" (temp)
: "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
: "cc");
@@ -75,7 +75,7 @@ extern __inline__ unsigned sz __in##fnsuffix (unsigned int port) \
"tst %2, #0x80000000\n\t" \
"mov %0, %4\n\t" \
"addeq %0, %0, %3\n\t" \
- "ldr" ##instr## " %1, [%0, %2, lsl #2]" \
+ "ldr" ##instr## " %1, [%0, %2, lsl #2] @ in"###fnsuffix \
: "=&r" (temp), "=r" (value) \
: "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
: "cc"); \
@@ -110,11 +110,11 @@ DECLARE_IO(long,l,"")
({ \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "strb %0, [%1, %2]" \
+ "strb %0, [%1, %2] @ outbc" \
: : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "strb %0, [%1, %2]" \
+ "strb %0, [%1, %2] @ outbc" \
: : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \
})
@@ -123,11 +123,11 @@ DECLARE_IO(long,l,"")
unsigned char result; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "ldrb %0, [%1, %2]" \
+ "ldrb %0, [%1, %2] @ inbc" \
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "ldrb %0, [%1, %2]" \
+ "ldrb %0, [%1, %2] @ inbc" \
: "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
result; \
})
@@ -137,11 +137,11 @@ DECLARE_IO(long,l,"")
unsigned long v = value; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outwc" \
: : "r" (v|v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outwc" \
: : "r" (v|v<<16), "r" (IO_BASE), "r" ((port) << 2)); \
})
@@ -150,11 +150,11 @@ DECLARE_IO(long,l,"")
unsigned short result; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inwc" \
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inwc" \
: "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
result & 0xffff; \
})
@@ -164,11 +164,11 @@ DECLARE_IO(long,l,"")
unsigned long v = value; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outlc" \
: : "r" (v), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outlc" \
: : "r" (v), "r" (IO_BASE), "r" ((port) << 2)); \
})
@@ -177,11 +177,11 @@ DECLARE_IO(long,l,"")
unsigned long result; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inlc" \
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inlc" \
: "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
result; \
})
diff --git a/include/asm-arm/arch-arc/keyboard.h b/include/asm-arm/arch-arc/keyboard.h
index 59272e269..388014703 100644
--- a/include/asm-arm/arch-arc/keyboard.h
+++ b/include/asm-arm/arch-arc/keyboard.h
@@ -35,3 +35,5 @@ extern unsigned char a5kkbd_sysrq_xlate[NR_SCANCODES];
#define kbd_sysrq_xlate a5kkbd_sysrq_xlate
#define kbd_disable_irq() disable_irq(IRQ_KEYBOARDRX)
#define kbd_enable_irq() enable_irq(IRQ_KEYBOARDRX)
+
+#define SYSRQ_KEY 13
diff --git a/include/asm-arm/arch-arc/processor.h b/include/asm-arm/arch-arc/processor.h
index 314525eef..cb63936e4 100644
--- a/include/asm-arm/arch-arc/processor.h
+++ b/include/asm-arm/arch-arc/processor.h
@@ -26,12 +26,7 @@
/* This decides where the kernel will search for a free chunk of vm
* space during mmap's.
*/
-#if 0
-#define TASK_UNMAPPED_BASE(off) (TASK_SIZE / 3)
-#else
#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
-#endif
-#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
#define INIT_MMAP \
{ &init_mm, 0, 0, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
diff --git a/include/asm-arm/arch-arc/system.h b/include/asm-arm/arch-arc/system.h
index 3becc7b2f..9e2e99cfd 100644
--- a/include/asm-arm/arch-arc/system.h
+++ b/include/asm-arm/arch-arc/system.h
@@ -23,25 +23,25 @@
#endif
-extern __inline__ void arch_hard_reset (void)
+extern __inline__ void arch_reset(char mode)
{
- extern void ecard_reset (int card);
+ extern void ecard_reset(int card);
+
+ /*
+ * Do any cleanups that the processor may require
+ */
+ processor._proc_fin();
/*
* Reset all expansion cards.
*/
- ecard_reset (-1);
+ ecard_reset(-1);
/*
* copy branch instruction to reset location and call it
*/
*(unsigned long *)0 = *(unsigned long *)0x03800000;
((void(*)(void))0)();
-
- /*
- * If that didn't work, loop endlessly
- */
- while (1);
}
#endif
diff --git a/include/asm-arm/arch-ebsa110/a.out.h b/include/asm-arm/arch-ebsa110/a.out.h
index 0123eb29a..2746584c8 100644
--- a/include/asm-arm/arch-ebsa110/a.out.h
+++ b/include/asm-arm/arch-ebsa110/a.out.h
@@ -9,7 +9,6 @@
#ifdef __KERNEL__
#define STACK_TOP ((current->personality==PER_LINUX_32BIT)? 0xc0000000 : 0x04000000)
-#define LIBRARY_START_TEXT (0x00c00000)
#endif
#endif
diff --git a/include/asm-arm/arch-ebsa110/dma.h b/include/asm-arm/arch-ebsa110/dma.h
index 96a265927..971369789 100644
--- a/include/asm-arm/arch-ebsa110/dma.h
+++ b/include/asm-arm/arch-ebsa110/dma.h
@@ -14,15 +14,6 @@
* bytes of RAM.
*/
#define MAX_DMA_ADDRESS 0xd0000000
-
-/*
- * DMA modes - we have two, IN and OUT
- */
-typedef enum {
- DMA_MODE_READ,
- DMA_MODE_WRITE
-} dmamode_t;
-
#define MAX_DMA_CHANNELS 8
#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-ebsa110/hardware.h b/include/asm-arm/arch-ebsa110/hardware.h
index 61ac7492e..e502b0fc6 100644
--- a/include/asm-arm/arch-ebsa110/hardware.h
+++ b/include/asm-arm/arch-ebsa110/hardware.h
@@ -28,9 +28,8 @@
/*
* Mapping areas
*/
-#define IO_END 0xffffffff
#define IO_BASE 0xe0000000
-#define IO_SIZE (IO_END - IO_BASE)
+#define IO_SIZE 0x20000000
#define IO_START 0xe0000000
/*
@@ -39,7 +38,7 @@
#define MAPTOPHYS(a) ((unsigned long)(a) - PAGE_OFFSET)
#define KERNTOPHYS(a) ((unsigned long)(&a))
#define KERNEL_BASE (0xc0008000)
-#define SAFE_ADDR 0x40000000
+#define FLUSH_BASE_PHYS 0x40000000
#else
diff --git a/include/asm-arm/arch-ebsa110/io.h b/include/asm-arm/arch-ebsa110/io.h
index 39f574d55..32fc49c1a 100644
--- a/include/asm-arm/arch-ebsa110/io.h
+++ b/include/asm-arm/arch-ebsa110/io.h
@@ -36,7 +36,7 @@ extern __inline__ void __out##fnsuffix (unsigned int value, unsigned int port) \
"tst %2, #0x80000000\n\t" \
"mov %0, %4\n\t" \
"addeq %0, %0, %3\n\t" \
- "str" ##instr## " %1, [%0, %2, lsl #2]" \
+ "str" ##instr## " %1, [%0, %2, lsl #2] @ out"###fnsuffix \
: "=&r" (temp) \
: "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
: "cc"); \
@@ -50,7 +50,7 @@ extern __inline__ unsigned sz __in##fnsuffix (unsigned int port) \
"tst %2, #0x80000000\n\t" \
"mov %0, %4\n\t" \
"addeq %0, %0, %3\n\t" \
- "ldr" ##instr## " %1, [%0, %2, lsl #2]" \
+ "ldr" ##instr## " %1, [%0, %2, lsl #2] @ in"###fnsuffix \
: "=&r" (temp), "=r" (value) \
: "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
: "cc"); \
@@ -87,11 +87,11 @@ DECLARE_IO(long,l,"")
({ \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "strb %0, [%1, %2]" \
+ "strb %0, [%1, %2] @ outbc" \
: : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "strb %0, [%1, %2]" \
+ "strb %0, [%1, %2] @ outbc" \
: : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \
})
@@ -100,11 +100,11 @@ DECLARE_IO(long,l,"")
unsigned char result; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "ldrb %0, [%1, %2]" \
+ "ldrb %0, [%1, %2] @ inbc" \
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "ldrb %0, [%1, %2]" \
+ "ldrb %0, [%1, %2] @ inbc" \
: "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
result; \
})
@@ -114,11 +114,11 @@ DECLARE_IO(long,l,"")
unsigned long v = value; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outwc" \
: : "r" (v|v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outwc" \
: : "r" (v|v<<16), "r" (IO_BASE), "r" ((port) << 2)); \
})
@@ -127,11 +127,11 @@ DECLARE_IO(long,l,"")
unsigned short result; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inwc" \
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inwc" \
: "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
result & 0xffff; \
})
@@ -141,11 +141,11 @@ DECLARE_IO(long,l,"")
unsigned long v = value; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outlc" \
: : "r" (v), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outlc" \
: : "r" (v), "r" (IO_BASE), "r" ((port) << 2)); \
})
@@ -154,11 +154,11 @@ DECLARE_IO(long,l,"")
unsigned long result; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inlc" \
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inlc" \
: "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
result; \
})
diff --git a/include/asm-arm/arch-ebsa110/processor.h b/include/asm-arm/arch-ebsa110/processor.h
index bf1f6d384..e98d1ff33 100644
--- a/include/asm-arm/arch-ebsa110/processor.h
+++ b/include/asm-arm/arch-ebsa110/processor.h
@@ -23,12 +23,7 @@
/* This decides where the kernel will search for a free chunk of vm
* space during mmap's.
*/
-#if 0
-#define TASK_UNMAPPED_BASE(off) (TASK_SIZE / 3)
-#else
#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
-#endif
-#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
#define INIT_MMAP \
{ &init_mm, 0, 0, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
diff --git a/include/asm-arm/arch-ebsa110/system.h b/include/asm-arm/arch-ebsa110/system.h
index a28161cb2..ba0c99258 100644
--- a/include/asm-arm/arch-ebsa110/system.h
+++ b/include/asm-arm/arch-ebsa110/system.h
@@ -6,13 +6,12 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
-extern __inline__ void arch_hard_reset (void)
+extern __inline__ void arch_reset(char mode)
{
/*
* loop endlessly
*/
cli();
- while (1);
}
#endif
diff --git a/include/asm-arm/arch-ebsa110/time.h b/include/asm-arm/arch-ebsa110/time.h
index 5b1447b7e..1f21a02e6 100644
--- a/include/asm-arm/arch-ebsa110/time.h
+++ b/include/asm-arm/arch-ebsa110/time.h
@@ -9,8 +9,10 @@
* 10-Oct-1996 RMK Created
* 04-Dec-1997 RMK Updated for new arch/arm/kernel/time.c
* 07-Aug-1998 RMK Updated for arch/arm/kernel/leds.c
+ * 28-Dec-1998 APH Made leds code optional
*/
+#include <linux/config.h>
#include <asm/leds.h>
#define IRQ_TIMER IRQ_EBSA110_TIMER0
@@ -47,15 +49,19 @@ extern __inline__ int reset_timer (void)
extern __inline__ int reset_timer (void)
{
static unsigned int divisor;
+#ifdef CONFIG_LEDS
static int count = 50;
+#endif
*PIT_T1 = (PIT1_COUNT) & 0xff;
*PIT_T1 = (PIT1_COUNT) >> 8;
+#ifdef CONFIG_LEDS
if (--count == 0) {
count = 50;
leds_event(led_timer);
}
+#endif
if (divisor == 0) {
divisor = DIVISOR - 1;
diff --git a/include/asm-arm/arch-ebsa285/a.out.h b/include/asm-arm/arch-ebsa285/a.out.h
index 0123eb29a..2746584c8 100644
--- a/include/asm-arm/arch-ebsa285/a.out.h
+++ b/include/asm-arm/arch-ebsa285/a.out.h
@@ -9,7 +9,6 @@
#ifdef __KERNEL__
#define STACK_TOP ((current->personality==PER_LINUX_32BIT)? 0xc0000000 : 0x04000000)
-#define LIBRARY_START_TEXT (0x00c00000)
#endif
#endif
diff --git a/include/asm-arm/arch-ebsa285/dma.h b/include/asm-arm/arch-ebsa285/dma.h
index d3a2aa0c9..28c093aec 100644
--- a/include/asm-arm/arch-ebsa285/dma.h
+++ b/include/asm-arm/arch-ebsa285/dma.h
@@ -15,20 +15,11 @@
#define MAX_DMA_ADDRESS 0xffffffff
/*
- * DMA modes - we have two, IN and OUT
- */
-
-typedef int dmamode_t;
-#define DMA_MODE_READ 0x44
-#define DMA_MODE_WRITE 0x48
-
-/*
* The 21285 has two internal DMA channels; we call these 0 and 1.
* On CATS hardware we have an additional eight ISA dma channels
* numbered 2..9.
*/
#define MAX_DMA_CHANNELS 10
-
#define DMA_ISA_BASE 2
#define DMA_FLOPPY (DMA_ISA_BASE + 2)
diff --git a/include/asm-arm/arch-ebsa285/hardware.h b/include/asm-arm/arch-ebsa285/hardware.h
index a9bc6f0a4..e08c5b823 100644
--- a/include/asm-arm/arch-ebsa285/hardware.h
+++ b/include/asm-arm/arch-ebsa285/hardware.h
@@ -19,12 +19,12 @@
* 0xf8000000 0x7b010000 PCI Config type 0
*
*/
+
+#include <asm/dec21285.h>
-#define IO_END 0xffffffff
#define IO_BASE 0xe0000000
-#define IO_SIZE (IO_END - IO_BASE)
-
-#define HAS_PCIO
+#define PCIO_BASE 0xffe00000
+#define PCI_IACK 0xfc000000
#define XBUS_LEDS ((volatile unsigned char *)0xfff12000)
#define XBUS_LED_AMBER (1 << 0)
@@ -38,70 +38,10 @@
#define XBUS_SWITCH_J17_11 ((*XBUS_SWITCH) & (1 << 5))
#define XBUS_SWITCH_J17_9 ((*XBUS_SWITCH) & (1 << 6))
-#define PCIO_BASE 0xffe00000
-
-#define CSR_SA110_CNTL ((volatile unsigned long *)0xfe00013c)
-#define CSR_PCIADDR_EXTN ((volatile unsigned long *)0xfe000140)
-#define CSR_PREFETCHMEMRANGE ((volatile unsigned long *)0xfe000144)
-#define CSR_XBUS_CYCLE ((volatile unsigned long *)0xfe000148)
-#define CSR_XBUS_IOSTROBE ((volatile unsigned long *)0xfe00014c)
-#define CSR_DOORBELL_PCI ((volatile unsigned long *)0xfe000150)
-#define CSR_DOORBELL_SA110 ((volatile unsigned long *)0xfe000154)
-
-
-#define CSR_UARTDR ((volatile unsigned long *)0xfe000160)
-#define CSR_RXSTAT ((volatile unsigned long *)0xfe000164)
-#define CSR_H_UBRLCR ((volatile unsigned long *)0xfe000168)
-#define CSR_M_UBRLCR ((volatile unsigned long *)0xfe00016c)
-#define CSR_L_UBRLCR ((volatile unsigned long *)0xfe000170)
-#define CSR_UARTCON ((volatile unsigned long *)0xfe000174)
-#define CSR_UARTFLG ((volatile unsigned long *)0xfe000178)
-
-#define CSR_IRQ_STATUS ((volatile unsigned long *)0xfe000180)
-#define CSR_IRQ_RAWSTATUS ((volatile unsigned long *)0xfe000184)
-#define CSR_IRQ_ENABLE ((volatile unsigned long *)0xfe000188)
-#define CSR_IRQ_DISABLE ((volatile unsigned long *)0xfe00018c)
-#define CSR_IRQ_SOFT ((volatile unsigned long *)0xfe000190)
-
-#define CSR_FIQ_STATUS ((volatile unsigned long *)0xfe000280)
-#define CSR_FIQ_RAWSTATUS ((volatile unsigned long *)0xfe000284)
-#define CSR_FIQ_ENABLE ((volatile unsigned long *)0xfe000288)
-#define CSR_FIQ_DISABLE ((volatile unsigned long *)0xfe00028c)
-#define CSR_FIQ_SOFT ((volatile unsigned long *)0xfe000290)
-
-#define CSR_TIMER1_LOAD ((volatile unsigned long *)0xfe000300)
-#define CSR_TIMER1_VALUE ((volatile unsigned long *)0xfe000304)
-#define CSR_TIMER1_CNTL ((volatile unsigned long *)0xfe000308)
-#define CSR_TIMER1_CLR ((volatile unsigned long *)0xfe00030c)
-
-#define CSR_TIMER2_LOAD ((volatile unsigned long *)0xfe000320)
-#define CSR_TIMER2_VALUE ((volatile unsigned long *)0xfe000324)
-#define CSR_TIMER2_CNTL ((volatile unsigned long *)0xfe000328)
-#define CSR_TIMER2_CLR ((volatile unsigned long *)0xfe00032c)
-
-#define CSR_TIMER3_LOAD ((volatile unsigned long *)0xfe000340)
-#define CSR_TIMER3_VALUE ((volatile unsigned long *)0xfe000344)
-#define CSR_TIMER3_CNTL ((volatile unsigned long *)0xfe000348)
-#define CSR_TIMER3_CLR ((volatile unsigned long *)0xfe00034c)
-
-#define CSR_TIMER4_LOAD ((volatile unsigned long *)0xfe000360)
-#define CSR_TIMER4_VALUE ((volatile unsigned long *)0xfe000364)
-#define CSR_TIMER4_CNTL ((volatile unsigned long *)0xfe000368)
-#define CSR_TIMER4_CLR ((volatile unsigned long *)0xfe00036c)
-
-
-#define TIMER_CNTL_ENABLE (1 << 7)
-#define TIMER_CNTL_AUTORELOAD (1 << 6)
-#define TIMER_CNTL_DIV1 (0)
-#define TIMER_CNTL_DIV16 (1 << 2)
-#define TIMER_CNTL_DIV256 (2 << 2)
-#define TIMER_CNTL_CNTEXT (3 << 2)
-
-
#define KERNTOPHYS(a) ((unsigned long)(&a))
#define PARAMS_OFFSET 0x0100
#define PARAMS_BASE (PAGE_OFFSET + PARAMS_OFFSET)
-#define SAFE_ADDR 0x50000000
+#define FLUSH_BASE_PHYS 0x50000000
diff --git a/include/asm-arm/arch-ebsa285/ide.h b/include/asm-arm/arch-ebsa285/ide.h
index 35eff5c28..b0071a45b 100644
--- a/include/asm-arm/arch-ebsa285/ide.h
+++ b/include/asm-arm/arch-ebsa285/ide.h
@@ -1 +1,38 @@
-/* no ide */
+/*
+ * linux/include/asm-arm/arch-ebsa285/ide.h
+ *
+ * Copyright (c) 1998 Russell King
+ *
+ * Modifications:
+ * 29-07-1998 RMK Major re-work of IDE architecture specific code
+ */
+#include <asm/irq.h>
+
+/*
+ * Set up a hw structure for a specified data port, control port and IRQ.
+ * This should follow whatever the default interface uses.
+ */
+static __inline__ void
+ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int irq)
+{
+ ide_ioreg_t reg = (ide_ioreg_t) data_port;
+ int i;
+
+ memset(hw, 0, sizeof(*hw));
+
+ for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
+ hw->io_ports[i] = reg;
+ reg += 1;
+ }
+ hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
+ hw->irq = irq;
+}
+
+/*
+ * This registers the standard ports for this architecture with the IDE
+ * driver.
+ */
+static __inline__ void
+ide_init_default_hwifs(void)
+{
+}
diff --git a/include/asm-arm/arch-ebsa285/io.h b/include/asm-arm/arch-ebsa285/io.h
index f42717350..1be73879d 100644
--- a/include/asm-arm/arch-ebsa285/io.h
+++ b/include/asm-arm/arch-ebsa285/io.h
@@ -1,5 +1,5 @@
/*
- * linux/include/asm-arm/arch-ebsa110/io.h
+ * linux/include/asm-arm/arch-ebsa285/io.h
*
* Copyright (C) 1997,1998 Russell King
*
@@ -9,6 +9,8 @@
#ifndef __ASM_ARM_ARCH_IO_H
#define __ASM_ARM_ARCH_IO_H
+#include <asm/dec21285.h>
+
/*
* This architecture does not require any delayed IO, and
* has the constant-optimised IO
@@ -23,7 +25,7 @@
extern __inline__ void __out##fnsuffix (unsigned int value, unsigned int port) \
{ \
__asm__ __volatile__( \
- "str" ##instr## " %0, [%1, %2]" \
+ "str%?" ##instr## " %0, [%1, %2] @ out"###fnsuffix \
: \
: "r" (value), "r" (PCIO_BASE), typ (port)); \
}
@@ -33,7 +35,7 @@ extern __inline__ unsigned sz __in##fnsuffix (unsigned int port) \
{ \
unsigned long value; \
__asm__ __volatile__( \
- "ldr" ##instr## " %0, [%1, %2]" \
+ "ldr%?" ##instr## " %0, [%1, %2] @ in"###fnsuffix \
: "=&r" (value) \
: "r" (PCIO_BASE), typ (port)); \
return (unsigned sz)value; \
@@ -65,7 +67,7 @@ DECLARE_IO(long,l,"","Jr")
#define __outbc(value,port) \
({ \
__asm__ __volatile__( \
- "strb %0, [%1, %2]" \
+ "str%?b %0, [%1, %2] @ outbc" \
: \
: "r" (value), "r" (PCIO_BASE), "Jr" (port)); \
})
@@ -74,7 +76,7 @@ DECLARE_IO(long,l,"","Jr")
({ \
unsigned char result; \
__asm__ __volatile__( \
- "ldrb %0, [%1, %2]" \
+ "ldr%?b %0, [%1, %2] @ inbc" \
: "=r" (result) \
: "r" (PCIO_BASE), "Jr" (port)); \
result; \
@@ -83,7 +85,7 @@ DECLARE_IO(long,l,"","Jr")
#define __outwc(value,port) \
({ \
__asm__ __volatile__( \
- "strh %0, [%1, %2]" \
+ "str%?h %0, [%1, %2] @ outwc" \
: \
: "r" (value), "r" (PCIO_BASE), "r" (port)); \
})
@@ -92,7 +94,7 @@ DECLARE_IO(long,l,"","Jr")
({ \
unsigned short result; \
__asm__ __volatile__( \
- "ldrh %0, [%1, %2]" \
+ "ldr%?h %0, [%1, %2] @ inwc" \
: "=r" (result) \
: "r" (PCIO_BASE), "r" (port)); \
result & 0xffff; \
@@ -101,7 +103,7 @@ DECLARE_IO(long,l,"","Jr")
#define __outlc(value,port) \
({ \
__asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str%? %0, [%1, %2] @ outlc" \
: \
: "r" (value), "r" (PCIO_BASE), "Jr" (port)); \
})
@@ -110,7 +112,7 @@ DECLARE_IO(long,l,"","Jr")
({ \
unsigned long result; \
__asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr%? %0, [%1, %2] @ inlc" \
: "=r" (result) \
: "r" (PCIO_BASE), "Jr" (port)); \
result; \
@@ -141,25 +143,68 @@ DECLARE_IO(long,l,"","Jr")
(*(volatile unsigned long *)(p))
/*
- * This is not sufficient... (and it's a hack anyway)
+ * ioremap support
+ */
+#define valid_ioaddr(iomem,size) ((iomem) < 0x80000000 && (iomem) + (size) <= 0x80000000)
+#define io_to_phys(iomem) ((iomem) + DC21285_PCI_MEM)
+
+/*
+ * Fudge up IO addresses by this much. Once we're confident that nobody
+ * is using read*() and so on with addresses they didn't get from ioremap
+ * this can go away.
+ */
+#define IO_FUDGE_FACTOR 0xe0000000
+
+extern inline void *ioremap(unsigned long iomem_addr, unsigned long size)
+{
+ unsigned long phys_addr;
+
+ if (!valid_ioaddr(iomem_addr, size))
+ return NULL;
+
+ phys_addr = io_to_phys(iomem_addr & PAGE_MASK);
+
+ return (void *)((unsigned long)__ioremap(phys_addr, size, 0)
+ - IO_FUDGE_FACTOR);
+}
+
+#define ioremap_nocache(iomem_addr,size) ioremap((iomem_addr),(size))
+
+extern void iounmap(void *addr);
+
+/*
+ * We'd probably be better off with these as macros rather than functions.
+ * Firstly that would be more efficient and secondly we could do with the
+ * ability to stop GCC whinging about type conversions. --philb
*/
static inline void writeb(unsigned char b, unsigned int addr)
{
- *(volatile unsigned char *)(0xe0000000 + (addr)) = b;
+ *(volatile unsigned char *)(IO_FUDGE_FACTOR + (addr)) = b;
}
static inline unsigned char readb(unsigned int addr)
{
- return *(volatile unsigned char *)(0xe0000000 + (addr));
+ return *(volatile unsigned char *)(IO_FUDGE_FACTOR + (addr));
}
static inline void writew(unsigned short b, unsigned int addr)
{
- *(volatile unsigned short *)(0xe0000000 + (addr)) = b;
+ *(volatile unsigned short *)(IO_FUDGE_FACTOR + (addr)) = b;
}
static inline unsigned short readw(unsigned int addr)
{
- return *(volatile unsigned short *)(0xe0000000 + (addr));
+ return *(volatile unsigned short *)(IO_FUDGE_FACTOR + (addr));
}
+
+static inline void writel(unsigned long b, unsigned int addr)
+{
+ *(volatile unsigned long *)(IO_FUDGE_FACTOR + (addr)) = b;
+}
+
+static inline unsigned short readl(unsigned int addr)
+{
+ return *(volatile unsigned long *)(IO_FUDGE_FACTOR + (addr));
+}
+
#endif
diff --git a/include/asm-arm/arch-ebsa285/irq.h b/include/asm-arm/arch-ebsa285/irq.h
index 029b1b1a6..74bc33c58 100644
--- a/include/asm-arm/arch-ebsa285/irq.h
+++ b/include/asm-arm/arch-ebsa285/irq.h
@@ -5,7 +5,9 @@
*
* Changelog:
* 22-08-1998 RMK Restructured IRQ routines
+ * 03-09-1998 PJB Merged CATS support
*/
+#include <linux/config.h>
static void ebsa285_mask_irq(unsigned int irq)
{
@@ -16,7 +18,73 @@ static void ebsa285_unmask_irq(unsigned int irq)
{
*CSR_IRQ_ENABLE = 1 << irq;
}
+
+#ifdef CONFIG_CATS
+
+/*
+ * This contains the irq mask for both 8259A irq controllers,
+ */
+static unsigned int isa_irq_mask = 0xffff;
+
+#define cached_21 (isa_irq_mask & 0xff)
+#define cached_A1 ((isa_irq_mask >> 8) & 0xff)
+
+#define update_8259(_irq) \
+ if ((_irq) & 8) \
+ outb(cached_A1, 0xa1); \
+ else \
+ outb(cached_21, 0x21);
+
+static void isa_interrupt(int irq, void *h, struct pt_regs *regs)
+{
+ asmlinkage void do_IRQ(int irq, struct pt_regs * regs);
+ unsigned int irqbits = inb(0x20) | (inb(0xa0) << 8), irqnr = 0;
+ irqbits &= ~(1<<2); /* don't try to service the cascade */
+ while (irqbits) {
+ if (irqbits & 1)
+ do_IRQ(32 + irqnr, regs);
+ irqbits >>= 1;
+ irqnr++;
+ }
+}
+
+static void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
+
+static struct irqaction irq_isa =
+ { isa_interrupt, SA_INTERRUPT, 0, "ISA PIC", NULL, NULL };
+static struct irqaction irq_cascade =
+ { no_action, 0, 0, "cascade", NULL, NULL };
+
+static void cats_mask_and_ack_isa_irq(unsigned int irq)
+{
+ isa_irq_mask |= (1 << (irq - 32));
+ update_8259(irq);
+ if (irq & 8) {
+ inb(0xA1); /* DUMMY */
+ outb(cached_A1,0xA1);
+ outb(0x62,0x20); /* Specific EOI to cascade */
+ outb(0x20,0xA0);
+ } else {
+ inb(0x21); /* DUMMY */
+ outb(cached_21,0x21);
+ outb(0x20,0x20);
+ }
+}
+
+static void cats_mask_isa_irq(unsigned int irq)
+{
+ isa_irq_mask |= (1 << (irq - 32));
+ update_8259(irq);
+}
+
+static void cats_unmask_isa_irq(unsigned int irq)
+{
+ isa_irq_mask &= ~(1 << (irq - 32));
+ update_8259(irq);
+}
+#endif
+
static __inline__ void irq_init_irq(void)
{
int irq;
@@ -27,8 +95,45 @@ static __inline__ void irq_init_irq(void)
for (irq = 0; irq < NR_IRQS; irq++) {
irq_desc[irq].valid = 1;
irq_desc[irq].probe_ok = 1;
- irq_desc[irq].mask_ack = ebsa285_mask_irq;
- irq_desc[irq].mask = ebsa285_mask_irq;
- irq_desc[irq].unmask = ebsa285_unmask_irq;
+#ifdef CONFIG_CATS
+ if (machine_is_cats() && IRQ_IS_ISA(irq)) {
+ irq_desc[irq].mask_ack = cats_mask_and_ack_isa_irq;
+ irq_desc[irq].mask = cats_mask_isa_irq;
+ irq_desc[irq].unmask = cats_unmask_isa_irq;
+ } else
+#endif
+ {
+ irq_desc[irq].mask_ack = ebsa285_mask_irq;
+ irq_desc[irq].mask = ebsa285_mask_irq;
+ irq_desc[irq].unmask = ebsa285_unmask_irq;
+ }
+ }
+
+#ifdef CONFIG_CATS
+ if (machine_is_cats()) {
+ request_region(0x20, 2, "pic1");
+ request_region(0xa0, 2, "pic2");
+
+ /* set up master 8259 */
+ outb(0x11, 0x20);
+ outb(0, 0x21);
+ outb(1<<2, 0x21);
+ outb(0x1, 0x21);
+ outb(0xff, 0x21);
+ outb(0x68, 0x20);
+ outb(0xa, 0x20);
+
+ /* set up slave 8259 */
+ outb(0x11, 0xa0);
+ outb(0, 0xa1);
+ outb(2, 0xa1);
+ outb(0x1, 0xa1);
+ outb(0xff, 0xa1);
+ outb(0x68, 0xa0);
+ outb(0xa, 0xa0);
+
+ setup_arm_irq(IRQ_ISA_PIC, &irq_isa);
+ setup_arm_irq(IRQ_ISA_CASCADE, &irq_cascade);
}
+#endif
}
diff --git a/include/asm-arm/arch-ebsa285/irqs.h b/include/asm-arm/arch-ebsa285/irqs.h
index f2ef06c9d..6021bee6e 100644
--- a/include/asm-arm/arch-ebsa285/irqs.h
+++ b/include/asm-arm/arch-ebsa285/irqs.h
@@ -2,9 +2,10 @@
* linux/include/asm-arm/arch-ebsa285/irqs.h
*
* Copyright (C) 1998 Russell King
+ * Copyright (C) 1998 Phil Blundell
*/
-#define NR_IRQS 32
+#define NR_IRQS 48
/*
* This is a list of all interrupts that the 21285
@@ -39,10 +40,18 @@
#define IRQ_PCITARGETABORT 30
#define IRQ_PCIPARITY 31
+/* IRQs 32-47 are the 16 ISA interrupts on a CATS board. */
+#define IRQ_ISA_PIC IRQ_IN2
+#define IRQ_IS_ISA(_x) (((_x) >= 32) && ((_x) <= 47))
+#define IRQ_ISA(_x) ((_x) + 0x20)
+#define IRQ_ISA_CASCADE IRQ_ISA(2)
+
/*
* Now map them to the Linux interrupts
*/
#define IRQ_TIMER IRQ_TIMER1
+#define IRQ_FLOPPYDISK IRQ_ISA(6)
+#define IRQ_HARDDISK IRQ_ISA(14)
+#define IRQ_HARDDISK_SECONDARY IRQ_ISA(15)
-#define irq_cannonicalize(i) (i)
-
+#define irq_cannonicalize(_i) (((_i) == IRQ_ISA_CASCADE) ? IRQ_ISA(9) : _i)
diff --git a/include/asm-arm/arch-ebsa285/keyboard.h b/include/asm-arm/arch-ebsa285/keyboard.h
index 4620ff165..ad6eb0e5a 100644
--- a/include/asm-arm/arch-ebsa285/keyboard.h
+++ b/include/asm-arm/arch-ebsa285/keyboard.h
@@ -4,16 +4,48 @@
* Keyboard driver definitions for EBSA285 architecture
*
* (C) 1998 Russell King
+ * (C) 1998 Phil Blundell
*/
#include <linux/config.h>
#include <asm/irq.h>
+#include <asm/system.h>
#define NR_SCANCODES 128
-#ifdef CONFIG_MAGIC_SYSRQ
-static unsigned char kbd_sysrq_xlate[NR_SCANCODES];
-#endif
+#ifdef CONFIG_CATS
+
+#define KEYBOARD_IRQ IRQ_ISA(1)
+
+extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
+extern int pckbd_getkeycode(unsigned int scancode);
+extern int pckbd_pretranslate(unsigned char scancode, char raw_mode);
+extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
+ char raw_mode);
+extern char pckbd_unexpected_up(unsigned char keycode);
+extern void pckbd_leds(unsigned char leds);
+extern void pckbd_init_hw(void);
+extern unsigned char pckbd_sysrq_xlate[128];
+
+#define kbd_setkeycode pckbd_setkeycode
+#define kbd_getkeycode pckbd_getkeycode
+#define kbd_pretranslate pckbd_pretranslate
+#define kbd_translate(sc, kcp, ufp, rm) ({ *ufp = sc & 0200; \
+ pckbd_translate(sc & 0x7f, kcp, rm);})
+
+#define kbd_unexpected_up pckbd_unexpected_up
+#define kbd_leds pckbd_leds
+#define kbd_init_hw() \
+ do { if (machine_is_cats()) pckbd_init_hw(); } while (0)
+#define kbd_sysrq_xlate pckbd_sysrq_xlate
+#define kbd_disable_irq()
+#define kbd_enable_irq()
+
+#define SYSRQ_KEY 0x54
+
+#else
+
+/* Dummy keyboard definitions */
#define kbd_setkeycode(sc,kc) (-EINVAL)
#define kbd_getkeycode(sc) (-EINVAL)
@@ -35,3 +67,6 @@ static unsigned char kbd_sysrq_xlate[NR_SCANCODES];
#define kbd_disable_irq()
#define kbd_enable_irq()
+#define SYSRQ_KEY 13
+
+#endif
diff --git a/include/asm-arm/arch-ebsa285/mmu.h b/include/asm-arm/arch-ebsa285/mmu.h
index 8e2e98ef6..b26aa8f66 100644
--- a/include/asm-arm/arch-ebsa285/mmu.h
+++ b/include/asm-arm/arch-ebsa285/mmu.h
@@ -7,6 +7,7 @@
* 20-10-1996 RMK Created
* 31-12-1997 RMK Fixed definitions to reduce warnings
* 17-05-1998 DAG Added __virt_to_bus and __bus_to_virt functions.
+ * 21-11-1998 RMK Changed __virt_to_bus and __bus_to_virt to macros.
*/
#ifndef __ASM_ARCH_MMU_H
#define __ASM_ARCH_MMU_H
@@ -15,11 +16,13 @@
* On ebsa285, the dram is contiguous
*/
#define __virt_to_phys__is_a_macro
-#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET)
+#define __virt_to_phys(vpage) ((unsigned long)(vpage) - PAGE_OFFSET)
#define __phys_to_virt__is_a_macro
-#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET)
+#define __phys_to_virt(ppage) ((unsigned long)(ppage) + PAGE_OFFSET)
-extern unsigned long __virt_to_bus(unsigned long);
-extern unsigned long __bus_to_virt(unsigned long);
+#define __virt_to_bus__is_a_macro
+#define __virt_to_bus(x) ((x) - 0xe0000000)
+#define __bus_to_virt__is_a_macro
+#define __bus_to_virt(x) ((x) + 0xe0000000)
#endif
diff --git a/include/asm-arm/arch-ebsa285/processor.h b/include/asm-arm/arch-ebsa285/processor.h
index bf1f6d384..e98d1ff33 100644
--- a/include/asm-arm/arch-ebsa285/processor.h
+++ b/include/asm-arm/arch-ebsa285/processor.h
@@ -23,12 +23,7 @@
/* This decides where the kernel will search for a free chunk of vm
* space during mmap's.
*/
-#if 0
-#define TASK_UNMAPPED_BASE(off) (TASK_SIZE / 3)
-#else
#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
-#endif
-#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
#define INIT_MMAP \
{ &init_mm, 0, 0, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
diff --git a/include/asm-arm/arch-ebsa285/serial.h b/include/asm-arm/arch-ebsa285/serial.h
index 0e8479ff8..c874f9dfa 100644
--- a/include/asm-arm/arch-ebsa285/serial.h
+++ b/include/asm-arm/arch-ebsa285/serial.h
@@ -5,10 +5,15 @@
*
* Changelog:
* 15-10-1996 RMK Created
+ * 25-05-1998 PJB CATS support
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
+#include <linux/config.h>
+
+#include <asm/irq.h>
+
/*
* This assumes you have a 1.8432 MHz clock for your UART.
*
@@ -18,23 +23,31 @@
*/
#define BASE_BAUD (1843200 / 16)
+#ifdef CONFIG_CATS
+#define _SER_IRQ0 IRQ_ISA(4)
+#define _SER_IRQ1 IRQ_ISA(3)
+#else
+#define _SER_IRQ0 0
+#define _SER_IRQ1 0
+#endif
+
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
/* UART CLK PORT IRQ FLAGS */
#define SERIAL_PORT_DFNS \
- { 0, BASE_BAUD, 0x3F8, 0, STD_COM_FLAGS }, /* ttyS0 */ \
- { 0, BASE_BAUD, 0x2F8, 0, STD_COM_FLAGS }, /* ttyS1 */ \
- { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS2 */ \
- { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS3 */ \
- { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS4 */ \
- { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS5 */ \
- { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS6 */ \
- { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS7 */ \
- { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS8 */ \
- { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS9 */ \
- { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS10 */ \
- { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS11 */ \
- { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS12 */ \
- { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS13 */
+ { 0, BASE_BAUD, 0x3F8, _SER_IRQ0, STD_COM_FLAGS }, /* ttyS0 */ \
+ { 0, BASE_BAUD, 0x2F8, _SER_IRQ1, STD_COM_FLAGS }, /* ttyS1 */ \
+ { 0, BASE_BAUD, 0 , 0 , STD_COM_FLAGS }, /* ttyS2 */ \
+ { 0, BASE_BAUD, 0 , 0 , STD_COM_FLAGS }, /* ttyS3 */ \
+ { 0, BASE_BAUD, 0 , 0 , STD_COM_FLAGS }, /* ttyS4 */ \
+ { 0, BASE_BAUD, 0 , 0 , STD_COM_FLAGS }, /* ttyS5 */ \
+ { 0, BASE_BAUD, 0 , 0 , STD_COM_FLAGS }, /* ttyS6 */ \
+ { 0, BASE_BAUD, 0 , 0 , STD_COM_FLAGS }, /* ttyS7 */ \
+ { 0, BASE_BAUD, 0 , 0 , STD_COM_FLAGS }, /* ttyS8 */ \
+ { 0, BASE_BAUD, 0 , 0 , STD_COM_FLAGS }, /* ttyS9 */ \
+ { 0, BASE_BAUD, 0 , 0 , STD_COM_FLAGS }, /* ttyS10 */ \
+ { 0, BASE_BAUD, 0 , 0 , STD_COM_FLAGS }, /* ttyS11 */ \
+ { 0, BASE_BAUD, 0 , 0 , STD_COM_FLAGS }, /* ttyS12 */ \
+ { 0, BASE_BAUD, 0 , 0 , STD_COM_FLAGS }, /* ttyS13 */
#endif
diff --git a/include/asm-arm/arch-ebsa285/system.h b/include/asm-arm/arch-ebsa285/system.h
index a3fed312c..40d540dba 100644
--- a/include/asm-arm/arch-ebsa285/system.h
+++ b/include/asm-arm/arch-ebsa285/system.h
@@ -6,19 +6,26 @@
#include <asm/hardware.h>
#include <asm/leds.h>
-/* To reboot, we set up the 21285 watchdog and enable it.
- * We then wait for it to timeout.
- */
-extern __inline__ void arch_hard_reset (void)
+extern __inline__ void arch_reset(char mode)
{
cli();
- *CSR_TIMER4_LOAD = 0x8000;
- *CSR_TIMER4_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16;
- *CSR_SA110_CNTL |= 1 << 13;
- while(1);
-}
-#define ARCH_IDLE_OK
+ if (mode == 's') {
+ __asm__ volatile (
+ "mov lr, #0x41000000 @ prepare to jump to ROM
+ mov r0, #0x130
+ mcr p15, 0, r0, c1, c0 @ MMU off
+ mcr p15, 0, ip, c7, c7 @ flush caches
+ mov pc, lr");
+ } else {
+ /* To reboot, we set up the 21285 watchdog and enable it.
+ * We then wait for it to timeout.
+ */
+ *CSR_TIMER4_LOAD = 0x8000;
+ *CSR_TIMER4_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16;
+ *CSR_SA110_CNTL |= 1 << 13;
+ }
+}
#define arch_start_idle() leds_event(led_idle_start)
#define arch_end_idle() leds_event(led_idle_end)
diff --git a/include/asm-arm/arch-ebsa285/time.h b/include/asm-arm/arch-ebsa285/time.h
index cbc53293a..342e9528f 100644
--- a/include/asm-arm/arch-ebsa285/time.h
+++ b/include/asm-arm/arch-ebsa285/time.h
@@ -2,40 +2,58 @@
* linux/include/asm-arm/arch-ebsa285/time.h
*
* Copyright (c) 1998 Russell King.
+ * Copyright (c) 1998 Phil Blundell
*
- * No real time clock on the evalulation board!
+ * CATS has a real-time clock, though the evaluation board doesn't.
*
* Changelog:
* 21-Mar-1998 RMK Created
+ * 27-Aug-1998 PJB CATS support
+ * 28-Dec-1998 APH Made leds optional
*/
+#define RTC_PORT(x) (0x72+(x))
+#define RTC_ALWAYS_BCD 1
+
+#include <linux/config.h>
#include <asm/leds.h>
+#include <asm/system.h>
+#include <linux/mc146818rtc.h>
extern __inline__ unsigned long gettimeoffset (void)
{
- return 0;
+ unsigned long value = LATCH - *CSR_TIMER1_VALUE;
+
+ return (tick * value) / LATCH;
}
extern __inline__ int reset_timer (void)
{
- static unsigned int count = 50;
- static int last_pid;
-
*CSR_TIMER1_CLR = 0;
- if (current->pid != last_pid) {
- last_pid = current->pid;
- if (last_pid)
- leds_event(led_idle_end);
- else
- leds_event(led_idle_start);
- }
+#ifdef CONFIG_LEDS
+ /*
+ * Do the LEDs thing on EBSA-285 hardware.
+ */
+ if (!machine_is_cats()) {
+ static unsigned int count = 50;
+ static int last_pid;
- if (--count == 0) {
- count = 50;
- leds_event(led_timer);
+ 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);
+ }
}
-
+#endif
+
return 1;
}
@@ -49,9 +67,59 @@ extern __inline__ int reset_timer (void)
*/
extern __inline__ unsigned long setup_timer (void)
{
+ int year, mon, day, hour, min, sec;
+
+ /*
+ * Default the date to 1 Jan 1970 0:0:0
+ */
+ year = 1970; mon = 1; day = 1;
+ hour = 0; min = 0; sec = 0;
+
*CSR_TIMER1_CLR = 0;
*CSR_TIMER1_LOAD = LATCH;
*CSR_TIMER1_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16;
- return mktime(1970, 1, 1, 0, 0, 0);
+ if (machine_is_cats())
+ {
+ int i;
+ /*
+ * Read the real time from the Dallas chip. (Code borrowed
+ * from arch/i386/kernel/time.c).
+ */
+
+ /* The Linux interpretation of the CMOS clock register contents:
+ * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
+ * RTC registers show the second which has precisely just started.
+ * Let's hope other operating systems interpret the RTC the same way.
+ */
+
+ /* read RTC exactly on falling edge of update flag */
+ for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
+ if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)
+ break;
+ for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */
+ if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
+ break;
+ do { /* Isn't this overkill ? UIP above should guarantee consistency */
+ sec = CMOS_READ(RTC_SECONDS);
+ min = CMOS_READ(RTC_MINUTES);
+ hour = CMOS_READ(RTC_HOURS);
+ day = CMOS_READ(RTC_DAY_OF_MONTH);
+ mon = CMOS_READ(RTC_MONTH);
+ year = CMOS_READ(RTC_YEAR);
+ } while (sec != CMOS_READ(RTC_SECONDS));
+ if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
+ {
+ BCD_TO_BIN(sec);
+ BCD_TO_BIN(min);
+ BCD_TO_BIN(hour);
+ BCD_TO_BIN(day);
+ BCD_TO_BIN(mon);
+ BCD_TO_BIN(year);
+ }
+ if ((year += 1900) < 1970)
+ year += 100;
+ }
+
+ return mktime(year, mon, day, hour, min, sec);
}
diff --git a/include/asm-arm/arch-ebsa285/uncompress.h b/include/asm-arm/arch-ebsa285/uncompress.h
index d6097d43f..7f655745f 100644
--- a/include/asm-arm/arch-ebsa285/uncompress.h
+++ b/include/asm-arm/arch-ebsa285/uncompress.h
@@ -4,27 +4,25 @@
* Copyright (C) 1996,1997,1998 Russell King
*/
+#define BASE 0x42000160
+
+static __inline__ void putc(char c)
+{
+ while (*((volatile unsigned int *)(BASE + 0x18)) & 8);
+ *((volatile unsigned int *)(BASE)) = c;
+}
+
/*
* This does not append a newline
*/
static void puts(const char *s)
{
- __asm__ __volatile__("
- ldrb %0, [%2], #1
- teq %0, #0
- beq 3f
-1: strb %0, [%3]
-2: ldrb %1, [%3, #0x14]
- and %1, %1, #0x60
- teq %1, #0x60
- bne 2b
- teq %0, #'\n'
- moveq %0, #'\r'
- beq 1b
- ldrb %0, [%2], #1
- teq %0, #0
- bne 1b
-3: " : : "r" (0), "r" (0), "r" (s), "r" (0xf0000be0) : "cc");
+ while (*s) {
+ putc(*s);
+ if (*s == '\n')
+ putc('\r');
+ s++;
+ }
}
/*
diff --git a/include/asm-arm/arch-nexuspci/a.out.h b/include/asm-arm/arch-nexuspci/a.out.h
index 9051eb0c9..4972f5f70 100644
--- a/include/asm-arm/arch-nexuspci/a.out.h
+++ b/include/asm-arm/arch-nexuspci/a.out.h
@@ -9,7 +9,6 @@
#ifdef __KERNEL__
#define STACK_TOP ((current->personality==PER_LINUX_32BIT)? 0xc0000000 : 0x04000000)
-#define LIBRARY_START_TEXT (0x00c00000)
#endif
#endif
diff --git a/include/asm-arm/arch-nexuspci/dma.h b/include/asm-arm/arch-nexuspci/dma.h
index 83931f566..6d0a46e17 100644
--- a/include/asm-arm/arch-nexuspci/dma.h
+++ b/include/asm-arm/arch-nexuspci/dma.h
@@ -7,6 +7,3 @@
* Copyright (C) 1998 Philip Blundell
*/
-/* Need this to keep <asm/dma.h> happy. */
-typedef unsigned int dmamode_t;
-
diff --git a/include/asm-arm/arch-nexuspci/hardware.h b/include/asm-arm/arch-nexuspci/hardware.h
index 997569748..6141bbf4c 100644
--- a/include/asm-arm/arch-nexuspci/hardware.h
+++ b/include/asm-arm/arch-nexuspci/hardware.h
@@ -27,15 +27,13 @@
/*
* Mapping areas
*/
-#define IO_END 0xffffffff
#define IO_BASE 0xfe000000
-#define IO_SIZE (IO_END - IO_BASE)
/*
* RAM definitions
*/
#define RAM_BASE 0x40000000
#define KERNTOPHYS(a) ((unsigned long)(&a))
-#define SAFE_ADDR 0x40000000
+#define FLUSH_BASE_PHYS 0x40000000
#endif
diff --git a/include/asm-arm/arch-nexuspci/processor.h b/include/asm-arm/arch-nexuspci/processor.h
index da9fdd583..f722be87c 100644
--- a/include/asm-arm/arch-nexuspci/processor.h
+++ b/include/asm-arm/arch-nexuspci/processor.h
@@ -24,12 +24,7 @@
/* This decides where the kernel will search for a free chunk of vm
* space during mmap's.
*/
-#if 0
-#define TASK_UNMAPPED_BASE(off) (TASK_SIZE / 3)
-#else
#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
-#endif
-#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
#define INIT_MMAP \
{ &init_mm, 0, 0, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
diff --git a/include/asm-arm/arch-nexuspci/system.h b/include/asm-arm/arch-nexuspci/system.h
index 7042dc436..b5a2464b2 100644
--- a/include/asm-arm/arch-nexuspci/system.h
+++ b/include/asm-arm/arch-nexuspci/system.h
@@ -6,13 +6,12 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
-extern __inline__ void arch_hard_reset (void)
+extern __inline__ void arch_reset(char mode)
{
/*
* loop endlessly - the watchdog will reset us if it's enabled.
*/
cli();
- while (1);
}
#endif
diff --git a/include/asm-arm/arch-rpc/a.out.h b/include/asm-arm/arch-rpc/a.out.h
index 6b55ee076..598614f23 100644
--- a/include/asm-arm/arch-rpc/a.out.h
+++ b/include/asm-arm/arch-rpc/a.out.h
@@ -9,7 +9,6 @@
#ifdef __KERNEL__
#define STACK_TOP ((current->personality==PER_LINUX_32BIT)? 0xc0000000 : 0x04000000)
-#define LIBRARY_START_TEXT (0x00c00000)
#endif
#endif
diff --git a/include/asm-arm/arch-rpc/dma.h b/include/asm-arm/arch-rpc/dma.h
index 0f556e856..c6b6679af 100644
--- a/include/asm-arm/arch-rpc/dma.h
+++ b/include/asm-arm/arch-rpc/dma.h
@@ -7,15 +7,6 @@
* bytes of RAM.
*/
#define MAX_DMA_ADDRESS 0xd0000000
-
-/*
- * DMA modes - we have two, IN and OUT
- */
-typedef enum {
- DMA_MODE_READ,
- DMA_MODE_WRITE
-} dmamode_t;
-
#define MAX_DMA_CHANNELS 8
#define DMA_0 0
diff --git a/include/asm-arm/arch-rpc/hardware.h b/include/asm-arm/arch-rpc/hardware.h
index 706992b78..8ca6273ff 100644
--- a/include/asm-arm/arch-rpc/hardware.h
+++ b/include/asm-arm/arch-rpc/hardware.h
@@ -13,33 +13,46 @@
* What hardware must be present
*/
#define HAS_IOMD
-#define HAS_PCIO
+#include <asm/iomd.h>
#define HAS_VIDC20
-/*
- * Optional hardware
- */
-#define HAS_EXPMASK
-
-/*
- * Physical definitions
+/* Hardware addresses of major areas.
+ * *_START is the physical address
+ * *_SIZE is the size of the region
+ * *_BASE is the virtual address
*/
+#define RAM_SIZE 0x10000000
#define RAM_START 0x10000000
-#define IO_START 0x03000000
+
+#define EASI_SIZE 0x08000000 /* EASI I/O */
+#define EASI_START 0x08000000
+#define EASI_BASE 0xe8000000
+
+#define IO_START 0x03000000 /* I/O */
+#define IO_SIZE 0x01000000
+#define IO_BASE 0xe0000000
+
#define SCREEN_START 0x02000000 /* VRAM */
+#define SCREEN2_END 0xe0000000
+#define SCREEN2_BASE 0xd8000000
+#define SCREEN1_END 0xd8000000
+#define SCREEN1_BASE 0xd0000000
+
#ifndef __ASSEMBLER__
/*
* for use with inb/outb
*/
-#define VIDC_AUDIO_BASE 0x80140000
-#define VIDC_BASE 0x80100000
-#define IOCEC4IO_BASE 0x8009c000
-#define IOCECIO_BASE 0x80090000
-#define IOMD_BASE 0x80080000
-#define MEMCEC8IO_BASE 0x8000ac00
-#define MEMCECIO_BASE 0x80000000
+#define IO_VIDC_AUDIO_BASE 0x80140000
+#define IO_VIDC_BASE 0x80100000
+#define IO_IOMD_BASE 0x80080000
+
+#define IO_EC_EASI_BASE 0x82000000
+#define IO_EC_IOC4_BASE 0x8009c000
+#define IO_EC_IOC_BASE 0x80090000
+#define IO_EC_MEMC8_BASE 0x8000ac00
+#define IO_EC_MEMC_BASE 0x80000000
/*
* IO definitions
@@ -51,21 +64,6 @@
#define PCIO_BASE 0xe0010000
/*
- * Mapping areas
- */
-#define IO_END 0xe1000000
-#define IO_BASE 0xe0000000
-#define IO_SIZE (IO_END - IO_BASE)
-
-/*
- * Screen mapping information
- */
-#define SCREEN2_END 0xe0000000
-#define SCREEN2_BASE 0xd8000000
-#define SCREEN1_END SCREEN2_BASE
-#define SCREEN1_BASE 0xd0000000
-
-/*
* Offsets from RAM base
*/
#define PARAMS_OFFSET 0x0100
@@ -95,7 +93,6 @@
#define IOC_BASE 0xe0200000
#define PCIO_FLOPPYDMABASE 0xe002a000
#define PCIO_BASE 0xe0010000
-#define IO_BASE 0xe0000000
#endif
#endif
diff --git a/include/asm-arm/arch-rpc/ide.h b/include/asm-arm/arch-rpc/ide.h
index 311a98853..ccbc7cf76 100644
--- a/include/asm-arm/arch-rpc/ide.h
+++ b/include/asm-arm/arch-rpc/ide.h
@@ -2,44 +2,41 @@
* linux/include/asm-arm/arch-rpc/ide.h
*
* Copyright (c) 1997 Russell King
+ *
+ * Modifications:
+ * 29-07-1998 RMK Major re-work of IDE architecture specific code
*/
#include <asm/irq.h>
-static __inline__ int
-ide_default_irq(ide_ioreg_t base)
+/*
+ * Set up a hw structure for a specified data port, control port and IRQ.
+ * This should follow whatever the default interface uses.
+ */
+static __inline__ void
+ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int irq)
{
- if (base == 0x1f0)
- return IRQ_HARDDISK;
- return 0;
-}
+ ide_ioreg_t reg = (ide_ioreg_t) data_port;
+ int i;
-static __inline__ ide_ioreg_t
-ide_default_io_base(int index)
-{
- if (index == 0)
- return 0x1f0;
- return 0;
-}
+ memset(hw, 0, sizeof(*hw));
-static __inline__ int
-ide_default_stepping(int index)
-{
- return 0;
+ for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
+ hw->io_ports[i] = reg;
+ reg += 1;
+ }
+ hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
+ hw->irq = irq;
}
+/*
+ * This registers the standard ports for this architecture with the IDE
+ * driver.
+ */
static __inline__ void
-ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int stepping, int *irq)
+ide_init_default_hwifs(void)
{
- ide_ioreg_t port = base;
- ide_ioreg_t ctrl = base + 0x206;
- int i;
+ hw_regs_t hw;
- i = 8;
- while (i--) {
- *p++ = port;
- port += 1 << stepping;
- }
- *p++ = ctrl;
- if (irq != NULL)
- *irq = 0;
+ ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, IRQ_HARDDISK);
+ ide_register_hw(&hw, NULL);
}
diff --git a/include/asm-arm/arch-rpc/io.h b/include/asm-arm/arch-rpc/io.h
index 43d787b96..ecf07c17c 100644
--- a/include/asm-arm/arch-rpc/io.h
+++ b/include/asm-arm/arch-rpc/io.h
@@ -36,7 +36,7 @@ extern __inline__ void __out##fnsuffix (unsigned int value, unsigned int port) \
"tst %2, #0x80000000\n\t" \
"mov %0, %4\n\t" \
"addeq %0, %0, %3\n\t" \
- "str" ##instr## " %1, [%0, %2, lsl #2]" \
+ "str" ##instr## " %1, [%0, %2, lsl #2] @ out"###fnsuffix \
: "=&r" (temp) \
: "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
: "cc"); \
@@ -50,7 +50,7 @@ extern __inline__ unsigned sz __in##fnsuffix (unsigned int port) \
"tst %2, #0x80000000\n\t" \
"mov %0, %4\n\t" \
"addeq %0, %0, %3\n\t" \
- "ldr" ##instr## " %1, [%0, %2, lsl #2]" \
+ "ldr" ##instr## " %1, [%0, %2, lsl #2] @ in"###fnsuffix \
: "=&r" (temp), "=r" (value) \
: "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
: "cc"); \
@@ -87,11 +87,11 @@ DECLARE_IO(long,l,"")
({ \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "strb %0, [%1, %2]" \
+ "strb %0, [%1, %2] @ outbc" \
: : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "strb %0, [%1, %2]" \
+ "strb %0, [%1, %2] @ outbc" \
: : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \
})
@@ -100,11 +100,11 @@ DECLARE_IO(long,l,"")
unsigned char result; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "ldrb %0, [%1, %2]" \
+ "ldrb %0, [%1, %2] @ inbc" \
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "ldrb %0, [%1, %2]" \
+ "ldrb %0, [%1, %2] @ inbc" \
: "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
result; \
})
@@ -114,11 +114,11 @@ DECLARE_IO(long,l,"")
unsigned long v = value; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outwc" \
: : "r" (v|v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outwc" \
: : "r" (v|v<<16), "r" (IO_BASE), "r" ((port) << 2)); \
})
@@ -127,11 +127,11 @@ DECLARE_IO(long,l,"")
unsigned short result; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inwc" \
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inwc" \
: "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
result & 0xffff; \
})
@@ -141,11 +141,11 @@ DECLARE_IO(long,l,"")
unsigned long v = value; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outlc" \
: : "r" (v), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outlc" \
: : "r" (v), "r" (IO_BASE), "r" ((port) << 2)); \
})
@@ -154,11 +154,11 @@ DECLARE_IO(long,l,"")
unsigned long result; \
if (__PORT_PCIO((port))) \
__asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inlc" \
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
else \
__asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inlc" \
: "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
result; \
})
diff --git a/include/asm-arm/arch-rpc/keyboard.h b/include/asm-arm/arch-rpc/keyboard.h
index 44090e122..6c04cf074 100644
--- a/include/asm-arm/arch-rpc/keyboard.h
+++ b/include/asm-arm/arch-rpc/keyboard.h
@@ -40,3 +40,4 @@ extern unsigned char ps2kbd_sysrq_xlate[NR_SCANCODES];
#define kbd_disable_irq() disable_irq(IRQ_KEYBOARDRX)
#define kbd_enable_irq() enable_irq(IRQ_KEYBOARDRX)
+#define SYSRQ_KEY 13
diff --git a/include/asm-arm/arch-rpc/processor.h b/include/asm-arm/arch-rpc/processor.h
index cdb79eeed..2fd9155b2 100644
--- a/include/asm-arm/arch-rpc/processor.h
+++ b/include/asm-arm/arch-rpc/processor.h
@@ -26,12 +26,7 @@
/* This decides where the kernel will search for a free chunk of vm
* space during mmap's.
*/
-#if 0
-#define TASK_UNMAPPED_BASE(off) (TASK_SIZE / 3)
-#else
#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
-#endif
-#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
#define INIT_MMAP \
{ &init_mm, 0, 0, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
diff --git a/include/asm-arm/arch-rpc/system.h b/include/asm-arm/arch-rpc/system.h
index aa6e645c6..e0a16f61d 100644
--- a/include/asm-arm/arch-rpc/system.h
+++ b/include/asm-arm/arch-rpc/system.h
@@ -8,10 +8,10 @@
#include <asm/proc-fns.h>
-#define arch_hard_reset() { \
+#define arch_reset(mode) { \
extern void ecard_reset (int card); \
outb (0, IOMD_ROMCR0); \
- ecard_reset (-1); \
+ ecard_reset(-1); \
cli(); \
__asm__ __volatile__("msr spsr, r1;" \
"mcr p15, 0, %0, c1, c0, 0;" \
diff --git a/include/asm-arm/arch-vnc/a.out.h b/include/asm-arm/arch-vnc/a.out.h
index 05f7c1d58..011b08373 100644
--- a/include/asm-arm/arch-vnc/a.out.h
+++ b/include/asm-arm/arch-vnc/a.out.h
@@ -9,7 +9,6 @@
#ifdef __KERNEL__
#define STACK_TOP ((current->personality==PER_LINUX_32BIT)? 0xc0000000 : 0x04000000)
-#define LIBRARY_START_TEXT (0x00c00000)
#endif
#endif
diff --git a/include/asm-arm/arch-vnc/dma.h b/include/asm-arm/arch-vnc/dma.h
index e6d042675..f205f0376 100644
--- a/include/asm-arm/arch-vnc/dma.h
+++ b/include/asm-arm/arch-vnc/dma.h
@@ -14,15 +14,6 @@
* bytes of RAM.
*/
#define MAX_DMA_ADDRESS 0xd0000000
-
-/*
- * DMA modes - we have two, IN and OUT
- */
-typedef enum {
- DMA_MODE_READ,
- DMA_MODE_WRITE
-} dmamode_t;
-
#define MAX_DMA_CHANNELS 8
#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-vnc/hardware.h b/include/asm-arm/arch-vnc/hardware.h
index b0021b724..e95b1e7b6 100644
--- a/include/asm-arm/arch-vnc/hardware.h
+++ b/include/asm-arm/arch-vnc/hardware.h
@@ -7,84 +7,20 @@
*/
/* Logical Physical
- * 0xfff00000 0x40000000 X-Bus
* 0xffe00000 0x7c000000 PCI I/O space
- *
* 0xfe000000 0x42000000 CSR
* 0xfd000000 0x78000000 Outbound write flush
* 0xfc000000 0x79000000 PCI IACK/special space
- *
- * 0xf9030000 0x7a080000 PCI Config type 1 card 4
- * 0xf9020000 0x7a040000 PCI Config type 1 card 3
- * 0xf9010000 0x7a020000 PCI Config type 1 card 2
- * 0xf9000000 0x7a010000 PCI Config type 1 card 1
- *
- * 0xf8030000 0x7b080000 PCI Config type 0 card 4
- * 0xf8020000 0x7b040000 PCI Config type 0 card 3
- * 0xf8010000 0x7b020000 PCI Config type 0 card 2
- * 0xf8000000 0x7b010000 PCI Config type 0 card 1
+ * 0xf9000000 0x7a000000 PCI Config type 1
+ * 0xf8000000 0x7b000000 PCI Config type 0
*
*/
-
-/*
- * DEC21285
- */
-#define CSR_SA110_CNTL ((volatile unsigned long *)0xfe00013c)
-#define CSR_PCIADDR_EXTN ((volatile unsigned long *)0xfe000140)
-#define CSR_PREFETCHMEMRANGE ((volatile unsigned long *)0xfe000144)
-#define CSR_XBUS_CYCLE ((volatile unsigned long *)0xfe000148)
-#define CSR_XBUS_IOSTROBE ((volatile unsigned long *)0xfe00014c)
-#define CSR_DOORBELL_PCI ((volatile unsigned long *)0xfe000150)
-#define CSR_DOORBELL_SA110 ((volatile unsigned long *)0xfe000154)
-
-
-#define CSR_UARTDR ((volatile unsigned long *)0xfe000160)
-#define CSR_RXSTAT ((volatile unsigned long *)0xfe000164)
-#define CSR_H_UBRLCR ((volatile unsigned long *)0xfe000168)
-#define CSR_M_UBRLCR ((volatile unsigned long *)0xfe00016c)
-#define CSR_L_UBRLCR ((volatile unsigned long *)0xfe000170)
-#define CSR_UARTCON ((volatile unsigned long *)0xfe000174)
-#define CSR_UARTFLG ((volatile unsigned long *)0xfe000178)
-
-#define CSR_IRQ_STATUS ((volatile unsigned long *)0xfe000180)
-#define CSR_IRQ_RAWSTATUS ((volatile unsigned long *)0xfe000184)
-#define CSR_IRQ_ENABLE ((volatile unsigned long *)0xfe000188)
-#define CSR_IRQ_DISABLE ((volatile unsigned long *)0xfe00018c)
-#define CSR_IRQ_SOFT ((volatile unsigned long *)0xfe000190)
-#define CSR_FIQ_STATUS ((volatile unsigned long *)0xfe000280)
-#define CSR_FIQ_RAWSTATUS ((volatile unsigned long *)0xfe000284)
-#define CSR_FIQ_ENABLE ((volatile unsigned long *)0xfe000288)
-#define CSR_FIQ_DISABLE ((volatile unsigned long *)0xfe00028c)
-#define CSR_FIQ_SOFT ((volatile unsigned long *)0xfe000290)
-
-#define CSR_TIMER1_LOAD ((volatile unsigned long *)0xfe000300)
-#define CSR_TIMER1_VALUE ((volatile unsigned long *)0xfe000304)
-#define CSR_TIMER1_CNTL ((volatile unsigned long *)0xfe000308)
-#define CSR_TIMER1_CLR ((volatile unsigned long *)0xfe00030c)
-
-#define CSR_TIMER2_LOAD ((volatile unsigned long *)0xfe000320)
-#define CSR_TIMER2_VALUE ((volatile unsigned long *)0xfe000324)
-#define CSR_TIMER2_CNTL ((volatile unsigned long *)0xfe000328)
-#define CSR_TIMER2_CLR ((volatile unsigned long *)0xfe00032c)
-
-#define CSR_TIMER3_LOAD ((volatile unsigned long *)0xfe000340)
-#define CSR_TIMER3_VALUE ((volatile unsigned long *)0xfe000344)
-#define CSR_TIMER3_CNTL ((volatile unsigned long *)0xfe000348)
-#define CSR_TIMER3_CLR ((volatile unsigned long *)0xfe00034c)
-
-#define CSR_TIMER4_LOAD ((volatile unsigned long *)0xfe000360)
-#define CSR_TIMER4_VALUE ((volatile unsigned long *)0xfe000364)
-#define CSR_TIMER4_CNTL ((volatile unsigned long *)0xfe000368)
-#define CSR_TIMER4_CLR ((volatile unsigned long *)0xfe00036c)
-
-#define TIMER_CNTL_ENABLE (1 << 7)
-#define TIMER_CNTL_AUTORELOAD (1 << 6)
-#define TIMER_CNTL_DIV1 (0)
-#define TIMER_CNTL_DIV16 (1 << 2)
-#define TIMER_CNTL_DIV256 (2 << 2)
-#define TIMER_CNTL_CNTEXT (3 << 2)
+#include <asm/dec21285.h>
+#define IO_BASE_ARM_CSR 0xfe000000
+#define PCI_IACK 0xfc000000
+
/* LEDs */
#define XBUS_LEDS ((volatile unsigned char *)0xfff12000)
#define XBUS_LED_AMBER (1 << 0)
@@ -103,18 +39,36 @@
#define IO_SIZE (IO_END - IO_BASE)
#define HAS_PCIO
-
-#define XBUS_SWITCH ((volatile unsigned char *)0xfff12000)
-#define XBUS_SWITCH_SWITCH ((*XBUS_SWITCH) & 15)
-#define XBUS_SWITCH_J17_13 ((*XBUS_SWITCH) & (1 << 4))
-#define XBUS_SWITCH_J17_11 ((*XBUS_SWITCH) & (1 << 5))
-#define XBUS_SWITCH_J17_9 ((*XBUS_SWITCH) & (1 << 6))
-
#define PCIO_BASE 0xffe00000
#define KERNTOPHYS(a) ((unsigned long)(&a))
-#define PARAMS_OFFSET 0x0100
-#define PARAMS_BASE (PAGE_OFFSET + PARAMS_OFFSET)
-
-#define SAFE_ADDR 0x50000000
+//#define PARAMS_OFFSET 0x0100
+//#define PARAMS_BASE (PAGE_OFFSET + PARAMS_OFFSET)
+
+#define FLUSH_BASE_PHYS 0x50000000
+
+/* GPIO pins */
+#define GPIO_CCLK 0x800
+#define GPIO_DSCLK 0x400
+#define GPIO_E2CLK 0x200
+#define GPIO_IOLOAD 0x100
+#define GPIO_RED_LED 0x080
+#define GPIO_WDTIMER 0x040
+#define GPIO_DATA 0x020
+#define GPIO_IOCLK 0x010
+#define GPIO_DONE 0x008
+#define GPIO_FAN 0x004
+#define GPIO_GREEN_LED 0x002
+#define GPIO_RESET 0x001
+
+/* CPLD pins */
+#define CPLD_DSRESET 8
+#define CPLD_UNMUTE 2
+
+#ifndef __ASSEMBLY__
+extern void gpio_modify_op(int mask, int set);
+extern void gpio_modify_io(int mask, int in);
+extern int gpio_read(void);
+extern void cpld_modify(int mask, int set);
+#endif
diff --git a/include/asm-arm/arch-vnc/ide.h b/include/asm-arm/arch-vnc/ide.h
index 35eff5c28..c3761ab90 100644
--- a/include/asm-arm/arch-vnc/ide.h
+++ b/include/asm-arm/arch-vnc/ide.h
@@ -1 +1,42 @@
-/* no ide */
+/*
+ * linux/include/asm-arm/arch-vnc/ide.h
+ *
+ * Copyright (c) 1998 Russell King
+ *
+ * Modifications:
+ * 29-07-1998 RMK Major re-work of IDE architecture specific code
+ */
+#include <asm/irq.h>
+
+/*
+ * Set up a hw structure for a specified data port, control port and IRQ.
+ * This should follow whatever the default interface uses.
+ */
+static __inline__ void
+ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int irq)
+{
+ ide_ioreg_t reg = (ide_ioreg_t) data_port;
+ int i;
+
+ memset(hw, 0, sizeof(*hw));
+
+ for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
+ hw->io_ports[i] = reg;
+ reg += 1;
+ }
+ hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
+ hw->irq = irq;
+}
+
+/*
+ * This registers the standard ports for this architecture with the IDE
+ * driver.
+ */
+static __inline__ void
+ide_init_default_hwifs(void)
+{
+ hw_regs_t hw;
+
+ ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, IRQ_HARDDISK);
+ ide_register_hw(&hw, NULL);
+}
diff --git a/include/asm-arm/arch-vnc/io.h b/include/asm-arm/arch-vnc/io.h
index 83d25d363..da1b48599 100644
--- a/include/asm-arm/arch-vnc/io.h
+++ b/include/asm-arm/arch-vnc/io.h
@@ -23,7 +23,7 @@
extern __inline__ void __out##fnsuffix (unsigned int value, unsigned int port) \
{ \
__asm__ __volatile__( \
- "str" ##instr## " %0, [%1, %2]" \
+ "str%?" ##instr## " %0, [%1, %2] @ out"###fnsuffix \
: \
: "r" (value), "r" (PCIO_BASE), typ (port)); \
}
@@ -33,7 +33,7 @@ extern __inline__ unsigned sz __in##fnsuffix (unsigned int port) \
{ \
unsigned long value; \
__asm__ __volatile__( \
- "ldr" ##instr## " %0, [%1, %2]" \
+ "ldr%?" ##instr## " %0, [%1, %2] @ in"###fnsuffix \
: "=&r" (value) \
: "r" (PCIO_BASE), typ (port)); \
return (unsigned sz)value; \
@@ -65,7 +65,7 @@ DECLARE_IO(long,l,"","Jr")
#define __outbc(value,port) \
({ \
__asm__ __volatile__( \
- "strb %0, [%1, %2]" \
+ "strb %0, [%1, %2] @ outbc" \
: \
: "r" (value), "r" (PCIO_BASE), "Jr" (port)); \
})
@@ -74,7 +74,7 @@ DECLARE_IO(long,l,"","Jr")
({ \
unsigned char result; \
__asm__ __volatile__( \
- "ldrb %0, [%1, %2]" \
+ "ldrb %0, [%1, %2] @ inbc" \
: "=r" (result) \
: "r" (PCIO_BASE), "Jr" (port)); \
result; \
@@ -83,7 +83,7 @@ DECLARE_IO(long,l,"","Jr")
#define __outwc(value,port) \
({ \
__asm__ __volatile__( \
- "strh %0, [%1, %2]" \
+ "strh %0, [%1, %2] @ outwc" \
: \
: "r" (value), "r" (PCIO_BASE), "r" (port)); \
})
@@ -92,7 +92,7 @@ DECLARE_IO(long,l,"","Jr")
({ \
unsigned short result; \
__asm__ __volatile__( \
- "ldrh %0, [%1, %2]" \
+ "ldrh %0, [%1, %2] @ inwc" \
: "=r" (result) \
: "r" (PCIO_BASE), "r" (port)); \
result & 0xffff; \
@@ -101,7 +101,7 @@ DECLARE_IO(long,l,"","Jr")
#define __outlc(value,port) \
({ \
__asm__ __volatile__( \
- "str %0, [%1, %2]" \
+ "str %0, [%1, %2] @ outlc" \
: \
: "r" (value), "r" (PCIO_BASE), "Jr" (port)); \
})
@@ -110,7 +110,7 @@ DECLARE_IO(long,l,"","Jr")
({ \
unsigned long result; \
__asm__ __volatile__( \
- "ldr %0, [%1, %2]" \
+ "ldr %0, [%1, %2] @ inlc" \
: "=r" (result) \
: "r" (PCIO_BASE), "Jr" (port)); \
result; \
@@ -163,12 +163,12 @@ static inline unsigned short readw(unsigned int addr)
return *(volatile unsigned short *)(0xe0000000 + (addr));
}
-static inline void writew(unsigned long b, unsigned int addr)
+static inline void writel(unsigned long b, unsigned int addr)
{
*(volatile unsigned long *)(0xe0000000 + (addr)) = b;
}
-static inline unsigned long readw(unsigned int addr)
+static inline unsigned long readl(unsigned int addr)
{
return *(volatile unsigned long *)(0xe0000000 + (addr));
}
diff --git a/include/asm-arm/arch-vnc/irq.h b/include/asm-arm/arch-vnc/irq.h
index abf877dc9..10e4d0f9e 100644
--- a/include/asm-arm/arch-vnc/irq.h
+++ b/include/asm-arm/arch-vnc/irq.h
@@ -7,6 +7,7 @@
* 22-08-1998 RMK Restructured IRQ routines
*/
+#include <asm/dec21285.h>
#include <asm/irq.h>
/*
@@ -39,7 +40,7 @@ static void vnc_mask_csr_irq(unsigned int irq)
static void vnc_unmask_csr_irq(unsigned int irq)
{
- *CSR_IRQ_DISABLE = fb_irq_mask[irq];
+ *CSR_IRQ_ENABLE = fb_irq_mask[irq];
}
static void vnc_mask_pic_lo_irq(unsigned int irq)
@@ -49,11 +50,19 @@ static void vnc_mask_pic_lo_irq(unsigned int irq)
outb(inb(PIC_MASK_LO) | mask, PIC_MASK_LO);
}
-static void vnc_unmask_pic_lo_irq(unsigned int irq)
+static void vnc_mask_ack_pic_lo_irq(unsigned int irq)
{
unsigned int mask = 1 << (irq & 7);
- outb(inb(PIC_MASK_LO) & ~mask, PIC_MASK_LO);
+ outb(inb(PIC_MASK_LO) | mask, PIC_MASK_LO);
+ outb(0x20, PIC_LO);
+}
+
+static void vnc_unmask_pic_lo_irq(unsigned int irq)
+{
+ unsigned int mask = ~(1 << (irq & 7));
+
+ outb(inb(PIC_MASK_LO) & mask, PIC_MASK_LO);
}
static void vnc_mask_pic_hi_irq(unsigned int irq)
@@ -63,6 +72,15 @@ static void vnc_mask_pic_hi_irq(unsigned int irq)
outb(inb(PIC_MASK_HI) | mask, PIC_MASK_HI);
}
+static void vnc_mask_ack_pic_hi_irq(unsigned int irq)
+{
+ unsigned int mask = 1 << (irq & 7);
+
+ outb(inb(PIC_MASK_HI) | mask, PIC_MASK_HI);
+ outb(0x62, PIC_LO);
+ outb(0x20, PIC_HI);
+}
+
static void vnc_unmask_pic_hi_irq(unsigned int irq)
{
unsigned int mask = 1 << (irq & 7);
@@ -70,6 +88,12 @@ static void vnc_unmask_pic_hi_irq(unsigned int irq)
outb(inb(PIC_MASK_HI) & ~mask, PIC_MASK_HI);
}
+static void no_action(int irq, void *dev_id, struct pt_regs *regs)
+{
+}
+
+static struct irqaction irq_cascade = { no_action, 0, 0, "cascade", NULL, NULL };
+
static __inline__ void irq_init_irq(void)
{
unsigned int irq;
@@ -97,13 +121,36 @@ static __inline__ void irq_init_irq(void)
irq_desc[irq].mask = vnc_mask_csr_irq;
irq_desc[irq].unmask = vnc_unmask_csr_irq;
} else if (irq < 24) {
- irq_desc[irq].mask_ack = vnc_mask_pic_lo_irq;
+irq_desc[irq].probe_ok = 0;
+ irq_desc[irq].mask_ack = vnc_mask_ack_pic_lo_irq;
irq_desc[irq].mask = vnc_mask_pic_lo_irq;
irq_desc[irq].unmask = vnc_unmask_pic_lo_irq;
} else {
- irq_desc[irq].mask_ack = vnc_mask_pic_hi_irq;
+irq_desc[irq].probe_ok = 0;
+ irq_desc[irq].mask_ack = vnc_mask_ack_pic_hi_irq;
irq_desc[irq].mask = vnc_mask_pic_hi_irq;
irq_desc[irq].unmask = vnc_unmask_pic_hi_irq;
}
}
+
+ irq_desc[0].probe_ok = 0;
+ irq_desc[IRQ_SOFTIRQ].probe_ok = 0;
+ irq_desc[IRQ_CONRX].probe_ok = 0;
+ irq_desc[IRQ_CONTX].probe_ok = 0;
+ irq_desc[IRQ_TIMER0].probe_ok = 0;
+ irq_desc[IRQ_TIMER1].probe_ok = 0;
+ irq_desc[IRQ_TIMER2].probe_ok = 0;
+ irq_desc[IRQ_WATCHDOG].probe_ok = 0;
+ irq_desc[IRQ_DMA1].probe_ok = 0;
+ irq_desc[13].probe_ok = 0;
+ irq_desc[14].probe_ok = 0;
+ irq_desc[IRQ_PCI_ERR].probe_ok = 0;
+ irq_desc[IRQ_PIC_HI].probe_ok = 0;
+ irq_desc[29].probe_ok = 0;
+ irq_desc[31].probe_ok = 0;
+
+ outb(0xff, PIC_MASK_LO);
+ outb(0xff, PIC_MASK_HI);
+
+ setup_arm_irq(IRQ_PIC_HI, &irq_cascade);
}
diff --git a/include/asm-arm/arch-vnc/irqs.h b/include/asm-arm/arch-vnc/irqs.h
index 37b48c43d..e9df93f5c 100644
--- a/include/asm-arm/arch-vnc/irqs.h
+++ b/include/asm-arm/arch-vnc/irqs.h
@@ -39,7 +39,7 @@
#define IRQ_HARDDISK 30 /* from 553.14 */
/* These defines handle the translation from the above FB #defines
- * into physical buts for the FootBridge IRQ registers
+ * into physical bits for the FootBridge IRQ registers
*/
#define IRQ_MASK_SOFTIRQ 0x00000002
#define IRQ_MASK_UART_DEBUG 0x0000000C
@@ -47,16 +47,21 @@
#define IRQ_MASK_TIMER1 0x00000020
#define IRQ_MASK_TIMER2 0x00000040
#define IRQ_MASK_WATCHDOG 0x00000080
-#define IRQ_MASK_ETHERH10 0x00000100
-#define IRQ_MASK_ETHERH100 0x00000200
+#define IRQ_MASK_ETHER10 0x00000100
+#define IRQ_MASK_ETHER100 0x00000200
#define IRQ_MASK_VIDCOMP 0x00000400
#define IRQ_MASK_EXTERN_IRQ 0x00000800
#define IRQ_MASK_DMA1 0x00030000
-#define IRQ_MASK_PCI_ERR 0xf0000000
+#define IRQ_MASK_PCI_ERR 0xf8800000
/*
* Now map them to the Linux interrupts
*/
+#undef IRQ_TIMER
#define IRQ_TIMER IRQ_TIMER0
+#undef RTC_IRQ
+#define RTC_IRQ IRQ_RTC_ALARM
+#undef AUX_IRQ
+#define AUX_IRQ IRQ_MOUSE
#define irq_cannonicalize(i) (i)
diff --git a/include/asm-arm/arch-vnc/keyboard.h b/include/asm-arm/arch-vnc/keyboard.h
index 4498ecc9b..2fa371ff9 100644
--- a/include/asm-arm/arch-vnc/keyboard.h
+++ b/include/asm-arm/arch-vnc/keyboard.h
@@ -1,36 +1,38 @@
/*
- * linux/include/asm-arm/arch-ebsa285/keyboard.h
+ * linux/include/asm-arm/arch-vnc/keyboard.h
*
- * Keyboard driver definitions for EBSA285 architecture
+ * Keyboard driver definitions for VNC architecture
*
* (C) 1998 Russell King
*/
-#include <linux/config.h>
#include <asm/irq.h>
#define NR_SCANCODES 128
-#ifdef CONFIG_MAGIC_SYSRQ
-static unsigned char kbd_sysrq_xlate[NR_SCANCODES];
-#endif
+#define KEYBOARD_IRQ IRQ_KEYBOARD
-#define kbd_setkeycode(sc,kc) (-EINVAL)
-#define kbd_getkeycode(sc) (-EINVAL)
+extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
+extern int pckbd_getkeycode(unsigned int scancode);
+extern int pckbd_pretranslate(unsigned char scancode, char raw_mode);
+extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
+ char raw_mode);
+extern char pckbd_unexpected_up(unsigned char keycode);
+extern void pckbd_leds(unsigned char leds);
+extern void pckbd_init_hw(void);
+extern unsigned char pckbd_sysrq_xlate[128];
-/* Prototype: int kbd_pretranslate(scancode, raw_mode)
- * Returns : 0 to ignore scancode
- */
-#define kbd_pretranslate(sc,rm) (1)
+#define kbd_setkeycode pckbd_setkeycode
+#define kbd_getkeycode pckbd_getkeycode
+#define kbd_pretranslate pckbd_pretranslate
+#define kbd_translate(sc, kcp, ufp, rm) ({ *ufp = sc & 0200; \
+ pckbd_translate(sc & 0x7f, kcp, rm);})
-/* 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
- */
-#define kbd_translate(sc, kcp, ufp, rm) (1)
-#define kbd_unexpected_up(kc) (0200)
-#define kbd_leds(leds)
-#define kbd_init_hw()
-//#define kbd_sysrq_xlate ps2kbd_sysrq_xlate
+#define kbd_unexpected_up pckbd_unexpected_up
+#define kbd_leds pckbd_leds
+#define kbd_init_hw() pckbd_init_hw()
+#define kbd_sysrq_xlate pckbd_sysrq_xlate
#define kbd_disable_irq()
#define kbd_enable_irq()
+
+#define SYSRQ_KEY 0x54
diff --git a/include/asm-arm/arch-vnc/mmu.h b/include/asm-arm/arch-vnc/mmu.h
index 85307d717..64e334292 100644
--- a/include/asm-arm/arch-vnc/mmu.h
+++ b/include/asm-arm/arch-vnc/mmu.h
@@ -19,8 +19,8 @@
#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET)
#define __virt_to_bus__is_a_macro
-#define __virt_to_bus(x) (x)
+#define __virt_to_bus(x) (x - 0xe0000000)
#define __bus_to_virt__is_a_macro
-#define __bus_to_virt(x) (x)
+#define __bus_to_virt(x) (x + 0xe0000000)
#endif
diff --git a/include/asm-arm/arch-vnc/system.h b/include/asm-arm/arch-vnc/system.h
index a3fed312c..dc21f08d8 100644
--- a/include/asm-arm/arch-vnc/system.h
+++ b/include/asm-arm/arch-vnc/system.h
@@ -1,24 +1,37 @@
/*
- * linux/include/asm-arm/arch-ebsa285/system.h
+ * linux/include/asm-arm/arch-vnc/system.h
*
* Copyright (c) 1996,1997,1998 Russell King.
+ * Copyright (c) 1998 Corel Computer Corp.
*/
#include <asm/hardware.h>
+#include <asm/dec21285.h>
#include <asm/leds.h>
+#include <asm/io.h>
-/* To reboot, we set up the 21285 watchdog and enable it.
- * We then wait for it to timeout.
- */
-extern __inline__ void arch_hard_reset (void)
+extern __inline__ void arch_reset(char mode)
{
cli();
- *CSR_TIMER4_LOAD = 0x8000;
- *CSR_TIMER4_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16;
- *CSR_SA110_CNTL |= 1 << 13;
- while(1);
-}
-#define ARCH_IDLE_OK
+ /* open up the SuperIO chip
+ */
+ outb(0x87, 0x370);
+ outb(0x87, 0x370);
+
+ /* aux function group 1 (Logical Device 7)
+ */
+ outb(0x07, 0x370);
+ outb(0x07, 0x371);
+
+ /* set GP16 for WD-TIMER output
+ */
+ outb(0xE6, 0x370);
+ outb(0x00, 0x371);
+
+ /* set a RED LED and toggle WD_TIMER for rebooting...
+ */
+ outb(0xC4, 0x338);
+}
#define arch_start_idle() leds_event(led_idle_start)
#define arch_end_idle() leds_event(led_idle_end)
diff --git a/include/asm-arm/arch-vnc/time.h b/include/asm-arm/arch-vnc/time.h
index 73f228441..c55000bdc 100644
--- a/include/asm-arm/arch-vnc/time.h
+++ b/include/asm-arm/arch-vnc/time.h
@@ -4,37 +4,229 @@
* Copyright (c) 1997 Corel Computer Corp.
* Slight modifications to bring in line with ebsa285 port.
* -- Russell King.
+ * Added LED driver (based on the ebsa285 code) - Alex Holden 28/12/98.
*/
+#include <linux/config.h>
+#include <linux/mc146818rtc.h>
+
+#include <asm/leds.h>
+#include <asm/system.h>
+
+#undef IRQ_TIMER
+#define IRQ_TIMER IRQ_TIMER4
+
+#define mSEC_10_from_14 ((14318180 + 100) / 200)
+
extern __inline__ unsigned long gettimeoffset (void)
{
- return 0;
+ int count;
+
+ static int count_p = (mSEC_10_from_14/6); /* for the first call after boot */
+ static unsigned long jiffies_p = 0;
+
+ /*
+ * cache volatile jiffies temporarily; we have IRQs turned off.
+ */
+ unsigned long jiffies_t;
+
+ /* timer count may underflow right here */
+ outb_p(0x00, 0x43); /* latch the count ASAP */
+
+ count = inb_p(0x40); /* read the latched count */
+
+ /*
+ * We do this guaranteed double memory access instead of a _p
+ * postfix in the previous port access. Wheee, hackady hack
+ */
+ jiffies_t = jiffies;
+
+ count |= inb_p(0x40) << 8;
+
+ /* Detect timer underflows. If we haven't had a timer tick since
+ the last time we were called, and time is apparently going
+ backwards, the counter must have wrapped during this routine. */
+ if ((jiffies_t == jiffies_p) && (count > count_p))
+ count -= (mSEC_10_from_14/6);
+ else
+ jiffies_p = jiffies_t;
+
+ count_p = count;
+
+ count = (((mSEC_10_from_14/6)-1) - count) * tick;
+ count = (count + (mSEC_10_from_14/6)/2) / (mSEC_10_from_14/6);
+
+ return count;
}
extern __inline__ int reset_timer (void)
{
- *CSR_TIMER1_CLR = 0;
+#ifdef CONFIG_LEDS
+ 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);
+ }
+#endif
return 1;
}
+unsigned long set_rtc_mmss(unsigned long nowtime)
+{
+ int retval = 0;
+ int real_seconds, real_minutes, cmos_minutes;
+ unsigned char save_control, save_freq_select;
+
+ save_control = CMOS_READ(RTC_CONTROL); /* tell the clock it's being set */
+ CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
+
+ save_freq_select = CMOS_READ(RTC_FREQ_SELECT); /* stop and reset prescaler */
+ CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
+
+ cmos_minutes = CMOS_READ(RTC_MINUTES);
+ if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
+ BCD_TO_BIN(cmos_minutes);
+
+ /*
+ * since we're only adjusting minutes and seconds,
+ * don't interfere with hour overflow. This avoids
+ * messing with unknown time zones but requires your
+ * RTC not to be off by more than 15 minutes
+ */
+ real_seconds = nowtime % 60;
+ real_minutes = nowtime / 60;
+ if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
+ real_minutes += 30; /* correct for half hour time zone */
+ real_minutes %= 60;
+
+ if (abs(real_minutes - cmos_minutes) < 30) {
+ if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
+ BIN_TO_BCD(real_seconds);
+ BIN_TO_BCD(real_minutes);
+ }
+ CMOS_WRITE(real_seconds,RTC_SECONDS);
+ CMOS_WRITE(real_minutes,RTC_MINUTES);
+ } else
+ retval = -1;
+
+ /* The following flags have to be released exactly in this order,
+ * otherwise the DS12887 (popular MC146818A clone with integrated
+ * battery and quartz) will not reset the oscillator and will not
+ * update precisely 500 ms later. You won't find this mentioned in
+ * the Dallas Semiconductor data sheets, but who believes data
+ * sheets anyway ... -- Markus Kuhn
+ */
+ CMOS_WRITE(save_control, RTC_CONTROL);
+ CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
+
+ return retval;
+}
+
/*
* We don't have a RTC to update!
*/
-#define update_rtc()
+extern __inline__ void update_rtc(void)
+{
+ static long last_rtc_update = 0; /* last time the cmos clock got updated */
+
+ /* 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_state != TIME_BAD && 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 */
+ }
+}
+
+extern __inline__ unsigned long get_cmos_time(void)
+{
+ unsigned int year, mon, day, hour, min, sec;
+ int i;
+
+ // check to see if the RTC makes sense.....
+ if ((CMOS_READ(RTC_VALID) & RTC_VRT) == 0)
+ return mktime(1970, 1, 1, 0, 0, 0);
+
+ /* The Linux interpretation of the CMOS clock register contents:
+ * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
+ * RTC registers show the second which has precisely just started.
+ * Let's hope other operating systems interpret the RTC the same way.
+ */
+ /* read RTC exactly on falling edge of update flag */
+ for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
+ if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)
+ break;
+
+ for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */
+ if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
+ break;
+
+ do { /* Isn't this overkill ? UIP above should guarantee consistency */
+ sec = CMOS_READ(RTC_SECONDS);
+ min = CMOS_READ(RTC_MINUTES);
+ hour = CMOS_READ(RTC_HOURS);
+ day = CMOS_READ(RTC_DAY_OF_MONTH);
+ mon = CMOS_READ(RTC_MONTH);
+ year = CMOS_READ(RTC_YEAR);
+ } while (sec != CMOS_READ(RTC_SECONDS));
+
+ if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
+ BCD_TO_BIN(sec);
+ BCD_TO_BIN(min);
+ BCD_TO_BIN(hour);
+ BCD_TO_BIN(day);
+ BCD_TO_BIN(mon);
+ BCD_TO_BIN(year);
+ }
+ if ((year += 1900) < 1970)
+ year += 100;
+ return mktime(year, mon, day, hour, min, sec);
+}
/*
* Set up timer interrupt, and return the current time in seconds.
*/
extern __inline__ unsigned long setup_timer (void)
{
- *CSR_TIMER1_CLR = 1;
- *CSR_TIMER1_LOAD = LATCH;
- *CSR_TIMER1_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16;
+ unsigned int c;
+
+ /* Turn on the RTC */
+ outb(13, 0x70);
+ if ((inb(0x71) & 0x80) == 0)
+ printk("RTC: *** warning: CMOS battery bad\n");
+
+ outb(10, 0x70); /* select control reg */
+ outb(32, 0x71); /* make sure the divider is set */
+ outb(11, 0x70); /* select other control reg */
+ c = inb(0x71) & 0xfb; /* read it */
+ outb(11, 0x70);
+ outb(c | 2, 0x71); /* turn on BCD counting and 24 hour clock mode */
+
+ /* enable PIT timer */
+ /* set for periodic (4) and LSB/MSB write (0x30) */
+ outb(0x34, 0x43);
+ outb((mSEC_10_from_14/6) & 0xFF, 0x40);
+ outb((mSEC_10_from_14/6) >> 8, 0x40);
/*
* Default the date to 1 Jan 1970 00:00:00
* You will have to run a time daemon to set the
* clock correctly at bootup
*/
- return mktime(1970, 1, 1, 0, 0, 0);
+ return get_cmos_time();
}
diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h
index 48d688eb1..431194234 100644
--- a/include/asm-arm/atomic.h
+++ b/include/asm-arm/atomic.h
@@ -12,17 +12,23 @@
#ifndef __ASM_ARM_ATOMIC_H
#define __ASM_ARM_ATOMIC_H
+#ifdef __SMP__
+#error SMP not supported
+#endif
+
+#include <linux/config.h>
+
+#ifdef CONFIG_ARCH_CO285
+typedef struct { volatile int counter; } atomic_t;
+#else
typedef struct { int counter; } atomic_t;
+#endif
#define ATOMIC_INIT(i) { (i) }
#ifdef __KERNEL__
#include <asm/system.h>
-#ifdef __SMP__
-#error SMP not supported
-#endif
-
#define atomic_read(v) ((v)->counter)
#define atomic_set(v,i) (((v)->counter) = (i))
diff --git a/include/asm-arm/byteorder.h b/include/asm-arm/byteorder.h
index 7b232d906..60a191cc3 100644
--- a/include/asm-arm/byteorder.h
+++ b/include/asm-arm/byteorder.h
@@ -3,7 +3,14 @@
#include <asm/types.h>
-#ifdef __GNUC__
+#if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ < 8
+
+/* Recent versions of GCC can open code the swaps at least as well
+ as we can write them by hand, so the "optimisations" here only
+ make sense for older compilers. Worse, some versions of GCC
+ actually go wrong in the presence of the assembler versions.
+ We play it safe and only turn them on for compilers older than
+ GCC 2.8.0. */
static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
{
@@ -33,6 +40,11 @@ static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
#endif /* __GNUC__ */
+#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+# define __BYTEORDER_HAS_U64__
+# define __SWAB_64_THRU_32__
+#endif
+
#include <linux/byteorder/little_endian.h>
#endif
diff --git a/include/asm-arm/dec21285.h b/include/asm-arm/dec21285.h
new file mode 100644
index 000000000..0facd0b7c
--- /dev/null
+++ b/include/asm-arm/dec21285.h
@@ -0,0 +1,94 @@
+/*
+ * include/asm-arm/dec21285.h
+ *
+ * Copyright (C) 1998 Russell King
+ *
+ * DC21285 registers
+ */
+#define DC21285_PCI_IACK 0x79000000
+#define DC21285_ARMCSR_BASE 0x42000000
+#define DC21285_PCI_TYPE_0_CONFIG 0x7b000000
+#define DC21285_PCI_TYPE_1_CONFIG 0x7a000000
+#define DC21285_OUTBOUND_WRITE_FLUSH 0x78000000
+#define DC21285_FLASH 0x41000000
+#define DC21285_PCI_IO 0x7c000000
+#define DC21285_PCI_MEM 0x80000000
+
+#ifndef __ASSEMBLY__
+#define DC21285_IO(x) ((volatile unsigned long *)(0xfe000000+(x)))
+#else
+#define DC21285_IO(x) (x)
+#endif
+
+#define CSR_PCICMD DC21285_IO(0x0004)
+#define CSR_PCICACHELINESIZE DC21285_IO(0x000c)
+#define CSR_PCICSRBASE DC21285_IO(0x0010)
+#define CSR_PCICSRIOBASE DC21285_IO(0x0014)
+#define CSR_PCISDRAMBASE DC21285_IO(0x0018)
+#define CSR_PCIROMBASE DC21285_IO(0x0030)
+#define CSR_CSRBASEMASK DC21285_IO(0x00f8)
+#define CSR_CSRBASEOFFSET DC21285_IO(0x00fc)
+#define CSR_SDRAMBASEMASK DC21285_IO(0x0100)
+#define CSR_SDRAMBASEOFFSET DC21285_IO(0x0104)
+#define CSR_ROMBASEMASK DC21285_IO(0x0108)
+#define CSR_SDRAMTIMING DC21285_IO(0x010c)
+#define CSR_SDRAMADDRSIZE0 DC21285_IO(0x0110)
+#define CSR_SDRAMADDRSIZE1 DC21285_IO(0x0114)
+#define CSR_SDRAMADDRSIZE2 DC21285_IO(0x0118)
+#define CSR_SDRAMADDRSIZE3 DC21285_IO(0x011c)
+#define CSR_I2O_INFREEHEAD DC21285_IO(0x0120)
+#define CSR_I2O_INPOSTTAIL DC21285_IO(0x0124)
+#define CSR_I2O_OUTPOSTHEAD DC21285_IO(0x0128)
+#define CSR_I2O_OUTFREETAIL DC21285_IO(0x012c)
+#define CSR_I2O_INFREECOUNT DC21285_IO(0x0130)
+#define CSR_I2O_OUTPOSTCOUNT DC21285_IO(0x0134)
+#define CSR_I2O_INPOSTCOUNT DC21285_IO(0x0138)
+#define CSR_SA110_CNTL DC21285_IO(0x013c)
+#define CSR_PCIADDR_EXTN DC21285_IO(0x0140)
+#define CSR_PREFETCHMEMRANGE DC21285_IO(0x0144)
+#define CSR_XBUS_CYCLE DC21285_IO(0x0148)
+#define CSR_XBUS_IOSTROBE DC21285_IO(0x014c)
+#define CSR_DOORBELL_PCI DC21285_IO(0x0150)
+#define CSR_DOORBELL_SA110 DC21285_IO(0x0154)
+#define CSR_UARTDR DC21285_IO(0x0160)
+#define CSR_RXSTAT DC21285_IO(0x0164)
+#define CSR_H_UBRLCR DC21285_IO(0x0168)
+#define CSR_M_UBRLCR DC21285_IO(0x016c)
+#define CSR_L_UBRLCR DC21285_IO(0x0170)
+#define CSR_UARTCON DC21285_IO(0x0174)
+#define CSR_UARTFLG DC21285_IO(0x0178)
+#define CSR_IRQ_STATUS DC21285_IO(0x0180)
+#define CSR_IRQ_RAWSTATUS DC21285_IO(0x0184)
+#define CSR_IRQ_ENABLE DC21285_IO(0x0188)
+#define CSR_IRQ_DISABLE DC21285_IO(0x018c)
+#define CSR_IRQ_SOFT DC21285_IO(0x0190)
+#define CSR_FIQ_STATUS DC21285_IO(0x0280)
+#define CSR_FIQ_RAWSTATUS DC21285_IO(0x0284)
+#define CSR_FIQ_ENABLE DC21285_IO(0x0288)
+#define CSR_FIQ_DISABLE DC21285_IO(0x028c)
+#define CSR_FIQ_SOFT DC21285_IO(0x0290)
+#define CSR_TIMER1_LOAD DC21285_IO(0x0300)
+#define CSR_TIMER1_VALUE DC21285_IO(0x0304)
+#define CSR_TIMER1_CNTL DC21285_IO(0x0308)
+#define CSR_TIMER1_CLR DC21285_IO(0x030c)
+#define CSR_TIMER2_LOAD DC21285_IO(0x0320)
+#define CSR_TIMER2_VALUE DC21285_IO(0x0324)
+#define CSR_TIMER2_CNTL DC21285_IO(0x0328)
+#define CSR_TIMER2_CLR DC21285_IO(0x032c)
+#define CSR_TIMER3_LOAD DC21285_IO(0x0340)
+#define CSR_TIMER3_VALUE DC21285_IO(0x0344)
+#define CSR_TIMER3_CNTL DC21285_IO(0x0348)
+#define CSR_TIMER3_CLR DC21285_IO(0x034c)
+#define CSR_TIMER4_LOAD DC21285_IO(0x0360)
+#define CSR_TIMER4_VALUE DC21285_IO(0x0364)
+#define CSR_TIMER4_CNTL DC21285_IO(0x0368)
+#define CSR_TIMER4_CLR DC21285_IO(0x036c)
+
+#define TIMER_CNTL_ENABLE (1 << 7)
+#define TIMER_CNTL_AUTORELOAD (1 << 6)
+#define TIMER_CNTL_DIV1 (0)
+#define TIMER_CNTL_DIV16 (1 << 2)
+#define TIMER_CNTL_DIV256 (2 << 2)
+#define TIMER_CNTL_CNTEXT (3 << 2)
+
+
diff --git a/include/asm-arm/dma.h b/include/asm-arm/dma.h
index d8b9f1d3a..9fb7a0242 100644
--- a/include/asm-arm/dma.h
+++ b/include/asm-arm/dma.h
@@ -3,9 +3,24 @@
typedef unsigned int dmach_t;
+#include <linux/config.h>
+#include <linux/kernel.h>
#include <asm/irq.h>
+#include <asm/system.h>
+#include <asm/spinlock.h>
#include <asm/arch/dma.h>
+/*
+ * DMA modes - we have two, IN and OUT
+ */
+typedef unsigned int dmamode_t;
+
+#define DMA_MODE_MASK 1
+
+#define DMA_MODE_READ 0
+#define DMA_MODE_WRITE 1
+#define DMA_AUTOINIT 2
+
typedef struct {
unsigned long address;
unsigned long length;
@@ -13,6 +28,20 @@ typedef struct {
extern const char dma_str[];
+extern spinlock_t dma_spin_lock;
+
+extern __inline__ unsigned long claim_dma_lock(void)
+{
+ unsigned long flags;
+ spin_lock_irqsave(&dma_spin_lock, flags);
+ return flags;
+}
+
+extern __inline__ void release_dma_lock(unsigned long flags)
+{
+ spin_unlock_irqrestore(&dma_spin_lock, flags);
+}
+
/* Clear the 'DMA Pointer Flip Flop'.
* Write 0 for LSB/MSB, 1 for MSB/LSB access.
*
@@ -26,7 +55,7 @@ extern const char dma_str[];
* NOTE: This is an architecture specific function, and should
* be hidden from the drivers
*/
-static __inline__ void set_dma_page(dmach_t channel, char pagenr)
+extern __inline__ void set_dma_page(dmach_t channel, char pagenr)
{
printk(dma_str, "set_dma_page", channel);
}
@@ -102,4 +131,10 @@ extern int get_dma_residue(dmach_t channel);
#define NO_DMA 255
#endif
+#ifdef CONFIG_PCI_QUIRKS
+extern int isa_dma_bridge_buggy;
+#else
+#define isa_dma_bridge_buggy (0)
+#endif
+
#endif /* _ARM_DMA_H */
diff --git a/include/asm-arm/ecard.h b/include/asm-arm/ecard.h
index afc4acc14..0f60505f9 100644
--- a/include/asm-arm/ecard.h
+++ b/include/asm-arm/ecard.h
@@ -31,6 +31,9 @@
#define MANU_ATOMWIDE 0x0017
#define PROD_ATOMWIDE_3PSERIAL 0x0090
+#define MANU_IRLAM_INSTRUMENTS 0x001f
+#define MANU_IRLAM_INSTRUMENTS_ETHERN 0x5678
+
#define MANU_OAK 0x0021
#define PROD_OAK_SCSI 0x0058
@@ -75,51 +78,48 @@
#define MAX_ECARDS 8
-/* Type of card's address space */
-typedef enum {
+typedef enum { /* Cards address space */
ECARD_IOC,
ECARD_MEMC,
- ECARD_DEBI
+ ECARD_EASI
} card_type_t;
-/* Speed of card for ECARD_IOC address space */
-typedef enum {
+typedef enum { /* Speed for ECARD_IOC space */
ECARD_SLOW = 0,
ECARD_MEDIUM = 1,
ECARD_FAST = 2,
ECARD_SYNC = 3
} card_speed_t;
-/* Card ID structure */
-typedef struct {
+typedef struct { /* Card ID structure */
unsigned short manufacturer;
unsigned short product;
} card_ids;
-/* External view of card ID information */
-struct in_ecld {
- unsigned short product;
- unsigned short manufacturer;
- unsigned char ecld;
- unsigned char country;
- unsigned char fiqmask;
- unsigned char irqmask;
- unsigned long fiqaddr;
- unsigned long irqaddr;
+struct in_ecid { /* Packed card ID information */
+ unsigned short product; /* Product code */
+ unsigned short manufacturer; /* Manufacturer code */
+ unsigned char id:4; /* Simple ID */
+ unsigned char cd:1; /* Chunk dir present */
+ unsigned char is:1; /* Interrupt status pointers */
+ unsigned char w:2; /* Width */
+ unsigned char country; /* Country */
+ unsigned char irqmask; /* IRQ mask */
+ unsigned char fiqmask; /* FIQ mask */
+ unsigned long irqoff; /* IRQ offset */
+ unsigned long fiqoff; /* FIQ offset */
};
typedef struct expansion_card ecard_t;
+typedef unsigned long *loader_t;
-/* Card handler routines */
-typedef struct {
+typedef struct { /* Card handler routines */
void (*irqenable)(ecard_t *ec, int irqnr);
void (*irqdisable)(ecard_t *ec, int irqnr);
void (*fiqenable)(ecard_t *ec, int fiqnr);
void (*fiqdisable)(ecard_t *ec, int fiqnr);
} expansioncard_ops_t;
-typedef unsigned long *loader_t;
-
/*
* This contains all the info needed on an expansion card
*/
@@ -131,17 +131,19 @@ struct expansion_card {
unsigned char fiqmask; /* FIQ mask */
unsigned char claimed; /* Card claimed? */
+ void *irq_data; /* Data for use for IRQ by card */
+ void *fiq_data; /* Data for use for FIQ by card */
+ expansioncard_ops_t *ops; /* Enable/Disable Ops for card */
+
CONST unsigned char slot_no; /* Slot number */
CONST unsigned char dma; /* DMA number (for request_dma) */
CONST unsigned char irq; /* IRQ number (for request_irq) */
CONST unsigned char fiq; /* FIQ number (for request_irq) */
-
- CONST struct in_ecld cld; /* Card Identification */
- void *irq_data; /* Data for use for IRQ by card */
- void *fiq_data; /* Data for use for FIQ by card */
- expansioncard_ops_t *ops; /* Enable/Disable Ops for card */
+ CONST card_type_t type; /* Type of card */
+ CONST struct in_ecid cid; /* Card Identification */
/* Private internal data */
+ const char *card_desc; /* Card description */
CONST unsigned int podaddr; /* Base Linux address for card */
CONST loader_t loader; /* loader program */
};
@@ -170,9 +172,9 @@ struct in_chunk_dir {
extern void ecard_startfind (void);
/*
- * Find an expansion card with the correct cld, product and manufacturer code
+ * Find an expansion card with the correct cid, product and manufacturer code
*/
-extern struct expansion_card *ecard_find (int cld, const card_ids *ids);
+extern struct expansion_card *ecard_find (int cid, const card_ids *ids);
/*
* Read a chunk from an expansion card
@@ -193,25 +195,31 @@ extern unsigned int ecard_address (struct expansion_card *ec, card_type_t card_t
*
* External expansion card header as read from the card
*/
-struct ex_ecld {
- unsigned char r_ecld;
- unsigned char r_reserved[2];
- unsigned char r_product[2];
- unsigned char r_manufacturer[2];
- unsigned char r_country;
- long r_fiqs;
- long r_irqs;
-#define e_ecld(x) ((x)->r_ecld)
-#define e_cd(x) ((x)->r_reserved[0] & 1)
-#define e_is(x) ((x)->r_reserved[0] & 2)
-#define e_w(x) (((x)->r_reserved[0] & 12)>>2)
-#define e_prod(x) ((x)->r_product[0]|((x)->r_product[1]<<8))
-#define e_manu(x) ((x)->r_manufacturer[0]|((x)->r_manufacturer[1]<<8))
-#define e_country(x) ((x)->r_country)
-#define e_fiqmask(x) ((x)->r_fiqs & 0xff)
-#define e_fiqaddr(x) ((x)->r_fiqs >> 8)
-#define e_irqmask(x) ((x)->r_irqs & 0xff)
-#define e_irqaddr(x) ((x)->r_irqs >> 8)
+struct ex_ecid {
+ unsigned char r_irq:1;
+ unsigned char r_zero:1;
+ unsigned char r_fiq:1;
+ unsigned char r_id:4;
+ unsigned char r_a:1;
+
+ unsigned char r_cd:1;
+ unsigned char r_is:1;
+ unsigned char r_w:2;
+ unsigned char r_r1:4;
+
+ unsigned char r_r2:8;
+
+ unsigned char r_prod[2];
+
+ unsigned char r_manu[2];
+
+ unsigned char r_country;
+
+ unsigned char r_irqmask;
+ unsigned char r_irqoff[3];
+
+ unsigned char r_fiqmask;
+ unsigned char r_fiqoff[3];
};
/*
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h
index c99a67292..8b0980053 100644
--- a/include/asm-arm/elf.h
+++ b/include/asm-arm/elf.h
@@ -6,6 +6,7 @@
*/
#include <asm/ptrace.h>
+#include <asm/proc/elf.h>
#include <asm/procinfo.h>
typedef unsigned long elf_greg_t;
@@ -20,7 +21,7 @@ typedef struct { void *null; } elf_fpregset_t;
/*
* This is used to ensure we don't load something for the wrong architecture.
*/
-#define elf_check_arch(x) ( ((x) == EM_ARM) )
+#define elf_check_arch(x) ( ((x)->e_machine == EM_ARM) && (ELF_PROC_OK((x))) )
/*
* These are used to set parameters in the core dumps.
@@ -30,7 +31,6 @@ typedef struct { void *null; } elf_fpregset_t;
#define ELF_ARCH EM_ARM
#define USE_ELF_CORE_DUMP
-#define ELF_EXEC_PAGESIZE 4096
/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
use of this is to invoke "./ld.so someprog" to test out a new version of
@@ -65,9 +65,4 @@ typedef struct { void *null; } elf_fpregset_t;
extern char elf_platform[];
#define ELF_PLATFORM (elf_platform)
-#ifdef __KERNEL__
-#define SET_PERSONALITY(ex,ibcs2) \
- current->personality = PER_LINUX_32BIT
-#endif
-
#endif
diff --git a/include/asm-arm/hardware.h b/include/asm-arm/hardware.h
index c21abeed3..cd4528235 100644
--- a/include/asm-arm/hardware.h
+++ b/include/asm-arm/hardware.h
@@ -11,257 +11,8 @@
#include <asm/arch/hardware.h>
-/*
- * Use these macros to read/write the IOC. All it does is perform the actual
- * read/write.
- */
-#ifdef HAS_IOC
-#ifndef __ASSEMBLER__
-#define __IOC(offset) (IOC_BASE + (offset >> 2))
-#else
-#define __IOC(offset) offset
-#endif
-
-#define IOC_CONTROL __IOC(0x00)
-#define IOC_KARTTX __IOC(0x04)
-#define IOC_KARTRX __IOC(0x04)
-
-#define IOC_IRQSTATA __IOC(0x10)
-#define IOC_IRQREQA __IOC(0x14)
-#define IOC_IRQCLRA __IOC(0x14)
-#define IOC_IRQMASKA __IOC(0x18)
-
-#define IOC_IRQSTATB __IOC(0x20)
-#define IOC_IRQREQB __IOC(0x24)
-#define IOC_IRQMASKB __IOC(0x28)
-
-#define IOC_FIQSTAT __IOC(0x30)
-#define IOC_FIQREQ __IOC(0x34)
-#define IOC_FIQMASK __IOC(0x38)
-
-#define IOC_T0CNTL __IOC(0x40)
-#define IOC_T0LTCHL __IOC(0x40)
-#define IOC_T0CNTH __IOC(0x44)
-#define IOC_T0LTCHH __IOC(0x44)
-#define IOC_T0GO __IOC(0x48)
-#define IOC_T0LATCH __IOC(0x4c)
-
-#define IOC_T1CNTL __IOC(0x50)
-#define IOC_T1LTCHL __IOC(0x50)
-#define IOC_T1CNTH __IOC(0x54)
-#define IOC_T1LTCHH __IOC(0x54)
-#define IOC_T1GO __IOC(0x58)
-#define IOC_T1LATCH __IOC(0x5c)
-
-#define IOC_T2CNTL __IOC(0x60)
-#define IOC_T2LTCHL __IOC(0x60)
-#define IOC_T2CNTH __IOC(0x64)
-#define IOC_T2LTCHH __IOC(0x64)
-#define IOC_T2GO __IOC(0x68)
-#define IOC_T2LATCH __IOC(0x6c)
-
-#define IOC_T3CNTL __IOC(0x70)
-#define IOC_T3LTCHL __IOC(0x70)
-#define IOC_T3CNTH __IOC(0x74)
-#define IOC_T3LTCHH __IOC(0x74)
-#define IOC_T3GO __IOC(0x78)
-#define IOC_T3LATCH __IOC(0x7c)
-#endif
-
-#ifdef HAS_MEMC
-#define VDMA_ALIGNMENT PAGE_SIZE
-#define VDMA_XFERSIZE 16
-#define VDMA_INIT 0
-#define VDMA_START 1
-#define VDMA_END 2
-
-#define video_set_dma(start,end,offset) \
-do { \
- memc_write (VDMA_START, (start >> 2)); \
- memc_write (VDMA_END, (end - VDMA_XFERSIZE) >> 2); \
- memc_write (VDMA_INIT, (offset >> 2)); \
-} while (0)
-#endif
-
-#ifdef HAS_IOMD
-#ifndef __ASSEMBLER__
-#define __IOMD(offset) (IOMD_BASE + (offset >> 2))
-#else
-#define __IOMD(offset) offset
-#endif
-
-#define IOMD_CONTROL __IOMD(0x000)
-#define IOMD_KARTTX __IOMD(0x004)
-#define IOMD_KARTRX __IOMD(0x004)
-#define IOMD_KCTRL __IOMD(0x008)
-
-#define IOMD_IRQSTATA __IOMD(0x010)
-#define IOMD_IRQREQA __IOMD(0x014)
-#define IOMD_IRQCLRA __IOMD(0x014)
-#define IOMD_IRQMASKA __IOMD(0x018)
-
-#define IOMD_IRQSTATB __IOMD(0x020)
-#define IOMD_IRQREQB __IOMD(0x024)
-#define IOMD_IRQMASKB __IOMD(0x028)
-
-#define IOMD_FIQSTAT __IOMD(0x030)
-#define IOMD_FIQREQ __IOMD(0x034)
-#define IOMD_FIQMASK __IOMD(0x038)
-
-#define IOMD_T0CNTL __IOMD(0x040)
-#define IOMD_T0LTCHL __IOMD(0x040)
-#define IOMD_T0CNTH __IOMD(0x044)
-#define IOMD_T0LTCHH __IOMD(0x044)
-#define IOMD_T0GO __IOMD(0x048)
-#define IOMD_T0LATCH __IOMD(0x04c)
-
-#define IOMD_T1CNTL __IOMD(0x050)
-#define IOMD_T1LTCHL __IOMD(0x050)
-#define IOMD_T1CNTH __IOMD(0x054)
-#define IOMD_T1LTCHH __IOMD(0x054)
-#define IOMD_T1GO __IOMD(0x058)
-#define IOMD_T1LATCH __IOMD(0x05c)
-
-#define IOMD_ROMCR0 __IOMD(0x080)
-#define IOMD_ROMCR1 __IOMD(0x084)
-#define IOMD_DRAMCR __IOMD(0x088)
-#define IOMD_VREFCR __IOMD(0x08C)
-
-#define IOMD_FSIZE __IOMD(0x090)
-#define IOMD_ID0 __IOMD(0x094)
-#define IOMD_ID1 __IOMD(0x098)
-#define IOMD_VERSION __IOMD(0x09C)
-
-#define IOMD_MOUSEX __IOMD(0x0A0)
-#define IOMD_MOUSEY __IOMD(0x0A4)
-
-#define IOMD_DMATCR __IOMD(0x0C0)
-#define IOMD_IOTCR __IOMD(0x0C4)
-#define IOMD_ECTCR __IOMD(0x0C8)
-#define IOMD_DMAEXT __IOMD(0x0CC)
-
-#define DMA_EXT_IO0 1
-#define DMA_EXT_IO1 2
-#define DMA_EXT_IO2 4
-#define DMA_EXT_IO3 8
-
-#define IOMD_IO0CURA __IOMD(0x100)
-#define IOMD_IO0ENDA __IOMD(0x104)
-#define IOMD_IO0CURB __IOMD(0x108)
-#define IOMD_IO0ENDB __IOMD(0x10C)
-#define IOMD_IO0CR __IOMD(0x110)
-#define IOMD_IO0ST __IOMD(0x114)
-
-#define IOMD_IO1CURA __IOMD(0x120)
-#define IOMD_IO1ENDA __IOMD(0x124)
-#define IOMD_IO1CURB __IOMD(0x128)
-#define IOMD_IO1ENDB __IOMD(0x12C)
-#define IOMD_IO1CR __IOMD(0x130)
-#define IOMD_IO1ST __IOMD(0x134)
-
-#define IOMD_IO2CURA __IOMD(0x140)
-#define IOMD_IO2ENDA __IOMD(0x144)
-#define IOMD_IO2CURB __IOMD(0x148)
-#define IOMD_IO2ENDB __IOMD(0x14C)
-#define IOMD_IO2CR __IOMD(0x150)
-#define IOMD_IO2ST __IOMD(0x154)
-
-#define IOMD_IO3CURA __IOMD(0x160)
-#define IOMD_IO3ENDA __IOMD(0x164)
-#define IOMD_IO3CURB __IOMD(0x168)
-#define IOMD_IO3ENDB __IOMD(0x16C)
-#define IOMD_IO3CR __IOMD(0x170)
-#define IOMD_IO3ST __IOMD(0x174)
-
-#define IOMD_SD0CURA __IOMD(0x180)
-#define IOMD_SD0ENDA __IOMD(0x184)
-#define IOMD_SD0CURB __IOMD(0x188)
-#define IOMD_SD0ENDB __IOMD(0x18C)
-#define IOMD_SD0CR __IOMD(0x190)
-#define IOMD_SD0ST __IOMD(0x194)
-
-#define IOMD_SD1CURA __IOMD(0x1A0)
-#define IOMD_SD1ENDA __IOMD(0x1A4)
-#define IOMD_SD1CURB __IOMD(0x1A8)
-#define IOMD_SD1ENDB __IOMD(0x1AC)
-#define IOMD_SD1CR __IOMD(0x1B0)
-#define IOMD_SD1ST __IOMD(0x1B4)
-
-#define IOMD_CURSCUR __IOMD(0x1C0)
-#define IOMD_CURSINIT __IOMD(0x1C4)
-
-#define IOMD_VIDCUR __IOMD(0x1D0)
-#define IOMD_VIDEND __IOMD(0x1D4)
-#define IOMD_VIDSTART __IOMD(0x1D8)
-#define IOMD_VIDINIT __IOMD(0x1DC)
-#define IOMD_VIDCR __IOMD(0x1E0)
-
-#define IOMD_DMASTAT __IOMD(0x1F0)
-#define IOMD_DMAREQ __IOMD(0x1F4)
-#define IOMD_DMAMASK __IOMD(0x1F8)
-
-#define DMA_END_S (1 << 31)
-#define DMA_END_L (1 << 30)
-
-#define DMA_CR_C 0x80
-#define DMA_CR_D 0x40
-#define DMA_CR_E 0x20
-
-#define DMA_ST_OFL 4
-#define DMA_ST_INT 2
-#define DMA_ST_AB 1
-/*
- * IOC compatability
- */
-#define IOC_CONTROL IOMD_CONTROL
-#define IOC_IRQSTATA IOMD_IRQSTATA
-#define IOC_IRQREQA IOMD_IRQREQA
-#define IOC_IRQCLRA IOMD_IRQCLRA
-#define IOC_IRQMASKA IOMD_IRQMASKA
-
-#define IOC_IRQSTATB IOMD_IRQSTATB
-#define IOC_IRQREQB IOMD_IRQREQB
-#define IOC_IRQMASKB IOMD_IRQMASKB
-
-#define IOC_FIQSTAT IOMD_FIQSTAT
-#define IOC_FIQREQ IOMD_FIQREQ
-#define IOC_FIQMASK IOMD_FIQMASK
-
-#define IOC_T0CNTL IOMD_T0CNTL
-#define IOC_T0LTCHL IOMD_T0LTCHL
-#define IOC_T0CNTH IOMD_T0CNTH
-#define IOC_T0LTCHH IOMD_T0LTCHH
-#define IOC_T0GO IOMD_T0GO
-#define IOC_T0LATCH IOMD_T0LATCH
-
-#define IOC_T1CNTL IOMD_T1CNTL
-#define IOC_T1LTCHL IOMD_T1LTCHL
-#define IOC_T1CNTH IOMD_T1CNTH
-#define IOC_T1LTCHH IOMD_T1LTCHH
-#define IOC_T1GO IOMD_T1GO
-#define IOC_T1LATCH IOMD_T1LATCH
-
-/*
- * DMA (MEMC) compatability
- */
-#define HALF_SAM vram_half_sam
-#define VDMA_ALIGNMENT (HALF_SAM * 2)
-#define VDMA_XFERSIZE (HALF_SAM)
-#define VDMA_INIT IOMD_VIDINIT
-#define VDMA_START IOMD_VIDSTART
-#define VDMA_END IOMD_VIDEND
-
-#ifndef __ASSEMBLER__
-extern unsigned int vram_half_sam;
-#define video_set_dma(start,end,offset) \
-do { \
- outl (SCREEN_START + start, VDMA_START); \
- outl (SCREEN_START + end - VDMA_XFERSIZE, VDMA_END); \
- if (offset >= end - VDMA_XFERSIZE) \
- offset |= 0x40000000; \
- outl (SCREEN_START + offset, VDMA_INIT); \
-} while (0)
-#endif
+#ifndef FLUSH_BASE
+#define FLUSH_BASE 0xdf000000
#endif
#ifdef HAS_EXPMASK
diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h
index 2ead7b36a..76da8806b 100644
--- a/include/asm-arm/ide.h
+++ b/include/asm-arm/ide.h
@@ -13,8 +13,6 @@
#ifdef __KERNEL__
-typedef unsigned long ide_ioreg_t;
-
#ifndef MAX_HWIFS
#define MAX_HWIFS 4
#endif
@@ -34,51 +32,19 @@ typedef union {
} b;
} select_t;
-static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
- unsigned long flags, const char *device, void *dev_id)
-{
- return request_irq(irq, handler, flags, device, dev_id);
-}
-
-static __inline__ void ide_free_irq(unsigned int irq, void *dev_id)
-{
- free_irq(irq, dev_id);
-}
-
-static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent)
-{
- return check_region(from, extent);
-}
-
-static __inline__ void ide_request_region (ide_ioreg_t from, unsigned int extent, const char *name)
-{
- request_region(from, extent, name);
-}
-
-static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent)
-{
- release_region(from, extent);
-}
+#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
+#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
+#define ide_check_region(from,extent) check_region((from), (extent))
+#define ide_request_region(from,extent,name) request_region((from), (extent), (name))
+#define ide_release_region(from,extent) release_region((from), (extent))
/*
* The following are not needed for the non-m68k ports
*/
-static __inline__ int ide_ack_intr (ide_ioreg_t status_port, ide_ioreg_t irq_port)
-{
- return(1);
-}
-
-static __inline__ void ide_fix_driveid(struct hd_driveid *id)
-{
-}
-
-static __inline__ void ide_release_lock (int *ide_lock)
-{
-}
-
-static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *, struct pt_regs *), void *data)
-{
-}
+#define ide_ack_intr(hwif) (1)
+#define ide_fix_driveid(id) do {} while (0)
+#define ide_release_lock(lock) do {} while (0)
+#define ide_get_lock(lock, hdlr, data) do {} while (0)
#endif /* __KERNEL__ */
diff --git a/include/asm-arm/init.h b/include/asm-arm/init.h
index 6105bbe88..c0aa97f7f 100644
--- a/include/asm-arm/init.h
+++ b/include/asm-arm/init.h
@@ -5,7 +5,7 @@
/* C routines */
-#ifdef CONFIG_BINUTILS_NEW
+#ifdef CONFIG_TEXT_INIT_SECTION
#define __init __attribute__ ((__section__ (".text.init")))
#define __initfunc(__arginit) \
@@ -26,4 +26,7 @@
#define __INITDATA .section ".data.init",@alloc,@write
#define __FINIT .previous
+#define __cacheline_aligned __attribute__ \
+ ((__aligned__ (L1_CACHE_BYTES)))
+
#endif
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index 10b20184a..e87744b71 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -31,7 +31,7 @@
* to an address that the kernel can use.
*/
#define virt_to_bus(x) (__virt_to_bus((unsigned long)(x)))
-#define bus_to_virt(x) ((void *)(__bus_to_virt(x)))
+#define bus_to_virt(x) ((void *)(__bus_to_virt((unsigned long)(x))))
/*
* These macros actually build the multi-value IO function prototypes
@@ -173,6 +173,8 @@ __IO(l,"",long)
#ifdef __KERNEL__
+extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
+
/*
* String version of IO memory access ops:
*/
diff --git a/include/asm-arm/ioc.h b/include/asm-arm/ioc.h
new file mode 100644
index 000000000..2b3d6062a
--- /dev/null
+++ b/include/asm-arm/ioc.h
@@ -0,0 +1,56 @@
+/*
+ * Use these macros to read/write the IOC. All it does is perform the actual
+ * read/write.
+ */
+
+#ifndef __ASSEMBLER__
+#define __IOC(offset) (IOC_BASE + (offset >> 2))
+#else
+#define __IOC(offset) offset
+#endif
+
+#define IOC_CONTROL __IOC(0x00)
+#define IOC_KARTTX __IOC(0x04)
+#define IOC_KARTRX __IOC(0x04)
+
+#define IOC_IRQSTATA __IOC(0x10)
+#define IOC_IRQREQA __IOC(0x14)
+#define IOC_IRQCLRA __IOC(0x14)
+#define IOC_IRQMASKA __IOC(0x18)
+
+#define IOC_IRQSTATB __IOC(0x20)
+#define IOC_IRQREQB __IOC(0x24)
+#define IOC_IRQMASKB __IOC(0x28)
+
+#define IOC_FIQSTAT __IOC(0x30)
+#define IOC_FIQREQ __IOC(0x34)
+#define IOC_FIQMASK __IOC(0x38)
+
+#define IOC_T0CNTL __IOC(0x40)
+#define IOC_T0LTCHL __IOC(0x40)
+#define IOC_T0CNTH __IOC(0x44)
+#define IOC_T0LTCHH __IOC(0x44)
+#define IOC_T0GO __IOC(0x48)
+#define IOC_T0LATCH __IOC(0x4c)
+
+#define IOC_T1CNTL __IOC(0x50)
+#define IOC_T1LTCHL __IOC(0x50)
+#define IOC_T1CNTH __IOC(0x54)
+#define IOC_T1LTCHH __IOC(0x54)
+#define IOC_T1GO __IOC(0x58)
+#define IOC_T1LATCH __IOC(0x5c)
+
+#define IOC_T2CNTL __IOC(0x60)
+#define IOC_T2LTCHL __IOC(0x60)
+#define IOC_T2CNTH __IOC(0x64)
+#define IOC_T2LTCHH __IOC(0x64)
+#define IOC_T2GO __IOC(0x68)
+#define IOC_T2LATCH __IOC(0x6c)
+
+#define IOC_T3CNTL __IOC(0x70)
+#define IOC_T3LTCHL __IOC(0x70)
+#define IOC_T3CNTH __IOC(0x74)
+#define IOC_T3LTCHH __IOC(0x74)
+#define IOC_T3GO __IOC(0x78)
+#define IOC_T3LATCH __IOC(0x7c)
+
diff --git a/include/asm-arm/iomd.h b/include/asm-arm/iomd.h
new file mode 100644
index 000000000..375c6fdf1
--- /dev/null
+++ b/include/asm-arm/iomd.h
@@ -0,0 +1,180 @@
+
+#ifndef __ASSEMBLER__
+#define __IOMD(offset) (IO_IOMD_BASE + (offset >> 2))
+#else
+#define __IOMD(offset) offset
+#endif
+
+#define IOMD_CONTROL __IOMD(0x000)
+#define IOMD_KARTTX __IOMD(0x004)
+#define IOMD_KARTRX __IOMD(0x004)
+#define IOMD_KCTRL __IOMD(0x008)
+
+#define IOMD_IRQSTATA __IOMD(0x010)
+#define IOMD_IRQREQA __IOMD(0x014)
+#define IOMD_IRQCLRA __IOMD(0x014)
+#define IOMD_IRQMASKA __IOMD(0x018)
+
+#define IOMD_IRQSTATB __IOMD(0x020)
+#define IOMD_IRQREQB __IOMD(0x024)
+#define IOMD_IRQMASKB __IOMD(0x028)
+
+#define IOMD_FIQSTAT __IOMD(0x030)
+#define IOMD_FIQREQ __IOMD(0x034)
+#define IOMD_FIQMASK __IOMD(0x038)
+
+#define IOMD_T0CNTL __IOMD(0x040)
+#define IOMD_T0LTCHL __IOMD(0x040)
+#define IOMD_T0CNTH __IOMD(0x044)
+#define IOMD_T0LTCHH __IOMD(0x044)
+#define IOMD_T0GO __IOMD(0x048)
+#define IOMD_T0LATCH __IOMD(0x04c)
+
+#define IOMD_T1CNTL __IOMD(0x050)
+#define IOMD_T1LTCHL __IOMD(0x050)
+#define IOMD_T1CNTH __IOMD(0x054)
+#define IOMD_T1LTCHH __IOMD(0x054)
+#define IOMD_T1GO __IOMD(0x058)
+#define IOMD_T1LATCH __IOMD(0x05c)
+
+#define IOMD_ROMCR0 __IOMD(0x080)
+#define IOMD_ROMCR1 __IOMD(0x084)
+#define IOMD_DRAMCR __IOMD(0x088)
+#define IOMD_VREFCR __IOMD(0x08C)
+
+#define IOMD_FSIZE __IOMD(0x090)
+#define IOMD_ID0 __IOMD(0x094)
+#define IOMD_ID1 __IOMD(0x098)
+#define IOMD_VERSION __IOMD(0x09C)
+
+#define IOMD_MOUSEX __IOMD(0x0A0)
+#define IOMD_MOUSEY __IOMD(0x0A4)
+
+#define IOMD_DMATCR __IOMD(0x0C0)
+#define IOMD_IOTCR __IOMD(0x0C4)
+#define IOMD_ECTCR __IOMD(0x0C8)
+#define IOMD_DMAEXT __IOMD(0x0CC)
+
+#define DMA_EXT_IO0 1
+#define DMA_EXT_IO1 2
+#define DMA_EXT_IO2 4
+#define DMA_EXT_IO3 8
+
+#define IOMD_IO0CURA __IOMD(0x100)
+#define IOMD_IO0ENDA __IOMD(0x104)
+#define IOMD_IO0CURB __IOMD(0x108)
+#define IOMD_IO0ENDB __IOMD(0x10C)
+#define IOMD_IO0CR __IOMD(0x110)
+#define IOMD_IO0ST __IOMD(0x114)
+
+#define IOMD_IO1CURA __IOMD(0x120)
+#define IOMD_IO1ENDA __IOMD(0x124)
+#define IOMD_IO1CURB __IOMD(0x128)
+#define IOMD_IO1ENDB __IOMD(0x12C)
+#define IOMD_IO1CR __IOMD(0x130)
+#define IOMD_IO1ST __IOMD(0x134)
+
+#define IOMD_IO2CURA __IOMD(0x140)
+#define IOMD_IO2ENDA __IOMD(0x144)
+#define IOMD_IO2CURB __IOMD(0x148)
+#define IOMD_IO2ENDB __IOMD(0x14C)
+#define IOMD_IO2CR __IOMD(0x150)
+#define IOMD_IO2ST __IOMD(0x154)
+
+#define IOMD_IO3CURA __IOMD(0x160)
+#define IOMD_IO3ENDA __IOMD(0x164)
+#define IOMD_IO3CURB __IOMD(0x168)
+#define IOMD_IO3ENDB __IOMD(0x16C)
+#define IOMD_IO3CR __IOMD(0x170)
+#define IOMD_IO3ST __IOMD(0x174)
+
+#define IOMD_SD0CURA __IOMD(0x180)
+#define IOMD_SD0ENDA __IOMD(0x184)
+#define IOMD_SD0CURB __IOMD(0x188)
+#define IOMD_SD0ENDB __IOMD(0x18C)
+#define IOMD_SD0CR __IOMD(0x190)
+#define IOMD_SD0ST __IOMD(0x194)
+
+#define IOMD_SD1CURA __IOMD(0x1A0)
+#define IOMD_SD1ENDA __IOMD(0x1A4)
+#define IOMD_SD1CURB __IOMD(0x1A8)
+#define IOMD_SD1ENDB __IOMD(0x1AC)
+#define IOMD_SD1CR __IOMD(0x1B0)
+#define IOMD_SD1ST __IOMD(0x1B4)
+
+#define IOMD_CURSCUR __IOMD(0x1C0)
+#define IOMD_CURSINIT __IOMD(0x1C4)
+
+#define IOMD_VIDCUR __IOMD(0x1D0)
+#define IOMD_VIDEND __IOMD(0x1D4)
+#define IOMD_VIDSTART __IOMD(0x1D8)
+#define IOMD_VIDINIT __IOMD(0x1DC)
+#define IOMD_VIDCR __IOMD(0x1E0)
+
+#define IOMD_DMASTAT __IOMD(0x1F0)
+#define IOMD_DMAREQ __IOMD(0x1F4)
+#define IOMD_DMAMASK __IOMD(0x1F8)
+
+#define DMA_END_S (1 << 31)
+#define DMA_END_L (1 << 30)
+
+#define DMA_CR_C 0x80
+#define DMA_CR_D 0x40
+#define DMA_CR_E 0x20
+
+#define DMA_ST_OFL 4
+#define DMA_ST_INT 2
+#define DMA_ST_AB 1
+/*
+ * IOC compatability
+ */
+#define IOC_CONTROL IOMD_CONTROL
+#define IOC_IRQSTATA IOMD_IRQSTATA
+#define IOC_IRQREQA IOMD_IRQREQA
+#define IOC_IRQCLRA IOMD_IRQCLRA
+#define IOC_IRQMASKA IOMD_IRQMASKA
+
+#define IOC_IRQSTATB IOMD_IRQSTATB
+#define IOC_IRQREQB IOMD_IRQREQB
+#define IOC_IRQMASKB IOMD_IRQMASKB
+
+#define IOC_FIQSTAT IOMD_FIQSTAT
+#define IOC_FIQREQ IOMD_FIQREQ
+#define IOC_FIQMASK IOMD_FIQMASK
+
+#define IOC_T0CNTL IOMD_T0CNTL
+#define IOC_T0LTCHL IOMD_T0LTCHL
+#define IOC_T0CNTH IOMD_T0CNTH
+#define IOC_T0LTCHH IOMD_T0LTCHH
+#define IOC_T0GO IOMD_T0GO
+#define IOC_T0LATCH IOMD_T0LATCH
+
+#define IOC_T1CNTL IOMD_T1CNTL
+#define IOC_T1LTCHL IOMD_T1LTCHL
+#define IOC_T1CNTH IOMD_T1CNTH
+#define IOC_T1LTCHH IOMD_T1LTCHH
+#define IOC_T1GO IOMD_T1GO
+#define IOC_T1LATCH IOMD_T1LATCH
+
+/*
+ * DMA (MEMC) compatability
+ */
+#define HALF_SAM vram_half_sam
+#define VDMA_ALIGNMENT (HALF_SAM * 2)
+#define VDMA_XFERSIZE (HALF_SAM)
+#define VDMA_INIT IOMD_VIDINIT
+#define VDMA_START IOMD_VIDSTART
+#define VDMA_END IOMD_VIDEND
+
+#ifndef __ASSEMBLER__
+extern unsigned int vram_half_sam;
+#define video_set_dma(start,end,offset) \
+do { \
+ outl (SCREEN_START + start, VDMA_START); \
+ outl (SCREEN_START + end - VDMA_XFERSIZE, VDMA_END); \
+ if (offset >= end - VDMA_XFERSIZE) \
+ offset |= 0x40000000; \
+ outl (SCREEN_START + offset, VDMA_INIT); \
+} while (0)
+#endif
+
diff --git a/include/asm-arm/irq.h b/include/asm-arm/irq.h
index 59770101e..0e8c4ad27 100644
--- a/include/asm-arm/irq.h
+++ b/include/asm-arm/irq.h
@@ -3,7 +3,9 @@
#include <asm/arch/irqs.h>
+#ifndef irq_cannonicalize
#define irq_cannonicalize(i) (i)
+#endif
#ifndef NR_IRQS
#define NR_IRQS 128
diff --git a/include/asm-arm/keyboard.h b/include/asm-arm/keyboard.h
index 6b64ec6af..9514b470a 100644
--- a/include/asm-arm/keyboard.h
+++ b/include/asm-arm/keyboard.h
@@ -19,8 +19,6 @@
#include <asm/arch/keyboard.h>
-#define SYSRQ_KEY 13
-
#endif /* __KERNEL__ */
#endif /* __ASM_ARM_KEYBOARD_H */
diff --git a/include/asm-arm/leds.h b/include/asm-arm/leds.h
index d253e2abf..f69aa7fce 100644
--- a/include/asm-arm/leds.h
+++ b/include/asm-arm/leds.h
@@ -4,6 +4,8 @@
* Copyright (C) 1998 Russell King
*
* Event-driven interface for LEDs on machines
+ *
+ * Added led_start and led_stop- Alex Holden, 28th Dec 1998.
*/
#ifndef ASM_ARM_LEDS_H
#define ASM_ARM_LEDS_H
@@ -11,7 +13,9 @@
typedef enum {
led_idle_start,
led_idle_end,
- led_timer
+ led_timer,
+ led_start,
+ led_stop
} led_event_t;
/* Use this routine to handle LEDs */
diff --git a/include/asm-arm/linux_logo.h b/include/asm-arm/linux_logo.h
index 9eeae3619..35ee86403 100644
--- a/include/asm-arm/linux_logo.h
+++ b/include/asm-arm/linux_logo.h
@@ -11,13 +11,16 @@
#define linux_logo_banner "ARM Linux version " UTS_RELEASE
-#define LINUX_LOGO_COLORS 221
+#define LINUX_LOGO_COLORS 214
#ifdef INCLUDE_LINUX_LOGO_DATA
+#define INCLUDE_LINUX_LOGOBW
#define INCLUDE_LINUX_LOGO16
+
#include <linux/linux_logo.h>
+#else
/* prototypes only */
extern unsigned char linux_logo_red[];
diff --git a/include/asm-arm/md.h b/include/asm-arm/md.h
new file mode 100644
index 000000000..0a2c5dd01
--- /dev/null
+++ b/include/asm-arm/md.h
@@ -0,0 +1,13 @@
+/* $Id: md.h,v 1.1 1997/12/15 15:11:57 jj Exp $
+ * md.h: High speed xor_block operation for RAID4/5
+ *
+ */
+
+#ifndef __ASM_MD_H
+#define __ASM_MD_H
+
+/* #define HAVE_ARCH_XORBLOCK */
+
+#define MD_XORBLOCK_ALIGNMENT sizeof(long)
+
+#endif /* __ASM_MD_H */
diff --git a/include/asm-arm/memc.h b/include/asm-arm/memc.h
new file mode 100644
index 000000000..820738a29
--- /dev/null
+++ b/include/asm-arm/memc.h
@@ -0,0 +1,13 @@
+#define VDMA_ALIGNMENT PAGE_SIZE
+#define VDMA_XFERSIZE 16
+#define VDMA_INIT 0
+#define VDMA_START 1
+#define VDMA_END 2
+
+#define video_set_dma(start,end,offset) \
+do { \
+ memc_write (VDMA_START, (start >> 2)); \
+ memc_write (VDMA_END, (end - VDMA_XFERSIZE) >> 2); \
+ memc_write (VDMA_INIT, (offset >> 2)); \
+} while (0)
+
diff --git a/include/asm-arm/posix_types.h b/include/asm-arm/posix_types.h
index cff51a289..4c02ac5fe 100644
--- a/include/asm-arm/posix_types.h
+++ b/include/asm-arm/posix_types.h
@@ -1,7 +1,7 @@
/*
* linux/include/asm-arm/posix_types.h
*
- * Copyright (c) 1996 Russell King.
+ * Copyright (c) 1996-1998 Russell King.
*
* Changelog:
* 27-06-1996 RMK Created
@@ -9,8 +9,6 @@
#ifndef __ARCH_ARM_POSIX_TYPES_H
#define __ARCH_ARM_POSIX_TYPES_H
-#include <linux/config.h>
-
/*
* This file is generally used by user-level software, so you need to
* be a little careful about namespace pollution etc. Also, we cannot
@@ -26,11 +24,7 @@ typedef int __kernel_pid_t;
typedef unsigned short __kernel_ipc_pid_t;
typedef unsigned short __kernel_uid_t;
typedef unsigned short __kernel_gid_t;
-#ifdef CONFIG_BINUTILS_NEW
-typedef long unsigned int __kernel_size_t;
-#else
typedef unsigned int __kernel_size_t;
-#endif
typedef int __kernel_ssize_t;
typedef int __kernel_ptrdiff_t;
typedef long __kernel_time_t;
diff --git a/include/asm-arm/proc-armo/elf.h b/include/asm-arm/proc-armo/elf.h
new file mode 100644
index 000000000..535deef31
--- /dev/null
+++ b/include/asm-arm/proc-armo/elf.h
@@ -0,0 +1,19 @@
+/*
+ * ELF definitions for 26-bit CPUs
+ */
+
+#define ELF_EXEC_PAGESIZE 32768
+
+#if 0 /* not yet */
+#define ELF_PROC_OK(x) \
+ ((x)->e_flags & EF_ARM_APCS26)
+#else
+#define ELF_PROC_OK(x) (1)
+#endif
+
+#ifdef __KERNEL__
+
+#define SET_PERSONALITY(ex,ibcs2) \
+ current->personality = PER_LINUX
+
+#endif
diff --git a/include/asm-arm/proc-armo/pgtable.h b/include/asm-arm/proc-armo/pgtable.h
index 10631f7b2..934902052 100644
--- a/include/asm-arm/proc-armo/pgtable.h
+++ b/include/asm-arm/proc-armo/pgtable.h
@@ -94,10 +94,6 @@ extern __inline__ void update_memc_addr(struct mm_struct *mm, unsigned long addr
#define __flush_entry_to_ram(entry)
-/* Certain architectures need to do special things when pte's
- * within a page table are directly modified. Thus, the following
- * hook is made available.
- */
/* PMD_SHIFT determines the size of the area a second-level page table can map */
#define PMD_SHIFT 20
#define PMD_SIZE (1UL << PMD_SHIFT)
@@ -119,13 +115,6 @@ extern __inline__ void update_memc_addr(struct mm_struct *mm, unsigned long addr
#define PTRS_PER_PGD 32
#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
-/* Just any arbitrary offset to the start of the vmalloc VM area: the
- * current 8MB value just means that there will be a 8MB "hole" after the
- * physical memory until the kernel virtual memory starts. That means that
- * any out-of-bounds memory accesses will hopefully be caught.
- * The vmalloc() routines leaves a hole of 4kB between each vmalloced
- * area for the same reason. ;)
- */
#define VMALLOC_START 0x01a00000
#define VMALLOC_VMADDR(x) ((unsigned long)(x))
#define VMALLOC_END 0x01c00000
@@ -280,6 +269,10 @@ extern __inline__ pte_t pte_modify(pte_t pte, pgprot_t newprot)
return pte;
}
+/* Certain architectures need to do special things when pte's
+ * within a page table are directly modified. Thus, the following
+ * hook is made available.
+ */
#define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval))
extern __inline__ unsigned long pte_page(pte_t pte)
diff --git a/include/asm-arm/proc-armo/processor.h b/include/asm-arm/proc-armo/processor.h
index f76b404c5..4a8b60d10 100644
--- a/include/asm-arm/proc-armo/processor.h
+++ b/include/asm-arm/proc-armo/processor.h
@@ -9,6 +9,7 @@
* 26-09-1996 RMK Added 'EXTRA_THREAD_STRUCT*'
* 28-09-1996 RMK Moved start_thread into the processor dependencies
* 11-01-1998 RMK Added new uaccess_t
+ * 09-09-1998 PJB Delete redundant `wp_works_ok'
*/
#ifndef __ASM_PROC_PROCESSOR_H
#define __ASM_PROC_PROCESSOR_H
@@ -20,12 +21,6 @@
#define KERNEL_STACK_SIZE 4096
-/*
- * on arm2,3 wp does not work
- */
-#define wp_works_ok 0
-#define wp_works_ok__is_a_macro /* for versions in ksyms.c */
-
struct context_save_struct {
unsigned long r4;
unsigned long r5;
diff --git a/include/asm-arm/proc-armo/system.h b/include/asm-arm/proc-armo/system.h
index a1c2d01cb..471daf654 100644
--- a/include/asm-arm/proc-armo/system.h
+++ b/include/asm-arm/proc-armo/system.h
@@ -19,6 +19,7 @@ extern __inline__ unsigned long __xchg(unsigned long x, volatile void *ptr, int
case 4: return processor.u.armv2._xchg_4(x, ptr);
default: arm_invalidptr(xchg_str, size);
}
+ return 0;
}
/*
@@ -39,74 +40,74 @@ extern __inline__ unsigned long __xchg(unsigned long x, volatile void *ptr, int
/*
* Save the current interrupt enable state & disable IRQs
*/
-#define __save_flags_cli(x) \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
-" mov %0, pc\n" \
-" orr %1, %0, #0x08000000\n" \
-" and %0, %0, #0x0c000000\n" \
-" teqp %1, #0\n" \
- : "=r" (x), "=r" (temp) \
- : \
- : "memory"); \
+#define __save_flags_cli(x) \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+" mov %0, pc @ save_flags_cli\n" \
+" orr %1, %0, #0x08000000\n" \
+" and %0, %0, #0x0c000000\n" \
+" teqp %1, #0\n" \
+ : "=r" (x), "=r" (temp) \
+ : \
+ : "memory"); \
} while (0)
/*
* Enable IRQs
*/
-#define __sti() \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
-" mov %0, pc\n" \
-" bic %0, %0, #0x08000000\n" \
-" teqp %0, #0\n" \
- : "=r" (temp) \
- : \
- : "memory"); \
+#define __sti() \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+" mov %0, pc @ sti\n" \
+" bic %0, %0, #0x08000000\n" \
+" teqp %0, #0\n" \
+ : "=r" (temp) \
+ : \
+ : "memory"); \
} while(0)
/*
* Disable IRQs
*/
-#define __cli() \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
-" mov %0, pc\n" \
-" orr %0, %0, #0x08000000\n" \
-" teqp %0, #0\n" \
- : "=r" (temp) \
- : \
- : "memory"); \
+#define __cli() \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+" mov %0, pc @ cli\n" \
+" orr %0, %0, #0x08000000\n" \
+" teqp %0, #0\n" \
+ : "=r" (temp) \
+ : \
+ : "memory"); \
} while(0)
/*
* save current IRQ & FIQ state
*/
-#define __save_flags(x) \
- do { \
- __asm__ __volatile__( \
-" mov %0, pc\n" \
-" and %0, %0, #0x0c000000\n" \
- : "=r" (x)); \
+#define __save_flags(x) \
+ do { \
+ __asm__ __volatile__( \
+" mov %0, pc @ save_flags\n" \
+" and %0, %0, #0x0c000000\n" \
+ : "=r" (x)); \
} while (0)
/*
* restore saved IRQ & FIQ state
*/
-#define __restore_flags(x) \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
-" mov %0, pc\n" \
-" bic %0, %0, #0x0c000000\n" \
-" orr %0, %0, %1\n" \
-" teqp %0, #0\n" \
- : "=r" (temp) \
- : "r" (x) \
- : "memory"); \
+#define __restore_flags(x) \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+" mov %0, pc @ restore_flags\n" \
+" bic %0, %0, #0x0c000000\n" \
+" orr %0, %0, %1\n" \
+" teqp %0, #0\n" \
+ : "=r" (temp) \
+ : "r" (x) \
+ : "memory"); \
} while (0)
#ifdef __SMP__
diff --git a/include/asm-arm/proc-armv/elf.h b/include/asm-arm/proc-armv/elf.h
new file mode 100644
index 000000000..f82a786db
--- /dev/null
+++ b/include/asm-arm/proc-armv/elf.h
@@ -0,0 +1,21 @@
+/*
+ * ELF definitions for 32-bit CPUs
+ */
+
+#define ELF_EXEC_PAGESIZE 4096
+
+/* We can execute both 32-bit and 26-bit code. */
+#define ELF_PROC_OK(x) (1)
+
+#ifdef __KERNEL__
+
+#if 0 /* not yet */
+#define SET_PERSONALITY(ex,ibcs2) \
+ current_personality = (ex->e_flags & EF_ARM_APCS26) ? \
+ PER_LINUX : PER_LINUX_32BIT
+#else
+#define SET_PERSONALITY(ex,ibcs2) \
+ current->personality = PER_LINUX_32BIT
+#endif
+
+#endif
diff --git a/include/asm-arm/proc-armv/io.h b/include/asm-arm/proc-armv/io.h
index 949d41010..461da303f 100644
--- a/include/asm-arm/proc-armv/io.h
+++ b/include/asm-arm/proc-armv/io.h
@@ -22,17 +22,17 @@
#include <asm/proc-fns.h>
-#define dma_cache_inv(_start,_size) \
- do { \
- processor.u.armv3v4._cache_purge_area(_start,(_start+_size)); \
- } while (0)
+extern inline void dma_cache_inv(unsigned long start, unsigned long size)
+{
+ processor.u.armv3v4._cache_purge_area(start, start + size);
+}
-#define dma_cache_wback(_start,_size) \
- do { \
- processor.u.armv3v4._cache_wback_area(_start,(_start+_size)); \
- } while (0)
+extern inline void dma_cache_wback(unsigned long start, unsigned long size)
+{
+ processor.u.armv3v4._cache_wback_area(start, start + size);
+}
-#define dma_cache_wback_inv(_start,_size) \
- do { \
- processor.u.armv3v4._flush_cache_area(_start,(_start+_size),0); \
- } while (0)
+extern inline void dma_cache_wback_inv(unsigned long start, unsigned long size)
+{
+ processor.u.armv3v4._flush_cache_area(start, start + size, 0);
+}
diff --git a/include/asm-arm/proc-armv/mm-init.h b/include/asm-arm/proc-armv/mm-init.h
index 2e861b213..a3f5c327f 100644
--- a/include/asm-arm/proc-armv/mm-init.h
+++ b/include/asm-arm/proc-armv/mm-init.h
@@ -136,7 +136,7 @@ setup_pagetables(unsigned long start_mem, unsigned long end_mem)
/*
* An area to invalidate the cache
*/
- alloc_init_section(&start_mem, 0xdf000000, SAFE_ADDR, DOMAIN_KERNEL,
+ alloc_init_section(&start_mem, FLUSH_BASE, FLUSH_BASE_PHYS, DOMAIN_KERNEL,
PMD_SECT_CACHEABLE | PMD_SECT_AP_READ);
/*
diff --git a/include/asm-arm/proc-armv/page.h b/include/asm-arm/proc-armv/page.h
index fd8768939..8acec4c75 100644
--- a/include/asm-arm/proc-armv/page.h
+++ b/include/asm-arm/proc-armv/page.h
@@ -7,6 +7,8 @@
#ifndef __ASM_PROC_PAGE_H
#define __ASM_PROC_PAGE_H
+#include <asm/hardware.h>
+
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 12
#define PAGE_SIZE (1UL << PAGE_SHIFT)
@@ -60,7 +62,10 @@ typedef unsigned long pgprot_t;
#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
/* This handles the memory map.. */
+#ifndef PAGE_OFFSET
#define PAGE_OFFSET 0xc0000000
+#endif
+
#define MAP_NR(addr) (((unsigned long)(addr) - PAGE_OFFSET) >> PAGE_SHIFT)
#endif /* __KERNEL__ */
diff --git a/include/asm-arm/proc-armv/processor.h b/include/asm-arm/proc-armv/processor.h
index 294dead68..88b277ea7 100644
--- a/include/asm-arm/proc-armv/processor.h
+++ b/include/asm-arm/proc-armv/processor.h
@@ -7,6 +7,7 @@
* 20-09-1996 RMK Created
* 26-09-1996 RMK Added 'EXTRA_THREAD_STRUCT*'
* 28-09-1996 RMK Moved start_thread into the processor dependencies
+ * 09-09-1998 PJB Delete redundant `wp_works_ok'
*/
#ifndef __ASM_PROC_PROCESSOR_H
#define __ASM_PROC_PROCESSOR_H
@@ -15,12 +16,6 @@
#define KERNEL_STACK_SIZE PAGE_SIZE
-/*
- * on arm2,3 wp does not work
- */
-#define wp_works_ok 0
-#define wp_works_ok__is_a_macro /* for versions in ksyms.c */
-
struct context_save_struct {
unsigned long cpsr;
unsigned long r4;
diff --git a/include/asm-arm/proc-armv/semaphore.h b/include/asm-arm/proc-armv/semaphore.h
index fb1ad746f..3da31f536 100644
--- a/include/asm-arm/proc-armv/semaphore.h
+++ b/include/asm-arm/proc-armv/semaphore.h
@@ -10,20 +10,24 @@
*/
extern inline void down(struct semaphore * sem)
{
+ unsigned int cpsr, temp;
+
__asm__ __volatile__ ("
@ atomic down operation
- mrs r0, cpsr
- orr r1, r0, #128 @ disable IRQs
- bic r0, r0, #0x80000000 @ clear N
- msr cpsr, r1
- ldr r1, [%0]
- subs r1, r1, #1
- str r1, [%0]
- orrmi r0, r0, #0x80000000 @ set N
- msr cpsr, r0
- movmi r0, %0
- blmi " SYMBOL_NAME_STR(__down)
- : : "r" (sem) : "r0", "r1", "r2", "r3", "ip", "lr", "cc");
+ mrs %0, cpsr
+ orr %1, %0, #128 @ disable IRQs
+ bic %0, %0, #0x80000000 @ clear N
+ msr cpsr, %1
+ ldr %1, [%2]
+ subs %1, %1, #1
+ orrmi %0, %0, #0x80000000 @ set N
+ str %1, [%2]
+ msr cpsr, %0
+ movmi r0, %2
+ blmi " SYMBOL_NAME_STR(__down_failed)
+ : "=&r" (cpsr), "=&r" (temp)
+ : "r" (sem)
+ : "r0", "lr", "cc");
}
/*
@@ -32,26 +36,28 @@ extern inline void down(struct semaphore * sem)
*/
extern inline int down_interruptible (struct semaphore * sem)
{
- int result;
+ unsigned int cpsr, temp;
+
__asm__ __volatile__ ("
- @ atomic down operation
- mrs r0, cpsr
- orr r1, r0, #128 @ disable IRQs
- bic r0, r0, #0x80000000 @ clear N
- msr cpsr, r1
- ldr r1, [%1]
- subs r1, r1, #1
- str r1, [%1]
- orrmi r0, r0, #0x80000000 @ set N
- msr cpsr, r0
- movmi r0, %1
+ @ atomic down interruptible operation
+ mrs %0, cpsr
+ orr %1, %0, #128 @ disable IRQs
+ bic %0, %0, #0x80000000 @ clear N
+ msr cpsr, %1
+ ldr %1, [%2]
+ subs %1, %1, #1
+ orrmi %0, %0, #0x80000000 @ set N
+ str %1, [%2]
+ msr cpsr, %0
+ movmi r0, %2
movpl r0, #0
- blmi " SYMBOL_NAME_STR(__down_interruptible) "
- mov %0, r0"
- : "=r" (result)
+ blmi " SYMBOL_NAME_STR(__down_interruptible_failed) "
+ mov %1, r0"
+ : "=&r" (cpsr), "=&r" (temp)
: "r" (sem)
- : "r0", "r1", "r2", "r3", "ip", "lr", "cc");
- return result;
+ : "r0", "lr", "cc");
+
+ return temp;
}
/*
@@ -62,20 +68,24 @@ extern inline int down_interruptible (struct semaphore * sem)
*/
extern inline void up(struct semaphore * sem)
{
+ unsigned int cpsr, temp;
+
__asm__ __volatile__ ("
@ atomic up operation
- mrs r0, cpsr
- orr r1, r0, #128 @ disable IRQs
- bic r0, r0, #0x80000000 @ clear N
- msr cpsr, r1
- ldr r1, [%0]
- adds r1, r1, #1
- str r1, [%0]
- orrls r0, r0, #0x80000000 @ set N
- msr cpsr, r0
- movmi r0, %0
- blmi " SYMBOL_NAME_STR(__up)
- : : "r" (sem) : "r0", "r1", "r2", "r3", "ip", "lr", "cc");
+ mrs %0, cpsr
+ orr %1, %0, #128 @ disable IRQs
+ bic %0, %0, #0x80000000 @ clear N
+ msr cpsr, %1
+ ldr %1, [%2]
+ adds %1, %1, #1
+ orrls %0, %0, #0x80000000 @ set N
+ str %1, [%2]
+ msr cpsr, %0
+ movmi r0, %2
+ blmi " SYMBOL_NAME_STR(__up_wakeup)
+ : "=&r" (cpsr), "=&r" (temp)
+ : "r" (sem)
+ : "r0", "lr", "cc");
}
#endif
diff --git a/include/asm-arm/proc-armv/system.h b/include/asm-arm/proc-armv/system.h
index 0ef12de11..9de0fccc5 100644
--- a/include/asm-arm/proc-armv/system.h
+++ b/include/asm-arm/proc-armv/system.h
@@ -22,22 +22,24 @@ extern __inline__ unsigned long __xchg(unsigned long x, volatile void *ptr, int
return x;
}
-/*
- * This processor does not need anything special before reset,
- * but RPC may do...
- */
-extern __inline__ void proc_hard_reset(void)
-{
-}
+#define set_cr(x) \
+ do { \
+ __asm__ __volatile__( \
+ "mcr p15, 0, %0, c1, c0 @ set CR" \
+ : : "r" (x)); \
+ } while (0)
+
+extern unsigned long cr_no_alignment; /* defined in entry-armv.S */
+extern unsigned long cr_alignment; /* defined in entry-armv.S */
/*
* We can wait for an interrupt...
*/
-#define proc_idle() \
- do { \
- __asm__ __volatile__( \
-" mcr p15, 0, %0, c15, c8, 2" \
- : : "r" (0)); \
+#define proc_idle() \
+ do { \
+ __asm__ __volatile__( \
+" mcr p15, 0, %0, c15, c8, 2 @ proc_idle" \
+ : : "r" (0)); \
} while (0)
/*
@@ -47,75 +49,75 @@ extern __inline__ void proc_hard_reset(void)
/*
* Save the current interrupt enable state & disable IRQs
*/
-#define __save_flags_cli(x) \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
- "mrs %1, cpsr\n" \
-" and %0, %1, #192\n" \
-" orr %1, %1, #128\n" \
-" msr cpsr, %1" \
- : "=r" (x), "=r" (temp) \
- : \
- : "memory"); \
+#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)
/*
* Enable IRQs
*/
-#define __sti() \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
- "mrs %0, cpsr\n" \
-" bic %0, %0, #128\n" \
-" msr cpsr, %0" \
- : "=r" (temp) \
- : \
- : "memory"); \
+#define __sti() \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+ "mrs %0, cpsr @ sti\n" \
+" bic %0, %0, #128\n" \
+" msr cpsr, %0" \
+ : "=r" (temp) \
+ : \
+ : "memory"); \
} while(0)
/*
* Disable IRQs
*/
-#define __cli() \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
- "mrs %0, cpsr\n" \
-" orr %0, %0, #128\n" \
-" msr cpsr, %0" \
- : "=r" (temp) \
- : \
- : "memory"); \
+#define __cli() \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+ "mrs %0, cpsr @ cli\n" \
+" orr %0, %0, #128\n" \
+" msr cpsr, %0" \
+ : "=r" (temp) \
+ : \
+ : "memory"); \
} while(0)
/*
* save current IRQ & FIQ state
*/
-#define __save_flags(x) \
- do { \
- __asm__ __volatile__( \
- "mrs %0, cpsr\n" \
-" and %0, %0, #192" \
- : "=r" (x) \
- : \
- : "memory"); \
+#define __save_flags(x) \
+ do { \
+ __asm__ __volatile__( \
+ "mrs %0, cpsr @ save_flags\n" \
+" and %0, %0, #192" \
+ : "=r" (x) \
+ : \
+ : "memory"); \
} while (0)
/*
* restore saved IRQ & FIQ state
*/
-#define __restore_flags(x) \
- do { \
- unsigned long temp; \
- __asm__ __volatile__( \
- "mrs %0, cpsr\n" \
-" bic %0, %0, #192\n" \
-" orr %0, %0, %1\n" \
-" msr cpsr, %0" \
- : "=r" (temp) \
- : "r" (x) \
+#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)
diff --git a/include/asm-arm/proc-armv/uaccess.h b/include/asm-arm/proc-armv/uaccess.h
index acadb35a3..a8dce6739 100644
--- a/include/asm-arm/proc-armv/uaccess.h
+++ b/include/asm-arm/proc-armv/uaccess.h
@@ -11,6 +11,8 @@
* DOMAIN_USER - domain 0 includes all user memory only
*/
+#include <asm/hardware.h>
+
#define DOMAIN_CLIENT 1
#define DOMAIN_MANAGER 3
@@ -35,7 +37,7 @@
* Note that this is actually 0x1,0000,0000
*/
#define KERNEL_DS 0x00000000
-#define USER_DS 0xc0000000
+#define USER_DS PAGE_OFFSET
#define get_ds() (KERNEL_DS)
#define get_fs() (current->addr_limit)
@@ -50,13 +52,10 @@ extern __inline__ void set_fs (mm_segment_t fs)
: "r" (fs ? USER_DOMAIN : KERNEL_DOMAIN));
}
-/*
- * a + s <= 2^32 -> C = 0 || Z = 0 (LS)
- * (a + s) <= l -> C = 0 || Z = 0 (LS)
- */
+/* We use 33-bit arithmetic here... */
#define __range_ok(addr,size) ({ \
unsigned long flag, sum; \
- __asm__ __volatile__("adds %1, %2, %3; cmpls %1, %0; movls %0, #0" \
+ __asm__ __volatile__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \
: "=&r" (flag), "=&r" (sum) \
: "r" (addr), "Ir" (size), "0" (current->addr_limit) \
: "cc"); \
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h
index edab09ace..f4c687089 100644
--- a/include/asm-arm/processor.h
+++ b/include/asm-arm/processor.h
@@ -53,11 +53,9 @@ struct mm_struct;
extern void release_thread(struct task_struct *);
/* Copy and release all segment info associated with a VM */
-extern void copy_segments(int nr, struct task_struct *p, struct mm_struct * mm);
-extern void release_segments(struct mm_struct * mm);
-
#define copy_segments(nr, tsk, mm) do { } while (0)
#define release_segments(mm) do { } while (0)
+#define forget_segments() do { } while (0)
#define init_task (init_task_union.task)
#define init_stack (init_task_union.stack)
diff --git a/include/asm-arm/semaphore.h b/include/asm-arm/semaphore.h
index 3186aac19..287d8c263 100644
--- a/include/asm-arm/semaphore.h
+++ b/include/asm-arm/semaphore.h
@@ -18,10 +18,11 @@ struct semaphore {
#define MUTEX_LOCKED ((struct semaphore) { ATOMIC_INIT(0), 0, NULL })
asmlinkage void __down_failed (void /* special register calling convention */);
-asmlinkage int __down_failed_interruptible (void /* special register calling convention */);
+asmlinkage int __down_interruptible_failed (void /* special register calling convention */);
asmlinkage void __up_wakeup (void /* special register calling convention */);
extern void __down(struct semaphore * sem);
+extern int __down_interruptible(struct semaphore * sem);
extern void __up(struct semaphore * sem);
#define sema_init(sem, val) atomic_set(&((sem)->count), (val))
@@ -47,7 +48,7 @@ static inline void wake_one_more(struct semaphore * sem)
restore_flags(flags);
}
-static inline int waking_non_zero(struct semaphore *sem)
+static inline int waking_non_zero(struct semaphore *sem, struct task_struct *tsk)
{
unsigned long flags;
int ret = 0;
diff --git a/include/asm-arm/signal.h b/include/asm-arm/signal.h
index 08b5edb50..12ec642aa 100644
--- a/include/asm-arm/signal.h
+++ b/include/asm-arm/signal.h
@@ -21,7 +21,7 @@ typedef struct {
} sigset_t;
#else
-/* Here we must cater to lics that poke about in kernel headers. */
+/* Here we must cater to libcs that poke about in kernel headers. */
#define NSIG 32
typedef unsigned long sigset_t;
@@ -69,6 +69,8 @@ typedef unsigned long sigset_t;
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
+#define SIGSWI 32
+
/*
* SA_FLAGS values:
*
@@ -96,6 +98,8 @@ typedef unsigned long sigset_t;
#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
#define SA_RESTORER 0x04000000
+#define SA_THIRTYTWO 0x02000000 /* deliver signal in 32-bit mode even if
+ task is running 26 bits. */
/*
* sigaltstack controls
@@ -132,6 +136,7 @@ typedef void (*__sighandler_t)(int);
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
+#ifdef __KERNEL__
struct old_sigaction {
__sighandler_t sa_handler;
old_sigset_t sa_mask;
@@ -150,6 +155,24 @@ struct k_sigaction {
struct sigaction sa;
};
+#else
+/* Here we must cater to libcs that poke about in kernel headers. */
+
+struct sigaction {
+ union {
+ __sighandler_t _sa_handler;
+ void (*_sa_sigaction)(int, struct siginfo *, void *);
+ } _u;
+ sigset_t sa_mask;
+ unsigned long sa_flags;
+ void (*sa_restorer)(void);
+};
+
+#define sa_handler _u._sa_handler
+#define sa_sigaction _u._sa_sigaction
+
+#endif /* __KERNEL__ */
+
typedef struct sigaltstack {
void *ss_sp;
int ss_flags;
diff --git a/include/asm-arm/socket.h b/include/asm-arm/socket.h
index 91de70e6e..d0d2ddb36 100644
--- a/include/asm-arm/socket.h
+++ b/include/asm-arm/socket.h
@@ -35,4 +35,8 @@
#define SO_BINDTODEVICE 25
+/* Socket filtering */
+#define SO_ATTACH_FILTER 26
+#define SO_DETACH_FILTER 27
+
#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-arm/softirq.h b/include/asm-arm/softirq.h
index ba99f96f6..6bad79dd4 100644
--- a/include/asm-arm/softirq.h
+++ b/include/asm-arm/softirq.h
@@ -13,7 +13,7 @@ extern unsigned int local_bh_count[NR_CPUS];
extern inline void init_bh(int nr, void (*routine)(void))
{
bh_base[nr] = routine;
- bh_mask_count[nr] = 0;
+ atomic_set(&bh_mask_count[nr], 0);
bh_mask |= 1 << nr;
}
@@ -58,13 +58,13 @@ extern inline void end_bh_atomic(void)
extern inline void disable_bh(int nr)
{
bh_mask &= ~(1 << nr);
- bh_mask_count[nr]++;
+ atomic_inc(&bh_mask_count[nr]);
synchronize_bh();
}
extern inline void enable_bh(int nr)
{
- if (!--bh_mask_count[nr])
+ if (atomic_dec_and_test(&bh_mask_count[nr]))
bh_mask |= 1 << nr;
}
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h
index e72553f1a..33e1fe183 100644
--- a/include/asm-arm/spinlock.h
+++ b/include/asm-arm/spinlock.h
@@ -4,11 +4,19 @@
#ifndef __SMP__
/*
+ * To be safe, we assume the only compiler that can cope with
+ * empty initialisers is EGCS.
+ */
+#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 90))
+#define EMPTY_INIT_OK
+#endif
+
+/*
* Your basic spinlocks, allowing only a single CPU anywhere
*/
-#if (__GNUC__ > 2) || (__GNUC_MINOR__ >= 8)
+#ifdef EMPTY_INIT_OK
typedef struct { } spinlock_t;
-# define SPIN_LOCK_UNLOCKED { }
+# define SPIN_LOCK_UNLOCKED (spinlock_t) { }
#else
typedef unsigned char spinlock_t;
# define SPIN_LOCK_UNLOCKED 0
@@ -37,8 +45,13 @@
* irq-safe write-lock, but readers can get non-irqsafe
* read-locks.
*/
-typedef struct { } rwlock_t;
-#define RW_LOCK_UNLOCKED { }
+#ifdef EMPTY_INIT_OK
+ typedef struct { } rwlock_t;
+# define RW_LOCK_UNLOCKED (rwlock_t) { }
+#else
+ typedef unsigned char rwlock_t;
+# define RW_LOCK_UNLOCKED 0
+#endif
#define read_lock(lock) do { } while(0)
#define read_unlock(lock) do { } while(0)
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 1d7e28b0b..91c08d668 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -1,6 +1,8 @@
#ifndef __ASM_ARM_SYSTEM_H
#define __ASM_ARM_SYSTEM_H
+#include <linux/config.h>
+
/* The type of machine we're running on */
extern unsigned int machine_type;
#define MACH_TYPE_EBSA110 0
@@ -11,6 +13,29 @@ extern unsigned int machine_type;
#define MACH_TYPE_CATS 6
#define MACH_TYPE_TBOX 7
+#ifdef CONFIG_ARCH_EBSA285
+#define machine_is_ebsa285() (1)
+#else
+#define machine_is_ebsa285() (0)
+#endif
+
+#ifdef CONFIG_ARCH_VNC
+#define machine_is_netwinder() (1)
+#else
+#define machine_is_netwinder() (0)
+#endif
+
+#if defined(CONFIG_CATS)
+#define machine_is_cats() (machine_type == MACH_TYPE_CATS)
+#else
+#define machine_is_cats() (0)
+#endif
+
+#if 0
+#define machine_is_ebsa285() (machine_type == MACH_TYPE_EBSA285)
+#define machine_is_netwinder() (machine_type == MACH_TYPE_NETWINDER)
+#endif
+
#include <linux/kernel.h>
#include <asm/proc-fns.h>
diff --git a/include/asm-arm/termbits.h b/include/asm-arm/termbits.h
index 435833937..9922760e4 100644
--- a/include/asm-arm/termbits.h
+++ b/include/asm-arm/termbits.h
@@ -117,10 +117,21 @@ struct termios {
#define HUPCL 0002000
#define CLOCAL 0004000
#define CBAUDEX 0010000
-#define B57600 0010001
-#define B115200 0010002
-#define B230400 0010003
-#define B460800 0010004
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+#define B500000 0010005
+#define B576000 0010006
+#define B921600 0010007
+#define B1000000 0010010
+#define B1152000 0010011
+#define B1500000 0010012
+#define B2000000 0010013
+#define B2500000 0010014
+#define B3000000 0010015
+#define B3500000 0010016
+#define B4000000 0010017
#define CIBAUD 002003600000 /* input baud rate (not used) */
#define CMSPAR 010000000000 /* mark or space (stick) parity */
#define CRTSCTS 020000000000 /* flow control */
diff --git a/include/asm-arm/termios.h b/include/asm-arm/termios.h
index 2510a5b0e..5e05c1754 100644
--- a/include/asm-arm/termios.h
+++ b/include/asm-arm/termios.h
@@ -58,6 +58,8 @@ struct termio {
#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
#define N_R3964 9 /* Reserved for Simatic R3964 module */
#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
+#define N_IRDA 11 /* Linux IrDa - http://www.cs.uit.no/~dagb/irda/irda.html */
+#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
#ifdef __KERNEL__
diff --git a/include/asm-arm/timex.h b/include/asm-arm/timex.h
index 29ae27df2..d9a3303be 100644
--- a/include/asm-arm/timex.h
+++ b/include/asm-arm/timex.h
@@ -10,4 +10,13 @@
#include <asm/arch/timex.h>
+typedef unsigned long cycles_t;
+
+extern cycles_t cacheflush_time;
+
+static inline cycles_t get_cycles (void)
+{
+ return 0;
+}
+
#endif
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index 780b7a13c..601af3b0a 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -23,7 +23,7 @@
#define __NR_time (__NR_SYSCALL_BASE+ 13)
#define __NR_mknod (__NR_SYSCALL_BASE+ 14)
#define __NR_chmod (__NR_SYSCALL_BASE+ 15)
-#define __NR_chown (__NR_SYSCALL_BASE+ 16)
+#define __NR_lchown (__NR_SYSCALL_BASE+ 16)
#define __NR_break (__NR_SYSCALL_BASE+ 17)
#define __NR_oldstat (__NR_SYSCALL_BASE+ 18)
#define __NR_lseek (__NR_SYSCALL_BASE+ 19)
@@ -189,8 +189,12 @@
#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)
#define __NR_pread (__NR_SYSCALL_BASE+180)
#define __NR_pwrite (__NR_SYSCALL_BASE+181)
-#define __NR_xstat (__NR_SYSCALL_BASE+182)
-#define __NR_xmknod (__NR_SYSCALL_BASE+183)
+#define __NR_chown (__NR_SYSCALL_BASE+182)
+#define __NR_getcwd (__NR_SYSCALL_BASE+183)
+#define __NR_capget (__NR_SYSCALL_BASE+184)
+#define __NR_capset (__NR_SYSCALL_BASE+185)
+#define __NR_sigaltstack (__NR_SYSCALL_BASE+186)
+#define __NR_sendfile (__NR_SYSCALL_BASE+187)
#define __sys2(x) #x
#define __sys1(x) __sys2(x)
@@ -299,41 +303,94 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \
#ifdef __KERNEL_SYSCALLS__
-/*
- * we need this inline - forking from kernel space will result
- * in NO COPY ON WRITE (!!!), until an execve is executed. This
- * is no problem, but for the stack. This is handled by not letting
- * main() use the stack at all after fork(). Thus, no function
- * calls - which means inline code for fork too, as otherwise we
- * would use the stack upon exit from 'fork()'.
- *
- * Actually only pause and fork are needed inline, so that there
- * won't be any messing with the stack from main(), but we define
- * some others too.
- */
-#define __NR__exit __NR_exit
-static inline _syscall0(int,idle);
-static inline _syscall0(int,pause);
-static inline _syscall1(int,setup,int,magic);
-static inline _syscall0(int,sync);
-static inline _syscall0(pid_t,setsid);
-static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count);
-static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
-static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count);
-static inline _syscall1(int,dup,int,fd);
-static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp);
-static inline _syscall3(int,open,const char *,file,int,flag,int,mode);
-static inline _syscall1(int,close,int,fd);
-static inline _syscall1(int,_exit,int,exitcode);
-static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options);
-static inline _syscall1(int,delete_module,const char *,name)
+static inline int idle(void)
+{
+ extern int sys_idle(void);
+ return sys_idle();
+}
-static inline pid_t wait(int * wait_stat)
+static inline int pause(void)
+{
+ extern int sys_pause(void);
+ return sys_pause();
+}
+
+static inline int sync(void)
+{
+ extern int sys_sync(void);
+ return sys_sync();
+}
+
+static inline pid_t setsid(void)
+{
+ extern int sys_setsid(void);
+ return sys_setsid();
+}
+
+static inline int write(int fd, const char *buf, off_t count)
+{
+ extern int sys_write(int, const char *, int);
+ return sys_write(fd, buf, count);
+}
+
+static inline int read(int fd, char *buf, off_t count)
+{
+ extern int sys_read(int, char *, int);
+ return sys_read(fd, buf, count);
+}
+
+static inline off_t lseek(int fd, off_t offset, int count)
+{
+ extern off_t sys_lseek(int, off_t, int);
+ return sys_lseek(fd, offset, count);
+}
+
+static inline int dup(int fd)
+{
+ extern int sys_dup(int);
+ return sys_dup(fd);
+}
+
+static inline int open(const char *file, int flag, int mode)
+{
+ extern int sys_open(const char *, int, int);
+ return sys_open(file, flag, mode);
+}
+
+static inline int close(int fd)
{
- return waitpid(-1,wait_stat,0);
+ return sys_close(fd);
}
+static inline int _exit(int exitcode)
+{
+ extern int sys_exit(int);
+ return sys_exit(exitcode);
+}
+static inline pid_t waitpid(pid_t pid, int *wait_stat, int options)
+{
+ extern int sys_wait4(int, int *, int, struct rusage *);
+ return sys_wait4((int)pid, wait_stat, options, NULL);
+}
+
+static inline int delete_module(const char *name)
+{
+ extern int sys_delete_module(const char *name);
+ return sys_delete_module(name);
+}
+
+static inline pid_t wait(int * wait_stat)
+{
+ extern int sys_wait4(int, int *, int, struct rusage *);
+ return sys_wait4(-1, wait_stat, 0, NULL);
+}
+
+/*
+ * The following two can't be eliminated yet - they rely on
+ * specific conditions.
+ */
+static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp);
/*
* This is the mechanism for creating a new kernel thread.