diff options
author | Minkyu Kang <mk7.kang@samsung.com> | 2010-07-06 17:29:44 +0900 |
---|---|---|
committer | Minkyu Kang <mk7.kang@samsung.com> | 2010-07-06 17:29:44 +0900 |
commit | 2271d3ddccfbd4a7640121669ff9b013b1fea361 (patch) | |
tree | 400f22f0a12ff0ae6c472bed6ac648befc1744a2 /arch/sh | |
parent | 25ae8aeb54a6ca89ba1fd11c00865b8fed9348b4 (diff) | |
parent | 54841ab50c20d6fa6c9cc3eb826989da3a22d934 (diff) |
Merge branch 'master' of git://git.denx.de/u-boot
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/cpu/sh2/cpu.c | 2 | ||||
-rw-r--r-- | arch/sh/cpu/sh2/watchdog.c | 8 | ||||
-rw-r--r-- | arch/sh/cpu/sh3/cpu.c | 2 | ||||
-rw-r--r-- | arch/sh/cpu/sh3/watchdog.c | 7 | ||||
-rw-r--r-- | arch/sh/cpu/sh4/cpu.c | 2 | ||||
-rw-r--r-- | arch/sh/cpu/sh4/watchdog.c | 4 | ||||
-rw-r--r-- | arch/sh/include/asm/system.h | 12 | ||||
-rw-r--r-- | arch/sh/lib/bootm.c | 2 | ||||
-rw-r--r-- | arch/sh/lib/time.c | 20 |
9 files changed, 50 insertions, 9 deletions
diff --git a/arch/sh/cpu/sh2/cpu.c b/arch/sh/cpu/sh2/cpu.c index e0cb04752d..6bbedd9d48 100644 --- a/arch/sh/cpu/sh2/cpu.c +++ b/arch/sh/cpu/sh2/cpu.c @@ -59,7 +59,7 @@ int cleanup_before_linux(void) return 0; } -int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { disable_interrupts(); reset_cpu(0); diff --git a/arch/sh/cpu/sh2/watchdog.c b/arch/sh/cpu/sh2/watchdog.c index de0254b446..0257d8d15d 100644 --- a/arch/sh/cpu/sh2/watchdog.c +++ b/arch/sh/cpu/sh2/watchdog.c @@ -1,6 +1,6 @@ /* - * Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhoro@renesas.com> - * Copyright (C) 2008 Renesas Solutions Corp. + * Copyright (C) 2008,2010 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> + * Copyright (C) 2008,2010 Renesas Solutions Corp. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -20,6 +20,7 @@ #include <common.h> #include <asm/processor.h> +#include <asm/system.h> int watchdog_init(void) { @@ -28,6 +29,9 @@ int watchdog_init(void) void reset_cpu(unsigned long ignored) { + /* Address error with SR.BL=1 first. */ + trigger_address_error(); + while (1) ; } diff --git a/arch/sh/cpu/sh3/cpu.c b/arch/sh/cpu/sh3/cpu.c index 8261d29d48..3e9caad8d2 100644 --- a/arch/sh/cpu/sh3/cpu.c +++ b/arch/sh/cpu/sh3/cpu.c @@ -45,7 +45,7 @@ int cleanup_before_linux(void) return 0; } -int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { disable_interrupts(); reset_cpu(0); diff --git a/arch/sh/cpu/sh3/watchdog.c b/arch/sh/cpu/sh3/watchdog.c index 92bea74719..90694f8664 100644 --- a/arch/sh/cpu/sh3/watchdog.c +++ b/arch/sh/cpu/sh3/watchdog.c @@ -1,4 +1,7 @@ /* + * (C) Copyright 2010 + * Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> + * * (C) Copyright 2007 * Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> * @@ -20,6 +23,7 @@ #include <common.h> #include <asm/processor.h> +#include <asm/system.h> int watchdog_init(void) { @@ -28,6 +32,9 @@ int watchdog_init(void) void reset_cpu(unsigned long ignored) { + /* Address error with SR.BL=1 first. */ + trigger_address_error(); + while (1) ; } diff --git a/arch/sh/cpu/sh4/cpu.c b/arch/sh/cpu/sh4/cpu.c index be410abf00..f136758334 100644 --- a/arch/sh/cpu/sh4/cpu.c +++ b/arch/sh/cpu/sh4/cpu.c @@ -44,7 +44,7 @@ int cleanup_before_linux (void) return 0; } -int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { disable_interrupts(); reset_cpu (0); diff --git a/arch/sh/cpu/sh4/watchdog.c b/arch/sh/cpu/sh4/watchdog.c index f6924290f0..d7e1703e69 100644 --- a/arch/sh/cpu/sh4/watchdog.c +++ b/arch/sh/cpu/sh4/watchdog.c @@ -17,6 +17,7 @@ #include <common.h> #include <asm/processor.h> +#include <asm/system.h> #include <asm/io.h> #define WDT_BASE WTCNT @@ -66,6 +67,9 @@ int watchdog_disable(void) void reset_cpu(unsigned long ignored) { + /* Address error with SR.BL=1 first. */ + trigger_address_error(); + while (1) ; } diff --git a/arch/sh/include/asm/system.h b/arch/sh/include/asm/system.h index a62c42261d..56fd77acea 100644 --- a/arch/sh/include/asm/system.h +++ b/arch/sh/include/asm/system.h @@ -8,7 +8,7 @@ * from linux kernel code. */ -#include <linux/irqflags.h> +#include <asm/irqflags.h> #include <asm/types.h> /* @@ -272,4 +272,14 @@ void enable_hlt(void); #define arch_align_stack(x) (x) +static inline void trigger_address_error(void) +{ + __asm__ __volatile__ ( + "ldc %0, sr\n\t" + "mov.l @%1, %0" + : + : "r" (0x10000000), "r" (0x80000001) + ); +} + #endif diff --git a/arch/sh/lib/bootm.c b/arch/sh/lib/bootm.c index ae1f869f10..9c58ed7ec8 100644 --- a/arch/sh/lib/bootm.c +++ b/arch/sh/lib/bootm.c @@ -43,7 +43,7 @@ static void hexdump(unsigned char *buf, int len) } #endif -int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) +int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *images) { /* Linux kernel load address */ void (*kernel) (void) = (void (*)(void))images->ep; diff --git a/arch/sh/lib/time.c b/arch/sh/lib/time.c index 9a8f89aef6..bc1656f73c 100644 --- a/arch/sh/lib/time.c +++ b/arch/sh/lib/time.c @@ -2,7 +2,7 @@ * (C) Copyright 2009 * Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> * - * (C) Copyright 2007-2008 + * (C) Copyright 2007-2010 * Nobobuhiro Iwamatsu <iwamatsu@nigauri.org> * * (C) Copyright 2003 @@ -36,6 +36,8 @@ #define TMU_MAX_COUNTER (~0UL) static ulong timer_freq; +static unsigned long last_tcnt; +static unsigned long long overflow_ticks; static inline unsigned long long tick_to_time(unsigned long long tick) { @@ -97,12 +99,26 @@ int timer_init (void) tmu_timer_stop(0); tmu_timer_start(0); + last_tcnt = 0; + overflow_ticks = 0; + return 0; } unsigned long long get_ticks (void) { - return 0 - readl(TCNT0); + unsigned long tcnt = 0 - readl(TCNT0); + unsigned long ticks; + + if (last_tcnt > tcnt) { /* overflow */ + overflow_ticks++; + ticks = (0xffffffff - last_tcnt) + tcnt; + } else { + ticks = tcnt; + } + last_tcnt = tcnt; + + return (overflow_ticks << 32) | tcnt; } void __udelay (unsigned long usec) |