summaryrefslogtreecommitdiffstats
path: root/include/asm-arm/arch-rpc
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
commitdcec8a13bf565e47942a1751a9cec21bec5648fe (patch)
tree548b69625b18cc2e88c3e68d0923be546c9ebb03 /include/asm-arm/arch-rpc
parent2e0f55e79c49509b7ff70ff1a10e1e9e90a3dfd4 (diff)
o Merge with Linux 2.1.99.
o Fix ancient bug in the ELF loader making ldd crash. o Fix ancient bug in the keyboard code for SGI, SNI and Jazz.
Diffstat (limited to 'include/asm-arm/arch-rpc')
-rw-r--r--include/asm-arm/arch-rpc/a.out.h2
-rw-r--r--include/asm-arm/arch-rpc/dma.h143
-rw-r--r--include/asm-arm/arch-rpc/hardware.h1
-rw-r--r--include/asm-arm/arch-rpc/io.h19
-rw-r--r--include/asm-arm/arch-rpc/irq.h4
-rw-r--r--include/asm-arm/arch-rpc/irqs.h9
-rw-r--r--include/asm-arm/arch-rpc/keyboard.h38
-rw-r--r--include/asm-arm/arch-rpc/mm-init.h47
-rw-r--r--include/asm-arm/arch-rpc/mmu.h10
-rw-r--r--include/asm-arm/arch-rpc/processor.h2
-rw-r--r--include/asm-arm/arch-rpc/uncompress.h2
11 files changed, 133 insertions, 144 deletions
diff --git a/include/asm-arm/arch-rpc/a.out.h b/include/asm-arm/arch-rpc/a.out.h
index c9a1d0413..6b55ee076 100644
--- a/include/asm-arm/arch-rpc/a.out.h
+++ b/include/asm-arm/arch-rpc/a.out.h
@@ -8,7 +8,7 @@
#define __ASM_ARCH_A_OUT_H
#ifdef __KERNEL__
-#define STACK_TOP (0xc0000000)
+#define STACK_TOP ((current->personality==PER_LINUX_32BIT)? 0xc0000000 : 0x04000000)
#define LIBRARY_START_TEXT (0x00c00000)
#endif
diff --git a/include/asm-arm/arch-rpc/dma.h b/include/asm-arm/arch-rpc/dma.h
index 540ac46f1..0f556e856 100644
--- a/include/asm-arm/arch-rpc/dma.h
+++ b/include/asm-arm/arch-rpc/dma.h
@@ -1,128 +1,33 @@
#ifndef __ASM_ARCH_DMA_H
#define __ASM_ARCH_DMA_H
-#define MAX_DMA_ADDRESS 0xd0000000
-
-#ifdef KERNEL_ARCH_DMA
-
-static unsigned char arch_dma_setup;
-unsigned char arch_dma_ctrl[8];
-unsigned long arch_dma_addr[8];
-unsigned long arch_dma_cnt[8];
-
-static inline void arch_enable_dma(int dmanr)
-{
- if (!(arch_dma_setup & (1 << dmanr))) {
- arch_dma_setup |= 1 << dmanr;
-/* dma_interrupt (16 + dmanr);*/
- }
- arch_dma_ctrl[dmanr] |= DMA_CR_E;
- switch (dmanr) {
- case 0: outb (arch_dma_ctrl[0], IOMD_IO0CR); break;
- case 1: outb (arch_dma_ctrl[1], IOMD_IO1CR); break;
- case 2: outb (arch_dma_ctrl[2], IOMD_IO2CR); break;
- case 3: outb (arch_dma_ctrl[3], IOMD_IO3CR); break;
- case 4: outb (arch_dma_ctrl[4], IOMD_SD0CR); break;
- case 5: outb (arch_dma_ctrl[5], IOMD_SD1CR); break;
- }
-}
-
-static inline void arch_disable_dma(int dmanr)
-{
- arch_dma_ctrl[dmanr] &= ~DMA_CR_E;
- switch (dmanr) {
- case 0: outb (arch_dma_ctrl[0], IOMD_IO0CR); break;
- case 1: outb (arch_dma_ctrl[1], IOMD_IO1CR); break;
- case 2: outb (arch_dma_ctrl[2], IOMD_IO2CR); break;
- case 3: outb (arch_dma_ctrl[3], IOMD_IO3CR); break;
- case 4: outb (arch_dma_ctrl[4], IOMD_SD0CR); break;
- case 5: outb (arch_dma_ctrl[5], IOMD_SD1CR); break;
- }
-}
-
-static inline void arch_set_dma_addr(int dmanr, unsigned int addr)
-{
- arch_dma_setup &= ~dmanr;
- arch_dma_addr[dmanr] = addr;
-}
-
-static inline void arch_set_dma_count(int dmanr, unsigned int count)
-{
- arch_dma_setup &= ~dmanr;
- arch_dma_cnt[dmanr] = count;
-}
-
-static inline void arch_set_dma_mode(int dmanr, char mode)
-{
- switch (mode) {
- case DMA_MODE_READ:
- arch_dma_ctrl[dmanr] |= DMA_CR_D;
- break;
- case DMA_MODE_WRITE:
- arch_dma_ctrl[dmanr] &= ~DMA_CR_D;
- break;
- }
-}
-
-static inline int arch_dma_count (int dmanr)
-{
- return arch_dma_cnt[dmanr];
-}
-#endif
-
-/* enable/disable a specific DMA channel */
-extern void enable_dma(unsigned int dmanr);
-
-static __inline__ void disable_dma(unsigned int dmanr)
-{
- switch(dmanr) {
- case 1: break;
- case 2: disable_irq(64); break;
- default: printk(dma_str, "disable_dma", dmanr); break;
- }
-}
-
-/* Clear the 'DMA Pointer Flip Flop'.
- * Write 0 for LSB/MSB, 1 for MSB/LSB access.
- * Use this once to initialize the FF to a known state.
- * After that, keep track of it. :-)
- * --- In order to do that, the DMA routines below should ---
- * --- only be used while interrupts are disabled! ---
- */
-#define clear_dma_ff(dmanr)
-
-/* set mode (above) for a specific DMA channel */
-extern void set_dma_mode(unsigned int dmanr, char mode);
-
-/* Set only the page register bits of the transfer address.
- * This is used for successive transfers when we know the contents of
- * the lower 16 bits of the DMA current address register, but a 64k boundary
- * may have been crossed.
- */
-static __inline__ void set_dma_page(unsigned int dmanr, char pagenr)
-{
- printk (dma_str, "set_dma_page", dmanr);
-}
-
-
-/* Set transfer address & page bits for specific DMA channel.
- * Assumes dma flipflop is clear.
+/*
+ * This is the maximum DMA address that can be DMAd to.
+ * There should not be more than (0xd0000000 - 0xc0000000)
+ * bytes of RAM.
*/
-extern void set_dma_addr(unsigned int dmanr, unsigned int addr);
-
-/* Set transfer size for a specific DMA channel.
- */
-extern void set_dma_count(unsigned int dmanr, unsigned int count);
+#define MAX_DMA_ADDRESS 0xd0000000
-/* Get DMA residue count. After a DMA transfer, this
- * should return zero. Reading this while a DMA transfer is
- * still in progress will return unpredictable results.
- * If called before the channel has been used, it may return 1.
- * Otherwise, it returns the number of _bytes_ left to transfer.
- *
- * Assumes DMA flip-flop is clear.
+/*
+ * DMA modes - we have two, IN and OUT
*/
-extern int get_dma_residue(unsigned int dmanr);
+typedef enum {
+ DMA_MODE_READ,
+ DMA_MODE_WRITE
+} dmamode_t;
+
+#define MAX_DMA_CHANNELS 8
+
+#define DMA_0 0
+#define DMA_1 1
+#define DMA_2 2
+#define DMA_3 3
+#define DMA_S0 4
+#define DMA_S1 5
+#define DMA_VIRTUAL_FLOPPY 6
+#define DMA_VIRTUAL_SOUND 7
+
+#define DMA_FLOPPY DMA_VIRTUAL_FLOPPY
#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-rpc/hardware.h b/include/asm-arm/arch-rpc/hardware.h
index 2bdd96c6f..75e112e98 100644
--- a/include/asm-arm/arch-rpc/hardware.h
+++ b/include/asm-arm/arch-rpc/hardware.h
@@ -85,6 +85,7 @@
#define KERNEL_BASE (PAGE_OFFSET + KERNEL_OFFSET)
#define PARAMS_BASE (PAGE_OFFSET + PARAMS_OFFSET)
#define Z_PARAMS_BASE (RAM_START + PARAMS_OFFSET)
+#define SAFE_ADDR 0x00000000 /* ROM */
#else
diff --git a/include/asm-arm/arch-rpc/io.h b/include/asm-arm/arch-rpc/io.h
index b78483cc8..43d787b96 100644
--- a/include/asm-arm/arch-rpc/io.h
+++ b/include/asm-arm/arch-rpc/io.h
@@ -10,16 +10,6 @@
#define __ASM_ARM_ARCH_IO_H
/*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- * address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- * to an address that the kernel can use.
- */
-#define virt_to_bus(x) ((unsigned long)(x))
-#define bus_to_virt(x) ((void *)(x))
-
-/*
* This architecture does not require any delayed IO, and
* has the constant-optimised IO
*/
@@ -174,14 +164,7 @@ DECLARE_IO(long,l,"")
})
#define __ioaddrc(port) \
-({ \
- unsigned long addr; \
- if (__PORT_PCIO((port))) \
- addr = PCIO_BASE + ((port) << 2); \
- else \
- addr = IO_BASE + ((port) << 2); \
- addr; \
-})
+ (__PORT_PCIO((port)) ? PCIO_BASE + ((port) << 2) : IO_BASE + ((port) << 2))
/*
* Translated address IO functions
diff --git a/include/asm-arm/arch-rpc/irq.h b/include/asm-arm/arch-rpc/irq.h
index 750f5c905..9ef1bacc7 100644
--- a/include/asm-arm/arch-rpc/irq.h
+++ b/include/asm-arm/arch-rpc/irq.h
@@ -131,8 +131,4 @@ static __inline__ void irq_init_irq(void)
outb(0, IOMD_IRQMASKB);
outb(0, IOMD_FIQMASK);
outb(0, IOMD_DMAMASK);
- outb(0, IOMD_IO0CR);
- outb(0, IOMD_IO1CR);
- outb(0, IOMD_IO2CR);
- outb(0, IOMD_IO3CR);
}
diff --git a/include/asm-arm/arch-rpc/irqs.h b/include/asm-arm/arch-rpc/irqs.h
index b7188fb8e..9adbc9c61 100644
--- a/include/asm-arm/arch-rpc/irqs.h
+++ b/include/asm-arm/arch-rpc/irqs.h
@@ -21,8 +21,17 @@
#define IRQ_KEYBOARDTX 14
#define IRQ_KEYBOARDRX 15
+#define IRQ_DMA0 16
+#define IRQ_DMA1 17
+#define IRQ_DMA2 18
+#define IRQ_DMA3 19
+#define IRQ_DMAS0 20
+#define IRQ_DMAS1 21
+
#define FIQ_FLOPPYDATA 0
#define FIQ_ECONET 2
#define FIQ_SERIALPORT 4
#define FIQ_EXPANSIONCARD 6
#define FIQ_FORCE 7
+
+#define IRQ_TIMER IRQ_TIMER0
diff --git a/include/asm-arm/arch-rpc/keyboard.h b/include/asm-arm/arch-rpc/keyboard.h
new file mode 100644
index 000000000..60d3f0b8c
--- /dev/null
+++ b/include/asm-arm/arch-rpc/keyboard.h
@@ -0,0 +1,38 @@
+/*
+ * linux/include/asm-arm/arch-rpc/keyboard.h
+ *
+ * Keyboard driver definitions for RiscPC architecture
+ *
+ * (C) 1998 Russell King
+ */
+
+#include <asm/irq.h>
+
+#define NR_SCANCODES 128
+
+extern int ps2kbd_pretranslate(unsigned char scancode);
+extern int ps2kbd_translate(unsigned char scancode, unsigned char *keycode_p, char *up_flag_p);
+extern void ps2kbd_leds(unsigned char leds);
+extern void ps2kbd_init_hw(void);
+extern unsigned char ps2kbd_sysrq_xlate[NR_SCANCODES];
+
+#define kbd_setkeycode(sc,kc) (-EINVAL)
+#define kbd_getkeycode(sc) (-EINVAL)
+
+/* Prototype: int kbd_pretranslate(scancode, raw_mode)
+ * Returns : 0 to ignore scancode
+ */
+#define kbd_pretranslate(sc,rm) ps2kbd_pretranslate(sc)
+
+/* Prototype: int kbd_translate(scancode, *keycode, *up_flag, raw_mode)
+ * Returns : 0 to ignore scancode, *keycode set to keycode, *up_flag
+ * set to 0200 if scancode indicates release
+ */
+#define kbd_translate(sc, kcp, ufp, rm) ps2kbd_translate(sc, kcp, ufp)
+#define kbd_unexpected_up(kc) (0200)
+#define kbd_leds(leds) ps2kbd_leds(leds)
+#define kbd_init_hw() ps2kbd_init_hw()
+#define kbd_sysrq_xlate ps2kbd_sysrq_xlate
+#define kbd_disable_irq() disable_irq(IRQ_KEYBOARDRX)
+#define kbd_enable_irq() enable_irq(IRQ_KEYBOARDRX)
+
diff --git a/include/asm-arm/arch-rpc/mm-init.h b/include/asm-arm/arch-rpc/mm-init.h
new file mode 100644
index 000000000..81de91a01
--- /dev/null
+++ b/include/asm-arm/arch-rpc/mm-init.h
@@ -0,0 +1,47 @@
+/*
+ * linux/include/asm-arm/arch-rpc/mmap.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#define HAVE_MAP_VID_MEM
+
+unsigned long map_screen_mem(unsigned long log_start, unsigned long kmem, int update)
+{
+ static int updated = 0;
+ unsigned long address;
+ pgd_t *pgd;
+
+ if (updated)
+ return 0;
+ updated = update;
+
+ address = SCREEN_START | PMD_TYPE_SECT | PMD_DOMAIN(DOMAIN_KERNEL) | PMD_SECT_AP_WRITE;
+ pgd = swapper_pg_dir + (SCREEN2_BASE >> PGDIR_SHIFT);
+ pgd_val(pgd[0]) = address;
+ pgd_val(pgd[1]) = address + (1 << PGDIR_SHIFT);
+
+ if (update) {
+ unsigned long pgtable = PAGE_ALIGN(kmem), *p;
+ int i;
+
+ memzero ((void *)pgtable, 4096);
+
+ pgd_val(pgd[-2]) = __virt_to_phys(pgtable) | PMD_TYPE_TABLE | PMD_DOMAIN(DOMAIN_KERNEL);
+ pgd_val(pgd[-1]) = __virt_to_phys(pgtable + PTRS_PER_PTE*4) | PMD_TYPE_TABLE | PMD_DOMAIN(DOMAIN_KERNEL);
+ p = (unsigned long *)pgtable;
+
+ i = PTRS_PER_PTE * 2 - ((SCREEN1_END - log_start) >> PAGE_SHIFT);
+ address = SCREEN_START | PTE_TYPE_SMALL | PTE_AP_WRITE;
+
+ while (i < PTRS_PER_PTE * 2) {
+ p[i++] = address;
+ address += PAGE_SIZE;
+ }
+
+ flush_page_to_ram(pgtable);
+
+ kmem = pgtable + PAGE_SIZE;
+ }
+ return kmem;
+}
diff --git a/include/asm-arm/arch-rpc/mmu.h b/include/asm-arm/arch-rpc/mmu.h
index fbd403d36..7fca09aaa 100644
--- a/include/asm-arm/arch-rpc/mmu.h
+++ b/include/asm-arm/arch-rpc/mmu.h
@@ -7,6 +7,7 @@
* 20-10-1996 RMK Created
* 31-12-1997 RMK Fixed definitions to reduce warnings
* 11-01-1998 RMK Uninlined to reduce hits on cache
+ * 08-02-1998 RMK Added __virt_to_bus and __bus_to_virt
*/
#ifndef __ASM_ARCH_MMU_H
#define __ASM_ARCH_MMU_H
@@ -14,4 +15,13 @@
extern unsigned long __virt_to_phys(unsigned long vpage);
extern unsigned long __phys_to_virt(unsigned long ppage);
+/*
+ * These are exactly the same on the RiscPC as the
+ * physical memory view.
+ */
+#define __virt_to_bus__is_a_macro
+#define __virt_to_bus(x) __virt_to_phys(x)
+#define __bus_to_virt__is_a_macro
+#define __bus_to_virt(x) __phys_to_virt(x)
+
#endif
diff --git a/include/asm-arm/arch-rpc/processor.h b/include/asm-arm/arch-rpc/processor.h
index d5c478737..61ab21538 100644
--- a/include/asm-arm/arch-rpc/processor.h
+++ b/include/asm-arm/arch-rpc/processor.h
@@ -29,6 +29,6 @@
#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
#define INIT_MMAP \
-{ &init_mm, 0xc0000000, 0xc2000000, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
+{ &init_mm, 0, 0, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
#endif
diff --git a/include/asm-arm/arch-rpc/uncompress.h b/include/asm-arm/arch-rpc/uncompress.h
index de645f76d..577d18d1e 100644
--- a/include/asm-arm/arch-rpc/uncompress.h
+++ b/include/asm-arm/arch-rpc/uncompress.h
@@ -77,7 +77,7 @@ static void puts(const char *s)
}
} else {
ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h);
- ll_write_char(ptr, c|(white<<8));
+ ll_write_char(ptr, c|(white<<16));
if ( ++x >= video_num_columns ) {
x = 0;
if ( ++y >= video_num_lines ) {