Exemple #1
0
int amiga7xx_detect(Scsi_Host_Template *tpnt)
{
    static unsigned char called = 0;
    int key, clock;
    int num = 0;
    unsigned long address;
    long long options;
    struct ConfigDev *cd;

    if (called || !MACH_IS_AMIGA)
	return 0;

    tpnt->proc_dir = &proc_scsi_amiga7xx;

#if defined(CONFIG_BLZ603EPLUS_SCSI) || defined(CONFIG_BLZ603EPLUS_SCSI_MODULE)
    if ((key = zorro_find(MANUF_PHASE5, PROD_BLIZZARD_603E_SCSI, 0, 0)))
    {
	cd = zorro_get_board(key);

	options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;

	clock = 50000000;	/* 50MHz SCSI Clock */

	ncr53c7xx_init(tpnt, 0, 710,
		       (u32)(unsigned char *)ZTWO_VADDR(0xf40000),
		       0, IRQ_AMIGA_PORTS & ~IRQ_MACHSPEC, DMA_NONE,
		       options, clock);

	zorro_config_board(key, 0);
	num++;
    }
#endif

#if defined(CONFIG_WARPENGINE_SCSI) || defined(CONFIG_WARPENGINE_SCSI_MODULE)
    if ((key = zorro_find(MANUF_MACROSYSTEMS, PROD_WARP_ENGINE, 0, 0)))
    {
	cd = zorro_get_board(key);
	address = (unsigned long)kernel_map((unsigned long)cd->cd_BoardAddr,
		cd->cd_BoardSize, KERNELMAP_NOCACHE_SER, NULL);

	options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;

	clock = 50000000;	/* 50MHz SCSI Clock */

	ncr53c7xx_init(tpnt, 0, 710, (u32)(unsigned char *)(address + 0x40000),
		       0, IRQ_AMIGA_PORTS & ~IRQ_MACHSPEC, DMA_NONE, 
		       options, clock);

	zorro_config_board(key, 0);
	num++;
    }
#endif

#if defined(CONFIG_A4000T_SCSI) || defined(CONFIG_A4000T_SCSI_MODULE)
    if (AMIGAHW_PRESENT(A4000_SCSI))
    { 
    	options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;

	clock = 50000000;	/* 50MHz SCSI Clock */

    	ncr53c7xx_init(tpnt, 0, 710,
		       (u32)(unsigned char *)ZTWO_VADDR(0xDD0040),
		       0, IRQ_AMIGA_PORTS & ~IRQ_MACHSPEC, DMA_NONE,
		       options, clock);
    	num++;
    }
#endif

#if defined(CONFIG_A4091_SCSI) || defined(CONFIG_A4091_SCSI_MODULE)
    while ( (key = zorro_find(MANUF_COMMODORE, PROD_A4091, 0, 0)) ||
	 (key = zorro_find(MANUF_COMMODORE2, PROD_A4091_2, 0, 0)) )
    {
	cd = zorro_get_board(key);
	address = (unsigned long)kernel_map((unsigned long)cd->cd_BoardAddr,
		cd->cd_BoardSize, KERNELMAP_NOCACHE_SER, NULL);

    	options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;

	clock = 50000000;	/* 50MHz SCSI Clock */

    	ncr53c7xx_init(tpnt, 0, 710, (u32)(unsigned char *)(address+0x800000),
		       0, IRQ_AMIGA_PORTS & ~IRQ_MACHSPEC,
		       DMA_NONE, options, clock);

	zorro_config_board(key, 0);
	num++;
    }
#endif

    called = 1;
    return num;
}
Exemple #2
0
/***************************************************************** Detection */
int fastlane_esp_detect(Scsi_Host_Template *tpnt)
{
	struct NCR_ESP *esp;
	const struct ConfigDev *esp_dev;
	unsigned int key;
	unsigned long address;

	if ((key = zorro_find(ZORRO_PROD_PHASE5_BLIZZARD_1230_II_FASTLANE_Z3_CYBERSCSI_CYBERSTORM060, 0, 0))){

		esp_dev = zorro_get_board(key);

		/* Check if this is really a fastlane controller. The problem
		 * is that also the cyberstorm and blizzard controllers use
		 * this ID value. Fortunately only Fastlane maps in Z3 space
		 */
		if((unsigned long)esp_dev->cd_BoardAddr < 0x1000000)
			return 0;

		esp = esp_allocate(tpnt, (void *) esp_dev);

		/* Do command transfer with programmed I/O */
		esp->do_pio_cmds = 1;

		/* Required functions */
		esp->dma_bytes_sent = &dma_bytes_sent;
		esp->dma_can_transfer = &dma_can_transfer;
		esp->dma_dump_state = &dma_dump_state;
		esp->dma_init_read = &dma_init_read;
		esp->dma_init_write = &dma_init_write;
		esp->dma_ints_off = &dma_ints_off;
		esp->dma_ints_on = &dma_ints_on;
		esp->dma_irq_p = &dma_irq_p;
		esp->dma_ports_p = &dma_ports_p;
		esp->dma_setup = &dma_setup;

		/* Optional functions */
		esp->dma_barrier = 0;
		esp->dma_drain = 0;
		esp->dma_invalidate = 0;
		esp->dma_irq_entry = 0;
		esp->dma_irq_exit = &dma_irq_exit;
		esp->dma_led_on = &dma_led_on;
		esp->dma_led_off = &dma_led_off;
		esp->dma_poll = 0;
		esp->dma_reset = 0;

		/* Initialize the portBits (enable IRQs) */
		ctrl_data = (FASTLANE_DMA_FCODE |
#ifndef NODMAIRQ
			     FASTLANE_DMA_EDI |
#endif
			     FASTLANE_DMA_ESI);
			

		/* SCSI chip clock */
		esp->cfreq = 40000000;


		/* Map the physical address space into virtual kernel space */
		address = (unsigned long)
			kernel_map((unsigned long)esp_dev->cd_BoardAddr,
				   esp_dev->cd_BoardSize,
				   KERNELMAP_NOCACHE_SER,
				   NULL);

		if(!address){
			printk("Could not remap Fastlane controller memory!");
			scsi_unregister (esp->ehost);
			return 0;
		}


		/* The DMA registers on the Fastlane are mapped
		 * relative to the device (i.e. in the same Zorro
		 * I/O block).
		 */
		esp->dregs = (void *)(address + FASTLANE_DMA_ADDR);

		/* ESP register base */
		esp->eregs = (struct ESP_regs *)(address + FASTLANE_ESP_ADDR);

		/* Board base */
		esp->edev = (void *) address;
		
		/* Set the command buffer */
		esp->esp_command = (volatile unsigned char*) cmd_buffer;
		esp->esp_command_dvma = virt_to_bus((unsigned long) cmd_buffer);

		esp->irq = IRQ_AMIGA_PORTS;
		request_irq(IRQ_AMIGA_PORTS, esp_intr, 0, 
			    "Fastlane SCSI", esp_intr);

		/* Controller ID */
		esp->scsi_id = 7;
		
		/* Check for differential SCSI-bus */
		/* What is this stuff? */
		esp->diff = 0;

		dma_clear(esp);
		esp_initialize(esp);

		zorro_config_board(key, 0);

		printk("\nESP: Total of %d ESP hosts found, %d actually in use.\n", nesps,esps_in_use);
		esps_running = esps_in_use;
		return esps_in_use;
	}
	return 0;
}