ide.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * linux/include/asm-cris/ide.h
  3. *
  4. * Copyright (C) 2000-2004 Axis Communications AB
  5. *
  6. * Authors: Bjorn Wesen, Mikael Starvik
  7. *
  8. */
  9. /*
  10. * This file contains the ETRAX FS specific IDE code.
  11. */
  12. #ifndef __ASMCRIS_IDE_H
  13. #define __ASMCRIS_IDE_H
  14. #ifdef __KERNEL__
  15. #include <asm/arch/hwregs/intr_vect.h>
  16. #include <asm/arch/hwregs/ata_defs.h>
  17. #include <asm/io.h>
  18. #include <asm-generic/ide_iops.h>
  19. /* ETRAX FS can support 4 IDE busses on the same pins (serialized) */
  20. #define MAX_HWIFS 4
  21. extern __inline__ int ide_default_irq(unsigned long base)
  22. {
  23. /* all IDE busses share the same IRQ,
  24. * this has the side-effect that ide-probe.c will cluster our 4 interfaces
  25. * together in a hwgroup, and will serialize accesses. this is good, because
  26. * we can't access more than one interface at the same time on ETRAX100.
  27. */
  28. return ATA_INTR_VECT;
  29. }
  30. extern __inline__ unsigned long ide_default_io_base(int index)
  31. {
  32. reg_ata_rw_ctrl2 ctrl2 = {.sel = index};
  33. /* we have no real I/O base address per interface, since all go through the
  34. * same register. but in a bitfield in that register, we have the i/f number.
  35. * so we can use the io_base to remember that bitfield.
  36. */
  37. ctrl2.sel = index;
  38. return REG_TYPE_CONV(unsigned long, reg_ata_rw_ctrl2, ctrl2);
  39. }
  40. /* some configuration options we don't need */
  41. #undef SUPPORT_VLB_SYNC
  42. #define SUPPORT_VLB_SYNC 0
  43. #define IDE_ARCH_ACK_INTR
  44. #define ide_ack_intr(hwif) (hwif)->hw.ack_intr(hwif)
  45. #endif /* __KERNEL__ */
  46. #endif /* __ASMCRIS_IDE_H */