summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/clock-target.h
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2008-12-04 20:04:31 +0000
committerRafaël Carré <rafael.carre@gmail.com>2008-12-04 20:04:31 +0000
commit45711ac2869f955c40be96d8dcbc7201c718dba4 (patch)
treeef022bec4b6e8bcc11005de34d300e073c60770d /firmware/target/arm/as3525/clock-target.h
parent7ea9e31658da4fce9c4a3e30838b82fda8eda287 (diff)
downloadrockbox-45711ac2869f955c40be96d8dcbc7201c718dba4.tar.gz
rockbox-45711ac2869f955c40be96d8dcbc7201c718dba4.zip
Sansa AMS: centralize clock settings in clock-target.h
Reorder system_init() to initialize peripherals not only in bootloader Use a 65MHz PCLK (and memclk) which will be needed for realtime decoding git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19330 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/clock-target.h')
-rw-r--r--firmware/target/arm/as3525/clock-target.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/clock-target.h b/firmware/target/arm/as3525/clock-target.h
new file mode 100644
index 0000000000..fd8cb021fa
--- /dev/null
+++ b/firmware/target/arm/as3525/clock-target.h
@@ -0,0 +1,64 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright © 2008 Rafaël Carré
11 *
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.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef CLOCK_TARGET_H
22#define CLOCK_TARGET_H
23
24/* PLL */
25
26#define AS3525_PLLA_FREQ 248000000
27#define AS3525_PLLA_SETTING 0x261F
28
29/* CPU */
30
31/* ensure that PLLA_FREQ * prediv == CPUFREQ_MAX */
32#define AS3525_CPU_PREDIV 0 /* div = 1/1 */
33
34#define CPUFREQ_MAX 248000000
35
36#define CPUFREQ_DEFAULT 24800000
37
38#define CPUFREQ_NORMAL 31000000
39
40/* peripherals */
41
42#define AS3525_PCLK_FREQ 65000000
43
44#define AS3525_IDE_FREQ 90000000
45
46#define AS3525_SD_IDENT_FREQ 400000 /* must be between 100 & 400 kHz */
47
48#define AS3525_I2C_FREQ 400000
49
50/* LCD controller : varies on the models */
51#if defined(SANSA_CLIP)
52#define AS3525_DBOP_FREQ 6000000
53#elif defined(SANSA_M200V4)
54#define AS3525_DBOP_FREQ 8000000
55#elif defined(SANSA_FUZE)
56#define AS3525_DBOP_FREQ 24000000
57#elif defined(SANSA_E200V2)
58#define AS3525_DBOP_FREQ 8000000
59#endif
60
61/* macro for not giving a target clock > at the one provided */
62#define CLK_DIV(ref, target) ((ref + target - 1) / target)
63
64#endif /* CLOCK_TARGET_H */