~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/asm-m68k/ide.h

Version: ~ [ linux-5.2-rc1 ] ~ [ linux-5.1.2 ] ~ [ linux-5.0.16 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.43 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.119 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.176 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.179 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.139 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.67 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *  linux/include/asm-m68k/ide.h
  3  *
  4  *  Copyright (C) 1994-1996  Linus Torvalds & authors
  5  */
  6  
  7 /* Copyright(c) 1996 Kars de Jong */
  8 /* Based on the ide driver from 1.2.13pl8 */
  9 
 10 /*
 11  * Credits (alphabetical):
 12  *
 13  *  - Bjoern Brauel
 14  *  - Kars de Jong
 15  *  - Torsten Ebeling
 16  *  - Dwight Engen
 17  *  - Thorsten Floeck
 18  *  - Roman Hodek
 19  *  - Guenther Kelleter
 20  *  - Chris Lawrence
 21  *  - Michael Rausch
 22  *  - Christian Sauer
 23  *  - Michael Schmitz
 24  *  - Jes Soerensen
 25  *  - Michael Thurm
 26  *  - Geert Uytterhoeven
 27  */
 28 
 29 #ifndef _M68K_IDE_H
 30 #define _M68K_IDE_H
 31 
 32 #ifdef __KERNEL__
 33 
 34 #include <linux/config.h>
 35 
 36 #include <asm/setup.h>
 37 #include <asm/io.h>
 38 #include <asm/irq.h>
 39 
 40 #ifdef CONFIG_ATARI
 41 #include <linux/interrupt.h>
 42 #include <asm/atari_stdma.h>
 43 #endif
 44 
 45 #ifdef CONFIG_MAC
 46 #include <asm/macints.h>
 47 #endif
 48 
 49 #ifndef MAX_HWIFS
 50 #define MAX_HWIFS       4       /* same as the other archs */
 51 #endif
 52 
 53 
 54 static __inline__ int ide_default_irq(unsigned long base)
 55 {
 56           return 0;
 57 }
 58 
 59 static __inline__ unsigned long ide_default_io_base(int index)
 60 {
 61           return 0;
 62 }
 63 
 64 
 65 /*
 66  * Set up a hw structure for a specified data port, control port and IRQ.
 67  * This should follow whatever the default interface uses.
 68  */
 69 static __inline__ void ide_init_hwif_ports(hw_regs_t *hw,
 70                                            unsigned long data_port,
 71                                            unsigned long ctrl_port, int *irq)
 72 {
 73         if (data_port || ctrl_port)
 74                 printk("ide_init_hwif_ports: must not be called\n");
 75 }
 76 
 77 /*
 78  * This registers the standard ports for this architecture with the IDE
 79  * driver.
 80  */
 81 static __inline__ void ide_init_default_hwifs(void)
 82 {
 83 }
 84 
 85 /*
 86  * Get rid of defs from io.h - ide has its private and conflicting versions
 87  * Since so far no single m68k platform uses ISA/PCI I/O space for IDE, we
 88  * always use the `raw' MMIO versions
 89  */
 90 #undef inb
 91 #undef inw
 92 #undef insw
 93 #undef inl
 94 #undef insl
 95 #undef outb
 96 #undef outw
 97 #undef outsw
 98 #undef outl
 99 #undef outsl
100 #undef readb
101 #undef readw
102 #undef readl
103 #undef writeb
104 #undef writew
105 #undef writel
106 
107 #define inb                             in_8
108 #define inw                             in_be16
109 #define insw(port, addr, n)             raw_insw((u16 *)port, addr, n)
110 #define inl                             in_be32
111 #define insl(port, addr, n)             raw_insl((u32 *)port, addr, n)
112 #define outb(val, port)                 out_8(port, val)
113 #define outw(val, port)                 out_be16(port, val)
114 #define outsw(port, addr, n)            raw_outsw((u16 *)port, addr, n)
115 #define outl(val, port)                 out_be32(port, val)
116 #define outsl(port, addr, n)            raw_outsl((u32 *)port, addr, n)
117 #define readb                           in_8
118 #define readw                           in_be16
119 #define __ide_mm_insw(port, addr, n)    raw_insw((u16 *)port, addr, n)
120 #define readl                           in_be32
121 #define __ide_mm_insl(port, addr, n)    raw_insl((u32 *)port, addr, n)
122 #define writeb(val, port)               out_8(port, val)
123 #define writew(val, port)               out_be16(port, val)
124 #define __ide_mm_outsw(port, addr, n)   raw_outsw((u16 *)port, addr, n)
125 #define writel(val, port)               out_be32(port, val)
126 #define __ide_mm_outsl(port, addr, n)   raw_outsl((u32 *)port, addr, n)
127 #if defined(CONFIG_ATARI) || defined(CONFIG_Q40)
128 #define insw_swapw(port, addr, n)       raw_insw_swapw((u16 *)port, addr, n)
129 #define outsw_swapw(port, addr, n)      raw_outsw_swapw((u16 *)port, addr, n)
130 #endif
131 
132 
133 /* Q40 and Atari have byteswapped IDE busses and since many interesting
134  * values in the identification string are text, chars and words they
135  * happened to be almost correct without swapping.. However *_capacity
136  * is needed for drives over 8 GB. RZ */
137 #if defined(CONFIG_Q40) || defined(CONFIG_ATARI)
138 #define M68K_IDE_SWAPW  (MACH_IS_Q40 || MACH_IS_ATARI)
139 #endif
140 
141 #ifdef CONFIG_BLK_DEV_FALCON_IDE
142 #define IDE_ARCH_LOCK
143 
144 extern int falconide_intr_lock;
145 
146 static __inline__ void ide_release_lock (void)
147 {
148         if (MACH_IS_ATARI) {
149                 if (falconide_intr_lock == 0) {
150                         printk("ide_release_lock: bug\n");
151                         return;
152                 }
153                 falconide_intr_lock = 0;
154                 stdma_release();
155         }
156 }
157 
158 static __inline__ void
159 ide_get_lock(irqreturn_t (*handler)(int, void *, struct pt_regs *), void *data)
160 {
161         if (MACH_IS_ATARI) {
162                 if (falconide_intr_lock == 0) {
163                         if (in_interrupt() > 0)
164                                 panic( "Falcon IDE hasn't ST-DMA lock in interrupt" );
165                         stdma_lock(handler, data);
166                         falconide_intr_lock = 1;
167                 }
168         }
169 }
170 #endif /* CONFIG_BLK_DEV_FALCON_IDE */
171 
172 #define IDE_ARCH_ACK_INTR
173 #define ide_ack_intr(hwif)      ((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1)
174 
175 #endif /* __KERNEL__ */
176 #endif /* _M68K_IDE_H */
177 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp