ide.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #define __ide_mm_insw(p, a, c) readsw((void __iomem *)(p), (a), (c))
  15. #define __ide_mm_insl(p, a, c) readsl((void __iomem *)(p), (a), (c))
  16. #define __ide_mm_outsw(p, a, c) writesw((void __iomem *)(p), (a), (c))
  17. #define __ide_mm_outsl(p, a, c) writesl((void __iomem *)(p), (a), (c))
  18. #ifndef __powerpc64__
  19. #include <linux/ioport.h>
  20. /* FIXME: use ide_platform host driver */
  21. static __inline__ int ide_default_irq(unsigned long base)
  22. {
  23. #ifdef CONFIG_PPLUS
  24. switch (base) {
  25. case 0x1f0: return 14;
  26. case 0x170: return 15;
  27. }
  28. #endif
  29. return 0;
  30. }
  31. /* FIXME: use ide_platform host driver */
  32. static __inline__ unsigned long ide_default_io_base(int index)
  33. {
  34. #ifdef CONFIG_PPLUS
  35. switch (index) {
  36. case 0: return 0x1f0;
  37. case 1: return 0x170;
  38. }
  39. #endif
  40. return 0;
  41. }
  42. #ifdef CONFIG_BLK_DEV_MPC8xx_IDE
  43. #define IDE_ARCH_ACK_INTR 1
  44. #define ide_ack_intr(hwif) ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1)
  45. #endif
  46. #endif /* __powerpc64__ */
  47. #endif /* __KERNEL__ */
  48. #endif /* _ASM_POWERPC_IDE_H */