diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 15:20:36 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 15:20:36 -0700 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /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.h | 76 |
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 @@ +/* + * linux/include/asm-arm/arch-sa1100/ide.h + * + * Copyright (c) 1998 Hugo Fiennes & Nicolas Pitre + * + * 18-aug-2000: Cleanup by Erik Mouw (J.A.K.Mouw@its.tudelft.nl) + * Get rid of the special ide_init_hwif_ports() functions + * and make a generalised function that can be used by all + * architectures. + */ + +#include <linux/config.h> +#include <asm/irq.h> +#include <asm/hardware.h> +#include <asm/mach-types.h> + +#error "This code is broken and needs update to match with current ide support" + + +/* + * 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, unsigned long data_port, + unsigned long ctrl_port, int *irq) +{ + unsigned long reg = data_port; + int i; + int regincr = 1; + + /* The Empeg board has the first two address lines unused */ + if (machine_is_empeg()) + regincr = 1 << 2; + + /* The LART doesn't use A0 for IDE */ + if (machine_is_lart()) + regincr = 1 << 1; + + memset(hw, 0, sizeof(*hw)); + + for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { + hw->io_ports[i] = reg; + reg += regincr; + } + + hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; + + if (irq) + *irq = 0; +} + +/* + * This registers the standard ports for this architecture with the IDE + * driver. + */ +static __inline__ void +ide_init_default_hwifs(void) +{ + if (machine_is_lart()) { +#ifdef CONFIG_SA1100_LART + hw_regs_t hw; + + /* Enable GPIO as interrupt line */ + GPDR &= ~LART_GPIO_IDE; + set_irq_type(LART_IRQ_IDE, IRQT_RISING); + + /* set PCMCIA interface timing */ + MECR = 0x00060006; + + /* init the interface */ + ide_init_hwif_ports(&hw, PCMCIA_IO_0_BASE + 0x0000, PCMCIA_IO_0_BASE + 0x1000, NULL); + hw.irq = LART_IRQ_IDE; + ide_register_hw(&hw); +#endif + } +} |