Move declaration of button_int and clickwheel_int to the proper header file instead...
[Rockbox.git] / firmware / target / arm / ata-target.h
blobc03d52737262f4575eb98eefae643ab3b21fa8fe
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006 by Barry Wardell
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifdef CPU_PP
24 /* primary channel */
25 #define ATA_DATA (*((volatile unsigned short*)(IDE_BASE + 0x1e0)))
26 #define ATA_ERROR (*((volatile unsigned char*)(IDE_BASE + 0x1e4)))
27 #define ATA_NSECTOR (*((volatile unsigned char*)(IDE_BASE + 0x1e8)))
28 #define ATA_SECTOR (*((volatile unsigned char*)(IDE_BASE + 0x1ec)))
29 #define ATA_LCYL (*((volatile unsigned char*)(IDE_BASE + 0x1f0)))
30 #define ATA_HCYL (*((volatile unsigned char*)(IDE_BASE + 0x1f4)))
31 #define ATA_SELECT (*((volatile unsigned char*)(IDE_BASE + 0x1f8)))
32 #define ATA_COMMAND (*((volatile unsigned char*)(IDE_BASE + 0x1fc)))
33 #define ATA_CONTROL (*((volatile unsigned char*)(IDE_BASE + 0x3f8)))
35 #define STATUS_BSY 0x80
36 #define STATUS_RDY 0x40
37 #define STATUS_DF 0x20
38 #define STATUS_DRQ 0x08
39 #define STATUS_ERR 0x01
40 #define ERROR_ABRT 0x04
42 #define WRITE_PATTERN1 0xa5
43 #define WRITE_PATTERN2 0x5a
44 #define WRITE_PATTERN3 0xaa
45 #define WRITE_PATTERN4 0x55
47 #define READ_PATTERN1 0xa5
48 #define READ_PATTERN2 0x5a
49 #define READ_PATTERN3 0xaa
50 #define READ_PATTERN4 0x55
52 #define READ_PATTERN1_MASK 0xff
53 #define READ_PATTERN2_MASK 0xff
54 #define READ_PATTERN3_MASK 0xff
55 #define READ_PATTERN4_MASK 0xff
57 #if (CONFIG_CPU == PP5002)
59 #define SET_REG(reg,val) do { reg = (val); \
60 while (!(IDE_CFG_STATUS & 0x40)); \
61 } while (0)
62 #define SET_16BITREG(reg,val) reg = (val)
64 /* Plain C reading and writing. See comment in ata-as-arm.S */
66 #elif defined CPU_PP502x
68 #define SET_REG(reg,val) reg = (val)
69 #define SET_16BITREG(reg,val) reg = (val)
71 /* asm optimized reading and writing */
72 #define ATA_OPTIMIZED_READING
73 #define ATA_OPTIMIZED_WRITING
74 void copy_read_sectors(unsigned char* buf, int wordcount);
75 void copy_write_sectors(const unsigned char* buf, int wordcount);
77 #endif /* CONFIG_CPU */
79 #endif
81 void ata_reset(void);
82 void ata_enable(bool on);
83 bool ata_is_coldstart(void);
84 void ata_device_init(void);