All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 07/17] imx: engicam-imx8mm: drop unused macro
  2022-05-03 12:24 ` [PATCH 07/17] imx: engicam-imx8mm: drop unused macro Peng Fan (OSS)
@ 2022-05-03 11:49   ` Michael Nazzareno Trimarchi
  0 siblings, 0 replies; 25+ messages in thread
From: Michael Nazzareno Trimarchi @ 2022-05-03 11:49 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: sbabic, festevam, Jagan Teki, Matteo Lisi, u-boot, Peng Fan

Hi

On Tue, May 3, 2022 at 1:44 PM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> Drop unused WDOG macro
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  board/engicam/imx8mm/spl.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/board/engicam/imx8mm/spl.c b/board/engicam/imx8mm/spl.c
> index f75f2dc634c..1846134a492 100644
> --- a/board/engicam/imx8mm/spl.c
> +++ b/board/engicam/imx8mm/spl.c
> @@ -54,8 +54,6 @@ int board_fit_config_name_match(const char *name)
>  }
>  #endif
>
> -#define WDOG_PAD_CTRL  (PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
> -
>  int board_early_init_f(void)
>  {
>         return 0;
> --
> 2.36.0
>

Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>


-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info@amarulasolutions.com
www.amarulasolutions.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 00/17] imx: imx8m: clean up wdog code
@ 2022-05-03 12:24 Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 01/17] imx: imx8mn_evk: enable pinctrl_wdog in SPL Peng Fan (OSS)
                   ` (16 more replies)
  0 siblings, 17 replies; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Enable pinctrl wdog to clean up board level code
imx_watchdog.c already has function of set_wdog_reset, so after watchdog
driver enabled, no need that.

Note: I only have NXP EVK board, so please help test if possible.

Based on: https://patchwork.ozlabs.org/project/uboot/cover/20220430124317.17382-1-peng.fan@oss.nxp.com/

Peng Fan (17):
  imx: imx8mn_evk: enable pinctrl_wdog in SPL
  imx: imx8mm_evk: enable pinctrl_wdog in SPL
  imx: imx8mp_evk: enable pinctrl_wdog in SPL
  imx: imx8mm_beacon: enable pinctrl_wdog in SPL
  imx: imx8mm-cl-iot-gate: enable pinctrl_wdog in SPL
  imx: imx8mm-data-modul-edm-sbc: enable pinctrl_wdog in SPL
  imx: engicam-imx8mm: drop unused macro
  imx: imx8mm-mx8menlo: drop unneeded watchdog settings
  imx: imx8mm/n/p-venice: enable pinctrl_wdog in SPL
  imx: imx8mn-beacon: enable pinctrl_wdog in SPL
  imx: imx8mn_smm_s2:  clean up board watchdog code
  imx: imx8mn_var_som:  clean up board watchdog code
  imx: imx8mp_rsb7320a1: enable wdog driver model in SPL
  imx: imx8mn-kontron-n801x: enable pinctrl_wdog in SPL
  imx: phycore_imx8mm/p:  clean up board watchdog code
  imx: verdin-imx8mm/p: cleanup board watchdog code
  imx: toradex/verdin-imx8mm/p: cleanup board watchdog code

 arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi    |  4 +++
 arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   |  4 +++
 .../dts/imx8mm-data-modul-edm-sbc-u-boot.dtsi |  4 +++
 arch/arm/dts/imx8mm-data-modul-edm-sbc.dts    |  9 ++++++
 arch/arm/dts/imx8mm-evk-u-boot.dtsi           |  4 +++
 arch/arm/dts/imx8mm-kontron-n801x-u-boot.dtsi |  4 +++
 arch/arm/dts/imx8mm-venice-u-boot.dtsi        |  4 +++
 arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi    |  4 +++
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi      |  4 +++
 arch/arm/dts/imx8mn-venice-u-boot.dtsi        |  4 +++
 arch/arm/dts/imx8mp-evk-u-boot.dtsi           |  4 +++
 arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi    |  8 +++++
 arch/arm/dts/imx8mp-venice-u-boot.dtsi        |  4 +++
 .../imx8mp_rsb3720a1/imx8mp_rsb3720a1.c       | 12 --------
 board/beacon/imx8mm/spl.c                     | 19 ------------
 board/beacon/imx8mn/spl.c                     | 10 -------
 board/bsh/imx8mn_smm_s2/spl.c                 | 11 -------
 board/compulab/imx8mm-cl-iot-gate/spl.c       | 19 ------------
 board/data_modul/imx8mm_edm_sbc/spl.c         | 17 -----------
 board/engicam/imx8mm/spl.c                    |  2 --
 board/freescale/imx8mm_evk/spl.c              | 19 ------------
 board/freescale/imx8mn_evk/spl.c              | 19 ------------
 board/freescale/imx8mp_evk/imx8mp_evk.c       | 17 -----------
 board/freescale/imx8mp_evk/spl.c              |  2 --
 board/gateworks/venice/spl.c                  | 30 -------------------
 board/kontron/sl-mx8mm/spl.c                  | 18 -----------
 board/menlo/mx8menlo/mx8menlo.c               | 12 --------
 board/phytec/phycore_imx8mm/spl.c             | 19 ------------
 board/phytec/phycore_imx8mp/spl.c             | 19 ------------
 board/toradex/verdin-imx8mm/spl.c             | 11 -------
 board/toradex/verdin-imx8mp/verdin-imx8mp.c   | 11 -------
 board/variscite/imx8mn_var_som/spl.c          | 11 -------
 configs/imx8mp_evk_defconfig                  |  1 -
 33 files changed, 61 insertions(+), 279 deletions(-)

-- 
2.36.0


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 01/17] imx: imx8mn_evk: enable pinctrl_wdog in SPL
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 02/17] imx: imx8mm_evk: " Peng Fan (OSS)
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, NXP i.MX U-Boot Team, Peng Fan; +Cc: u-boot

From: Peng Fan <peng.fan@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@nxp.com>
---
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi |  4 ++++
 board/freescale/imx8mn_evk/spl.c         | 19 -------------------
 2 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index 6f70722586d..4d0ecb07d4f 100644
--- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
@@ -80,6 +80,10 @@
 	u-boot,dm-spl;
 };
 
+&pinctrl_wdog {
+	u-boot,dm-spl;
+};
+
 &gpio1 {
 	u-boot,dm-spl;
 };
diff --git a/board/freescale/imx8mn_evk/spl.c b/board/freescale/imx8mn_evk/spl.c
index 63f335be3b0..3d9aa56d2c0 100644
--- a/board/freescale/imx8mn_evk/spl.c
+++ b/board/freescale/imx8mn_evk/spl.c
@@ -115,23 +115,6 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
-
-static iomux_v3_cfg_t const wdog_pads[] = {
-	IMX8MN_PAD_GPIO1_IO02__WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
-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;
-}
-
 void board_init_f(ulong dummy)
 {
 	int ret;
@@ -140,8 +123,6 @@ void board_init_f(ulong dummy)
 
 	init_uart_clk(1);
 
-	board_early_init_f();
-
 	timer_init();
 
 	/* Clear the BSS. */
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 02/17] imx: imx8mm_evk: enable pinctrl_wdog in SPL
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 01/17] imx: imx8mn_evk: enable pinctrl_wdog in SPL Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 03/17] imx: imx8mp_evk: " Peng Fan (OSS)
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, NXP i.MX U-Boot Team, Peng Fan; +Cc: u-boot

From: Peng Fan <peng.fan@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@nxp.com>
---
 arch/arm/dts/imx8mm-evk-u-boot.dtsi |  4 ++++
 board/freescale/imx8mm_evk/spl.c    | 19 -------------------
 2 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
index 8861542ec58..e9fbf7b8021 100644
--- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
@@ -121,6 +121,10 @@
 	u-boot,dm-spl;
 };
 
+&pinctrl_wdog {
+	u-boot,dm-spl;
+};
+
 &fec1 {
 	phy-reset-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
 };
diff --git a/board/freescale/imx8mm_evk/spl.c b/board/freescale/imx8mm_evk/spl.c
index 7eeec6c485a..ae2fb73fc51 100644
--- a/board/freescale/imx8mm_evk/spl.c
+++ b/board/freescale/imx8mm_evk/spl.c
@@ -72,23 +72,6 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
-
-static iomux_v3_cfg_t const wdog_pads[] = {
-	IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
-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;
-}
-
 static int power_init_board(void)
 {
 	struct udevice *dev;
@@ -135,8 +118,6 @@ void board_init_f(ulong dummy)
 
 	init_uart_clk(1);
 
-	board_early_init_f();
-
 	timer_init();
 
 	/* Clear the BSS. */
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 03/17] imx: imx8mp_evk: enable pinctrl_wdog in SPL
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 01/17] imx: imx8mn_evk: enable pinctrl_wdog in SPL Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 02/17] imx: imx8mm_evk: " Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 04/17] imx: imx8mm_beacon: " Peng Fan (OSS)
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, NXP i.MX U-Boot Team, Peng Fan; +Cc: u-boot

From: Peng Fan <peng.fan@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@nxp.com>
---
 arch/arm/dts/imx8mp-evk-u-boot.dtsi     |  4 ++++
 board/freescale/imx8mp_evk/imx8mp_evk.c | 17 -----------------
 board/freescale/imx8mp_evk/spl.c        |  2 --
 configs/imx8mp_evk_defconfig            |  1 -
 4 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 7aa908304aa..f43eb6238d0 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -43,6 +43,10 @@
 	u-boot,dm-spl;
 };
 
+&pinctrl_wdog {
+	u-boot,dm-spl;
+};
+
 &gpio1 {
 	u-boot,dm-spl;
 };
diff --git a/board/freescale/imx8mp_evk/imx8mp_evk.c b/board/freescale/imx8mp_evk/imx8mp_evk.c
index fb6c61c39e7..8971a827df3 100644
--- a/board/freescale/imx8mp_evk/imx8mp_evk.c
+++ b/board/freescale/imx8mp_evk/imx8mp_evk.c
@@ -20,23 +20,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
-
-static iomux_v3_cfg_t const wdog_pads[] = {
-	MX8MP_PAD_GPIO1_IO02__WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
-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;
-}
-
 static void setup_fec(void)
 {
 	struct iomuxc_gpr_base_regs *gpr =
diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c
index 503a752ae98..a2732148f24 100644
--- a/board/freescale/imx8mp_evk/spl.c
+++ b/board/freescale/imx8mp_evk/spl.c
@@ -134,8 +134,6 @@ void board_init_f(ulong dummy)
 
 	init_uart_clk(1);
 
-	board_early_init_f();
-
 	ret = spl_early_init();
 	if (ret) {
 		debug("spl_init() failed: %d\n", ret);
diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
index 081f7e08f8e..c3ffed85998 100644
--- a/configs/imx8mp_evk_defconfig
+++ b/configs/imx8mp_evk_defconfig
@@ -27,7 +27,6 @@ CONFIG_SPL_LOAD_FIT=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx8mp-evk.dtb"
-CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_BOOTROM_SUPPORT=y
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 04/17] imx: imx8mm_beacon: enable pinctrl_wdog in SPL
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
                   ` (2 preceding siblings ...)
  2022-05-03 12:24 ` [PATCH 03/17] imx: imx8mp_evk: " Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 05/17] imx: imx8mm-cl-iot-gate: " Peng Fan (OSS)
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, NXP i.MX U-Boot Team, Adam Ford; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@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@nxp.com>
---
 arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi |  4 ++++
 board/beacon/imx8mm/spl.c                  | 19 -------------------
 2 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
index e33e10ac129..c94b4ffa4c3 100644
--- a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi
@@ -73,6 +73,10 @@
 	u-boot,dm-spl;
 };
 
+&pinctrl_wdog {
+	u-boot,dm-spl;
+};
+
 &uart2 {
 	u-boot,dm-spl;
 };
diff --git a/board/beacon/imx8mm/spl.c b/board/beacon/imx8mm/spl.c
index f92b4c3ed0a..a93cc938784 100644
--- a/board/beacon/imx8mm/spl.c
+++ b/board/beacon/imx8mm/spl.c
@@ -59,23 +59,6 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
-
-static iomux_v3_cfg_t const wdog_pads[] = {
-	IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
-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;
-}
-
 static int power_init_board(void)
 {
 	struct udevice *dev;
@@ -116,8 +99,6 @@ void board_init_f(ulong dummy)
 
 	init_uart_clk(1);
 
-	board_early_init_f();
-
 	timer_init();
 
 	/* Clear the BSS. */
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 05/17] imx: imx8mm-cl-iot-gate: enable pinctrl_wdog in SPL
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
                   ` (3 preceding siblings ...)
  2022-05-03 12:24 ` [PATCH 04/17] imx: imx8mm_beacon: " Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 06/17] imx: imx8mm-data-modul-edm-sbc: " Peng Fan (OSS)
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, NXP i.MX U-Boot Team, Ying-Chun Liu (PaulLiu)
  Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@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@nxp.com>
---
 arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi |  4 ++++
 board/compulab/imx8mm-cl-iot-gate/spl.c     | 19 -------------------
 2 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi b/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
index 433b02cceee..a7044b63699 100644
--- a/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
@@ -84,6 +84,10 @@
 	u-boot,dm-spl;
 };
 
+&pinctrl_wdog {
+	u-boot,dm-spl;
+};
+
 &uart3 {
 	u-boot,dm-spl;
 };
diff --git a/board/compulab/imx8mm-cl-iot-gate/spl.c b/board/compulab/imx8mm-cl-iot-gate/spl.c
index f183704c9d2..d2d20269ba0 100644
--- a/board/compulab/imx8mm-cl-iot-gate/spl.c
+++ b/board/compulab/imx8mm-cl-iot-gate/spl.c
@@ -83,23 +83,6 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
-
-static iomux_v3_cfg_t const wdog_pads[] = {
-	IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
-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;
-}
-
 static int power_init_board(void)
 {
 	struct udevice *dev;
@@ -141,8 +124,6 @@ void board_init_f(ulong dummy)
 
 	arch_cpu_init();
 
-	board_early_init_f();
-
 	init_uart_clk(2);
 
 	timer_init();
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 06/17] imx: imx8mm-data-modul-edm-sbc: enable pinctrl_wdog in SPL
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
                   ` (4 preceding siblings ...)
  2022-05-03 12:24 ` [PATCH 05/17] imx: imx8mm-cl-iot-gate: " Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-03 13:51   ` Marek Vasut
  2022-05-03 12:24 ` [PATCH 07/17] imx: engicam-imx8mm: drop unused macro Peng Fan (OSS)
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, NXP i.MX U-Boot Team, Marek Vasut; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Add pinctrl_wdog.
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@nxp.com>
---
 .../dts/imx8mm-data-modul-edm-sbc-u-boot.dtsi   |  4 ++++
 arch/arm/dts/imx8mm-data-modul-edm-sbc.dts      |  9 +++++++++
 board/data_modul/imx8mm_edm_sbc/spl.c           | 17 -----------------
 3 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/arch/arm/dts/imx8mm-data-modul-edm-sbc-u-boot.dtsi b/arch/arm/dts/imx8mm-data-modul-edm-sbc-u-boot.dtsi
index 184c30ab4a7..32413e98118 100644
--- a/arch/arm/dts/imx8mm-data-modul-edm-sbc-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-data-modul-edm-sbc-u-boot.dtsi
@@ -114,3 +114,7 @@
 &wdog1 {
 	u-boot,dm-spl;
 };
+
+&pinctrl_wdog {
+	u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/imx8mm-data-modul-edm-sbc.dts b/arch/arm/dts/imx8mm-data-modul-edm-sbc.dts
index 154116d01c9..b444482be21 100644
--- a/arch/arm/dts/imx8mm-data-modul-edm-sbc.dts
+++ b/arch/arm/dts/imx8mm-data-modul-edm-sbc.dts
@@ -512,6 +512,12 @@
 		>;
 	};
 
+	pinctrl_wdog: wdoggrp {
+		fsl,pins = <
+			MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0x166
+		>;
+	};
+
 	pinctrl_hog_feature: hog-feature-grp {
 		fsl,pins = <
 			/* GPIO4_IO27 */
@@ -992,5 +998,8 @@
 };
 
 &wdog1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_wdog>;
+	fsl,ext-reset-output;
 	status = "okay";
 };
diff --git a/board/data_modul/imx8mm_edm_sbc/spl.c b/board/data_modul/imx8mm_edm_sbc/spl.c
index f5063eb8c19..5a40bf3d682 100644
--- a/board/data_modul/imx8mm_edm_sbc/spl.c
+++ b/board/data_modul/imx8mm_edm_sbc/spl.c
@@ -28,21 +28,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
-
-static const iomux_v3_cfg_t wdog_pads[] = {
-	IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
-static void data_modul_imx8mm_edm_sbc_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);
-}
-
 static int data_modul_imx8mm_edm_sbc_board_power_init(void)
 {
 	struct udevice *dev;
@@ -139,8 +124,6 @@ void board_init_f(ulong dummy)
 
 	init_uart_clk(2);
 
-	data_modul_imx8mm_edm_sbc_early_init_f();
-
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 07/17] imx: engicam-imx8mm: drop unused macro
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
                   ` (5 preceding siblings ...)
  2022-05-03 12:24 ` [PATCH 06/17] imx: imx8mm-data-modul-edm-sbc: " Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-03 11:49   ` Michael Nazzareno Trimarchi
  2022-05-03 12:24 ` [PATCH 08/17] imx: imx8mm-mx8menlo: drop unneeded watchdog settings Peng Fan (OSS)
                   ` (9 subsequent siblings)
  16 siblings, 1 reply; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, Jagan Teki, Matteo Lisi; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Drop unused WDOG macro

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 board/engicam/imx8mm/spl.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/board/engicam/imx8mm/spl.c b/board/engicam/imx8mm/spl.c
index f75f2dc634c..1846134a492 100644
--- a/board/engicam/imx8mm/spl.c
+++ b/board/engicam/imx8mm/spl.c
@@ -54,8 +54,6 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
-
 int board_early_init_f(void)
 {
        return 0;
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 08/17] imx: imx8mm-mx8menlo: drop unneeded watchdog settings
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
                   ` (6 preceding siblings ...)
  2022-05-03 12:24 ` [PATCH 07/17] imx: engicam-imx8mm: drop unused macro Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 09/17] imx: imx8mm/n/p-venice: enable pinctrl_wdog in SPL Peng Fan (OSS)
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, Marek Vasut, Olaf Mandel; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

pinctrl_wdog as u-boot,dm-spl already marked in imx8mm-verdin-u-boot.dtsi,
set_wdog_reset function could be handled by imx_watchdog.c driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 board/menlo/mx8menlo/mx8menlo.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/board/menlo/mx8menlo/mx8menlo.c b/board/menlo/mx8menlo/mx8menlo.c
index 95ff95ad360..9d3708a3637 100644
--- a/board/menlo/mx8menlo/mx8menlo.c
+++ b/board/menlo/mx8menlo/mx8menlo.c
@@ -12,12 +12,6 @@
 #include <asm/mach-imx/iomux-v3.h>
 #include <spl.h>
 
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
-
-static iomux_v3_cfg_t const wdog_pads[] = {
-	IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
 #define SNVS_BASE_ADDR		0x30370000
 #define SNVS_LPSR		0x4c
 #define SNVS_LPLVDR		0x64
@@ -35,12 +29,6 @@ static void setup_snvs(void)
 
 void board_early_init(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);
-
 	init_uart_clk(1);
 
 	setup_snvs();
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 09/17] imx: imx8mm/n/p-venice: enable pinctrl_wdog in SPL
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
                   ` (7 preceding siblings ...)
  2022-05-03 12:24 ` [PATCH 08/17] imx: imx8mm-mx8menlo: drop unneeded watchdog settings Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-03 16:19   ` Tim Harvey
  2022-05-03 12:24 ` [PATCH 10/17] imx: imx8mn-beacon: " Peng Fan (OSS)
                   ` (7 subsequent siblings)
  16 siblings, 1 reply; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, Tim Harvey, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@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@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


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 10/17] imx: imx8mn-beacon: enable pinctrl_wdog in SPL
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
                   ` (8 preceding siblings ...)
  2022-05-03 12:24 ` [PATCH 09/17] imx: imx8mm/n/p-venice: enable pinctrl_wdog in SPL Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 11/17] imx: imx8mn_smm_s2: clean up board watchdog code Peng Fan (OSS)
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, NXP i.MX U-Boot Team, Adam Ford; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@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@nxp.com>
---
 arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi |  4 ++++
 board/beacon/imx8mn/spl.c                  | 10 ----------
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
index 69fd69c8d02..eb1dd8debba 100644
--- a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
@@ -132,6 +132,10 @@
 	u-boot,dm-spl;
 };
 
+&pinctrl_wdog {
+	u-boot,dm-spl;
+};
+
 &binman {
 	 u-boot-spl-ddr {
 		filename = "u-boot-spl-ddr.bin";
diff --git a/board/beacon/imx8mn/spl.c b/board/beacon/imx8mn/spl.c
index 4563446db19..029f71bc995 100644
--- a/board/beacon/imx8mn/spl.c
+++ b/board/beacon/imx8mn/spl.c
@@ -68,27 +68,17 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
 #define PWM1_PAD_CTRL (PAD_CTL_FSEL2 | PAD_CTL_DSE6)
 
 static iomux_v3_cfg_t const pwm_pads[] = {
 	IMX8MN_PAD_GPIO1_IO01__PWM1_OUT | MUX_PAD_CTRL(PWM1_PAD_CTRL),
 };
 
-static iomux_v3_cfg_t const wdog_pads[] = {
-	IMX8MN_PAD_GPIO1_IO02__WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
 int board_early_init_f(void)
 {
-	struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR;
-
 	/* Claiming pwm pins prevents LCD flicker during startup*/
 	imx_iomux_v3_setup_multiple_pads(pwm_pads, ARRAY_SIZE(pwm_pads));
 
-	imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads));
-	set_wdog_reset(wdog);
-
 	init_uart_clk(1);
 
 	return 0;
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 11/17] imx: imx8mn_smm_s2:  clean up board watchdog code
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
                   ` (9 preceding siblings ...)
  2022-05-03 12:24 ` [PATCH 10/17] imx: imx8mn-beacon: " Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-04 19:18   ` Ariel D'Alessandro
  2022-05-03 12:24 ` [PATCH 12/17] imx: imx8mn_var_som: " Peng Fan (OSS)
                   ` (5 subsequent siblings)
  16 siblings, 1 reply; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, Ariel D'Alessandro, Michael Trimarchi
  Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

pinctrl_wdog already marked u-boot,dm-spl, so clean up board code.
set_wdog_reset function could be handled by imx_watchdog.c driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 board/bsh/imx8mn_smm_s2/spl.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/board/bsh/imx8mn_smm_s2/spl.c b/board/bsh/imx8mn_smm_s2/spl.c
index 0f61acc6302..4ccee7c31a8 100644
--- a/board/bsh/imx8mn_smm_s2/spl.c
+++ b/board/bsh/imx8mn_smm_s2/spl.c
@@ -40,19 +40,8 @@ void spl_board_init(void)
 		puts("Failed to find clock node. Check device tree\n");
 }
 
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
-
-static const iomux_v3_cfg_t wdog_pads[] = {
-	IMX8MN_PAD_GPIO1_IO02__WDOG1_WDOG_B | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
 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);
-
 	init_uart_clk(3);
 
 	if (IS_ENABLED(CONFIG_NAND_MXS)) {
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 12/17] imx: imx8mn_var_som:  clean up board watchdog code
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
                   ` (10 preceding siblings ...)
  2022-05-03 12:24 ` [PATCH 11/17] imx: imx8mn_smm_s2: clean up board watchdog code Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-04 19:10   ` Ariel D'Alessandro
  2022-05-03 12:24 ` [PATCH 13/17] imx: imx8mp_rsb7320a1: enable wdog driver model in SPL Peng Fan (OSS)
                   ` (4 subsequent siblings)
  16 siblings, 1 reply; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, Ariel D'Alessandro; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

pinctrl_wdog already marked u-boot,dm-spl, so clean up board code.
set_wdog_reset function could be handled by imx_watchdog.c driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 board/variscite/imx8mn_var_som/spl.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/board/variscite/imx8mn_var_som/spl.c b/board/variscite/imx8mn_var_som/spl.c
index 1a8b64fc0a9..41e70505774 100644
--- a/board/variscite/imx8mn_var_som/spl.c
+++ b/board/variscite/imx8mn_var_som/spl.c
@@ -40,19 +40,8 @@ void spl_board_init(void)
 		puts("Failed to find clock node. Check device tree\n");
 }
 
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
-
-static const iomux_v3_cfg_t wdog_pads[] = {
-	IMX8MN_PAD_GPIO1_IO02__WDOG1_WDOG_B | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
 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);
-
 	init_uart_clk(3);
 
 	return 0;
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 13/17] imx: imx8mp_rsb7320a1: enable wdog driver model in SPL
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
                   ` (11 preceding siblings ...)
  2022-05-03 12:24 ` [PATCH 12/17] imx: imx8mn_var_som: " Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 14/17] imx: imx8mn-kontron-n801x: enable pinctrl_wdog " Peng Fan (OSS)
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, NXP i.MX U-Boot Team, Ying-Chun Liu (PaulLiu)
  Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Mark wdog1/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@nxp.com>
---
 arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi          |  8 ++++++++
 board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c | 12 ------------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi b/arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi
index 2848b24f655..4419967ee42 100644
--- a/arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi
@@ -89,6 +89,14 @@
 	u-boot,dm-spl;
 };
 
+&wdog1 {
+	u-boot,dm-spl;
+};
+
+&pinctrl_wdog {
+	u-boot,dm-spl;
+};
+
 &pinctrl_i2c1 {
 	u-boot,dm-spl;
 };
diff --git a/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c b/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
index f129ebd429b..0a1b2c94161 100644
--- a/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
+++ b/board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c
@@ -28,12 +28,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
-
-static const iomux_v3_cfg_t wdog_pads[] = {
-	MX8MP_PAD_GPIO1_IO02__WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
 #ifdef CONFIG_NAND_MXS
 static void setup_gpmi_nand(void)
 {
@@ -69,12 +63,6 @@ u8 num_image_type_guids = ARRAY_SIZE(fw_images);
 
 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);
-
 	init_uart_clk(2);
 
 	return 0;
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 14/17] imx: imx8mn-kontron-n801x: enable pinctrl_wdog in SPL
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
                   ` (12 preceding siblings ...)
  2022-05-03 12:24 ` [PATCH 13/17] imx: imx8mp_rsb7320a1: enable wdog driver model in SPL Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 15/17] imx: phycore_imx8mm/p: clean up board watchdog code Peng Fan (OSS)
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, NXP i.MX U-Boot Team, Frieder Schrempf; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@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@nxp.com>
---
 arch/arm/dts/imx8mm-kontron-n801x-u-boot.dtsi |  4 ++++
 board/kontron/sl-mx8mm/spl.c                  | 18 ------------------
 2 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/arch/arm/dts/imx8mm-kontron-n801x-u-boot.dtsi b/arch/arm/dts/imx8mm-kontron-n801x-u-boot.dtsi
index 22d18e6f1cf..6882513f161 100644
--- a/arch/arm/dts/imx8mm-kontron-n801x-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-kontron-n801x-u-boot.dtsi
@@ -126,3 +126,7 @@
 &wdog1 {
 	u-boot,dm-spl;
 };
+
+&pinctrl_wdog {
+	u-boot,dm-spl;
+};
diff --git a/board/kontron/sl-mx8mm/spl.c b/board/kontron/sl-mx8mm/spl.c
index a58a75dc958..63361f1d2ab 100644
--- a/board/kontron/sl-mx8mm/spl.c
+++ b/board/kontron/sl-mx8mm/spl.c
@@ -32,7 +32,6 @@ enum {
 
 #define GPIO_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
 #define I2C_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_HYS | PAD_CTL_PUE)
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
 
 #define TOUCH_RESET_GPIO	IMX_GPIO_NR(3, 23)
 
@@ -50,10 +49,6 @@ static iomux_v3_cfg_t const touch_gpio[] = {
 	IMX8MM_PAD_SAI5_RXD2_GPIO3_IO23 | MUX_PAD_CTRL(GPIO_PAD_CTRL)
 };
 
-static iomux_v3_cfg_t const wdog_pads[] = {
-	IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
 int spl_board_boot_device(enum boot_device boot_dev_spl)
 {
 	switch (boot_dev_spl) {
@@ -216,17 +211,6 @@ void spl_board_init(void)
 		printf("Failed to find clock node. Check device tree\n");
 }
 
-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;
-}
-
 static int power_init_board(void)
 {
 	struct udevice *dev;
@@ -261,8 +245,6 @@ void board_init_f(ulong dummy)
 
 	init_uart_clk(2);
 
-	board_early_init_f();
-
 	timer_init();
 
 	/* Clear the BSS. */
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 15/17] imx: phycore_imx8mm/p:  clean up board watchdog code
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
                   ` (13 preceding siblings ...)
  2022-05-03 12:24 ` [PATCH 14/17] imx: imx8mn-kontron-n801x: enable pinctrl_wdog " Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-03 13:52   ` Teresa Remmet
  2022-05-03 12:24 ` [PATCH 16/17] imx: verdin-imx8mm/p: cleanup " Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 17/17] imx: toradex/verdin-imx8mm/p: " Peng Fan (OSS)
  16 siblings, 1 reply; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, Teresa Remmet; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

pinctrl_wdog already marked u-boot,dm-spl, so clean up board code.
set_wdog_reset function could be handled by imx_watchdog.c driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 board/phytec/phycore_imx8mm/spl.c | 19 -------------------
 board/phytec/phycore_imx8mp/spl.c | 19 -------------------
 2 files changed, 38 deletions(-)

diff --git a/board/phytec/phycore_imx8mm/spl.c b/board/phytec/phycore_imx8mm/spl.c
index 7f24a3affc8..d87ab6d4497 100644
--- a/board/phytec/phycore_imx8mm/spl.c
+++ b/board/phytec/phycore_imx8mm/spl.c
@@ -57,23 +57,6 @@ int board_fit_config_name_match(const char *name)
 	return 0;
 }
 
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE)
-
-static iomux_v3_cfg_t const wdog_pads[] = {
-	IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
-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;
-}
-
 void board_init_f(ulong dummy)
 {
 	int ret;
@@ -82,8 +65,6 @@ void board_init_f(ulong dummy)
 
 	init_uart_clk(2);
 
-	board_early_init_f();
-
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
diff --git a/board/phytec/phycore_imx8mp/spl.c b/board/phytec/phycore_imx8mp/spl.c
index 38a581bef57..faed6fc3b76 100644
--- a/board/phytec/phycore_imx8mp/spl.c
+++ b/board/phytec/phycore_imx8mp/spl.c
@@ -89,23 +89,6 @@ int board_fit_config_name_match(const char *name)
 	return 0;
 }
 
-#define WDOG_PAD_CTRL   (PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
-
-static iomux_v3_cfg_t const wdog_pads[] = {
-	MX8MP_PAD_GPIO1_IO02__WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
-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;
-}
-
 void board_init_f(ulong dummy)
 {
 	int ret;
@@ -114,8 +97,6 @@ void board_init_f(ulong dummy)
 
 	init_uart_clk(0);
 
-	board_early_init_f();
-
 	ret = spl_early_init();
 	if (ret) {
 		debug("spl_early_init() failed: %d\n", ret);
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 16/17] imx: verdin-imx8mm/p: cleanup board watchdog code
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
                   ` (14 preceding siblings ...)
  2022-05-03 12:24 ` [PATCH 15/17] imx: phycore_imx8mm/p: clean up board watchdog code Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  2022-05-03 12:24 ` [PATCH 17/17] imx: toradex/verdin-imx8mm/p: " Peng Fan (OSS)
  16 siblings, 0 replies; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, Marcel Ziswiler; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

pinctrl_wdog already marked u-boot,dm-spl, so clean up board code.
set_wdog_reset function could be handled by imx_watchdog.c driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 board/toradex/verdin-imx8mp/verdin-imx8mp.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/board/toradex/verdin-imx8mp/verdin-imx8mp.c b/board/toradex/verdin-imx8mp/verdin-imx8mp.c
index 8334c9bb376..e3c1a1201da 100644
--- a/board/toradex/verdin-imx8mp/verdin-imx8mp.c
+++ b/board/toradex/verdin-imx8mp/verdin-imx8mp.c
@@ -24,7 +24,6 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #define UART_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_FSEL1)
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
 
 /* Verdin UART_3, Console/Debug UART */
 static const iomux_v3_cfg_t uart_pads[] = {
@@ -32,18 +31,8 @@ static const iomux_v3_cfg_t uart_pads[] = {
 	MX8MP_PAD_UART3_TXD__UART3_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
 };
 
-static const iomux_v3_cfg_t wdog_pads[] = {
-	MX8MP_PAD_GPIO1_IO02__WDOG1_WDOG_B | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
 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);
-
 	imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
 
 	init_uart_clk(2);
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 17/17] imx: toradex/verdin-imx8mm/p: cleanup board watchdog code
  2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
                   ` (15 preceding siblings ...)
  2022-05-03 12:24 ` [PATCH 16/17] imx: verdin-imx8mm/p: cleanup " Peng Fan (OSS)
@ 2022-05-03 12:24 ` Peng Fan (OSS)
  16 siblings, 0 replies; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-03 12:24 UTC (permalink / raw)
  To: sbabic, festevam, Marcel Ziswiler; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

pinctrl_wdog already marked u-boot,dm-spl, so clean up board code.
set_wdog_reset function could be handled by imx_watchdog.c driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 board/toradex/verdin-imx8mm/spl.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c
index 1f3f38351ef..1f643129d98 100644
--- a/board/toradex/verdin-imx8mm/spl.c
+++ b/board/toradex/verdin-imx8mm/spl.c
@@ -75,7 +75,6 @@ int board_fit_config_name_match(const char *name)
 #endif
 
 #define UART_PAD_CTRL	(PAD_CTL_PUE | PAD_CTL_PE | PAD_CTL_DSE4)
-#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
 
 /* Verdin UART_3, Console/Debug UART */
 static iomux_v3_cfg_t const uart_pads[] = {
@@ -83,20 +82,10 @@ static iomux_v3_cfg_t const uart_pads[] = {
 	IMX8MM_PAD_SAI2_RXC_UART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
 };
 
-static iomux_v3_cfg_t const wdog_pads[] = {
-	IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
 __weak void board_early_init(void)
 {
-	struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR;
-
 	init_uart_clk(0);
 
-	imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads));
-
-	set_wdog_reset(wdog);
-
 	imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
 }
 
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH 06/17] imx: imx8mm-data-modul-edm-sbc: enable pinctrl_wdog in SPL
  2022-05-03 12:24 ` [PATCH 06/17] imx: imx8mm-data-modul-edm-sbc: " Peng Fan (OSS)
@ 2022-05-03 13:51   ` Marek Vasut
  2022-05-05 10:16     ` Peng Fan (OSS)
  0 siblings, 1 reply; 25+ messages in thread
From: Marek Vasut @ 2022-05-03 13:51 UTC (permalink / raw)
  To: Peng Fan (OSS), sbabic, festevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan

On 5/3/22 14:24, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Add pinctrl_wdog.
> 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.

There is already pinctrl_watchdog_gpio .

Any changes to the main DT should really be submitted to Linux first, 
else the U-Boot and Linux DT will be out of sync.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 15/17] imx: phycore_imx8mm/p:  clean up board watchdog code
  2022-05-03 12:24 ` [PATCH 15/17] imx: phycore_imx8mm/p: clean up board watchdog code Peng Fan (OSS)
@ 2022-05-03 13:52   ` Teresa Remmet
  0 siblings, 0 replies; 25+ messages in thread
From: Teresa Remmet @ 2022-05-03 13:52 UTC (permalink / raw)
  To: peng.fan, festevam, sbabic; +Cc: peng.fan, u-boot

Am Dienstag, dem 03.05.2022 um 20:24 +0800 schrieb Peng Fan (OSS):
> From: Peng Fan <peng.fan@nxp.com>
> 
> pinctrl_wdog already marked u-boot,dm-spl, so clean up board code.
> set_wdog_reset function could be handled by imx_watchdog.c driver.

Thank you for the cleanup!

Tested on phyCORE-i.MX8MM and phyCORE-i.MX8MP. 

Tested-by: Teresa Remmet <t.remmet@phytec.de>

Regards,
Teresa


> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  board/phytec/phycore_imx8mm/spl.c | 19 -------------------
>  board/phytec/phycore_imx8mp/spl.c | 19 -------------------
>  2 files changed, 38 deletions(-)
> 
> diff --git a/board/phytec/phycore_imx8mm/spl.c
> b/board/phytec/phycore_imx8mm/spl.c
> index 7f24a3affc8..d87ab6d4497 100644
> --- a/board/phytec/phycore_imx8mm/spl.c
> +++ b/board/phytec/phycore_imx8mm/spl.c
> @@ -57,23 +57,6 @@ int board_fit_config_name_match(const char *name)
>  	return 0;
>  }
>  
> -#define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE)
> -
> -static iomux_v3_cfg_t const wdog_pads[] = {
> -	IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  |
> MUX_PAD_CTRL(WDOG_PAD_CTRL),
> -};
> -
> -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;
> -}
> -
>  void board_init_f(ulong dummy)
>  {
>  	int ret;
> @@ -82,8 +65,6 @@ void board_init_f(ulong dummy)
>  
>  	init_uart_clk(2);
>  
> -	board_early_init_f();
> -
>  	/* Clear the BSS. */
>  	memset(__bss_start, 0, __bss_end - __bss_start);
>  
> diff --git a/board/phytec/phycore_imx8mp/spl.c
> b/board/phytec/phycore_imx8mp/spl.c
> index 38a581bef57..faed6fc3b76 100644
> --- a/board/phytec/phycore_imx8mp/spl.c
> +++ b/board/phytec/phycore_imx8mp/spl.c
> @@ -89,23 +89,6 @@ int board_fit_config_name_match(const char *name)
>  	return 0;
>  }
>  
> -#define WDOG_PAD_CTRL   (PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE |
> PAD_CTL_PE)
> -
> -static iomux_v3_cfg_t const wdog_pads[] = {
> -	MX8MP_PAD_GPIO1_IO02__WDOG1_WDOG_B  |
> MUX_PAD_CTRL(WDOG_PAD_CTRL),
> -};
> -
> -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;
> -}
> -
>  void board_init_f(ulong dummy)
>  {
>  	int ret;
> @@ -114,8 +97,6 @@ void board_init_f(ulong dummy)
>  
>  	init_uart_clk(0);
>  
> -	board_early_init_f();
> -
>  	ret = spl_early_init();
>  	if (ret) {
>  		debug("spl_early_init() failed: %d\n", ret);
-- 
PHYTEC Messtechnik GmbH | Robert-Koch-Str. 39 | 55129 Mainz, Germany

Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber |
Handelsregister Mainz HRB 4656 | Finanzamt Mainz | St.Nr. 266500608, DE
149059855

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 09/17] imx: imx8mm/n/p-venice: enable pinctrl_wdog in SPL
  2022-05-03 12:24 ` [PATCH 09/17] imx: imx8mm/n/p-venice: enable pinctrl_wdog in SPL Peng Fan (OSS)
@ 2022-05-03 16:19   ` Tim Harvey
  0 siblings, 0 replies; 25+ messages in thread
From: Tim Harvey @ 2022-05-03 16:19 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team, u-boot, Peng Fan

On Tue, May 3, 2022 at 4:42 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@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@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@gateworks.com> #imx8m{m,n,p}-venice-*

Best Regards,

Tim

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 12/17] imx: imx8mn_var_som: clean up board watchdog code
  2022-05-03 12:24 ` [PATCH 12/17] imx: imx8mn_var_som: " Peng Fan (OSS)
@ 2022-05-04 19:10   ` Ariel D'Alessandro
  0 siblings, 0 replies; 25+ messages in thread
From: Ariel D'Alessandro @ 2022-05-04 19:10 UTC (permalink / raw)
  To: Peng Fan (OSS), sbabic, festevam; +Cc: u-boot, Peng Fan

Hi Peng,

On 5/3/22 09:24, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> pinctrl_wdog already marked u-boot,dm-spl, so clean up board code.
> set_wdog_reset function could be handled by imx_watchdog.c driver.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  board/variscite/imx8mn_var_som/spl.c | 11 -----------
>  1 file changed, 11 deletions(-)

Tested on i.MX8MN Variscite Symphony board

Tested-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>

Thanks!

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 11/17] imx: imx8mn_smm_s2: clean up board watchdog code
  2022-05-03 12:24 ` [PATCH 11/17] imx: imx8mn_smm_s2: clean up board watchdog code Peng Fan (OSS)
@ 2022-05-04 19:18   ` Ariel D'Alessandro
  0 siblings, 0 replies; 25+ messages in thread
From: Ariel D'Alessandro @ 2022-05-04 19:18 UTC (permalink / raw)
  To: Peng Fan (OSS), sbabic, festevam, Michael Trimarchi; +Cc: u-boot, Peng Fan

Hi Peng,

On 5/3/22 09:24, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> pinctrl_wdog already marked u-boot,dm-spl, so clean up board code.
> set_wdog_reset function could be handled by imx_watchdog.c driver.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  board/bsh/imx8mn_smm_s2/spl.c | 11 -----------
>  1 file changed, 11 deletions(-)

Tested on i.MX8MN BSH SMM S2 PRO board.

Tested-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>

Thanks!

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 06/17] imx: imx8mm-data-modul-edm-sbc: enable pinctrl_wdog in SPL
  2022-05-03 13:51   ` Marek Vasut
@ 2022-05-05 10:16     ` Peng Fan (OSS)
  0 siblings, 0 replies; 25+ messages in thread
From: Peng Fan (OSS) @ 2022-05-05 10:16 UTC (permalink / raw)
  To: Marek Vasut, sbabic, festevam, dl-uboot-imx; +Cc: u-boot, Peng Fan



On 2022/5/3 21:51, Marek Vasut wrote:
> On 5/3/22 14:24, Peng Fan (OSS) wrote:
>> From: Peng Fan <peng.fan@nxp.com>
>>
>> Add pinctrl_wdog.
>> 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.
> 
> There is already pinctrl_watchdog_gpio .
> 
> Any changes to the main DT should really be submitted to Linux first,
> else the U-Boot and Linux DT will be out of sync.

I not have idea how the board works with watchdog_gpio with status 
disabled. I'll drop this patch in V2 for now, and may pick it
up again when linux DT ready.

Thanks
Peng.

> 

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2022-05-05 10:17 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03 12:24 [PATCH 00/17] imx: imx8m: clean up wdog code Peng Fan (OSS)
2022-05-03 12:24 ` [PATCH 01/17] imx: imx8mn_evk: enable pinctrl_wdog in SPL Peng Fan (OSS)
2022-05-03 12:24 ` [PATCH 02/17] imx: imx8mm_evk: " Peng Fan (OSS)
2022-05-03 12:24 ` [PATCH 03/17] imx: imx8mp_evk: " Peng Fan (OSS)
2022-05-03 12:24 ` [PATCH 04/17] imx: imx8mm_beacon: " Peng Fan (OSS)
2022-05-03 12:24 ` [PATCH 05/17] imx: imx8mm-cl-iot-gate: " Peng Fan (OSS)
2022-05-03 12:24 ` [PATCH 06/17] imx: imx8mm-data-modul-edm-sbc: " Peng Fan (OSS)
2022-05-03 13:51   ` Marek Vasut
2022-05-05 10:16     ` Peng Fan (OSS)
2022-05-03 12:24 ` [PATCH 07/17] imx: engicam-imx8mm: drop unused macro Peng Fan (OSS)
2022-05-03 11:49   ` Michael Nazzareno Trimarchi
2022-05-03 12:24 ` [PATCH 08/17] imx: imx8mm-mx8menlo: drop unneeded watchdog settings Peng Fan (OSS)
2022-05-03 12:24 ` [PATCH 09/17] imx: imx8mm/n/p-venice: enable pinctrl_wdog in SPL Peng Fan (OSS)
2022-05-03 16:19   ` Tim Harvey
2022-05-03 12:24 ` [PATCH 10/17] imx: imx8mn-beacon: " Peng Fan (OSS)
2022-05-03 12:24 ` [PATCH 11/17] imx: imx8mn_smm_s2: clean up board watchdog code Peng Fan (OSS)
2022-05-04 19:18   ` Ariel D'Alessandro
2022-05-03 12:24 ` [PATCH 12/17] imx: imx8mn_var_som: " Peng Fan (OSS)
2022-05-04 19:10   ` Ariel D'Alessandro
2022-05-03 12:24 ` [PATCH 13/17] imx: imx8mp_rsb7320a1: enable wdog driver model in SPL Peng Fan (OSS)
2022-05-03 12:24 ` [PATCH 14/17] imx: imx8mn-kontron-n801x: enable pinctrl_wdog " Peng Fan (OSS)
2022-05-03 12:24 ` [PATCH 15/17] imx: phycore_imx8mm/p: clean up board watchdog code Peng Fan (OSS)
2022-05-03 13:52   ` Teresa Remmet
2022-05-03 12:24 ` [PATCH 16/17] imx: verdin-imx8mm/p: cleanup " Peng Fan (OSS)
2022-05-03 12:24 ` [PATCH 17/17] imx: toradex/verdin-imx8mm/p: " Peng Fan (OSS)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.