Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[linux-2.6-block.git] / include / asm-powerpc / ide.h
CommitLineData
1da177e4 1/*
b354cab0 2 * Copyright (C) 1994-1996 Linus Torvalds & authors
1da177e4 3 *
b354cab0 4 * This file contains the powerpc architecture specific IDE code.
1da177e4 5 */
b354cab0
SR
6#ifndef _ASM_POWERPC_IDE_H
7#define _ASM_POWERPC_IDE_H
1da177e4
LT
8
9#ifdef __KERNEL__
10
b354cab0 11#ifndef __powerpc64__
1da177e4
LT
12#include <linux/sched.h>
13#include <asm/mpc8xx.h>
b354cab0 14#endif
73ea9e1b 15#include <asm/io.h>
1da177e4
LT
16
17#ifndef MAX_HWIFS
b354cab0
SR
18#ifdef __powerpc64__
19#define MAX_HWIFS 10
20#else
1da177e4
LT
21#define MAX_HWIFS 8
22#endif
b354cab0 23#endif
1da177e4 24
4cb3cee0
BH
25#define __ide_mm_insw(p, a, c) readsw((void __iomem *)(p), (a), (c))
26#define __ide_mm_insl(p, a, c) readsl((void __iomem *)(p), (a), (c))
27#define __ide_mm_outsw(p, a, c) writesw((void __iomem *)(p), (a), (c))
28#define __ide_mm_outsl(p, a, c) writesl((void __iomem *)(p), (a), (c))
73ea9e1b 29
b354cab0 30#ifndef __powerpc64__
1da177e4
LT
31#include <linux/hdreg.h>
32#include <linux/ioport.h>
1da177e4 33
1d850bd0 34/* FIXME: use ide_platform host driver */
1da177e4
LT
35static __inline__ int ide_default_irq(unsigned long base)
36{
1d850bd0
BZ
37#ifdef CONFIG_PPLUS
38 switch (base) {
39 case 0x1f0: return 14;
40 case 0x170: return 15;
41 }
42#endif
43#ifdef CONFIG_PPC_PREP
44 switch (base) {
45 case 0x1f0: return 13;
46 case 0x170: return 13;
47 case 0x1e8: return 11;
48 case 0x168: return 10;
49 case 0xfff0: return 14; /* MCP(N)750 ide0 */
50 case 0xffe0: return 15; /* MCP(N)750 ide1 */
51 }
52#endif
1da177e4
LT
53 return 0;
54}
55
1d850bd0 56/* FIXME: use ide_platform host driver */
1da177e4
LT
57static __inline__ unsigned long ide_default_io_base(int index)
58{
1d850bd0
BZ
59#ifdef CONFIG_PPLUS
60 switch (index) {
61 case 0: return 0x1f0;
62 case 1: return 0x170;
63 }
64#endif
65#ifdef CONFIG_PPC_PREP
66 switch (index) {
67 case 0: return 0x1f0;
68 case 1: return 0x170;
69 case 2: return 0x1e8;
70 case 3: return 0x168;
71 }
72#endif
1da177e4
LT
73 return 0;
74}
75
e6b6e3ff 76#ifdef CONFIG_BLK_DEV_MPC8xx_IDE
1da177e4 77#define IDE_ARCH_ACK_INTR 1
18e181fe 78#define ide_ack_intr(hwif) ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1)
1da177e4
LT
79#endif
80
b354cab0
SR
81#endif /* __powerpc64__ */
82
1da177e4
LT
83#endif /* __KERNEL__ */
84
b354cab0 85#endif /* _ASM_POWERPC_IDE_H */