summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2013-10-22 08:37:46 -0400
committerTom Rini <trini@ti.com>2013-10-22 08:37:46 -0400
commit55aea84b1db277bd86edadb37d11b78d36db7608 (patch)
tree6d3d0ce8cb6b3afe9b5f6151c0236ec9503ad218 /arch
parent748bde608a8dfea5b64e186af4d9c27642fe7813 (diff)
parent7f2013d47c8c62c2373cafe68d6ba4649099e49a (diff)
downloadu-boot-imx-55aea84b1db277bd86edadb37d11b78d36db7608.zip
u-boot-imx-55aea84b1db277bd86edadb37d11b78d36db7608.tar.gz
u-boot-imx-55aea84b1db277bd86edadb37d11b78d36db7608.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-sh
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/cpu/sh4/cache.c4
-rw-r--r--arch/sh/cpu/sh4/cpu.c2
-rw-r--r--arch/sh/include/asm/cache.h3
-rw-r--r--arch/sh/lib/time.c10
4 files changed, 9 insertions, 10 deletions
diff --git a/arch/sh/cpu/sh4/cache.c b/arch/sh/cpu/sh4/cache.c
index 1947ec8..e1ee970 100644
--- a/arch/sh/cpu/sh4/cache.c
+++ b/arch/sh/cpu/sh4/cache.c
@@ -91,7 +91,7 @@ int cache_control(unsigned int cmd)
return 0;
}
-void dcache_wback_range(u32 start, u32 end)
+void flush_dcache_range(unsigned long start, unsigned long end)
{
u32 v;
@@ -102,7 +102,7 @@ void dcache_wback_range(u32 start, u32 end)
}
}
-void dcache_invalid_range(u32 start, u32 end)
+void invalidate_dcache_range(unsigned long start, unsigned long end)
{
u32 v;
diff --git a/arch/sh/cpu/sh4/cpu.c b/arch/sh/cpu/sh4/cpu.c
index 9fae614..91133a3 100644
--- a/arch/sh/cpu/sh4/cpu.c
+++ b/arch/sh/cpu/sh4/cpu.c
@@ -41,7 +41,7 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
void flush_cache (unsigned long addr, unsigned long size)
{
- dcache_invalid_range( addr , addr + size );
+ invalidate_dcache_range(addr , addr + size);
}
void icache_enable (void)
diff --git a/arch/sh/include/asm/cache.h b/arch/sh/include/asm/cache.h
index 24941b3..b21dc44 100644
--- a/arch/sh/include/asm/cache.h
+++ b/arch/sh/include/asm/cache.h
@@ -10,9 +10,6 @@ int cache_control(unsigned int cmd);
struct __large_struct { unsigned long buf[100]; };
#define __m(x) (*(struct __large_struct *)(x))
-void dcache_wback_range(u32 start, u32 end);
-void dcache_invalid_range(u32 start, u32 end);
-
#else
/*
diff --git a/arch/sh/lib/time.c b/arch/sh/lib/time.c
index 1fe537e..c554fe8 100644
--- a/arch/sh/lib/time.c
+++ b/arch/sh/lib/time.c
@@ -17,15 +17,17 @@
#include <asm/io.h>
#include <sh_tmu.h>
+#define TCR_TPSC 0x07
+
static struct tmu_regs *tmu = (struct tmu_regs *)TMU_BASE;
-static u16 bit;
static unsigned long last_tcnt;
static unsigned long long overflow_ticks;
unsigned long get_tbclk(void)
{
- return get_tmu0_clk_rate() >> ((bit + 1) * 2);
+ u16 tmu_bit = (ffs(CONFIG_SYS_TMU_CLK_DIV) >> 1) - 1;
+ return get_tmu0_clk_rate() >> ((tmu_bit + 1) * 2);
}
static inline unsigned long long tick_to_time(unsigned long long tick)
@@ -60,8 +62,8 @@ static void tmu_timer_stop(unsigned int timer)
int timer_init(void)
{
- bit = (ffs(CONFIG_SYS_TMU_CLK_DIV) >> 1) - 1;
- writew(readw(&tmu->tcr0) | bit, &tmu->tcr0);
+ u16 tmu_bit = (ffs(CONFIG_SYS_TMU_CLK_DIV) >> 1) - 1;
+ writew((readw(&tmu->tcr0) & ~TCR_TPSC) | tmu_bit, &tmu->tcr0);
tmu_timer_stop(0);
tmu_timer_start(0);