diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2006-03-07 13:19:34 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2006-03-07 13:19:34 +0000 |
commit | c5c8883cc84318f1ea77aa99da931e1d967b8024 (patch) | |
tree | 248334238528a14b7ab4043278f26616ba1668be /firmware/target/coldfire | |
parent | 322cb1411582f37b1e8347eff2276afd7d3c8198 (diff) | |
download | rockbox-c5c8883cc84318f1ea77aa99da931e1d967b8024.tar.gz rockbox-c5c8883cc84318f1ea77aa99da931e1d967b8024.zip |
iAudio X5 target-specific ATA driver code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8947 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/coldfire')
-rwxr-xr-x | firmware/target/coldfire/iaudio/x5/ata-target.h | 26 | ||||
-rwxr-xr-x | firmware/target/coldfire/iaudio/x5/ata-x5.c | 64 |
2 files changed, 90 insertions, 0 deletions
diff --git a/firmware/target/coldfire/iaudio/x5/ata-target.h b/firmware/target/coldfire/iaudio/x5/ata-target.h new file mode 100755 index 0000000000..1801a7d376 --- /dev/null +++ b/firmware/target/coldfire/iaudio/x5/ata-target.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Linus Nielsen Feltzing | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef ATA_TARGET_H | ||
20 | #define ATA_TARGET_H | ||
21 | |||
22 | void ata_reset(void); | ||
23 | void ata_device_init(void); | ||
24 | bool ata_is_coldstart(void); | ||
25 | |||
26 | #endif | ||
diff --git a/firmware/target/coldfire/iaudio/x5/ata-x5.c b/firmware/target/coldfire/iaudio/x5/ata-x5.c new file mode 100755 index 0000000000..21c088288a --- /dev/null +++ b/firmware/target/coldfire/iaudio/x5/ata-x5.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Linus Nielsen Feltzing | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #include "config.h" | ||
20 | #include "cpu.h" | ||
21 | #include <stdbool.h> | ||
22 | #include "kernel.h" | ||
23 | #include "system.h" | ||
24 | #include "power.h" | ||
25 | #include "pcf50606.h" | ||
26 | |||
27 | void ata_reset(void) | ||
28 | { | ||
29 | and_l(~0x40000000, &GPIO_OUT); | ||
30 | sleep(1); /* > 25us */ | ||
31 | or_l(0x40000000, &GPIO_OUT); | ||
32 | sleep(1); /* > 2ms */ | ||
33 | } | ||
34 | |||
35 | void ata_enable(bool on) | ||
36 | { | ||
37 | if(on) | ||
38 | and_l(~0x00000800, &GPIO1_OUT); | ||
39 | else | ||
40 | or_l(0x00000800, &GPIO1_OUT); | ||
41 | } | ||
42 | |||
43 | bool ata_is_coldstart(void) | ||
44 | { | ||
45 | return true; /* TODO */ | ||
46 | } | ||
47 | |||
48 | void ata_device_init(void) | ||
49 | { | ||
50 | /* ATA reset */ | ||
51 | or_l(0x40000000, &GPIO_OUT); | ||
52 | or_l(0x40000000, &GPIO_ENABLE); | ||
53 | or_l(0x40000000, &GPIO_FUNCTION); | ||
54 | |||
55 | /* ATA enable */ | ||
56 | or_l(0x00000800, &GPIO1_OUT); | ||
57 | or_l(0x00000800, &GPIO1_ENABLE); | ||
58 | or_l(0x00000800, &GPIO1_FUNCTION); | ||
59 | |||
60 | /* USB enable */ | ||
61 | and_l(~0x00000008, &GPIO1_OUT); | ||
62 | or_l(0x00000008, &GPIO1_ENABLE); | ||
63 | or_l(0x00000008, &GPIO1_FUNCTION); | ||
64 | } | ||