ide.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef _ASM_M32R_IDE_H
  2. #define _ASM_M32R_IDE_H
  3. /*
  4. * linux/include/asm-m32r/ide.h
  5. *
  6. * Copyright (C) 1994-1996 Linus Torvalds & authors
  7. */
  8. /*
  9. * This file contains the i386 architecture specific IDE code.
  10. */
  11. #ifdef __KERNEL__
  12. #include <asm/m32r.h>
  13. #ifndef MAX_HWIFS
  14. # ifdef CONFIG_BLK_DEV_IDEPCI
  15. #define MAX_HWIFS 10
  16. # else
  17. #define MAX_HWIFS 2
  18. # endif
  19. #endif
  20. #define IDE_ARCH_OBSOLETE_DEFAULTS
  21. static __inline__ int ide_default_irq(unsigned long base)
  22. {
  23. switch (base) {
  24. #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \
  25. || defined(CONFIG_PLAT_OPSPUT)
  26. case 0x1f0: return PLD_IRQ_CFIREQ;
  27. default:
  28. return 0;
  29. #elif defined(CONFIG_PLAT_MAPPI3)
  30. case 0x1f0: return PLD_IRQ_CFIREQ;
  31. case 0x170: return PLD_IRQ_IDEIREQ;
  32. default:
  33. return 0;
  34. #else
  35. case 0x1f0: return 14;
  36. case 0x170: return 15;
  37. case 0x1e8: return 11;
  38. case 0x168: return 10;
  39. case 0x1e0: return 8;
  40. case 0x160: return 12;
  41. default:
  42. return 0;
  43. #endif
  44. }
  45. }
  46. static __inline__ unsigned long ide_default_io_base(int index)
  47. {
  48. switch (index) {
  49. case 0: return 0x1f0;
  50. case 1: return 0x170;
  51. case 2: return 0x1e8;
  52. case 3: return 0x168;
  53. case 4: return 0x1e0;
  54. case 5: return 0x160;
  55. default:
  56. return 0;
  57. }
  58. }
  59. #define IDE_ARCH_OBSOLETE_INIT
  60. #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
  61. #ifdef CONFIG_BLK_DEV_IDEPCI
  62. #define ide_init_default_irq(base) (0)
  63. #else
  64. #define ide_init_default_irq(base) ide_default_irq(base)
  65. #endif
  66. #include <asm-generic/ide_iops.h>
  67. #endif /* __KERNEL__ */
  68. #endif /* _ASM_M32R_IDE_H */