falconide.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * linux/drivers/ide/legacy/falconide.c -- Atari Falcon IDE Driver
  3. *
  4. * Created 12 Jul 1997 by Geert Uytterhoeven
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file COPYING in the main directory of this archive for
  8. * more details.
  9. */
  10. #include <linux/types.h>
  11. #include <linux/mm.h>
  12. #include <linux/interrupt.h>
  13. #include <linux/blkdev.h>
  14. #include <linux/hdreg.h>
  15. #include <linux/ide.h>
  16. #include <linux/init.h>
  17. #include <asm/setup.h>
  18. #include <asm/atarihw.h>
  19. #include <asm/atariints.h>
  20. #include <asm/atari_stdma.h>
  21. /*
  22. * Base of the IDE interface
  23. */
  24. #define ATA_HD_BASE 0xfff00000
  25. /*
  26. * Offsets from the above base
  27. */
  28. #define ATA_HD_DATA 0x00
  29. #define ATA_HD_ERROR 0x05 /* see err-bits */
  30. #define ATA_HD_NSECTOR 0x09 /* nr of sectors to read/write */
  31. #define ATA_HD_SECTOR 0x0d /* starting sector */
  32. #define ATA_HD_LCYL 0x11 /* starting cylinder */
  33. #define ATA_HD_HCYL 0x15 /* high byte of starting cyl */
  34. #define ATA_HD_SELECT 0x19 /* 101dhhhh , d=drive, hhhh=head */
  35. #define ATA_HD_STATUS 0x1d /* see status-bits */
  36. #define ATA_HD_CONTROL 0x39
  37. static int falconide_offsets[IDE_NR_PORTS] __initdata = {
  38. ATA_HD_DATA, ATA_HD_ERROR, ATA_HD_NSECTOR, ATA_HD_SECTOR, ATA_HD_LCYL,
  39. ATA_HD_HCYL, ATA_HD_SELECT, ATA_HD_STATUS, ATA_HD_CONTROL, -1
  40. };
  41. /*
  42. * falconide_intr_lock is used to obtain access to the IDE interrupt,
  43. * which is shared between several drivers.
  44. */
  45. int falconide_intr_lock;
  46. /*
  47. * Probe for a Falcon IDE interface
  48. */
  49. void __init falconide_init(void)
  50. {
  51. if (MACH_IS_ATARI && ATARIHW_PRESENT(IDE)) {
  52. hw_regs_t hw;
  53. int index;
  54. ide_setup_ports(&hw, ATA_HD_BASE, falconide_offsets,
  55. 0, 0, NULL,
  56. // falconide_iops,
  57. IRQ_MFP_IDE);
  58. index = ide_register_hw(&hw, NULL);
  59. if (index != -1)
  60. printk("ide%d: Falcon IDE interface\n", index);
  61. }
  62. }