• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Generic Generic NCR5380 driver defines
3  *
4  * Copyright 1993, Drew Eckhardt
5  *	Visionary Computing
6  *	(Unix and Linux consulting and custom programming)
7  *	drew@colorado.edu
8  *      +1 (303) 440-4894
9  *
10  * NCR53C400 extensions (c) 1994,1995,1996, Kevin Lentin
11  *    K.Lentin@cs.monash.edu.au
12  */
13 
14 #ifndef GENERIC_NCR5380_H
15 #define GENERIC_NCR5380_H
16 
17 #ifndef SCSI_G_NCR5380_MEM
18 #define DRV_MODULE_NAME "g_NCR5380"
19 
20 #define NCR5380_read(reg) \
21 	inb(instance->io_port + (reg))
22 #define NCR5380_write(reg, value) \
23 	outb(value, instance->io_port + (reg))
24 
25 #define NCR5380_implementation_fields \
26 	int c400_ctl_status; \
27 	int c400_blk_cnt; \
28 	int c400_host_buf; \
29 	int io_width;
30 
31 #else
32 /* therefore SCSI_G_NCR5380_MEM */
33 #define DRV_MODULE_NAME "g_NCR5380_mmio"
34 
35 #define NCR53C400_mem_base 0x3880
36 #define NCR53C400_host_buffer 0x3900
37 #define NCR53C400_region_size 0x3a00
38 
39 #define NCR5380_read(reg) \
40 	readb(((struct NCR5380_hostdata *)shost_priv(instance))->iomem + \
41 	      NCR53C400_mem_base + (reg))
42 #define NCR5380_write(reg, value) \
43 	writeb(value, ((struct NCR5380_hostdata *)shost_priv(instance))->iomem + \
44 	       NCR53C400_mem_base + (reg))
45 
46 #define NCR5380_implementation_fields \
47 	void __iomem *iomem; \
48 	resource_size_t iomem_size; \
49 	int c400_ctl_status; \
50 	int c400_blk_cnt; \
51 	int c400_host_buf;
52 
53 #endif
54 
55 #define NCR5380_dma_xfer_len(instance, cmd, phase) \
56         generic_NCR5380_dma_xfer_len(instance, cmd)
57 #define NCR5380_dma_recv_setup		generic_NCR5380_pread
58 #define NCR5380_dma_send_setup		generic_NCR5380_pwrite
59 #define NCR5380_dma_residual(instance)	(0)
60 
61 #define NCR5380_intr generic_NCR5380_intr
62 #define NCR5380_queue_command generic_NCR5380_queue_command
63 #define NCR5380_abort generic_NCR5380_abort
64 #define NCR5380_bus_reset generic_NCR5380_bus_reset
65 #define NCR5380_info generic_NCR5380_info
66 
67 #define NCR5380_io_delay(x)		udelay(x)
68 
69 #define BOARD_NCR5380	0
70 #define BOARD_NCR53C400	1
71 #define BOARD_NCR53C400A 2
72 #define BOARD_DTC3181E	3
73 #define BOARD_HP_C2502	4
74 
75 #endif /* GENERIC_NCR5380_H */
76 
77