ide.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. #ifndef MAX_HWIFS
  14. #ifdef __powerpc64__
  15. #define MAX_HWIFS 10
  16. #else
  17. #define MAX_HWIFS 8
  18. #endif
  19. #endif
  20. #ifndef __powerpc64__
  21. #include <linux/config.h>
  22. #include <linux/hdreg.h>
  23. #include <linux/ioport.h>
  24. #include <asm/io.h>
  25. extern void __ide_mm_insw(void __iomem *port, void *addr, u32 count);
  26. extern void __ide_mm_outsw(void __iomem *port, void *addr, u32 count);
  27. extern void __ide_mm_insl(void __iomem *port, void *addr, u32 count);
  28. extern void __ide_mm_outsl(void __iomem *port, void *addr, u32 count);
  29. struct ide_machdep_calls {
  30. int (*default_irq)(unsigned long base);
  31. unsigned long (*default_io_base)(int index);
  32. void (*ide_init_hwif)(hw_regs_t *hw,
  33. unsigned long data_port,
  34. unsigned long ctrl_port,
  35. int *irq);
  36. };
  37. extern struct ide_machdep_calls ppc_ide_md;
  38. #undef SUPPORT_SLOW_DATA_PORTS
  39. #define SUPPORT_SLOW_DATA_PORTS 0
  40. #define IDE_ARCH_OBSOLETE_DEFAULTS
  41. static __inline__ int ide_default_irq(unsigned long base)
  42. {
  43. if (ppc_ide_md.default_irq)
  44. return ppc_ide_md.default_irq(base);
  45. return 0;
  46. }
  47. static __inline__ unsigned long ide_default_io_base(int index)
  48. {
  49. if (ppc_ide_md.default_io_base)
  50. return ppc_ide_md.default_io_base(index);
  51. return 0;
  52. }
  53. #ifdef CONFIG_PCI
  54. #define ide_init_default_irq(base) (0)
  55. #else
  56. #define ide_init_default_irq(base) ide_default_irq(base)
  57. #endif
  58. #if (defined CONFIG_APUS || defined CONFIG_BLK_DEV_MPC8xx_IDE )
  59. #define IDE_ARCH_ACK_INTR 1
  60. #define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1)
  61. #endif
  62. #endif /* __powerpc64__ */
  63. #define IDE_ARCH_OBSOLETE_INIT
  64. #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
  65. #endif /* __KERNEL__ */
  66. #endif /* _ASM_POWERPC_IDE_H */