[PATCH u-boot v2016.07-aspeed-openbmc] Add extended configuration for ast-g5 board

Mykola Kostenok c_mykolak at mellanox.com
Wed May 24 20:03:23 AEST 2017


Hi, Joel.
Thanks for reply.
Ok, I will make separate patch for defconfig.

About WD2 please look at my comments below.

Best regards, Mykola Kostenok.

> -----Original Message-----
> From: joel.stan at gmail.com [mailto:joel.stan at gmail.com] On Behalf Of Joel
> Stanley
> Sent: Wednesday, May 24, 2017 4:44 AM
> 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 extended
> configuration for ast-g5 board
> 
> On Tue, May 23, 2017 at 9:34 PM, Mykola Kostenok
> <c_mykolak at mellanox.com> wrote:
> > Add defconfig extends ast_g5_ncsi_defconfig with the number of options:
> > It allows 2-nd  boot partition, memory testing, boot, image info
> > option, extra filesystem and environment commands.
> > Add WATCHDOG_RESET macro support for aspeed g5 boards for cases
> when
> > HW watchdog is configured.
> >
> > Signed-off-by: Mykola Kostenok <c_mykolak at mellanox.com>
> > ---
> >  board/aspeed/ast-g5/Kconfig         |  1 +
> >  board/aspeed/ast-g5/ast-g5.c        | 17 +++++++++++++++++
> >  configs/ast_g5_ncsi_2boot_defconfig | 36
> > ++++++++++++++++++++++++++++++++++++
> >  3 files changed, 54 insertions(+)
> >  create mode 100644 configs/ast_g5_ncsi_2boot_defconfig
> >
> > diff --git a/board/aspeed/ast-g5/Kconfig b/board/aspeed/ast-g5/Kconfig
> > index 9bd3e7de49..0a8b38b9db 100644
> > --- a/board/aspeed/ast-g5/Kconfig
> > +++ b/board/aspeed/ast-g5/Kconfig
> > @@ -18,5 +18,6 @@ config SYS_SOC
> >  config SYS_CONFIG_NAME
> >         default "ast-g5-phy" if ASPEED_NET_PHY
> >         default "ast-g5-ncsi" if ASPEED_NET_NCSI
> > +       default "ast-g5-ncsi-2boot" if ASPEED_NET_NCSI &&
> > + FIRMWARE_2ND_BOOT
> >
> >  endif
> > diff --git a/board/aspeed/ast-g5/ast-g5.c
> > b/board/aspeed/ast-g5/ast-g5.c index da79d7b79a..2965ffea0e 100644
> > --- a/board/aspeed/ast-g5/ast-g5.c
> > +++ b/board/aspeed/ast-g5/ast-g5.c
> > @@ -46,3 +46,20 @@ int board_eth_init(bd_t *bd)
> >          return aspeednic_initialize(bd);  }  #endif
> > +
> > +/*Called by macro WATCHDOG_RESET*/
> > +#if defined(CONFIG_HW_WATCHDOG)
> > +
> > +#define AST_BASE_WD 0x1E785000 /* Watch DOG */ #define WDT_28
> 0x28
> > +/*WDT2 Counter Restart Register*/ #define WDT_RESTART_VALUE
> 0x4755
> > +/*value to write into WDT restart register.*/
> > +
> > +void hw_watchdog_reset(void)
> > +{
> > +       u32 reg = 0;
> > +       /*restart WD2 timer*/
> > +       reg = WDT_RESTART_VALUE;
> 
> You can just use WDT_RESTART_VALUE instead of creating the local variable.
> 

Yes, I'll fix it.

> Can you explain what you're doing here. You're setting the magic reload
> value, but not the WDT enable or the count.
> 

This function used for refresh WD2 timer and mean thats system alive. 
If we enable WD2 and stop in u-boot CMD, 
without this function WD2 will reboot our system to backup flash.
This magic value described in AST2500 datasheet in chapter 
41.3 Registers : Base Address = 0x1E78:5000
Offset: 28h WDT28: WDT2 Counter Restart register:
	Restart register is used to avoid system deadlock. If the 0x4755 value is written into
	this register, the Reload register will be loaded into WDT20 register and WDT20 register
	restarts to decrease if WDT2C[0] register is set.

> > +       writel(reg, AST_BASE_WD | WDT_28); }
> > +
> > +#endif /* CONFIG_WATCHDOG */
> > diff --git a/configs/ast_g5_ncsi_2boot_defconfig
> > b/configs/ast_g5_ncsi_2boot_defconfig
> > new file mode 100644
> > index 0000000000..f919f237b4
> > --- /dev/null
> > +++ b/configs/ast_g5_ncsi_2boot_defconfig
> 
> The defconfig looks okay. If you send that change in a separate patch I can
> merge it.
> 
> Cheers,
> 
> Joel
> 
> > @@ -0,0 +1,36 @@
> > +CONFIG_ARM=y
> > +CONFIG_TARGET_AST_G5=y
> > +CONFIG_SYS_PROMPT="ast# "
> > +CONFIG_CMD_BOOTEFI=n
> > +CONFIG_CMD_DHCP=y
> > +CONFIG_CMD_PING=y
> > +CONFIG_EFI_LOADER=n
> > +CONFIG_FIT=y
> > +CONFIG_FIT_VERBOSE=y
> > +CONFIG_HUSH_PARSER=y
> > +CONFIG_OF_LIBFDT=y
> > +CONFIG_SPI_FLASH=y
> > +CONFIG_SYS_NS16550=y
> > +CONFIG_FIRMWARE_2ND_BOOT=y
> > +CONFIG_AUTOBOOT=y
> > +CONFIG_AUTOBOOT_KEYED=y
> > +CONFIG_AUTOBOOT_PROMPT="\nBooting the BMC in %d seconds. Type
> the password to stop autoboot.\n"
> > +CONFIG_AUTOBOOT_STOP_STR="0penBmc"
> > +CONFIG_CMD_SAVEENV=y
> > +CONFIG_CMDLINE=y
> > +CONFIG_BOOTDELAY=5
> > +CONFIG_NETDEVICES=y
> > +CONFIG_CMD_GREPENV=y
> > +CONFIG_CMD_MEMINFO=y
> > +CONFIG_CMD_EXT2=y
> > +CONFIG_CMD_FAT=y
> > +CONFIG_EXPERT=y
> > +CONFIG_REGEX=y
> > +CONFIG_CMD_IMI=y
> > +CONFIG_CMD_IMLS=y
> > +CONFIG_CMD_MEMORY=y
> > +CONFIG_CMD_CRC32=y
> > +CONFIG_LOOPW=y
> > +CONFIG_CMD_MEMTEST=y
> > +CONFIG_CMD_MX_CYCLIC=y
> > +
> > --
> > 2.11.0
> >


More information about the openbmc mailing list