[U-Boot] [PATCH V2 2/3] imx: mx7: psci: add system reset support

Fabio Estevam festevam at gmail.com
Sat Jan 6 18:06:23 UTC 2018


Hi Anson,

On Sat, Jan 6, 2018 at 12:17 AM, Anson Huang <Anson.Huang at nxp.com> wrote:

>  }
> +
> +__secure void imx_system_reset(void)
> +{
> +       writew(1 << 2, WDOG1_BASE_ADDR);

It would be safer to turn on the wdog1 clock prior to writing to this register.
Better not assume that is already turned on.

Also this could be improved:

- Do not use hardcoded 1 << 2. There is a WCR_WDE define already
available for that.

- Access this register via proper accessors:

struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR;
clrsetbits_le16(&wdog->wcr, 0, WCR_WDE);


More information about the U-Boot mailing list