1 /*-
2  * Copyright (c) 2008 John Hay.  All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  *
24  * $FreeBSD: stable/9/sys/boot/arm/ixp425/boot2/cf_ata.h 183651 2008-10-06 19:38:10Z jhay $
25  */
26 
27 #ifndef ARM_BOOT_CF_ATA_H
28 #define ARM_BOOT_CF_ATA_H
29 
30 #define CF_DATA		0x00
31 #define CF_ERROR	0x01
32 #define CF_FEATURE	0x01
33 #define CF_SECT_CNT	0x02
34 #define CF_SECT_NUM	0x03
35 #define CF_CYL_L	0x04
36 #define CF_CYL_H	0x05
37 #define CF_DRV_HEAD	0x06
38 #define CF_D_MASTER		0x00
39 #define CF_D_LBA		0x40
40 #define CF_D_IBM		0xa0
41 #define CF_STATUS	0x07
42 #define CF_S_ERROR		0x01
43 #define CF_S_INDEX		0x02
44 #define CF_S_CORR		0x04
45 #define CF_S_DRQ		0x08
46 #define CF_S_DSC		0x10
47 #define CF_S_DWF		0x20
48 #define CF_S_READY		0x40
49 #define CF_S_BUSY		0x80
50 #define CF_COMMAND	0x07
51 
52 /* This is according to the appnote, but Sam use 0x1e in avila_ata.c */
53 #define CF_ALT_STATUS	0x16
54 #define CF_ALT_DEV_CTR	0x16
55 #define CF_ALT_DEV_CTR2	0x1e
56 #define CF_A_IDS		0x02
57 #define CF_A_RESET		0x04
58 #define CF_A_4BIT		0x08
59 
60 #define AVILA_IDE_GPIN		12
61 
62 #endif /* !ARM_BOOT_CF_ATA_H */
63