[PATCH 09/17] imx: imx8mm/n/p-venice: enable pinctrl_wdog in SPL
Tim Harvey
tharvey at gateworks.com
Tue May 3 18:19:24 CEST 2022
On Tue, May 3, 2022 at 4:42 AM Peng Fan (OSS) <peng.fan at oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan at nxp.com>
>
> Mark pinctrl_wdog as u-boot,dm-spl to clean up board code,
> set_wdog_reset function could be handled by imx_watchdog.c driver.
>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> ---
> arch/arm/dts/imx8mm-venice-u-boot.dtsi | 4 ++++
> arch/arm/dts/imx8mn-venice-u-boot.dtsi | 4 ++++
> arch/arm/dts/imx8mp-venice-u-boot.dtsi | 4 ++++
> board/gateworks/venice/spl.c | 30 --------------------------
> 4 files changed, 12 insertions(+), 30 deletions(-)
>
> diff --git a/arch/arm/dts/imx8mm-venice-u-boot.dtsi b/arch/arm/dts/imx8mm-venice-u-boot.dtsi
> index c61c6de935f..68978a0413e 100644
> --- a/arch/arm/dts/imx8mm-venice-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-venice-u-boot.dtsi
> @@ -72,3 +72,7 @@
> &wdog1 {
> u-boot,dm-spl;
> };
> +
> +&pinctrl_wdog {
> + u-boot,dm-spl;
> +};
> diff --git a/arch/arm/dts/imx8mn-venice-u-boot.dtsi b/arch/arm/dts/imx8mn-venice-u-boot.dtsi
> index 4f23da35676..35819553879 100644
> --- a/arch/arm/dts/imx8mn-venice-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mn-venice-u-boot.dtsi
> @@ -110,6 +110,10 @@
> u-boot,dm-spl;
> };
>
> +&pinctrl_wdog {
> + u-boot,dm-spl;
> +};
> +
> &binman {
> u-boot-spl-ddr {
> align = <4>;
> diff --git a/arch/arm/dts/imx8mp-venice-u-boot.dtsi b/arch/arm/dts/imx8mp-venice-u-boot.dtsi
> index 37f3edc9817..96b9fa89cf4 100644
> --- a/arch/arm/dts/imx8mp-venice-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mp-venice-u-boot.dtsi
> @@ -72,3 +72,7 @@
> &wdog1 {
> u-boot,dm-spl;
> };
> +
> +&pinctrl_wdog {
> + u-boot,dm-spl;
> +};
> diff --git a/board/gateworks/venice/spl.c b/board/gateworks/venice/spl.c
> index af196e5b87c..4c0feb4381c 100644
> --- a/board/gateworks/venice/spl.c
> +++ b/board/gateworks/venice/spl.c
> @@ -87,34 +87,6 @@ static void spl_dram_init(int size)
> ddr_init(dram_timing);
> }
>
> -#define WDOG_PAD_CTRL (PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
> -
> -#ifdef CONFIG_IMX8MM
> -static iomux_v3_cfg_t const wdog_pads[] = {
> - IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B | MUX_PAD_CTRL(WDOG_PAD_CTRL),
> -};
> -#elif CONFIG_IMX8MN
> -static const iomux_v3_cfg_t wdog_pads[] = {
> - IMX8MN_PAD_GPIO1_IO02__WDOG1_WDOG_B | MUX_PAD_CTRL(WDOG_PAD_CTRL),
> -};
> -#elif CONFIG_IMX8MP
> -static const iomux_v3_cfg_t wdog_pads[] = {
> - MX8MP_PAD_GPIO1_IO02__WDOG1_WDOG_B | MUX_PAD_CTRL(WDOG_PAD_CTRL),
> -};
> -
> -#endif
> -
> -int board_early_init_f(void)
> -{
> - struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR;
> -
> - imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads));
> -
> - set_wdog_reset(wdog);
> -
> - return 0;
> -}
> -
> /*
> * Model specific PMIC adjustments necessary prior to DRAM init
> *
> @@ -254,8 +226,6 @@ void board_init_f(ulong dummy)
>
> init_uart_clk(1);
>
> - board_early_init_f();
> -
> timer_init();
>
> /* Clear the BSS. */
> --
> 2.36.0
>
Peng,
Thanks for another great cleanup for imx8m!
If you do another version of this series I would suggest changing the
2nd sentence of the commit logs from:
set_wdog_reset function could be handled by imx_watchdog.c driver.
to:
The set_wdog_reset() function is not necessary as this is handled by
the imx_watchdog.c driver due to the 'fsl,ext-reset-output' property
being set.
Tested By: Tim Harvey <tharvey at gateworks.com> #imx8m{m,n,p}-venice-*
Best Regards,
Tim
More information about the U-Boot
mailing list