mvme16x.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Detection routine for the NCR53c710 based MVME16x 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 <asm/page.h>
  11. #include <asm/pgtable.h>
  12. #include <asm/mvme16xhw.h>
  13. #include <asm/irq.h>
  14. #include "scsi.h"
  15. #include <scsi/scsi_host.h>
  16. #include "53c7xx.h"
  17. #include "mvme16x.h"
  18. #include<linux/stat.h>
  19. int mvme16x_scsi_detect(struct scsi_host_template *tpnt)
  20. {
  21. static unsigned char called = 0;
  22. int clock;
  23. long long options;
  24. if (!MACH_IS_MVME16x)
  25. return 0;
  26. if (mvme16x_config & MVME16x_CONFIG_NO_SCSICHIP) {
  27. printk ("SCSI detection disabled, SCSI chip not present\n");
  28. return 0;
  29. }
  30. if (called)
  31. return 0;
  32. tpnt->proc_name = "MVME16x";
  33. options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;
  34. clock = 66000000; /* 66MHz SCSI Clock */
  35. ncr53c7xx_init(tpnt, 0, 710, (unsigned long)0xfff47000,
  36. 0, MVME16x_IRQ_SCSI, DMA_NONE,
  37. options, clock);
  38. called = 1;
  39. return 1;
  40. }
  41. static int mvme16x_scsi_release(struct Scsi_Host *shost)
  42. {
  43. if (shost->irq)
  44. free_irq(shost->irq, NULL);
  45. if (shost->dma_channel != 0xff)
  46. free_dma(shost->dma_channel);
  47. if (shost->io_port && shost->n_io_port)
  48. release_region(shost->io_port, shost->n_io_port);
  49. scsi_unregister(shost);
  50. return 0;
  51. }
  52. static struct scsi_host_template driver_template = {
  53. .name = "MVME16x NCR53c710 SCSI",
  54. .detect = mvme16x_scsi_detect,
  55. .release = mvme16x_scsi_release,
  56. .queuecommand = NCR53c7xx_queue_command,
  57. .abort = NCR53c7xx_abort,
  58. .reset = NCR53c7xx_reset,
  59. .can_queue = 24,
  60. .this_id = 7,
  61. .sg_tablesize = 63,
  62. .cmd_per_lun = 3,
  63. .use_clustering = DISABLE_CLUSTERING
  64. };
  65. #include "scsi_module.c"