aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm/arch-sa1100/ide.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-arm/arch-sa1100/ide.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-arm/arch-sa1100/ide.h')
-rw-r--r--include/asm-arm/arch-sa1100/ide.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/include/asm-arm/arch-sa1100/ide.h b/include/asm-arm/arch-sa1100/ide.h
new file mode 100644
index 000000000000..2153538069c7
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/ide.h
@@ -0,0 +1,76 @@
1/*
2 * linux/include/asm-arm/arch-sa1100/ide.h
3 *
4 * Copyright (c) 1998 Hugo Fiennes & Nicolas Pitre
5 *
6 * 18-aug-2000: Cleanup by Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
7 * Get rid of the special ide_init_hwif_ports() functions
8 * and make a generalised function that can be used by all
9 * architectures.
10 */
11
12#include <linux/config.h>
13#include <asm/irq.h>
14#include <asm/hardware.h>
15#include <asm/mach-types.h>
16
17#error "This code is broken and needs update to match with current ide support"
18
19
20/*
21 * Set up a hw structure for a specified data port, control port and IRQ.
22 * This should follow whatever the default interface uses.
23 */
24static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
25 unsigned long ctrl_port, int *irq)
26{
27 unsigned long reg = data_port;
28 int i;
29 int regincr = 1;
30
31 /* The Empeg board has the first two address lines unused */
32 if (machine_is_empeg())
33 regincr = 1 << 2;
34
35 /* The LART doesn't use A0 for IDE */
36 if (machine_is_lart())
37 regincr = 1 << 1;
38
39 memset(hw, 0, sizeof(*hw));
40
41 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
42 hw->io_ports[i] = reg;
43 reg += regincr;
44 }
45
46 hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
47
48 if (irq)
49 *irq = 0;
50}
51
52/*
53 * This registers the standard ports for this architecture with the IDE
54 * driver.
55 */
56static __inline__ void
57ide_init_default_hwifs(void)
58{
59 if (machine_is_lart()) {
60#ifdef CONFIG_SA1100_LART
61 hw_regs_t hw;
62
63 /* Enable GPIO as interrupt line */
64 GPDR &= ~LART_GPIO_IDE;
65 set_irq_type(LART_IRQ_IDE, IRQT_RISING);
66
67 /* set PCMCIA interface timing */
68 MECR = 0x00060006;
69
70 /* init the interface */
71 ide_init_hwif_ports(&hw, PCMCIA_IO_0_BASE + 0x0000, PCMCIA_IO_0_BASE + 0x1000, NULL);
72 hw.irq = LART_IRQ_IDE;
73 ide_register_hw(&hw);
74#endif
75 }
76}