ide.h 1.5 KB

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