ide.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * linux/include/asm-ppc/ide.h
  3. *
  4. * Copyright (C) 1994-1996 Linus Torvalds & authors */
  5. /*
  6. * This file contains the ppc architecture specific IDE code.
  7. */
  8. #ifndef __ASMPPC_IDE_H
  9. #define __ASMPPC_IDE_H
  10. #ifdef __KERNEL__
  11. #include <linux/sched.h>
  12. #include <asm/mpc8xx.h>
  13. #ifndef MAX_HWIFS
  14. #define MAX_HWIFS 8
  15. #endif
  16. #include <linux/config.h>
  17. #include <linux/hdreg.h>
  18. #include <linux/ioport.h>
  19. #include <asm/io.h>
  20. extern void __ide_mm_insw(void __iomem *port, void *addr, u32 count);
  21. extern void __ide_mm_outsw(void __iomem *port, void *addr, u32 count);
  22. extern void __ide_mm_insl(void __iomem *port, void *addr, u32 count);
  23. extern void __ide_mm_outsl(void __iomem *port, void *addr, u32 count);
  24. struct ide_machdep_calls {
  25. int (*default_irq)(unsigned long base);
  26. unsigned long (*default_io_base)(int index);
  27. void (*ide_init_hwif)(hw_regs_t *hw,
  28. unsigned long data_port,
  29. unsigned long ctrl_port,
  30. int *irq);
  31. };
  32. extern struct ide_machdep_calls ppc_ide_md;
  33. #undef SUPPORT_SLOW_DATA_PORTS
  34. #define SUPPORT_SLOW_DATA_PORTS 0
  35. #define IDE_ARCH_OBSOLETE_DEFAULTS
  36. static __inline__ int ide_default_irq(unsigned long base)
  37. {
  38. if (ppc_ide_md.default_irq)
  39. return ppc_ide_md.default_irq(base);
  40. return 0;
  41. }
  42. static __inline__ unsigned long ide_default_io_base(int index)
  43. {
  44. if (ppc_ide_md.default_io_base)
  45. return ppc_ide_md.default_io_base(index);
  46. return 0;
  47. }
  48. #define IDE_ARCH_OBSOLETE_INIT
  49. #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
  50. #ifdef CONFIG_PCI
  51. #define ide_init_default_irq(base) (0)
  52. #else
  53. #define ide_init_default_irq(base) ide_default_irq(base)
  54. #endif
  55. #if (defined CONFIG_APUS || defined CONFIG_BLK_DEV_MPC8xx_IDE )
  56. #define IDE_ARCH_ACK_INTR 1
  57. #define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1)
  58. #endif
  59. #endif /* __KERNEL__ */
  60. #endif /* __ASMPPC_IDE_H */