diff mbox

[U-Boot,1/3] dm: mips: Fix lb60 WDT control

Message ID 1343415515-17755-1-git-send-email-marex@denx.de
State Accepted
Commit 36d0a42b682e4d8493e8c080425bc9fb6f188cd2
Delegated to: Daniel Schwierzeck
Headers show

Commit Message

Marek Vasut July 27, 2012, 6:58 p.m. UTC
Write the TSCR register via 32bit write instead of 16bit one.
The register is 32bit wide and bit 16 is being set, triggering
gcc overflow error and making the code broken.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel <zpxu@ingenic.cn>
Cc: Shinya Kuribayashi <skuribay@pobox.com>
Cc: Xiangfu Liu <xiangfu@openmobilefree.net>
---
 arch/mips/cpu/xburst/cpu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marek Vasut July 30, 2012, 6:36 a.m. UTC | #1
Dear Marek Vasut,

> Write the TSCR register via 32bit write instead of 16bit one.
> The register is 32bit wide and bit 16 is being set, triggering
> gcc overflow error and making the code broken.
[...]
Dan, can you please pick these (I didn't CC you ... sigh :/ ) ?

Best regards,
Marek Vasut
Daniel Schwierzeck July 30, 2012, 10:50 a.m. UTC | #2
2012/7/30 Marek Vasut <marex@denx.de>:
> Dear Marek Vasut,
>
>> Write the TSCR register via 32bit write instead of 16bit one.
>> The register is 32bit wide and bit 16 is being set, triggering
>> gcc overflow error and making the code broken.
> [...]
> Dan, can you please pick these (I didn't CC you ... sigh :/ ) ?
>

Sure. I'm still waiting for some comments from Xiangfu.

Best regards,
Daniel
Daniel Schwierzeck Aug. 19, 2012, 6:19 p.m. UTC | #3
2012/7/27 Marek Vasut <marex@denx.de>:
> Write the TSCR register via 32bit write instead of 16bit one.
> The register is 32bit wide and bit 16 is being set, triggering
> gcc overflow error and making the code broken.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Daniel <zpxu@ingenic.cn>
> Cc: Shinya Kuribayashi <skuribay@pobox.com>
> Cc: Xiangfu Liu <xiangfu@openmobilefree.net>
> ---
>  arch/mips/cpu/xburst/cpu.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied to u-boot-mips/master, thanks
diff mbox

Patch

diff --git a/arch/mips/cpu/xburst/cpu.c b/arch/mips/cpu/xburst/cpu.c
index e976341..ddcbfaa 100644
--- a/arch/mips/cpu/xburst/cpu.c
+++ b/arch/mips/cpu/xburst/cpu.c
@@ -62,7 +62,7 @@  void __attribute__((weak)) _machine_restart(void)
 
 	writew(100, &wdt->tdr); /* wdt_set_data(100) */
 	writew(0, &wdt->tcnt); /* wdt_set_count(0); */
-	writew(TCU_TSSR_WDTSC, &tcu->tscr); /* tcu_start_wdt_clock */
+	writel(TCU_TSSR_WDTSC, &tcu->tscr); /* tcu_start_wdt_clock */
 	writeb(readb(&wdt->tcer) | WDT_TCER_TCEN, &wdt->tcer); /* wdt start */
 
 	while (1)