bvme6000.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Detection routine for the NCR53c710 based BVME6000 SCSI Controllers for Linux.
  3. *
  4. * Based on work by Alan Hourihane
  5. */
  6. #include <linux/types.h>
  7. #include <linux/mm.h>
  8. #include <linux/blkdev.h>
  9. #include <linux/sched.h>
  10. #include <linux/version.h>
  11. #include <linux/zorro.h>
  12. #include <asm/setup.h>
  13. #include <asm/page.h>
  14. #include <asm/pgtable.h>
  15. #include <asm/bvme6000hw.h>
  16. #include <asm/irq.h>
  17. #include "scsi.h"
  18. #include <scsi/scsi_host.h>
  19. #include "53c7xx.h"
  20. #include "bvme6000.h"
  21. #include<linux/stat.h>
  22. int bvme6000_scsi_detect(Scsi_Host_Template *tpnt)
  23. {
  24. static unsigned char called = 0;
  25. int clock;
  26. long long options;
  27. if (called)
  28. return 0;
  29. if (!MACH_IS_BVME6000)
  30. return 0;
  31. tpnt->proc_name = "BVME6000";
  32. options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;
  33. clock = 40000000; /* 66MHz SCSI Clock */
  34. ncr53c7xx_init(tpnt, 0, 710, (unsigned long)BVME_NCR53C710_BASE,
  35. 0, BVME_IRQ_SCSI, DMA_NONE,
  36. options, clock);
  37. called = 1;
  38. return 1;
  39. }
  40. static int bvme6000_scsi_release(struct Scsi_Host *shost)
  41. {
  42. if (shost->irq)
  43. free_irq(shost->irq, NULL);
  44. if (shost->dma_channel != 0xff)
  45. free_dma(shost->dma_channel);
  46. if (shost->io_port && shost->n_io_port)
  47. release_region(shost->io_port, shost->n_io_port);
  48. scsi_unregister(shost);
  49. return 0;
  50. }
  51. static Scsi_Host_Template driver_template = {
  52. .name = "BVME6000 NCR53c710 SCSI",
  53. .detect = bvme6000_scsi_detect,
  54. .release = bvme6000_scsi_release,
  55. .queuecommand = NCR53c7xx_queue_command,
  56. .abort = NCR53c7xx_abort,
  57. .reset = NCR53c7xx_reset,
  58. .can_queue = 24,
  59. .this_id = 7,
  60. .sg_tablesize = 63,
  61. .cmd_per_lun = 3,
  62. .use_clustering = DISABLE_CLUSTERING
  63. };
  64. #include "scsi_module.c"