2 * linux/include/asm-m68k/ide.h
4 * Copyright (C) 1994-1996 Linus Torvalds & authors
7 /* Copyright(c) 1996 Kars de Jong */
8 /* Based on the ide driver from 1.2.13pl8 */
11 * Credits (alphabetical):
26 * - Geert Uytterhoeven
34 #include <linux/config.h>
36 #include <asm/setup.h>
41 #include <linux/interrupt.h>
42 #include <asm/atari_stdma.h>
46 #include <asm/macints.h>
50 #define MAX_HWIFS 4 /* same as the other archs */
54 static __inline__ int ide_default_irq(unsigned long base)
59 static __inline__ unsigned long ide_default_io_base(int index)
66 * Set up a hw structure for a specified data port, control port and IRQ.
67 * This should follow whatever the default interface uses.
69 static __inline__ void ide_init_hwif_ports(hw_regs_t *hw,
70 unsigned long data_port,
71 unsigned long ctrl_port, int *irq)
73 if (data_port || ctrl_port)
74 printk("ide_init_hwif_ports: must not be called\n");
77 #define ide_init_default_irq(base) (0)
80 * Get rid of defs from io.h - ide has its private and conflicting versions
81 * Since so far no single m68k platform uses ISA/PCI I/O space for IDE, we
82 * always use the `raw' MMIO versions
103 #define insw(port, addr, n) raw_insw((u16 *)port, addr, n)
105 #define insl(port, addr, n) raw_insl((u32 *)port, addr, n)
106 #define outb(val, port) out_8(port, val)
107 #define outw(val, port) out_be16(port, val)
108 #define outsw(port, addr, n) raw_outsw((u16 *)port, addr, n)
109 #define outl(val, port) out_be32(port, val)
110 #define outsl(port, addr, n) raw_outsl((u32 *)port, addr, n)
112 #define readw in_be16
113 #define __ide_mm_insw(port, addr, n) raw_insw((u16 *)port, addr, n)
114 #define readl in_be32
115 #define __ide_mm_insl(port, addr, n) raw_insl((u32 *)port, addr, n)
116 #define writeb(val, port) out_8(port, val)
117 #define writew(val, port) out_be16(port, val)
118 #define __ide_mm_outsw(port, addr, n) raw_outsw((u16 *)port, addr, n)
119 #define writel(val, port) out_be32(port, val)
120 #define __ide_mm_outsl(port, addr, n) raw_outsl((u32 *)port, addr, n)
121 #if defined(CONFIG_ATARI) || defined(CONFIG_Q40)
122 #define insw_swapw(port, addr, n) raw_insw_swapw((u16 *)port, addr, n)
123 #define outsw_swapw(port, addr, n) raw_outsw_swapw((u16 *)port, addr, n)
127 /* Q40 and Atari have byteswapped IDE busses and since many interesting
128 * values in the identification string are text, chars and words they
129 * happened to be almost correct without swapping.. However *_capacity
130 * is needed for drives over 8 GB. RZ */
131 #if defined(CONFIG_Q40) || defined(CONFIG_ATARI)
132 #define M68K_IDE_SWAPW (MACH_IS_Q40 || MACH_IS_ATARI)
135 #ifdef CONFIG_BLK_DEV_FALCON_IDE
136 #define IDE_ARCH_LOCK
138 extern int falconide_intr_lock;
140 static __inline__ void ide_release_lock (void)
143 if (falconide_intr_lock == 0) {
144 printk("ide_release_lock: bug\n");
147 falconide_intr_lock = 0;
152 static __inline__ void
153 ide_get_lock(irqreturn_t (*handler)(int, void *, struct pt_regs *), void *data)
156 if (falconide_intr_lock == 0) {
157 if (in_interrupt() > 0)
158 panic( "Falcon IDE hasn't ST-DMA lock in interrupt" );
159 stdma_lock(handler, data);
160 falconide_intr_lock = 1;
164 #endif /* CONFIG_BLK_DEV_FALCON_IDE */
166 #define IDE_ARCH_ACK_INTR
167 #define ide_ack_intr(hwif) ((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1)
169 #endif /* __KERNEL__ */
170 #endif /* _M68K_IDE_H */