Message ID | 20220503122417.26953-7-peng.fan@oss.nxp.com |
---|---|
State | Superseded |
Delegated to: | Stefano Babic |
Headers | show |
Series | imx: imx8m: clean up wdog code | expand |
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.
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. >
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);