| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
| Stephen Rothwell | b354cab | 2005-11-08 12:20:34 +1100 | [diff] [blame] | 2 | *  Copyright (C) 1994-1996 Linus Torvalds & authors | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * | 
| Stephen Rothwell | b354cab | 2005-11-08 12:20:34 +1100 | [diff] [blame] | 4 | *  This file contains the powerpc architecture specific IDE code. | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | */ | 
| Stephen Rothwell | b354cab | 2005-11-08 12:20:34 +1100 | [diff] [blame] | 6 | #ifndef _ASM_POWERPC_IDE_H | 
|  | 7 | #define _ASM_POWERPC_IDE_H | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 |  | 
|  | 9 | #ifdef __KERNEL__ | 
|  | 10 |  | 
| Stephen Rothwell | b354cab | 2005-11-08 12:20:34 +1100 | [diff] [blame] | 11 | #ifndef __powerpc64__ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #include <linux/sched.h> | 
|  | 13 | #include <asm/mpc8xx.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #endif | 
| Stephen Rothwell | 73ea9e1 | 2006-09-19 17:30:20 +1000 | [diff] [blame] | 15 | #include <asm/io.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 |  | 
| Benjamin Herrenschmidt | 4cb3cee | 2006-11-11 17:25:10 +1100 | [diff] [blame] | 17 | #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 Rothwell | 73ea9e1 | 2006-09-19 17:30:20 +1000 | [diff] [blame] | 21 |  | 
| Stephen Rothwell | b354cab | 2005-11-08 12:20:34 +1100 | [diff] [blame] | 22 | #ifndef  __powerpc64__ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | #include <linux/ioport.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 |  | 
| Bartlomiej Zolnierkiewicz | 1d850bd | 2008-04-18 00:46:32 +0200 | [diff] [blame] | 25 | /* FIXME: use ide_platform host driver */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | static __inline__ int ide_default_irq(unsigned long base) | 
|  | 27 | { | 
| Bartlomiej Zolnierkiewicz | 1d850bd | 2008-04-18 00:46:32 +0200 | [diff] [blame] | 28 | #ifdef CONFIG_PPLUS | 
|  | 29 | switch (base) { | 
|  | 30 | case 0x1f0:	return 14; | 
|  | 31 | case 0x170:	return 15; | 
|  | 32 | } | 
|  | 33 | #endif | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | return 0; | 
|  | 35 | } | 
|  | 36 |  | 
| Bartlomiej Zolnierkiewicz | 1d850bd | 2008-04-18 00:46:32 +0200 | [diff] [blame] | 37 | /* FIXME: use ide_platform host driver */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | static __inline__ unsigned long ide_default_io_base(int index) | 
|  | 39 | { | 
| Bartlomiej Zolnierkiewicz | 1d850bd | 2008-04-18 00:46:32 +0200 | [diff] [blame] | 40 | #ifdef CONFIG_PPLUS | 
|  | 41 | switch (index) { | 
|  | 42 | case 0:		return 0x1f0; | 
|  | 43 | case 1:		return 0x170; | 
|  | 44 | } | 
|  | 45 | #endif | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | return 0; | 
|  | 47 | } | 
|  | 48 |  | 
| Adrian Bunk | e6b6e3f | 2007-08-27 23:29:53 +0200 | [diff] [blame] | 49 | #ifdef CONFIG_BLK_DEV_MPC8xx_IDE | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | #define IDE_ARCH_ACK_INTR  1 | 
| Bartlomiej Zolnierkiewicz | 18e181f | 2007-10-20 00:32:32 +0200 | [diff] [blame] | 51 | #define ide_ack_intr(hwif) ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | #endif | 
|  | 53 |  | 
| Stephen Rothwell | b354cab | 2005-11-08 12:20:34 +1100 | [diff] [blame] | 54 | #endif /* __powerpc64__ */ | 
|  | 55 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | #endif /* __KERNEL__ */ | 
|  | 57 |  | 
| Stephen Rothwell | b354cab | 2005-11-08 12:20:34 +1100 | [diff] [blame] | 58 | #endif /* _ASM_POWERPC_IDE_H */ |