Commit | Line | Data |
---|---|---|
1da177e4 LT |
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 | * ALPHA RELEASE 1. | |
1da177e4 LT |
14 | */ |
15 | ||
1da177e4 LT |
16 | #ifndef GENERIC_NCR5380_H |
17 | #define GENERIC_NCR5380_H | |
18 | ||
1da177e4 LT |
19 | |
20 | #define GENERIC_NCR5380_PUBLIC_RELEASE 1 | |
21 | ||
22 | #ifdef NCR53C400 | |
23 | #define BIOSPARAM | |
24 | #define NCR5380_BIOSPARAM generic_NCR5380_biosparam | |
25 | #else | |
26 | #define NCR5380_BIOSPARAM NULL | |
27 | #endif | |
28 | ||
29 | #ifndef ASM | |
1da177e4 LT |
30 | |
31 | #ifndef CMD_PER_LUN | |
32 | #define CMD_PER_LUN 2 | |
33 | #endif | |
34 | ||
35 | #ifndef CAN_QUEUE | |
36 | #define CAN_QUEUE 16 | |
37 | #endif | |
38 | ||
1da177e4 LT |
39 | #define __STRVAL(x) #x |
40 | #define STRVAL(x) __STRVAL(x) | |
41 | ||
702a98c6 | 42 | #ifndef SCSI_G_NCR5380_MEM |
1da177e4 LT |
43 | |
44 | #define NCR5380_map_config port | |
45 | #define NCR5380_map_type int | |
46 | #define NCR5380_map_name port | |
47 | #define NCR5380_instance_name io_port | |
48 | #define NCR53C400_register_offset 0 | |
49 | #define NCR53C400_address_adjust 8 | |
50 | ||
51 | #ifdef NCR53C400 | |
52 | #define NCR5380_region_size 16 | |
53 | #else | |
54 | #define NCR5380_region_size 8 | |
55 | #endif | |
56 | ||
57 | #define NCR5380_read(reg) (inb(NCR5380_map_name + (reg))) | |
58 | #define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg)))) | |
59 | ||
c818cb64 AV |
60 | #define NCR5380_implementation_fields \ |
61 | NCR5380_map_type NCR5380_map_name | |
62 | ||
63 | #define NCR5380_local_declare() \ | |
64 | register NCR5380_implementation_fields | |
65 | ||
66 | #define NCR5380_setup(instance) \ | |
67 | NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name) | |
68 | ||
1da177e4 | 69 | #else |
702a98c6 | 70 | /* therefore SCSI_G_NCR5380_MEM */ |
1da177e4 LT |
71 | |
72 | #define NCR5380_map_config memory | |
73 | #define NCR5380_map_type unsigned long | |
74 | #define NCR5380_map_name base | |
75 | #define NCR5380_instance_name base | |
76 | #define NCR53C400_register_offset 0x108 | |
77 | #define NCR53C400_address_adjust 0 | |
78 | #define NCR53C400_mem_base 0x3880 | |
79 | #define NCR53C400_host_buffer 0x3900 | |
80 | #define NCR5380_region_size 0x3a00 | |
81 | ||
c818cb64 AV |
82 | #define NCR5380_read(reg) readb(iomem + NCR53C400_mem_base + (reg)) |
83 | #define NCR5380_write(reg, value) writeb(value, iomem + NCR53C400_mem_base + (reg)) | |
1da177e4 LT |
84 | |
85 | #define NCR5380_implementation_fields \ | |
c818cb64 AV |
86 | NCR5380_map_type NCR5380_map_name; \ |
87 | void __iomem *iomem; | |
1da177e4 LT |
88 | |
89 | #define NCR5380_local_declare() \ | |
c818cb64 | 90 | register void __iomem *iomem |
1da177e4 LT |
91 | |
92 | #define NCR5380_setup(instance) \ | |
702a98c6 | 93 | iomem = (((struct NCR5380_hostdata *)(instance)->hostdata)->iomem) |
c818cb64 AV |
94 | |
95 | #endif | |
1da177e4 LT |
96 | |
97 | #define NCR5380_intr generic_NCR5380_intr | |
98 | #define NCR5380_queue_command generic_NCR5380_queue_command | |
99 | #define NCR5380_abort generic_NCR5380_abort | |
100 | #define NCR5380_bus_reset generic_NCR5380_bus_reset | |
1da177e4 LT |
101 | #define NCR5380_pread generic_NCR5380_pread |
102 | #define NCR5380_pwrite generic_NCR5380_pwrite | |
1da177e4 LT |
103 | |
104 | #define BOARD_NCR5380 0 | |
105 | #define BOARD_NCR53C400 1 | |
106 | #define BOARD_NCR53C400A 2 | |
107 | #define BOARD_DTC3181E 3 | |
108 | ||
1da177e4 LT |
109 | #endif /* ndef ASM */ |
110 | #endif /* GENERIC_NCR5380_H */ | |
111 |