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 * Get rid of defs from io.h - ide has its private and conflicting versions
55 * Since so far no single m68k platform uses ISA/PCI I/O space for IDE, we
56 * always use the `raw' MMIO versions
77 #define insw(port, addr, n) raw_insw((u16 *)port, addr, n)
79 #define insl(port, addr, n) raw_insl((u32 *)port, addr, n)
80 #define outb(val, port) out_8(port, val)
81 #define outw(val, port) out_be16(port, val)
82 #define outsw(port, addr, n) raw_outsw((u16 *)port, addr, n)
83 #define outl(val, port) out_be32(port, val)
84 #define outsl(port, addr, n) raw_outsl((u32 *)port, addr, n)
87 #define __ide_mm_insw(port, addr, n) raw_insw((u16 *)port, addr, n)
89 #define __ide_mm_insl(port, addr, n) raw_insl((u32 *)port, addr, n)
90 #define writeb(val, port) out_8(port, val)
91 #define writew(val, port) out_be16(port, val)
92 #define __ide_mm_outsw(port, addr, n) raw_outsw((u16 *)port, addr, n)
93 #define writel(val, port) out_be32(port, val)
94 #define __ide_mm_outsl(port, addr, n) raw_outsl((u32 *)port, addr, n)
95 #if defined(CONFIG_ATARI) || defined(CONFIG_Q40)
96 #define insw_swapw(port, addr, n) raw_insw_swapw((u16 *)port, addr, n)
97 #define outsw_swapw(port, addr, n) raw_outsw_swapw((u16 *)port, addr, n)
101 /* Q40 and Atari have byteswapped IDE busses and since many interesting
102 * values in the identification string are text, chars and words they
103 * happened to be almost correct without swapping.. However *_capacity
104 * is needed for drives over 8 GB. RZ */
105 #if defined(CONFIG_Q40) || defined(CONFIG_ATARI)
106 #define M68K_IDE_SWAPW (MACH_IS_Q40 || MACH_IS_ATARI)
109 #ifdef CONFIG_BLK_DEV_FALCON_IDE
110 #define IDE_ARCH_LOCK
112 extern int falconide_intr_lock;
114 static __inline__ void ide_release_lock (void)
117 if (falconide_intr_lock == 0) {
118 printk("ide_release_lock: bug\n");
121 falconide_intr_lock = 0;
126 static __inline__ void
127 ide_get_lock(irqreturn_t (*handler)(int, void *, struct pt_regs *), void *data)
130 if (falconide_intr_lock == 0) {
131 if (in_interrupt() > 0)
132 panic( "Falcon IDE hasn't ST-DMA lock in interrupt" );
133 stdma_lock(handler, data);
134 falconide_intr_lock = 1;
138 #endif /* CONFIG_BLK_DEV_FALCON_IDE */
140 #define IDE_ARCH_ACK_INTR
141 #define ide_ack_intr(hwif) ((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1)
143 #endif /* __KERNEL__ */
144 #endif /* _M68K_IDE_H */