summaryrefslogtreecommitdiff
path: root/cpu/arm920t/ks8695
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2009-05-15 23:47:02 +0200
committerWolfgang Denk <wd@denx.de>2009-06-12 20:39:48 +0200
commitb54384e3ba6b5535751f317fcd3940a53eed0d3a (patch)
tree2a2027057af7b2bf1817d530b2ee33ca33e4d660 /cpu/arm920t/ks8695
parent5b4bebe1d20c4f2b70d48b06aed1016785efcc25 (diff)
downloadu-boot-imx-b54384e3ba6b5535751f317fcd3940a53eed0d3a.zip
u-boot-imx-b54384e3ba6b5535751f317fcd3940a53eed0d3a.tar.gz
u-boot-imx-b54384e3ba6b5535751f317fcd3940a53eed0d3a.tar.bz2
arm: timer and interrupt init rework
actually the timer init use the interrupt_init as init callback which make the interrupt and timer implementation difficult to follow so now rename it as int timer_init(void) and use interrupt_init for interrupt btw also remane the corresponding file to the functionnality implemented as ixp arch implement two timer - one based on interrupt - so all the timer related code is moved to timer.c Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'cpu/arm920t/ks8695')
-rw-r--r--cpu/arm920t/ks8695/Makefile3
-rw-r--r--cpu/arm920t/ks8695/timer.c (renamed from cpu/arm920t/ks8695/interrupts.c)12
2 files changed, 6 insertions, 9 deletions
diff --git a/cpu/arm920t/ks8695/Makefile b/cpu/arm920t/ks8695/Makefile
index f6b0063..f53fdc2 100644
--- a/cpu/arm920t/ks8695/Makefile
+++ b/cpu/arm920t/ks8695/Makefile
@@ -25,9 +25,10 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(SOC).a
-COBJS = interrupts.o
SOBJS = lowlevel_init.o
+COBJS = timer.o
+
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/arm920t/ks8695/interrupts.c b/cpu/arm920t/ks8695/timer.c
index 883d689..22987bc 100644
--- a/cpu/arm920t/ks8695/interrupts.c
+++ b/cpu/arm920t/ks8695/timer.c
@@ -29,13 +29,13 @@
#define ks8695_read(a) *((volatile ulong *) (KS8695_IO_BASE + (a)))
#define ks8695_write(a,v) *((volatile ulong *) (KS8695_IO_BASE + (a))) = (v)
-int timer_inited;
ulong timer_ticks;
-int interrupt_init (void)
+int timer_init (void)
{
- /* nothing happens here - we don't setup any IRQs */
- return (0);
+ reset_timer();
+
+ return 0;
}
/*
@@ -53,7 +53,6 @@ void reset_timer_masked(void)
ks8695_write(KS8695_TIMER1_PCOUNT, TIMER_PULSE);
ks8695_write(KS8695_TIMER_CTRL, 0x2);
timer_ticks = 0;
- timer_inited++;
}
void reset_timer(void)
@@ -87,9 +86,6 @@ void udelay(ulong usec)
ulong start = get_timer_masked();
ulong end;
- if (!timer_inited)
- reset_timer();
-
/* Only 1ms resolution :-( */
end = usec / 1000;
while (get_timer(start) < end)