ide.h 1.8 KB

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