xref: /netbsd-src/sys/arch/amiga/dev/efareg.h (revision a5847cc334d9a7029f6352b847e9e8d71a0f9e0c)
1 /*	$NetBSD: efareg.h,v 1.2 2011/10/29 11:16:19 rkujawa Exp $ */
2 
3 /*-
4  * Copyright (c) 2011 The NetBSD Foundation, Inc.
5  * All rights reserved.
6  *
7  * This code is derived from software contributed to The NetBSD Foundation
8  * by Radoslaw Kujawa.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #ifndef _AMIGA_EFAREG_H_
33 
34 #define GAYLE_IDE_BASE		0xDA0000
35 #define FATA1_BASE		0xDA2000
36 
37 /* Offsets. Stride of 4 is used, so multiply any offset by 4. */
38 #define FATA1_PIO0_OFF		0x0
39 #define FATA1_PIO3_OFF		0x4000
40 #define FATA1_PIO4_OFF		0x5000
41 #define FATA1_PIO5_OFF		0x4800
42 
43 #define FATA1_CHAN_SIZE		0x400
44 #define FATA1_REGS_SIZE		0x4BC0
45 
46 /* PIO0 */
47 #define FATA1_PIO0_OFF_DATA	0x0
48 #define FATA1_PIO0_OFF_ERROR	0x1
49 #define FATA1_PIO0_OFF_SECCNT	0x2
50 #define FATA1_PIO0_OFF_SECTOR	0x3
51 #define FATA1_PIO0_OFF_CYL_LO	0x4
52 #define FATA1_PIO0_OFF_CYL_HI	0x5
53 #define FATA1_PIO0_OFF_SDH	0x6
54 #define FATA1_PIO0_OFF_COMMAND	0x7
55 
56 /* PIO3-5 */
57 #define FATA1_PION_OFF_DATA	0x82	/* 16-bit data port */
58 #define FATA1_PION_OFF_DATA32	0x0	/* 32-bit data port, 2 cycles to HD */
59 #define FATA1_PION_OFF_ERROR	0x80
60 #define FATA1_PION_OFF_SECCNT	0x100
61 #define FATA1_PION_OFF_SECTOR	0x180
62 #define FATA1_PION_OFF_CYL_LO	0x200
63 #define FATA1_PION_OFF_CYL_HI	0x280
64 #define FATA1_PION_OFF_SDH	0x300
65 #define FATA1_PION_OFF_COMMAND	0x380
66 
67 #define FATA1_PION_OFF_INTST	0x140	/* FastATA interrupt status */
68 
69 #define FATA1_INT_ANY		0x80
70 #define FATA1_INT_DRIVE0	0x40
71 #define FATA1_INT_DRIVE1	0x20
72 
73 #endif /* _AMIGA_EFAREG_H_ */
74 
75