diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/SOURCES | 1 | ||||
-rwxr-xr-x | firmware/target/coldfire/iaudio/x5/ata-target.h | 26 | ||||
-rwxr-xr-x | firmware/target/coldfire/iaudio/x5/ata-x5.c | 64 |
3 files changed, 91 insertions, 0 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index f09c7d1aab..0aa6224bf7 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -209,5 +209,6 @@ target/coldfire/iaudio/x5/power-x5.c | |||
209 | target/coldfire/iaudio/x5/lcd-x5.c | 209 | target/coldfire/iaudio/x5/lcd-x5.c |
210 | target/coldfire/iaudio/x5/pcf50606-x5.c | 210 | target/coldfire/iaudio/x5/pcf50606-x5.c |
211 | target/coldfire/iaudio/x5/adc-x5.c | 211 | target/coldfire/iaudio/x5/adc-x5.c |
212 | target/coldfire/iaudio/x5/ata-x5.c | ||
212 | #endif | 213 | #endif |
213 | #endif | 214 | #endif |
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 | } | ||