public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Suniel Mahesh <sunil@amarulasolutions.com>
To: Jagan Teki <jagan@amarulasolutions.com>,
	Stefano Babic <sbabic@denx.de>,
	Fabio Estevam <festevam@gmail.com>
Cc: Tom Rini <trini@konsulko.com>,
	Michael Trimarchi <michael@amarulasolutions.com>,
	Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	linux-amarula@amarulasolutions.com,
	Manoj Sai <abbaraju.manojsai@amarulasolutions.com>,
	"NXP i . MX U-Boot Team" <uboot-imx@nxp.com>,
	u-boot@lists.denx.de
Subject: [PATCH] engicam: imx6: migrate to DM_SERIAL
Date: Fri,  9 Dec 2022 15:05:49 +0530	[thread overview]
Message-ID: <20221209093549.4137825-1-sunil@amarulasolutions.com> (raw)

From: Michael Trimarchi <michael@amarulasolutions.com>

Add the needed DT overrides and configs to enable UART in SPL.

Cc: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Tested-by: Suniel Mahesh <sunil@amarulasolutions.com>
---
Note:
Tested this patch on Engicam Starter Kit with I.CORE - M6 (MCIMX6Q7CVT08AC) SOM.
---
 arch/arm/dts/imx6qdl-icore-u-boot.dtsi | 16 ++++++++++++++++
 arch/arm/dts/imx6ul-isiot-u-boot.dtsi  | 16 ++++++++++++++++
 board/engicam/common/spl.c             | 20 +++-----------------
 configs/imx6dl_icore_nand_defconfig    |  1 +
 configs/imx6q_icore_nand_defconfig     |  1 +
 configs/imx6qdl_icore_mipi_defconfig   |  1 +
 configs/imx6qdl_icore_mmc_defconfig    |  1 +
 configs/imx6qdl_icore_nand_defconfig   |  1 +
 configs/imx6qdl_icore_rqs_defconfig    |  1 +
 9 files changed, 41 insertions(+), 17 deletions(-)

diff --git a/arch/arm/dts/imx6qdl-icore-u-boot.dtsi b/arch/arm/dts/imx6qdl-icore-u-boot.dtsi
index f95d49d00d..12e46e38f6 100644
--- a/arch/arm/dts/imx6qdl-icore-u-boot.dtsi
+++ b/arch/arm/dts/imx6qdl-icore-u-boot.dtsi
@@ -5,6 +5,22 @@
 
 #include "imx6qdl-u-boot.dtsi"
 
+&soc {
+	u-boot,dm-pre-reloc;
+};
+
+&aips1 {
+	u-boot,dm-pre-reloc;
+};
+
+&pinctrl_uart4 {
+	u-boot,dm-pre-reloc;
+};
+
+&uart4 {
+	u-boot,dm-pre-reloc;
+};
+
 &usdhc1 {
 	u-boot,dm-spl;
 };
diff --git a/arch/arm/dts/imx6ul-isiot-u-boot.dtsi b/arch/arm/dts/imx6ul-isiot-u-boot.dtsi
index aa8e9804bf..7213e71989 100644
--- a/arch/arm/dts/imx6ul-isiot-u-boot.dtsi
+++ b/arch/arm/dts/imx6ul-isiot-u-boot.dtsi
@@ -5,6 +5,22 @@
 
 #include "imx6ul-u-boot.dtsi"
 
+&soc {
+	u-boot,dm-pre-reloc;
+};
+
+&aips1 {
+	u-boot,dm-pre-reloc;
+};
+
+&pinctrl_uart1 {
+	u-boot,dm-pre-reloc;
+};
+
+&uart1 {
+	u-boot,dm-pre-reloc;
+};
+
 &usdhc1 {
 	u-boot,dm-spl;
 };
diff --git a/board/engicam/common/spl.c b/board/engicam/common/spl.c
index 6a0612481a..f1ccdc3343 100644
--- a/board/engicam/common/spl.c
+++ b/board/engicam/common/spl.c
@@ -26,20 +26,6 @@
 #include <asm/mach-imx/iomux-v3.h>
 #include <asm/mach-imx/video.h>
 
-#define UART_PAD_CTRL  (PAD_CTL_PKE | PAD_CTL_PUE |             \
-        PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED |               \
-        PAD_CTL_DSE_40ohm   | PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
-
-static iomux_v3_cfg_t const uart_pads[] = {
-#ifdef CONFIG_MX6QDL
-        IOMUX_PADS(PAD_KEY_COL0__UART4_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)),
-        IOMUX_PADS(PAD_KEY_ROW0__UART4_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)),
-#elif CONFIG_MX6UL
-	IOMUX_PADS(PAD_UART1_TX_DATA__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL)),
-	IOMUX_PADS(PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL)),
-#endif
-};
-
 #ifdef CONFIG_SPL_LOAD_FIT
 int board_fit_config_name_match(const char *name)
 {
@@ -421,12 +407,12 @@ void board_init_f(ulong dummy)
 	if (!(is_mx6ul()))
 		gpr_init();
 
-	/* iomux */
-	SETUP_IOMUX_PADS(uart_pads);
-
 	/* setup GP timer */
 	timer_init();
 
+	/* Enable device tree and early DM support*/
+	spl_early_init();
+
 	/* UART clocks enabled and gd valid - init serial console */
 	preloader_console_init();
 
diff --git a/configs/imx6dl_icore_nand_defconfig b/configs/imx6dl_icore_nand_defconfig
index fe4866e2f5..af5873a784 100644
--- a/configs/imx6dl_icore_nand_defconfig
+++ b/configs/imx6dl_icore_nand_defconfig
@@ -66,6 +66,7 @@ CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_VIDEO=y
diff --git a/configs/imx6q_icore_nand_defconfig b/configs/imx6q_icore_nand_defconfig
index 2cb995e7ae..8535627049 100644
--- a/configs/imx6q_icore_nand_defconfig
+++ b/configs/imx6q_icore_nand_defconfig
@@ -67,6 +67,7 @@ CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_VIDEO=y
diff --git a/configs/imx6qdl_icore_mipi_defconfig b/configs/imx6qdl_icore_mipi_defconfig
index 90eb153c45..8dd5e89511 100644
--- a/configs/imx6qdl_icore_mipi_defconfig
+++ b/configs/imx6qdl_icore_mipi_defconfig
@@ -74,5 +74,6 @@ CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
diff --git a/configs/imx6qdl_icore_mmc_defconfig b/configs/imx6qdl_icore_mmc_defconfig
index 9f6d29a268..46497fbde1 100644
--- a/configs/imx6qdl_icore_mmc_defconfig
+++ b/configs/imx6qdl_icore_mmc_defconfig
@@ -90,6 +90,7 @@ CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_VIDEO=y
diff --git a/configs/imx6qdl_icore_nand_defconfig b/configs/imx6qdl_icore_nand_defconfig
index 2cb995e7ae..8535627049 100644
--- a/configs/imx6qdl_icore_nand_defconfig
+++ b/configs/imx6qdl_icore_nand_defconfig
@@ -67,6 +67,7 @@ CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_VIDEO=y
diff --git a/configs/imx6qdl_icore_rqs_defconfig b/configs/imx6qdl_icore_rqs_defconfig
index ee2c597bcb..3bab6739d0 100644
--- a/configs/imx6qdl_icore_rqs_defconfig
+++ b/configs/imx6qdl_icore_rqs_defconfig
@@ -72,4 +72,5 @@ CONFIG_FEC_MXC=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
-- 
2.25.1


             reply	other threads:[~2022-12-09  9:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09  9:35 Suniel Mahesh [this message]
2022-12-16 10:12 ` [PATCH] engicam: imx6: migrate to DM_SERIAL Suniel Mahesh
2022-12-16 16:39 ` Fabio Estevam
2023-01-31 20:34 ` sbabic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221209093549.4137825-1-sunil@amarulasolutions.com \
    --to=sunil@amarulasolutions.com \
    --cc=abbaraju.manojsai@amarulasolutions.com \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=festevam@gmail.com \
    --cc=jagan@amarulasolutions.com \
    --cc=linux-amarula@amarulasolutions.com \
    --cc=michael@amarulasolutions.com \
    --cc=sbabic@denx.de \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox