diff options
Diffstat (limited to 'firmware/target/coldfire')
-rwxr-xr-x | firmware/target/coldfire/iaudio/x5/m5636-target.h | 37 | ||||
-rwxr-xr-x | firmware/target/coldfire/iaudio/x5/m5636-x5.c | 50 |
2 files changed, 87 insertions, 0 deletions
diff --git a/firmware/target/coldfire/iaudio/x5/m5636-target.h b/firmware/target/coldfire/iaudio/x5/m5636-target.h new file mode 100755 index 0000000000..51cb933c07 --- /dev/null +++ b/firmware/target/coldfire/iaudio/x5/m5636-target.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 Ulrich Pegelow | ||
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 M5636_TARGET_H | ||
20 | #define M5636_TARGET_H | ||
21 | |||
22 | #define M5636_BASE 0xf0004000L /* Rockbox: 0xf0004000; OF: 0x20004000 */ | ||
23 | |||
24 | /* We are currently lacking a datasheet for the M5636. No mnemonics available. | ||
25 | The registers are named according to their respective hexadecimal offsets. | ||
26 | */ | ||
27 | |||
28 | #define M5636_4064 (*(volatile unsigned short *)(M5636_BASE + 0x64L)) | ||
29 | #define M5636_4068 (*(volatile unsigned short *)(M5636_BASE + 0x68L)) | ||
30 | #define M5636_4078 (*(volatile unsigned short *)(M5636_BASE + 0x78L)) | ||
31 | |||
32 | extern void m5636_device_init(void); | ||
33 | |||
34 | /* for debugging purposes only */ | ||
35 | extern void m5636_dump_regs(void); | ||
36 | |||
37 | #endif | ||
diff --git a/firmware/target/coldfire/iaudio/x5/m5636-x5.c b/firmware/target/coldfire/iaudio/x5/m5636-x5.c new file mode 100755 index 0000000000..d30ff360d6 --- /dev/null +++ b/firmware/target/coldfire/iaudio/x5/m5636-x5.c | |||
@@ -0,0 +1,50 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 Ulrich Pegelow | ||
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 "system.h" | ||
22 | #include "logf.h" | ||
23 | #include "m5636-target.h" | ||
24 | |||
25 | void m5636_device_init(void) | ||
26 | { | ||
27 | and_l(~0x00004000, &GPIO_INT_EN); /* probably redundant: disable | ||
28 | interrupt; just in case ... */ | ||
29 | and_l(~0x00000004, &GPIO1_OUT); /* probably redundant: set GPIO34 low */ | ||
30 | or_l( 0x00000004, &GPIO1_ENABLE); /* GPIO34 enable (see above) */ | ||
31 | or_l( 0x00000004, &GPIO1_FUNCTION); /* GPIO34 function (see above) */ | ||
32 | } | ||
33 | |||
34 | /* for debugging purposes only */ | ||
35 | void m5636_dump_regs(void) | ||
36 | { | ||
37 | unsigned short *address; | ||
38 | |||
39 | for (address = (unsigned short *)M5636_BASE; | ||
40 | address < (unsigned short *)(M5636_BASE + 0x100); | ||
41 | address++) | ||
42 | { | ||
43 | logf("m5636 A:%08x D:%04x", address, (unsigned)*address); | ||
44 | } | ||
45 | |||
46 | logf("GPIO_INT_EN %08x", GPIO_INT_EN); | ||
47 | logf("GPIO1_OUT %08x", GPIO1_OUT); | ||
48 | logf("GPIO1_ENABLE %08x", GPIO1_ENABLE); | ||
49 | logf("GPIO1_FUNCTION %08x", GPIO1_FUNCTION); | ||
50 | } | ||