1 /* blz1230.h: Defines and structures for the Blizzard 1230 SCSI IV driver. 2 * 3 * Copyright (C) 1996 Jesper Skov (jskov@cygnus.co.uk) 4 * 5 * This file is based on cyber_esp.h (hence the occasional reference to 6 * CyberStorm). 7 */ 8 9 #include "NCR53C9x.h" 10 11 #ifndef BLZ1230_H 12 #define BLZ1230_H 13 14 /* The controller registers can be found in the Z2 config area at these 15 * offsets: 16 */ 17 #define BLZ1230_ESP_ADDR 0x8000 18 #define BLZ1230_DMA_ADDR 0x10000 19 #define BLZ1230II_ESP_ADDR 0x10000 20 #define BLZ1230II_DMA_ADDR 0x10021 21 22 23 /* The Blizzard 1230 DMA interface 24 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 25 * Only two things can be programmed in the Blizzard DMA: 26 * 1) The data direction is controlled by the status of bit 31 (1 = write) 27 * 2) The source/dest address (word aligned, shifted one right) in bits 30-0 28 * 29 * Program DMA by first latching the highest byte of the address/direction 30 * (i.e. bits 31-24 of the long word constructed as described in steps 1+2 31 * above). Then write each byte of the address/direction (starting with the 32 * top byte, working down) to the DMA address register. 33 * 34 * Figure out interrupt status by reading the ESP status byte. 35 */ 36 struct blz1230_dma_registers { 37 volatile unsigned char dma_addr; /* DMA address [0x0000] */ 38 unsigned char dmapad2[0x7fff]; 39 volatile unsigned char dma_latch; /* DMA latch [0x8000] */ 40 }; 41 42 struct blz1230II_dma_registers { 43 volatile unsigned char dma_addr; /* DMA address [0x0000] */ 44 unsigned char dmapad2[0xf]; 45 volatile unsigned char dma_latch; /* DMA latch [0x0010] */ 46 }; 47 48 #define BLZ1230_DMA_WRITE 0x80000000 49 50 extern int blz1230_esp_detect(struct SHT *); 51 extern int blz1230_esp_release(struct Scsi_Host *); 52 extern const char *esp_info(struct Scsi_Host *); 53 extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 54 extern int esp_command(Scsi_Cmnd *); 55 extern int esp_abort(Scsi_Cmnd *); 56 extern int esp_reset(Scsi_Cmnd *, unsigned int); 57 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length, 58 int hostno, int inout); 59 60 #define SCSI_BLZ1230 { proc_name: "esp-blz1230", \ 61 proc_info: esp_proc_info, \ 62 name: "Blizzard1230 SCSI IV", \ 63 detect: blz1230_esp_detect, \ 64 release: blz1230_esp_release, \ 65 command: esp_command, \ 66 queuecommand: esp_queue, \ 67 abort: esp_abort, \ 68 reset: esp_reset, \ 69 can_queue: 7, \ 70 this_id: 7, \ 71 sg_tablesize: SG_ALL, \ 72 cmd_per_lun: 1, \ 73 use_clustering: ENABLE_CLUSTERING } 74 75 #endif /* BLZ1230_H */ 76