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 |
| 15 | |
Stephen Rothwell | b354cab | 2005-11-08 12:20:34 +1100 | [diff] [blame] | 16 | #ifndef MAX_HWIFS |
| 17 | #ifdef __powerpc64__ |
| 18 | #define MAX_HWIFS 10 |
| 19 | #else |
| 20 | #define MAX_HWIFS 8 |
| 21 | #endif |
| 22 | #endif |
| 23 | |
| 24 | #ifndef __powerpc64__ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | #include <linux/hdreg.h> |
| 26 | #include <linux/ioport.h> |
| 27 | #include <asm/io.h> |
| 28 | |
| 29 | extern void __ide_mm_insw(void __iomem *port, void *addr, u32 count); |
| 30 | extern void __ide_mm_outsw(void __iomem *port, void *addr, u32 count); |
| 31 | extern void __ide_mm_insl(void __iomem *port, void *addr, u32 count); |
| 32 | extern void __ide_mm_outsl(void __iomem *port, void *addr, u32 count); |
| 33 | |
| 34 | struct ide_machdep_calls { |
| 35 | int (*default_irq)(unsigned long base); |
| 36 | unsigned long (*default_io_base)(int index); |
| 37 | void (*ide_init_hwif)(hw_regs_t *hw, |
| 38 | unsigned long data_port, |
| 39 | unsigned long ctrl_port, |
| 40 | int *irq); |
| 41 | }; |
| 42 | |
| 43 | extern struct ide_machdep_calls ppc_ide_md; |
| 44 | |
| 45 | #undef SUPPORT_SLOW_DATA_PORTS |
| 46 | #define SUPPORT_SLOW_DATA_PORTS 0 |
| 47 | |
| 48 | #define IDE_ARCH_OBSOLETE_DEFAULTS |
| 49 | |
| 50 | static __inline__ int ide_default_irq(unsigned long base) |
| 51 | { |
| 52 | if (ppc_ide_md.default_irq) |
| 53 | return ppc_ide_md.default_irq(base); |
| 54 | return 0; |
| 55 | } |
| 56 | |
| 57 | static __inline__ unsigned long ide_default_io_base(int index) |
| 58 | { |
| 59 | if (ppc_ide_md.default_io_base) |
| 60 | return ppc_ide_md.default_io_base(index); |
| 61 | return 0; |
| 62 | } |
| 63 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | #ifdef CONFIG_PCI |
| 65 | #define ide_init_default_irq(base) (0) |
| 66 | #else |
| 67 | #define ide_init_default_irq(base) ide_default_irq(base) |
| 68 | #endif |
| 69 | |
| 70 | #if (defined CONFIG_APUS || defined CONFIG_BLK_DEV_MPC8xx_IDE ) |
| 71 | #define IDE_ARCH_ACK_INTR 1 |
| 72 | #define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1) |
| 73 | #endif |
| 74 | |
Stephen Rothwell | b354cab | 2005-11-08 12:20:34 +1100 | [diff] [blame] | 75 | #endif /* __powerpc64__ */ |
| 76 | |
| 77 | #define IDE_ARCH_OBSOLETE_INIT |
| 78 | #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ |
| 79 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | #endif /* __KERNEL__ */ |
| 81 | |
Stephen Rothwell | b354cab | 2005-11-08 12:20:34 +1100 | [diff] [blame] | 82 | #endif /* _ASM_POWERPC_IDE_H */ |