mvme16x.c 1.8 KB

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