falconide.c
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *  linux/drivers/ide/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.      *  Probe for a Falcon IDE interface
  43.      */
  44. void __init falconide_init(void)
  45. {
  46.     if (MACH_IS_ATARI && ATARIHW_PRESENT(IDE)) {
  47. hw_regs_t hw;
  48. int index;
  49. ide_setup_ports(&hw, (ide_ioreg_t)ATA_HD_BASE, falconide_offsets,
  50. 0, 0, NULL, IRQ_MFP_IDE);
  51. index = ide_register_hw(&hw, NULL);
  52. if (index != -1)
  53.     printk("ide%d: Falcon IDE interfacen", index);
  54.     }
  55. }