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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [scsi/] [g_NCR5380.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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