[PATCH u-boot v2016.07-aspeed-openbmc] Add WD2 reset support for ast-g5

Mykola Kostenok c_mykolak at mellanox.com
Mon Jun 26 23:50:04 AEST 2017



Best regards. Mykola Kostenok.

> -----Original Message-----
> From: joel.stan at gmail.com [mailto:joel.stan at gmail.com] On Behalf Of Joel
> Stanley
> Sent: Monday, June 26, 2017 1:30 PM
> To: Mykola Kostenok <c_mykolak at mellanox.com>
> Cc: OpenBMC Maillist <openbmc at lists.ozlabs.org>
> Subject: Re: [PATCH u-boot v2016.07-aspeed-openbmc] Add WD2 reset
> support for ast-g5
> 
> On Thu, May 25, 2017 at 12:58 AM, Mykola Kostenok
> <c_mykolak at mellanox.com> wrote:
> > Add support for WATCHDOG_RESET macro for aspeed g5 boards
> 
> As I understand it, with this change we can have the watchdog enabled from
> boot but also have u-boot pat the watchdog when dropping to the console?
> 

Yes, its allow to stop in u-boot cli and do not reboot if WDT2 enabled.
We also need to add CONFIG_HW_WATCHDOG define to make it work.

> This is great!
> 
> >
> > Signed-off-by: Mykola Kostenok <c_mykolak at mellanox.com>
> 
> Merged to v2016.07-aspeed-openbmc.
> 
> Cheers,
> 
> Joel
> 
> > ---
> >  board/aspeed/ast-g5/ast-g5.c | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >
> > diff --git a/board/aspeed/ast-g5/ast-g5.c
> > b/board/aspeed/ast-g5/ast-g5.c index da79d7b79a..412b632a41 100644
> > --- a/board/aspeed/ast-g5/ast-g5.c
> > +++ b/board/aspeed/ast-g5/ast-g5.c
> > @@ -46,3 +46,17 @@ int board_eth_init(bd_t *bd)
> >          return aspeednic_initialize(bd);  }  #endif
> > +
> > +/*Called by macro WATCHDOG_RESET*/
> > +#if defined(CONFIG_HW_WATCHDOG)
> > +
> > +#define AST_WDT2_RESTART_REG 0x28 /*WDT2 Counter Restart
> Register*/
> > +#define AST_WDT2_RESTART_SET 0x4755 /*WDT2 Restart Counter
> > +programming value*/
> > +
> > +void hw_watchdog_reset(void)
> > +{
> > +       /*restart WD2 timer*/
> > +       writel(AST_WDT2_RESTART_SET, AST_BASE_WD |
> > +AST_WDT2_RESTART_REG); }
> > +
> > +#endif /* CONFIG_WATCHDOG */
> > --
> > 2.11.0
> >


More information about the openbmc mailing list