bvme6000.c 1.7 KB

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