[U-Boot] [PATCH 2/4] nds32/ag102: add ag102 soc support

Macpaul Lin macpaul at gmail.com
Wed Nov 23 03:16:50 CET 2011


Hi Mike

2011/11/19 Mike Frysinger <vapier at gentoo.org>

Thanks for your review.

[snip]

>
> > +.globl       turnoff_watchdog
> > +turnoff_watchdog:
> > +
> > +#define WD_CR                0xC
> > +#define WD_ENABLE    0x1
> > +
> > +     ! Turn off the watchdog, according to Faraday FTWDT010 spec
> > +     li      $p0, (CONFIG_FTWDT010_BASE+WD_CR)       ! Get the addr of
> WD CR
> > +     lwi     $p1, [$p0]                              ! Get the config
> of WD
> > +     andi    $p1, $p1, 0x1f                          ! Wipe out useless
> bits
> > +     li      $r0, ~WD_ENABLE
> > +     and     $p1, $p1, $r0                           ! Set WD disable
> > +     sw      $p1, [$p0]                              ! Write back to WD
> CR
> > +
> > +     ! Disable Interrupts by clear GIE in $PSW reg
> > +     setgie.d
>
> can't this be C code ?
> -mike
>

This is because after reset, the watchdog might be enabled if there is
another boot loader has ran before u-boot.
If the other boot loader enabled watchdog but didn't stop it,
it might cause u-boot to be reset during assembly initialization phase.
So we need to disable watchdog here.

Other suggestions will be adapted.
Thanks!

-- 
Best regards,
Macpaul Lin


More information about the U-Boot mailing list