ide.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * linux/include/asm-i386/ide.h
  3. *
  4. * Copyright (C) 1994-1996 Linus Torvalds & authors
  5. */
  6. /*
  7. * This file contains the i386 architecture specific IDE code.
  8. */
  9. #ifndef __ASMi386_IDE_H
  10. #define __ASMi386_IDE_H
  11. #ifdef __KERNEL__
  12. #ifndef MAX_HWIFS
  13. # ifdef CONFIG_BLK_DEV_IDEPCI
  14. #define MAX_HWIFS 10
  15. # else
  16. #define MAX_HWIFS 6
  17. # endif
  18. #endif
  19. #define IDE_ARCH_OBSOLETE_DEFAULTS
  20. static __inline__ int ide_default_irq(unsigned long base)
  21. {
  22. switch (base) {
  23. case 0x1f0: return 14;
  24. case 0x170: return 15;
  25. case 0x1e8: return 11;
  26. case 0x168: return 10;
  27. case 0x1e0: return 8;
  28. case 0x160: return 12;
  29. default:
  30. return 0;
  31. }
  32. }
  33. static __inline__ unsigned long ide_default_io_base(int index)
  34. {
  35. /*
  36. * If PCI is present then it is not safe to poke around
  37. * the other legacy IDE ports. Only 0x1f0 and 0x170 are
  38. * defined compatibility mode ports for PCI. A user can
  39. * override this using ide= but we must default safe.
  40. */
  41. if (no_pci_devices()) {
  42. switch(index) {
  43. case 2: return 0x1e8;
  44. case 3: return 0x168;
  45. case 4: return 0x1e0;
  46. case 5: return 0x160;
  47. }
  48. }
  49. switch (index) {
  50. case 0: return 0x1f0;
  51. case 1: return 0x170;
  52. default:
  53. return 0;
  54. }
  55. }
  56. #define IDE_ARCH_OBSOLETE_INIT
  57. #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
  58. #ifdef CONFIG_BLK_DEV_IDEPCI
  59. #define ide_init_default_irq(base) (0)
  60. #else
  61. #define ide_init_default_irq(base) ide_default_irq(base)
  62. #endif
  63. #include <asm-generic/ide_iops.h>
  64. #endif /* __KERNEL__ */
  65. #endif /* __ASMi386_IDE_H */