summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/clock-target.h
blob: a227f464ff7ec602d5ec86ae9c221f405f4043fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/***************************************************************************
 *             __________               __   ___.
 *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
 *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
 *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
 *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
 *                     \/            \/     \/    \/            \/
 * $Id$
 *
 * Copyright © 2008 Rafaël Carré
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 * KIND, either express or implied.
 *
 ****************************************************************************/
#ifndef CLOCK_TARGET_H
#define CLOCK_TARGET_H

/* PLL */

#define AS3525_PLLA_FREQ        248000000
#define AS3525_PLLA_SETTING     0x261F

/* CPU */

/* ensure that PLLA_FREQ * prediv == CPUFREQ_MAX */
#define AS3525_CPU_PREDIV       0 /* div = 1/1 */

#define CPUFREQ_MAX             248000000

#define CPUFREQ_DEFAULT         24800000

#define CPUFREQ_NORMAL          31000000

/* peripherals */

#define AS3525_PCLK_FREQ        65000000

#define AS3525_IDE_FREQ         90000000

#define AS3525_SD_IDENT_FREQ    400000      /* must be between 100 & 400 kHz */

#define AS3525_I2C_FREQ         400000

/* LCD controller : varies on the models */
#if     defined(SANSA_CLIP)
#define AS3525_DBOP_FREQ        6000000
#elif   defined(SANSA_M200V4)
#define AS3525_DBOP_FREQ        8000000
#elif   defined(SANSA_FUZE)
#define AS3525_DBOP_FREQ        8000000
#elif   defined(SANSA_E200V2)
#define AS3525_DBOP_FREQ        8000000
#elif   defined(SANSA_C200V2)
#define AS3525_DBOP_FREQ        8000000
#endif

/* macro for not giving a target clock > at the one provided */
#define CLK_DIV(ref, target) ((ref + target - 1) / target)

#endif /* CLOCK_TARGET_H */