bvme6000.c 1.7 KB

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