summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-05-19 13:28:41 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2012-05-19 16:10:52 +0200
commit068443caaf101bccfa5ff44b44e6f98e6612b27f (patch)
tree174bc3b0099455a54e911a6315be4718ab094fb9
parent9ced006c06a4240cbd2a9ebe9196d9a0658810f9 (diff)
downloadrockbox-068443caaf101bccfa5ff44b44e6f98e6612b27f.tar.gz
rockbox-068443caaf101bccfa5ff44b44e6f98e6612b27f.zip
imx233: move away timer defines from imx233.h
Change-Id: I9f721ae12a3ddf72c4e90ad0754a5c2b819847bb
-rw-r--r--firmware/export/imx233.h10
-rw-r--r--firmware/target/arm/imx233/kernel-imx233.c10
-rw-r--r--firmware/target/arm/imx233/timer-imx233.c10
3 files changed, 23 insertions, 7 deletions
diff --git a/firmware/export/imx233.h b/firmware/export/imx233.h
index d672137a48..58e1d48de6 100644
--- a/firmware/export/imx233.h
+++ b/firmware/export/imx233.h
@@ -64,13 +64,6 @@
64/* Timer runs at APBX speed which is derived from ref_xtal@24MHz */ 64/* Timer runs at APBX speed which is derived from ref_xtal@24MHz */
65#define TIMER_FREQ 24000000 65#define TIMER_FREQ 24000000
66 66
67#ifdef SANSA_FUZEPLUS
68#define TICK_TIMER_NR 0
69#define USER_TIMER_NR 1
70#else
71#error Select timers !
72#endif
73
74/* USBOTG */ 67/* USBOTG */
75#define USB_QHARRAY_ATTR __attribute__((section(".qharray"),nocommon,aligned(2048))) 68#define USB_QHARRAY_ATTR __attribute__((section(".qharray"),nocommon,aligned(2048)))
76#define USB_NUM_ENDPOINTS 5 69#define USB_NUM_ENDPOINTS 5
@@ -84,6 +77,8 @@
84#define __REG_SET(reg) (*((volatile uint32_t *)(&reg + 1))) 77#define __REG_SET(reg) (*((volatile uint32_t *)(&reg + 1)))
85#define __REG_CLR(reg) (*((volatile uint32_t *)(&reg + 2))) 78#define __REG_CLR(reg) (*((volatile uint32_t *)(&reg + 2)))
86#define __REG_TOG(reg) (*((volatile uint32_t *)(&reg + 3))) 79#define __REG_TOG(reg) (*((volatile uint32_t *)(&reg + 3)))
80#define __REG_SET_CLR(reg, set) \
81 (*((volatile uint32_t *)(&reg + (set ? 1 : 2))))
87 82
88#define __BLOCK_SFTRST (1 << 31) 83#define __BLOCK_SFTRST (1 << 31)
89#define __BLOCK_CLKGATE (1 << 30) 84#define __BLOCK_CLKGATE (1 << 30)
@@ -93,5 +88,6 @@
93#define __XTRACT(reg, field) ((reg & reg##__##field##_BM) >> reg##__##field##_BP) 88#define __XTRACT(reg, field) ((reg & reg##__##field##_BM) >> reg##__##field##_BP)
94#define __XTRACT_EX(val, field) (((val) & field##_BM) >> field##_BP) 89#define __XTRACT_EX(val, field) (((val) & field##_BM) >> field##_BP)
95#define __FIELD_SET(reg, field, val) reg = (reg & ~reg##__##field##_BM) | (val << reg##__##field##_BP) 90#define __FIELD_SET(reg, field, val) reg = (reg & ~reg##__##field##_BM) | (val << reg##__##field##_BP)
91#define __FIELD_SET_CLR(reg, field, set) __REG_SET_CLR(reg, set) = reg##__##field
96 92
97#endif /* __IMX233_H__ */ 93#endif /* __IMX233_H__ */
diff --git a/firmware/target/arm/imx233/kernel-imx233.c b/firmware/target/arm/imx233/kernel-imx233.c
index 752db68149..8e1e122277 100644
--- a/firmware/target/arm/imx233/kernel-imx233.c
+++ b/firmware/target/arm/imx233/kernel-imx233.c
@@ -23,6 +23,16 @@
23#include "clkctrl-imx233.h" 23#include "clkctrl-imx233.h"
24#include "kernel-imx233.h" 24#include "kernel-imx233.h"
25 25
26#ifdef SANSA_FUZEPLUS
27#define TICK_TIMER_NR 0
28#elif defined(CREATIVE_ZENXFI2)
29#define TICK_TIMER_NR 0
30#elif defined(CREATIVE_ZENXFI3)
31#define TICK_TIMER_NR 0
32#else
33#error Select tick timer !
34#endif
35
26static void tick_timer(void) 36static void tick_timer(void)
27{ 37{
28 /* Run through the list of tick tasks */ 38 /* Run through the list of tick tasks */
diff --git a/firmware/target/arm/imx233/timer-imx233.c b/firmware/target/arm/imx233/timer-imx233.c
index 2812f1adfc..bcc1974c63 100644
--- a/firmware/target/arm/imx233/timer-imx233.c
+++ b/firmware/target/arm/imx233/timer-imx233.c
@@ -22,6 +22,16 @@
22#include "timrot-imx233.h" 22#include "timrot-imx233.h"
23#include "timer.h" 23#include "timer.h"
24 24
25#ifdef SANSA_FUZEPLUS
26#define USER_TIMER_NR 1
27#elif defined(CREATIVE_ZENXFI2)
28#define USER_TIMER_NR 1
29#elif defined(CREATIVE_ZENXFI3)
30#define USER_TIMER_NR 1
31#else
32#error Select user timer !
33#endif
34
25static long timer_cycles = 0; 35static long timer_cycles = 0;
26 36
27static void timer_fn(void) 37static void timer_fn(void)