summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/arm920t/at91
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/cpu/arm920t/at91')
-rw-r--r--arch/arm/cpu/arm920t/at91/Makefile4
-rw-r--r--arch/arm/cpu/arm920t/at91/reset.c8
-rw-r--r--arch/arm/cpu/arm920t/at91/timer.c29
3 files changed, 21 insertions, 20 deletions
diff --git a/arch/arm/cpu/arm920t/at91/Makefile b/arch/arm/cpu/arm920t/at91/Makefile
index d8a4383..5c71b77 100644
--- a/arch/arm/cpu/arm920t/at91/Makefile
+++ b/arch/arm/cpu/arm920t/at91/Makefile
@@ -23,7 +23,7 @@
include $(TOPDIR)/config.mk
-LIB = $(obj)lib$(SOC).a
+LIB = $(obj)lib$(SOC).o
SOBJS += lowlevel_init.o
COBJS += reset.o
@@ -35,7 +35,7 @@ OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
all: $(obj).depend $(LIB)
$(LIB): $(OBJS)
- $(AR) $(ARFLAGS) $@ $(OBJS)
+ $(call cmd_link_o_target, $(OBJS))
#########################################################################
diff --git a/arch/arm/cpu/arm920t/at91/reset.c b/arch/arm/cpu/arm920t/at91/reset.c
index ce9c156..51043ec 100644
--- a/arch/arm/cpu/arm920t/at91/reset.c
+++ b/arch/arm/cpu/arm920t/at91/reset.c
@@ -35,7 +35,10 @@
#include <asm/arch/hardware.h>
#include <asm/arch/at91_st.h>
-void board_reset(void) __attribute__((__weak__));
+void __attribute__((weak)) board_reset(void)
+{
+ /* true empty function for defining weak symbol */
+}
void reset_cpu(ulong ignored)
{
@@ -45,8 +48,7 @@ void reset_cpu(ulong ignored)
serial_exit();
#endif
- if (board_reset)
- board_reset();
+ board_reset();
/* Reset the cpu by setting up the watchdog timer */
writel(AT91_ST_WDMR_RSTEN | AT91_ST_WDMR_EXTEN | AT91_ST_WDMR_WDV(2),
diff --git a/arch/arm/cpu/arm920t/at91/timer.c b/arch/arm/cpu/arm920t/at91/timer.c
index 91377d4..d9a024f 100644
--- a/arch/arm/cpu/arm920t/at91/timer.c
+++ b/arch/arm/cpu/arm920t/at91/timer.c
@@ -32,17 +32,16 @@
#include <common.h>
-#include <asm/io.h>
-#include <asm/hardware.h>
+#include <asm/arch/io.h>
+#include <asm/arch/hardware.h>
#include <asm/arch/at91_tc.h>
#include <asm/arch/at91_pmc.h>
+DECLARE_GLOBAL_DATA_PTR;
+
/* the number of clocks per CONFIG_SYS_HZ */
#define TIMER_LOAD_VAL (CONFIG_SYS_HZ_CLOCK/CONFIG_SYS_HZ)
-static u32 timestamp;
-static u32 lastinc;
-
int timer_init(void)
{
at91_tc_t *tc = (at91_tc_t *) AT91_TC_BASE;
@@ -64,8 +63,8 @@ int timer_init(void)
writel(TIMER_LOAD_VAL, &tc->tc[0].rc);
writel(AT91_TC_CCR_SWTRG | AT91_TC_CCR_CLKEN, &tc->tc[0].ccr);
- lastinc = 0;
- timestamp = 0;
+ gd->lastinc = 0;
+ gd->tbl = 0;
return 0;
}
@@ -86,7 +85,7 @@ ulong get_timer(ulong base)
void set_timer(ulong t)
{
- timestamp = t;
+ gd->tbl = t;
}
void __udelay(unsigned long usec)
@@ -98,8 +97,8 @@ void reset_timer_masked(void)
{
/* reset time */
at91_tc_t *tc = (at91_tc_t *) AT91_TC_BASE;
- lastinc = readl(&tc->tc[0].cv) & 0x0000ffff;
- timestamp = 0;
+ gd->lastinc = readl(&tc->tc[0].cv) & 0x0000ffff;
+ gd->tbl = 0;
}
ulong get_timer_raw(void)
@@ -109,16 +108,16 @@ ulong get_timer_raw(void)
now = readl(&tc->tc[0].cv) & 0x0000ffff;
- if (now >= lastinc) {
+ if (now >= gd->lastinc) {
/* normal mode */
- timestamp += now - lastinc;
+ gd->tbl += now - gd->lastinc;
} else {
/* we have an overflow ... */
- timestamp += now + TIMER_LOAD_VAL - lastinc;
+ gd->tbl += now + TIMER_LOAD_VAL - gd->lastinc;
}
- lastinc = now;
+ gd->lastinc = now;
- return timestamp;
+ return gd->tbl;
}
ulong get_timer_masked(void)