All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] warp7: Remove UART initialization code
@ 2022-03-14 23:24 Fabio Estevam
  2022-04-11 18:20 ` Stefano Babic
  2022-04-12 18:44 ` sbabic
  0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2022-03-14 23:24 UTC (permalink / raw)
  To: sbabic; +Cc: u-boot, trini, smoch, Fabio Estevam

From: Fabio Estevam <festevam@denx.de>

With DM_SERIAL selected, it is no longer needed board code to
initialize the UART.

Describe the nodes that require dm-pre-reloc, which allows
the DM model to configure the UART pinctrl early.

Remove the now unneeded board UART initialization.

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 arch/arm/dts/imx7s-warp-u-boot.dtsi | 16 ++++++++++++++++
 arch/arm/dts/imx7s.dtsi             |  2 +-
 board/warp7/warp7.c                 | 20 --------------------
 configs/warp7_defconfig             |  1 +
 4 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/arch/arm/dts/imx7s-warp-u-boot.dtsi b/arch/arm/dts/imx7s-warp-u-boot.dtsi
index 6319840b1ce3..bc4b5745fc7c 100644
--- a/arch/arm/dts/imx7s-warp-u-boot.dtsi
+++ b/arch/arm/dts/imx7s-warp-u-boot.dtsi
@@ -8,3 +8,19 @@
         stdout-path = &uart1;
     };
 };
+
+&aips3 {
+	u-boot,dm-pre-reloc;
+};
+
+&pinctrl_uart1 {
+	u-boot,dm-pre-reloc;
+};
+
+&soc {
+	u-boot,dm-pre-reloc;
+};
+
+&uart1 {
+	u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/dts/imx7s.dtsi b/arch/arm/dts/imx7s.dtsi
index 483824fc06e6..cf0206dd0f08 100644
--- a/arch/arm/dts/imx7s.dtsi
+++ b/arch/arm/dts/imx7s.dtsi
@@ -184,7 +184,7 @@
 			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
 	};
 
-	soc {
+	soc: soc {
 		#address-cells = <1>;
 		#size-cells = <1>;
 		compatible = "simple-bus";
diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index c5c5433048dd..95b8e82dd1cc 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -27,9 +27,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define UART_PAD_CTRL  (PAD_CTL_DSE_3P3V_49OHM | PAD_CTL_PUS_PU100KOHM | \
-			PAD_CTL_HYS)
-
 int dram_init(void)
 {
 	gd->ram_size = PHYS_SDRAM_SIZE;
@@ -46,23 +43,6 @@ static iomux_v3_cfg_t const wdog_pads[] = {
 	MX7D_PAD_GPIO1_IO00__WDOG1_WDOG_B | MUX_PAD_CTRL(NO_PAD_CTRL),
 };
 
-static iomux_v3_cfg_t const uart1_pads[] = {
-	MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
-static void setup_iomux_uart(void)
-{
-	imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
-};
-
-int board_early_init_f(void)
-{
-	setup_iomux_uart();
-
-	return 0;
-}
-
 #ifdef CONFIG_DM_PMIC
 int power_init_board(void)
 {
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index a76565edfd4a..be69174217b0 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -19,6 +19,7 @@ CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="mmc dev ${mmcdev};mmc dev ${mmcdev}; if mmc rescan; then run do_bootscript_hab;if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; fi; fi; fi"
+# CONFIG_BOARD_EARLY_INIT_F is not set
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BOOTD is not set
 CONFIG_CMD_BOOTZ=y
-- 
2.25.1


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

* Re: [PATCH] warp7: Remove UART initialization code
  2022-03-14 23:24 [PATCH] warp7: Remove UART initialization code Fabio Estevam
@ 2022-04-11 18:20 ` Stefano Babic
  2022-04-12 18:44 ` sbabic
  1 sibling, 0 replies; 3+ messages in thread
From: Stefano Babic @ 2022-04-11 18:20 UTC (permalink / raw)
  To: Fabio Estevam, sbabic; +Cc: u-boot, trini, smoch, Fabio Estevam

Hi Fabio,

On 15.03.22 00:24, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> With DM_SERIAL selected, it is no longer needed board code to
> initialize the UART.
> 
> Describe the nodes that require dm-pre-reloc, which allows
> the DM model to configure the UART pinctrl early.
> 
> Remove the now unneeded board UART initialization.
> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---
>   arch/arm/dts/imx7s-warp-u-boot.dtsi | 16 ++++++++++++++++
>   arch/arm/dts/imx7s.dtsi             |  2 +-
>   board/warp7/warp7.c                 | 20 --------------------
>   configs/warp7_defconfig             |  1 +
>   4 files changed, 18 insertions(+), 21 deletions(-)
> 
> diff --git a/arch/arm/dts/imx7s-warp-u-boot.dtsi b/arch/arm/dts/imx7s-warp-u-boot.dtsi
> index 6319840b1ce3..bc4b5745fc7c 100644
> --- a/arch/arm/dts/imx7s-warp-u-boot.dtsi
> +++ b/arch/arm/dts/imx7s-warp-u-boot.dtsi
> @@ -8,3 +8,19 @@
>           stdout-path = &uart1;
>       };
>   };
> +
> +&aips3 {
> +	u-boot,dm-pre-reloc;
> +};
> +
> +&pinctrl_uart1 {
> +	u-boot,dm-pre-reloc;
> +};
> +
> +&soc {
> +	u-boot,dm-pre-reloc;
> +};
> +
> +&uart1 {
> +	u-boot,dm-pre-reloc;
> +};
> diff --git a/arch/arm/dts/imx7s.dtsi b/arch/arm/dts/imx7s.dtsi
> index 483824fc06e6..cf0206dd0f08 100644
> --- a/arch/arm/dts/imx7s.dtsi
> +++ b/arch/arm/dts/imx7s.dtsi
> @@ -184,7 +184,7 @@
>   			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
>   	};
>   
> -	soc {
> +	soc: soc {
>   		#address-cells = <1>;
>   		#size-cells = <1>;
>   		compatible = "simple-bus";
> diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
> index c5c5433048dd..95b8e82dd1cc 100644
> --- a/board/warp7/warp7.c
> +++ b/board/warp7/warp7.c
> @@ -27,9 +27,6 @@
>   
>   DECLARE_GLOBAL_DATA_PTR;
>   
> -#define UART_PAD_CTRL  (PAD_CTL_DSE_3P3V_49OHM | PAD_CTL_PUS_PU100KOHM | \
> -			PAD_CTL_HYS)
> -
>   int dram_init(void)
>   {
>   	gd->ram_size = PHYS_SDRAM_SIZE;
> @@ -46,23 +43,6 @@ static iomux_v3_cfg_t const wdog_pads[] = {
>   	MX7D_PAD_GPIO1_IO00__WDOG1_WDOG_B | MUX_PAD_CTRL(NO_PAD_CTRL),
>   };
>   
> -static iomux_v3_cfg_t const uart1_pads[] = {
> -	MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
> -	MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
> -};
> -
> -static void setup_iomux_uart(void)
> -{
> -	imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
> -};
> -
> -int board_early_init_f(void)
> -{
> -	setup_iomux_uart();
> -
> -	return 0;
> -}
> -
>   #ifdef CONFIG_DM_PMIC
>   int power_init_board(void)
>   {
> diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
> index a76565edfd4a..be69174217b0 100644
> --- a/configs/warp7_defconfig
> +++ b/configs/warp7_defconfig
> @@ -19,6 +19,7 @@ CONFIG_FIT=y
>   CONFIG_FIT_VERBOSE=y
>   CONFIG_USE_BOOTCOMMAND=y
>   CONFIG_BOOTCOMMAND="mmc dev ${mmcdev};mmc dev ${mmcdev}; if mmc rescan; then run do_bootscript_hab;if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; fi; fi; fi"
> +# CONFIG_BOARD_EARLY_INIT_F is not set

Added the same to warp7_bl33_defconfig by merging.

Regards,
Stefano

>   CONFIG_HUSH_PARSER=y
>   # CONFIG_CMD_BOOTD is not set
>   CONFIG_CMD_BOOTZ=y

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

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

* [PATCH] warp7: Remove UART initialization code
  2022-03-14 23:24 [PATCH] warp7: Remove UART initialization code Fabio Estevam
  2022-04-11 18:20 ` Stefano Babic
@ 2022-04-12 18:44 ` sbabic
  1 sibling, 0 replies; 3+ messages in thread
From: sbabic @ 2022-04-12 18:44 UTC (permalink / raw)
  To: Fabio Estevam, u-boot

> From: Fabio Estevam <festevam@denx.de>
> With DM_SERIAL selected, it is no longer needed board code to
> initialize the UART.
> Describe the nodes that require dm-pre-reloc, which allows
> the DM model to configure the UART pinctrl early.
> Remove the now unneeded board UART initialization.
> Signed-off-by: Fabio Estevam <festevam@denx.de>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

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

end of thread, other threads:[~2022-04-12 18:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 23:24 [PATCH] warp7: Remove UART initialization code Fabio Estevam
2022-04-11 18:20 ` Stefano Babic
2022-04-12 18:44 ` sbabic

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.