revert r27044 (which was a revert of r26953 & r26954)
[kugel-rb.git] / firmware / target / arm / as3525 / system-target.h
blobb3b9001a455307d53fe60def3c3518ea66c27648
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2008 Rafaël Carré
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef SYSTEM_TARGET_H
22 #define SYSTEM_TARGET_H
24 #include "system-arm.h"
25 #include "mmu-arm.h"
26 #include "panic.h"
28 #include "clock-target.h" /* CPUFREQ_* are defined here */
30 #define STORAGE_WANTS_ALIGN
32 /* We can use a interrupt-based mechanism on the fuzev2 */
33 #define INCREASED_SCROLLWHEEL_POLLING \
34 (defined(HAVE_SCROLLWHEEL) && (CONFIG_CPU == AS3525))
36 #if INCREASED_SCROLLWHEEL_POLLING
37 /* let the timer interrupt twice as often for the scrollwheel polling */
38 #define KERNEL_TIMER_FREQ (TIMER_FREQ/2)
39 #else
40 #define KERNEL_TIMER_FREQ TIMER_FREQ
41 #endif
43 #define AS3525_UNCACHED_ADDR(a) ((typeof(a)) ((uintptr_t)(a) + 0x10000000))
44 #define AS3525_PHYSICAL_ADDR(a) \
45 ((typeof(a)) ((((uintptr_t)(a)) & (MEM*0x100000)) \
46 ? (((uintptr_t)(a)) - IRAM_ORIG) \
47 : ((uintptr_t)(a))))
49 #ifdef SANSA_C200V2
50 /* 0: Backlight on A5, 1: Backlight on A7 */
51 extern int c200v2_variant;
52 /* c200v2 changes the timer interval often due to software pwm */
53 #define TIMER_PERIOD TIMER2_BGLOAD
54 #else
55 #define TIMER_PERIOD (KERNEL_TIMER_FREQ/HZ)
56 #endif
58 void udelay(unsigned usecs);
59 static inline void mdelay(unsigned msecs)
61 udelay(1000 * msecs);
63 #endif /* SYSTEM_TARGET_H */