ide.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. struct ide_machdep_calls {
  29. int (*default_irq)(unsigned long base);
  30. unsigned long (*default_io_base)(int index);
  31. void (*ide_init_hwif)(hw_regs_t *hw,
  32. unsigned long data_port,
  33. unsigned long ctrl_port,
  34. int *irq);
  35. };
  36. extern struct ide_machdep_calls ppc_ide_md;
  37. #undef SUPPORT_SLOW_DATA_PORTS
  38. #define SUPPORT_SLOW_DATA_PORTS 0
  39. #define IDE_ARCH_OBSOLETE_DEFAULTS
  40. static __inline__ int ide_default_irq(unsigned long base)
  41. {
  42. if (ppc_ide_md.default_irq)
  43. return ppc_ide_md.default_irq(base);
  44. return 0;
  45. }
  46. static __inline__ unsigned long ide_default_io_base(int index)
  47. {
  48. if (ppc_ide_md.default_io_base)
  49. return ppc_ide_md.default_io_base(index);
  50. return 0;
  51. }
  52. #ifdef CONFIG_PCI
  53. #define ide_init_default_irq(base) (0)
  54. #else
  55. #define ide_init_default_irq(base) ide_default_irq(base)
  56. #endif
  57. #ifdef CONFIG_BLK_DEV_MPC8xx_IDE
  58. #define IDE_ARCH_ACK_INTR 1
  59. #define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1)
  60. #endif
  61. #endif /* __powerpc64__ */
  62. #define IDE_ARCH_OBSOLETE_INIT
  63. #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
  64. #endif /* __KERNEL__ */
  65. #endif /* _ASM_POWERPC_IDE_H */