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
35 #include <asm/setup.h>
40 #include <linux/interrupt.h>
41 #include <asm/atari_stdma.h>
45 #include <asm/macints.h>
49 * Get rid of defs from io.h - ide has its private and conflicting versions
50 * Since so far no single m68k platform uses ISA/PCI I/O space for IDE, we
51 * always use the `raw' MMIO versions
72 #define insw(port, addr, n) raw_insw((u16 *)port, addr, n)
74 #define insl(port, addr, n) raw_insl((u32 *)port, addr, n)
75 #define outb(val, port) out_8(port, val)
76 #define outw(val, port) out_be16(port, val)
77 #define outsw(port, addr, n) raw_outsw((u16 *)port, addr, n)
78 #define outl(val, port) out_be32(port, val)
79 #define outsl(port, addr, n) raw_outsl((u32 *)port, addr, n)
82 #define __ide_mm_insw(port, addr, n) raw_insw((u16 *)port, addr, n)
84 #define __ide_mm_insl(port, addr, n) raw_insl((u32 *)port, addr, n)
85 #define writeb(val, port) out_8(port, val)
86 #define writew(val, port) out_be16(port, val)
87 #define __ide_mm_outsw(port, addr, n) raw_outsw((u16 *)port, addr, n)
88 #define writel(val, port) out_be32(port, val)
89 #define __ide_mm_outsl(port, addr, n) raw_outsl((u32 *)port, addr, n)
90 #if defined(CONFIG_ATARI) || defined(CONFIG_Q40)
91 #define insw_swapw(port, addr, n) raw_insw_swapw((u16 *)port, addr, n)
92 #define outsw_swapw(port, addr, n) raw_outsw_swapw((u16 *)port, addr, n)
96 /* Q40 and Atari have byteswapped IDE busses and since many interesting
97 * values in the identification string are text, chars and words they
98 * happened to be almost correct without swapping.. However *_capacity
99 * is needed for drives over 8 GB. RZ */
100 #if defined(CONFIG_Q40) || defined(CONFIG_ATARI)
101 #define M68K_IDE_SWAPW (MACH_IS_Q40 || MACH_IS_ATARI)
104 #ifdef CONFIG_BLK_DEV_FALCON_IDE
105 #define IDE_ARCH_LOCK
107 extern int falconide_intr_lock
;
109 static __inline__
void ide_release_lock (void)
112 if (falconide_intr_lock
== 0) {
113 printk("ide_release_lock: bug\n");
116 falconide_intr_lock
= 0;
121 static __inline__
void
122 ide_get_lock(irq_handler_t handler
, void *data
)
125 if (falconide_intr_lock
== 0) {
126 if (in_interrupt() > 0)
127 panic( "Falcon IDE hasn't ST-DMA lock in interrupt" );
128 stdma_lock(handler
, data
);
129 falconide_intr_lock
= 1;
133 #endif /* CONFIG_BLK_DEV_FALCON_IDE */
135 #define IDE_ARCH_ACK_INTR
136 #define ide_ack_intr(hwif) ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1)
138 #endif /* __KERNEL__ */
139 #endif /* _M68K_IDE_H */