OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [drivers/] [scsi/] [g_NCR5380.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/*
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.
14
 *
15
 * For more information, please consult
16
 *
17
 * NCR 5380 Family
18
 * SCSI Protocol Controller
19
 * Databook
20
 *
21
 * NCR Microelectronics
22
 * 1635 Aeroplaza Drive
23
 * Colorado Springs, CO 80916
24
 * 1+ (719) 578-3400
25
 * 1+ (800) 334-5454
26
 */
27
 
28
/*
29
 * $Log: not supported by cvs2svn $
30
 * Revision 1.1.1.1  2001/07/02 17:58:27  simons
31
 * Initial revision
32
 *
33
 */
34
 
35
#ifndef GENERIC_NCR5380_H
36
#define GENERIC_NCR5380_H
37
 
38
#include <linux/config.h>
39
 
40
#define GENERIC_NCR5380_PUBLIC_RELEASE 1
41
 
42
#ifdef NCR53C400
43
#define BIOSPARAM
44
#define NCR5380_BIOSPARAM generic_NCR5380_biosparam
45
#else
46
#define NCR5380_BIOSPARAM NULL
47
#endif
48
 
49
#ifndef ASM
50
int generic_NCR5380_abort(Scsi_Cmnd *);
51
int generic_NCR5380_detect(Scsi_Host_Template *);
52
int generic_NCR5380_release_resources(struct Scsi_Host *);
53
int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
54
int generic_NCR5380_reset(Scsi_Cmnd *, unsigned int);
55
int notyet_generic_proc_info (char *buffer ,char **start, off_t offset,
56
                     int length, int hostno, int inout);
57
const char* generic_NCR5380_info(struct Scsi_Host *);
58
#ifdef BIOSPARAM
59
int generic_NCR5380_biosparam(Disk *, kdev_t, int *);
60
#endif
61
 
62
int generic_NCR5380_proc_info(char* buffer, char** start, off_t offset, int length, int hostno, int inout);
63
 
64
#ifndef NULL
65
#define NULL 0
66
#endif
67
 
68
#ifndef CMD_PER_LUN
69
#define CMD_PER_LUN 2
70
#endif
71
 
72
#ifndef CAN_QUEUE
73
#define CAN_QUEUE 16
74
#endif
75
 
76
#if defined(HOSTS_C) || defined(MODULE)
77
 
78
#define GENERIC_NCR5380 {NULL, NULL, NULL,                              \
79
        generic_NCR5380_proc_info,                                      \
80
        "Generic NCR5380/NCR53C400 Scsi Driver",                        \
81
        generic_NCR5380_detect, generic_NCR5380_release_resources,      \
82
        (void *)generic_NCR5380_info, NULL,                             \
83
        generic_NCR5380_queue_command, generic_NCR5380_abort,           \
84
        generic_NCR5380_reset, NULL,                                    \
85
        NCR5380_BIOSPARAM,                                              \
86
        /* can queue */ CAN_QUEUE, /* id */ 7, SG_ALL,                  \
87
        /* cmd per lun */ CMD_PER_LUN , 0, 0, DISABLE_CLUSTERING}
88
 
89
#endif
90
 
91
#ifndef HOSTS_C
92
 
93
#define __STRVAL(x) #x
94
#define STRVAL(x) __STRVAL(x)
95
 
96
#ifdef CONFIG_SCSI_G_NCR5380_PORT
97
 
98
#define NCR5380_map_config port
99
 
100
#define NCR5380_map_type int
101
 
102
#define NCR5380_map_name port
103
 
104
#define NCR5380_instance_name io_port
105
 
106
#define NCR53C400_register_offset 0
107
 
108
#define NCR53C400_address_adjust 8
109
 
110
#ifdef NCR53C400
111
#define NCR5380_region_size 16
112
#else
113
#define NCR5380_region_size 8
114
#endif
115
 
116
#define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
117
#define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
118
 
119
#else 
120
/* therefore CONFIG_SCSI_G_NCR5380_MEM */
121
 
122
#define NCR5380_map_config memory
123
 
124
#define NCR5380_map_type volatile unsigned char*
125
 
126
#define NCR5380_map_name base
127
 
128
#define NCR5380_instance_name base
129
 
130
#define NCR53C400_register_offset 0x108
131
 
132
#define NCR53C400_address_adjust 0
133
 
134
#define NCR53C400_mem_base 0x3880
135
 
136
#define NCR53C400_host_buffer 0x3900
137
 
138
#define NCR5380_region_size 0x3a00
139
 
140
 
141
#define NCR5380_read(reg) (*(NCR5380_map_name + NCR53C400_mem_base + (reg)))
142
#define NCR5380_write(reg, value) (*(NCR5380_map_name + NCR53C400_mem_base + (reg)) = value)
143
 
144
#endif
145
 
146
#define NCR5380_implementation_fields \
147
    NCR5380_map_type NCR5380_map_name
148
 
149
#define NCR5380_local_declare() \
150
    register NCR5380_implementation_fields
151
 
152
#define NCR5380_setup(instance) \
153
    NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
154
 
155
#define NCR5380_intr generic_NCR5380_intr
156
#define NCR5380_queue_command generic_NCR5380_queue_command
157
#define NCR5380_abort generic_NCR5380_abort
158
#define NCR5380_reset generic_NCR5380_reset
159
#define NCR5380_pread generic_NCR5380_pread
160
#define NCR5380_pwrite generic_NCR5380_pwrite
161
#define NCR5380_proc_info notyet_generic_proc_info
162
 
163
#define BOARD_NCR5380   0
164
#define BOARD_NCR53C400 1
165
 
166
#endif /* else def HOSTS_C */
167
#endif /* ndef ASM */
168
#endif /* GENERIC_NCR5380_H */
169
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.