blob: 1aaf27be8741a3ab9f52a3e538376a38978be779 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Stephen Rothwellb354cab2005-11-08 12:20:34 +11002 * Copyright (C) 1994-1996 Linus Torvalds & authors
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
Stephen Rothwellb354cab2005-11-08 12:20:34 +11004 * This file contains the powerpc architecture specific IDE code.
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 */
Stephen Rothwellb354cab2005-11-08 12:20:34 +11006#ifndef _ASM_POWERPC_IDE_H
7#define _ASM_POWERPC_IDE_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
9#ifdef __KERNEL__
10
Stephen Rothwellb354cab2005-11-08 12:20:34 +110011#ifndef __powerpc64__
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#include <linux/sched.h>
13#include <asm/mpc8xx.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070014#endif
Stephen Rothwell73ea9e12006-09-19 17:30:20 +100015#include <asm/io.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
Benjamin Herrenschmidt4cb3cee2006-11-11 17:25:10 +110017#define __ide_mm_insw(p, a, c) readsw((void __iomem *)(p), (a), (c))
18#define __ide_mm_insl(p, a, c) readsl((void __iomem *)(p), (a), (c))
19#define __ide_mm_outsw(p, a, c) writesw((void __iomem *)(p), (a), (c))
20#define __ide_mm_outsl(p, a, c) writesl((void __iomem *)(p), (a), (c))
Stephen Rothwell73ea9e12006-09-19 17:30:20 +100021
Stephen Rothwellb354cab2005-11-08 12:20:34 +110022#ifndef __powerpc64__
Linus Torvalds1da177e2005-04-16 15:20:36 -070023#include <linux/hdreg.h>
24#include <linux/ioport.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
Bartlomiej Zolnierkiewicz1d850bd2008-04-18 00:46:32 +020026/* FIXME: use ide_platform host driver */
Linus Torvalds1da177e2005-04-16 15:20:36 -070027static __inline__ int ide_default_irq(unsigned long base)
28{
Bartlomiej Zolnierkiewicz1d850bd2008-04-18 00:46:32 +020029#ifdef CONFIG_PPLUS
30 switch (base) {
31 case 0x1f0: return 14;
32 case 0x170: return 15;
33 }
34#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070035 return 0;
36}
37
Bartlomiej Zolnierkiewicz1d850bd2008-04-18 00:46:32 +020038/* FIXME: use ide_platform host driver */
Linus Torvalds1da177e2005-04-16 15:20:36 -070039static __inline__ unsigned long ide_default_io_base(int index)
40{
Bartlomiej Zolnierkiewicz1d850bd2008-04-18 00:46:32 +020041#ifdef CONFIG_PPLUS
42 switch (index) {
43 case 0: return 0x1f0;
44 case 1: return 0x170;
45 }
46#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070047 return 0;
48}
49
Adrian Bunke6b6e3f2007-08-27 23:29:53 +020050#ifdef CONFIG_BLK_DEV_MPC8xx_IDE
Linus Torvalds1da177e2005-04-16 15:20:36 -070051#define IDE_ARCH_ACK_INTR 1
Bartlomiej Zolnierkiewicz18e181f2007-10-20 00:32:32 +020052#define ide_ack_intr(hwif) ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1)
Linus Torvalds1da177e2005-04-16 15:20:36 -070053#endif
54
Stephen Rothwellb354cab2005-11-08 12:20:34 +110055#endif /* __powerpc64__ */
56
Linus Torvalds1da177e2005-04-16 15:20:36 -070057#endif /* __KERNEL__ */
58
Stephen Rothwellb354cab2005-11-08 12:20:34 +110059#endif /* _ASM_POWERPC_IDE_H */