diff options
author | Jens Arnold <amiconn@rockbox.org> | 2008-03-12 23:36:05 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2008-03-12 23:36:05 +0000 |
commit | 2b5f9aec646aceaf24b243e38e1de316e1bc3475 (patch) | |
tree | dad72e25ea1c25cdedc9f8e456ad5bc0facd9840 | |
parent | 80ded2ad7c819cb111e178aefe0f0afc168bf63d (diff) | |
download | rockbox-2b5f9aec646aceaf24b243e38e1de316e1bc3475.tar.gz rockbox-2b5f9aec646aceaf24b243e38e1de316e1bc3475.zip |
Make ATA work on M3.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16650 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/SOURCES | 2 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/m3/ata-m3.c | 59 |
2 files changed, 60 insertions, 1 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index 1e1085a880..f4fc252193 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -496,7 +496,7 @@ target/coldfire/iaudio/m5/audio-m5.c | |||
496 | #ifdef IAUDIO_M3 | 496 | #ifdef IAUDIO_M3 |
497 | #ifndef SIMULATOR | 497 | #ifndef SIMULATOR |
498 | target/coldfire/ata-as-coldfire.S | 498 | target/coldfire/ata-as-coldfire.S |
499 | target/coldfire/iaudio/ata-iaudio.c | 499 | target/coldfire/iaudio/m3/ata-m3.c |
500 | target/coldfire/iaudio/m3/backlight-m3.c | 500 | target/coldfire/iaudio/m3/backlight-m3.c |
501 | target/coldfire/iaudio/m3/button-m3.c | 501 | target/coldfire/iaudio/m3/button-m3.c |
502 | target/coldfire/iaudio/m3/lcd-m3.c | 502 | target/coldfire/iaudio/m3/lcd-m3.c |
diff --git a/firmware/target/coldfire/iaudio/m3/ata-m3.c b/firmware/target/coldfire/iaudio/m3/ata-m3.c new file mode 100644 index 0000000000..3a0a28b618 --- /dev/null +++ b/firmware/target/coldfire/iaudio/m3/ata-m3.c | |||
@@ -0,0 +1,59 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Jens Arnold | ||
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 | |||
20 | #include "config.h" | ||
21 | #include "cpu.h" | ||
22 | #include <stdbool.h> | ||
23 | #include "kernel.h" | ||
24 | #include "system.h" | ||
25 | #include "power.h" | ||
26 | |||
27 | void ata_reset(void) | ||
28 | { | ||
29 | and_l(~0x00000040, &GPIO1_OUT); | ||
30 | sleep(1); /* > 25us */ | ||
31 | or_l(0x00000040, &GPIO1_OUT); | ||
32 | sleep(1); /* > 2ms */ | ||
33 | } | ||
34 | |||
35 | void ata_enable(bool on) | ||
36 | { | ||
37 | if(on) | ||
38 | and_l(~0x01000000, &GPIO1_OUT); | ||
39 | else | ||
40 | or_l(0x01000000, &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 enable & reset */ | ||
51 | or_l(0x01000040, &GPIO1_OUT); | ||
52 | or_l(0x01000040, &GPIO1_ENABLE); | ||
53 | or_l(0x01000040, &GPIO1_FUNCTION); | ||
54 | |||
55 | /* USB enable */ | ||
56 | and_l(~0x10000000, &GPIO_OUT); | ||
57 | or_l(0x10000000, &GPIO_ENABLE); | ||
58 | or_l(0x10000000, &GPIO_FUNCTION); | ||
59 | } | ||