ide.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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/hdreg.h>
  20. #include <linux/ioport.h>
  21. /* FIXME: use ide_platform host driver */
  22. static __inline__ int ide_default_irq(unsigned long base)
  23. {
  24. #ifdef CONFIG_PPLUS
  25. switch (base) {
  26. case 0x1f0: return 14;
  27. case 0x170: return 15;
  28. }
  29. #endif
  30. return 0;
  31. }
  32. /* FIXME: use ide_platform host driver */
  33. static __inline__ unsigned long ide_default_io_base(int index)
  34. {
  35. #ifdef CONFIG_PPLUS
  36. switch (index) {
  37. case 0: return 0x1f0;
  38. case 1: return 0x170;
  39. }
  40. #endif
  41. return 0;
  42. }
  43. #ifdef CONFIG_BLK_DEV_MPC8xx_IDE
  44. #define IDE_ARCH_ACK_INTR 1
  45. #define ide_ack_intr(hwif) ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1)
  46. #endif
  47. #endif /* __powerpc64__ */
  48. #endif /* __KERNEL__ */
  49. #endif /* _ASM_POWERPC_IDE_H */