Skip to contentSkip to conversation

imx8m: convert to DM_SERIAL

PATCH Superseded Peng Fan (OSS) 9 participants 29 messages Apr 30, 2022 – May 3, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover imx8m: convert to DM_SERIAL

From: Peng Fan <[email protected]>

This patchset is to convert some i.MX8M boards to DM SERIAL

Note: this is based on my experience on i.MX8M*-EVK from NXP, I not have the following boards. If possible, please test.

Peng Fan (15):
imx: imx8mp_rsb3720a1: convert to DM_SERIAL
imx: imx8m[m/n/p]_venice: Enable SPL_DM_SERIAL
imx: imx8mm_mx8menlo: Enable DM_SERIAL
imx: imx8m[m/n]_beacon: Enable SPL_DM_SERIAL
imx: imx8mm-cl-iot-gate: Enable DM_SERIAL
imx: imx8mm_icore: Enable SPL_DM_SERIAL
imx: imx8m[m/p]_phycore: Enable DM_SERIAL
imx: imx8mn_var_som: enable DM_SERIAL
imx: imx8mm_edm_sbc: Enable SPL_DM_SERIAL
imx: kontron-sl-mx8mm: enable DM_SERIAL
imx: imx8mn_bsh_smm_s2: drop CONFIG_MXC_UART_BASE
imx: dts: move common changes to imx8mq-u-boot.dtsi
imx: imx8mq-cm: enable CONFIG_DM_SERIAL
imx: imx8mq-pico: enable CONFIG_DM_SERIAL
imx: imx8mq-phandle: enable CONFIG_DM_SERIAL

 arch/arm/dts/imx8mq-cm-u-boot.dtsi            |  8 +++++++
 arch/arm/dts/imx8mq-evk-u-boot.dtsi           | 24 -------------------
 arch/arm/dts/imx8mq-phanbell-u-boot.dtsi      |  8 +++++++
 arch/arm/dts/imx8mq-pico-pi-u-boot.dtsi       |  9 +++++++
 arch/arm/dts/imx8mq-u-boot.dtsi               | 24 +++++++++++++++++++
 .../imx8mp_rsb3720a1/imx8mp_rsb3720a1.c       |  8 -------
 board/beacon/imx8mm/spl.c                     | 12 ++--------
 board/beacon/imx8mn/spl.c                     | 11 ++-------
 board/compulab/imx8mm-cl-iot-gate/spl.c       | 12 ++--------
 board/data_modul/imx8mm_edm_sbc/spl.c         | 12 ++--------
 board/engicam/imx8mm/spl.c                    | 14 +++--------
 board/gateworks/venice/spl.c                  | 22 ++---------------
 board/kontron/sl-mx8mm/spl.c                  | 12 ++--------
 board/menlo/mx8menlo/mx8menlo.c               |  9 -------
 board/phytec/phycore_imx8mm/spl.c             | 12 ++--------
 board/phytec/phycore_imx8mp/spl.c             |  8 -------
 board/variscite/imx8mn_var_som/spl.c          | 11 ++-------
 configs/imx8mm-cl-iot-gate-optee_defconfig    |  1 +
 configs/imx8mm-cl-iot-gate_defconfig          |  1 +
 configs/imx8mm-icore-mx8mm-ctouch2_defconfig  |  1 -
 configs/imx8mm-icore-mx8mm-edimm2.2_defconfig |  1 -
 configs/imx8mm-mx8menlo_defconfig             |  1 +
 configs/imx8mm_beacon_defconfig               |  1 -
 configs/imx8mm_data_modul_edm_sbc_defconfig   |  1 -
 configs/imx8mm_venice_defconfig               |  1 -
 configs/imx8mn_beacon_2g_defconfig            |  1 -
 configs/imx8mn_beacon_defconfig               |  1 -
 configs/imx8mn_var_som_defconfig              |  1 +
 configs/imx8mn_venice_defconfig               |  1 -
 configs/imx8mp_rsb3720a1_4G_defconfig         |  1 +
 configs/imx8mp_rsb3720a1_6G_defconfig         |  1 +
 configs/imx8mp_venice_defconfig               |  1 -
 configs/imx8mq_cm_defconfig                   |  1 +
 configs/imx8mq_phanbell_defconfig             |  1 +
 configs/kontron-sl-mx8mm_defconfig            |  1 +
 configs/phycore-imx8mm_defconfig              |  1 +
 configs/phycore-imx8mp_defconfig              |  1 +
 configs/pico-imx8mq_defconfig                 |  1 +
 include/configs/imx8mm-cl-iot-gate.h          |  2 --
 include/configs/imx8mm-mx8menlo.h             |  3 ---
 include/configs/imx8mm_beacon.h               |  2 --
 include/configs/imx8mm_data_modul_edm_sbc.h   |  2 --
 include/configs/imx8mm_icore_mx8mm.h          |  3 ---
 include/configs/imx8mm_venice.h               |  3 ---
 include/configs/imx8mn_beacon.h               |  2 --
 include/configs/imx8mn_bsh_smm_s2_common.h    |  2 --
 include/configs/imx8mn_var_som.h              |  2 --
 include/configs/imx8mn_venice.h               |  3 ---
 include/configs/imx8mp_rsb3720.h              |  2 --
 include/configs/imx8mp_venice.h               |  3 ---
 include/configs/kontron-sl-mx8mm.h            |  1 -
 include/configs/phycore_imx8mm.h              |  3 ---
 include/configs/phycore_imx8mp.h              |  3 ---
 53 files changed, 80 insertions(+), 193 deletions(-)
 create mode 100644 arch/arm/dts/imx8mq-pico-pi-u-boot.dtsi
Signature · 1 line
2.36.0
#1 lore raw

PATCH 1/15 imx: imx8mp_rsb3720a1: convert to DM_SERIAL

From: Peng Fan <[email protected]>

Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already marked with u-boot,dm-spl.

---
 board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c | 8 --------
 configs/imx8mp_rsb3720a1_4G_defconfig               | 1 +
 configs/imx8mp_rsb3720a1_6G_defconfig               | 1 +
 include/configs/imx8mp_rsb3720.h                    | 2 --
 4 files changed, 2 insertions(+), 10 deletions(-)
board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c +0 -8
index 782025dc785..f129ebd429b 100644
@@ -28,14 +28,8 @@
 
 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)
 
-static const iomux_v3_cfg_t uart_pads[] = {
-	MX8MP_PAD_ECSPI1_SCLK__UART3_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	MX8MP_PAD_ECSPI1_MOSI__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),
 };
@@ -81,8 +75,6 @@ int board_early_init_f(void)
 
 	set_wdog_reset(wdog);
 
-	imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
 	init_uart_clk(2);
 
 	return 0;
configs/imx8mp_rsb3720a1_4G_defconfig +1 -0
index a7585ba71f0..b5a2add43da 100644
@@ -135,6 +135,7 @@ CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_SPL_DM_REGULATOR_GPIO=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_S35392A=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
configs/imx8mp_rsb3720a1_6G_defconfig +1 -0
index 5d06dc4a88d..5f04f392ede 100644
@@ -136,6 +136,7 @@ CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_SPL_DM_REGULATOR_GPIO=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_S35392A=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
include/configs/imx8mp_rsb3720.h +0 -2
index c5dd545471e..f2d9fa8cbf9 100644
@@ -169,8 +169,6 @@
 #define PHYS_SDRAM_2_SIZE		0x80000000	/* 2 GB */
 #endif
 
-#define CONFIG_MXC_UART_BASE		UART3_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		2048
 #define CONFIG_SYS_MAXARGS		64
Signature · 1 line
2.36.0
#2 lore raw

PATCH 2/15 imx: imx8m[m/n/p]_venice: Enable SPL_DM_SERIAL

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_SPL_DM_SERIAL. uart2 and its pinmux was already marked with u-boot,dm-spl.
Move preloader_console_init after spl_early_init to make sure driver model work.

---
 board/gateworks/venice/spl.c    | 22 ++--------------------
 configs/imx8mm_venice_defconfig |  1 -
 configs/imx8mn_venice_defconfig |  1 -
 configs/imx8mp_venice_defconfig |  1 -
 include/configs/imx8mm_venice.h |  3 ---
 include/configs/imx8mn_venice.h |  3 ---
 include/configs/imx8mp_venice.h |  3 ---
 7 files changed, 2 insertions(+), 32 deletions(-)
board/gateworks/venice/spl.c +2 -20
index 223f22d3463..af196e5b87c 100644
@@ -87,33 +87,17 @@ static void spl_dram_init(int size)
 	ddr_init(dram_timing);
 }
 
-#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)
 
 #ifdef CONFIG_IMX8MM
-static iomux_v3_cfg_t const uart_pads[] = {
-	IMX8MM_PAD_UART2_RXD_UART2_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MM_PAD_UART2_TXD_UART2_TX | 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),
 };
 #elif CONFIG_IMX8MN
-static const iomux_v3_cfg_t uart_pads[] = {
-	IMX8MN_PAD_UART2_RXD__UART2_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MN_PAD_UART2_TXD__UART2_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
 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 uart_pads[] = {
-	MX8MP_PAD_UART2_RXD__UART2_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	MX8MP_PAD_UART2_TXD__UART2_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),
 };
@@ -128,8 +112,6 @@ int board_early_init_f(void)
 
 	set_wdog_reset(wdog);
 
-	imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
 	return 0;
 }
 
@@ -276,8 +258,6 @@ void board_init_f(ulong dummy)
 
 	timer_init();
 
-	preloader_console_init();
-
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -287,6 +267,8 @@ void board_init_f(ulong dummy)
 		hang();
 	}
 
+	preloader_console_init();
+
 	enable_tzc380();
 
 	/* need to hold PCIe switch in reset otherwise it can lock i2c bus EEPROM is on */
configs/imx8mm_venice_defconfig +0 -1
index 490de193181..0165a4e5df0 100644
@@ -113,7 +113,6 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
configs/imx8mn_venice_defconfig +0 -1
index 639fee7e5f1..63a65497371 100644
@@ -112,7 +112,6 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
configs/imx8mp_venice_defconfig +0 -1
index 97c8bb59211..626ac247881 100644
@@ -112,7 +112,6 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
include/configs/imx8mm_venice.h +0 -3
index 1b26e0280e1..c3e92b76141 100644
@@ -101,9 +101,6 @@
 #define PHYS_SDRAM_SIZE			SZ_4G
 #define CONFIG_SYS_BOOTM_LEN		SZ_256M
 
-/* UART */
-#define CONFIG_MXC_UART_BASE		UART2_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		SZ_2K
 #define CONFIG_SYS_MAXARGS		64
include/configs/imx8mn_venice.h +0 -3
index a4826779022..41062b139f8 100644
@@ -97,9 +97,6 @@
 #define PHYS_SDRAM_SIZE			SZ_4G
 #define CONFIG_SYS_BOOTM_LEN		SZ_256M
 
-/* UART */
-#define CONFIG_MXC_UART_BASE		UART2_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		SZ_2K
 #define CONFIG_SYS_MAXARGS		64
include/configs/imx8mp_venice.h +0 -3
index aa0396db8b8..5242b56ad8c 100644
@@ -97,9 +97,6 @@
 #define PHYS_SDRAM_SIZE			SZ_4G
 #define CONFIG_SYS_BOOTM_LEN		SZ_256M
 
-/* UART */
-#define CONFIG_MXC_UART_BASE		UART2_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		SZ_2K
 #define CONFIG_SYS_MAXARGS		64
Signature · 1 line
2.36.0
Acked-by on v1 2/15
#3 lore raw

Re: [PATCH 02/15] imx: imx8m[m/n/p]_venice: Enable SPL_DM_SERIAL

Quoted 163 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_SPL_DM_SERIAL. uart2 and its pinmux was already marked with u-boot,dm-spl.
Move preloader_console_init after spl_early_init to make sure driver model work.

---
 board/gateworks/venice/spl.c    | 22 ++--------------------
 configs/imx8mm_venice_defconfig |  1 -
 configs/imx8mn_venice_defconfig |  1 -
 configs/imx8mp_venice_defconfig |  1 -
 include/configs/imx8mm_venice.h |  3 ---
 include/configs/imx8mn_venice.h |  3 ---
 include/configs/imx8mp_venice.h |  3 ---
 7 files changed, 2 insertions(+), 32 deletions(-)
board/gateworks/venice/spl.c +2 -20
index 223f22d3463..af196e5b87c 100644
@@ -87,33 +87,17 @@ static void spl_dram_init(int size)
        ddr_init(dram_timing);
 }
 
-#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)
 
 #ifdef CONFIG_IMX8MM
-static iomux_v3_cfg_t const uart_pads[] = {
-       IMX8MM_PAD_UART2_RXD_UART2_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-       IMX8MM_PAD_UART2_TXD_UART2_TX | 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),
 };
 #elif CONFIG_IMX8MN
-static const iomux_v3_cfg_t uart_pads[] = {
-       IMX8MN_PAD_UART2_RXD__UART2_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-       IMX8MN_PAD_UART2_TXD__UART2_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
 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 uart_pads[] = {
-       MX8MP_PAD_UART2_RXD__UART2_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-       MX8MP_PAD_UART2_TXD__UART2_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),
 };
@@ -128,8 +112,6 @@ int board_early_init_f(void)
 
        set_wdog_reset(wdog);
 
-       imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
        return 0;
 }
 
@@ -276,8 +258,6 @@ void board_init_f(ulong dummy)
 
        timer_init();
 
-       preloader_console_init();
-
        /* Clear the BSS. */
        memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -287,6 +267,8 @@ void board_init_f(ulong dummy)
                hang();
        }
 
+       preloader_console_init();
+
        enable_tzc380();
 
        /* need to hold PCIe switch in reset otherwise it can lock i2c bus EEPROM is on */
configs/imx8mm_venice_defconfig +0 -1
index 490de193181..0165a4e5df0 100644
@@ -113,7 +113,6 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
configs/imx8mn_venice_defconfig +0 -1
index 639fee7e5f1..63a65497371 100644
@@ -112,7 +112,6 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
configs/imx8mp_venice_defconfig +0 -1
index 97c8bb59211..626ac247881 100644
@@ -112,7 +112,6 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
include/configs/imx8mm_venice.h +0 -3
index 1b26e0280e1..c3e92b76141 100644
@@ -101,9 +101,6 @@
 #define PHYS_SDRAM_SIZE                        SZ_4G
 #define CONFIG_SYS_BOOTM_LEN           SZ_256M
 
-/* UART */
-#define CONFIG_MXC_UART_BASE           UART2_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE              SZ_2K
 #define CONFIG_SYS_MAXARGS             64
include/configs/imx8mn_venice.h +0 -3
index a4826779022..41062b139f8 100644
@@ -97,9 +97,6 @@
 #define PHYS_SDRAM_SIZE                        SZ_4G
 #define CONFIG_SYS_BOOTM_LEN           SZ_256M
 
-/* UART */
-#define CONFIG_MXC_UART_BASE           UART2_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE              SZ_2K
 #define CONFIG_SYS_MAXARGS             64
include/configs/imx8mp_venice.h +0 -4
index aa0396db8b8..5242b56ad8c 100644
@@ -97,9 +97,6 @@
 #define PHYS_SDRAM_SIZE                        SZ_4G
 #define CONFIG_SYS_BOOTM_LEN           SZ_256M
 
-/* UART */
-#define CONFIG_MXC_UART_BASE           UART2_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE              SZ_2K
 #define CONFIG_SYS_MAXARGS             64
--
Quoted 2 lines

2.36.0

Peng,

Thanks for doing this.

It would be nice to get rid of the wdog pinmux as well... do you know if we can do that now as well?

This

#4 lore raw

Re: [PATCH 02/15] imx: imx8m[m/n/p]_venice: Enable SPL_DM_SERIAL

Quoted 169 lines · Tim Harvey
Quoted 163 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_SPL_DM_SERIAL. uart2 and its pinmux was already marked with u-boot,dm-spl.
Move preloader_console_init after spl_early_init to make sure driver model work.

---
  board/gateworks/venice/spl.c    | 22 ++--------------------
  configs/imx8mm_venice_defconfig |  1 -
  configs/imx8mn_venice_defconfig |  1 -
  configs/imx8mp_venice_defconfig |  1 -
  include/configs/imx8mm_venice.h |  3 ---
  include/configs/imx8mn_venice.h |  3 ---
  include/configs/imx8mp_venice.h |  3 ---
  7 files changed, 2 insertions(+), 32 deletions(-)
board/gateworks/venice/spl.c +2 -20
index 223f22d3463..af196e5b87c 100644
@@ -87,33 +87,17 @@ static void spl_dram_init(int size)
         ddr_init(dram_timing);
  }
 
-#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)
 
  #ifdef CONFIG_IMX8MM
-static iomux_v3_cfg_t const uart_pads[] = {
-       IMX8MM_PAD_UART2_RXD_UART2_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-       IMX8MM_PAD_UART2_TXD_UART2_TX | 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),
  };
  #elif CONFIG_IMX8MN
-static const iomux_v3_cfg_t uart_pads[] = {
-       IMX8MN_PAD_UART2_RXD__UART2_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-       IMX8MN_PAD_UART2_TXD__UART2_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
  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 uart_pads[] = {
-       MX8MP_PAD_UART2_RXD__UART2_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-       MX8MP_PAD_UART2_TXD__UART2_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),
  };
@@ -128,8 +112,6 @@ int board_early_init_f(void)
 
         set_wdog_reset(wdog);
 
-       imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
         return 0;
  }
 
@@ -276,8 +258,6 @@ void board_init_f(ulong dummy)
 
         timer_init();
 
-       preloader_console_init();
-
         /* Clear the BSS. */
         memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -287,6 +267,8 @@ void board_init_f(ulong dummy)
                 hang();
         }
 
+       preloader_console_init();
+
         enable_tzc380();
 
         /* need to hold PCIe switch in reset otherwise it can lock i2c bus EEPROM is on */
configs/imx8mm_venice_defconfig +0 -1
index 490de193181..0165a4e5df0 100644
@@ -113,7 +113,6 @@ CONFIG_DM_REGULATOR=y
  CONFIG_DM_REGULATOR_FIXED=y
  CONFIG_DM_REGULATOR_GPIO=y
  CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
  CONFIG_MXC_UART=y
  CONFIG_SYSRESET=y
  CONFIG_SPL_SYSRESET=y
configs/imx8mn_venice_defconfig +0 -1
index 639fee7e5f1..63a65497371 100644
@@ -112,7 +112,6 @@ CONFIG_DM_REGULATOR=y
  CONFIG_DM_REGULATOR_FIXED=y
  CONFIG_DM_REGULATOR_GPIO=y
  CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
  CONFIG_MXC_UART=y
  CONFIG_SYSRESET=y
  CONFIG_SPL_SYSRESET=y
configs/imx8mp_venice_defconfig +0 -1
index 97c8bb59211..626ac247881 100644
@@ -112,7 +112,6 @@ CONFIG_DM_REGULATOR=y
  CONFIG_DM_REGULATOR_FIXED=y
  CONFIG_DM_REGULATOR_GPIO=y
  CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
  CONFIG_MXC_UART=y
  CONFIG_SYSRESET=y
  CONFIG_SPL_SYSRESET=y
include/configs/imx8mm_venice.h +0 -3
index 1b26e0280e1..c3e92b76141 100644
@@ -101,9 +101,6 @@
  #define PHYS_SDRAM_SIZE                        SZ_4G
  #define CONFIG_SYS_BOOTM_LEN           SZ_256M
 
-/* UART */
-#define CONFIG_MXC_UART_BASE           UART2_BASE_ADDR
-
  /* Monitor Command Prompt */
  #define CONFIG_SYS_CBSIZE              SZ_2K
  #define CONFIG_SYS_MAXARGS             64
include/configs/imx8mn_venice.h +0 -3
index a4826779022..41062b139f8 100644
@@ -97,9 +97,6 @@
  #define PHYS_SDRAM_SIZE                        SZ_4G
  #define CONFIG_SYS_BOOTM_LEN           SZ_256M
 
-/* UART */
-#define CONFIG_MXC_UART_BASE           UART2_BASE_ADDR
-
  /* Monitor Command Prompt */
  #define CONFIG_SYS_CBSIZE              SZ_2K
  #define CONFIG_SYS_MAXARGS             64
include/configs/imx8mp_venice.h +0 -4
index aa0396db8b8..5242b56ad8c 100644
@@ -97,9 +97,6 @@
  #define PHYS_SDRAM_SIZE                        SZ_4G
  #define CONFIG_SYS_BOOTM_LEN           SZ_256M
 
-/* UART */
-#define CONFIG_MXC_UART_BASE           UART2_BASE_ADDR
-
  /* Monitor Command Prompt */
  #define CONFIG_SYS_CBSIZE              SZ_2K
  #define CONFIG_SYS_MAXARGS             64
--
Quoted 2 lines

2.36.0

Peng,

Quoted 6 lines

Thanks for doing this.

It would be nice to get rid of the wdog pinmux as well... do you know if we can do that now as well?

watchdog needs Watchdog driver model enabled, should be doable. I could give a look.

Regards,
Peng.

Quoted 3 lines

This

#5 lore raw

PATCH 3/15 imx: imx8mm_mx8menlo: Enable DM_SERIAL

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already marked with u-boot,dm-spl.

---
 board/menlo/mx8menlo/mx8menlo.c   | 9 ---------
 configs/imx8mm-mx8menlo_defconfig | 1 +
 include/configs/imx8mm-mx8menlo.h | 3 ---
 3 files changed, 1 insertion(+), 12 deletions(-)
board/menlo/mx8menlo/mx8menlo.c +0 -9
index a4d0becdcc8..95ff95ad360 100644
@@ -12,15 +12,8 @@
 #include <asm/mach-imx/iomux-v3.h>
 #include <spl.h>
 
-#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[] = {
-	IMX8MM_PAD_SAI3_TXFS_UART2_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MM_PAD_SAI3_TXC_UART2_TX | 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),
 };
@@ -48,8 +41,6 @@ void board_early_init(void)
 
 	set_wdog_reset(wdog);
 
-	imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
 	init_uart_clk(1);
 
 	setup_snvs();
configs/imx8mm-mx8menlo_defconfig +1 -0
index 0d3e19e5e31..a4164951de0 100644
@@ -105,6 +105,7 @@ CONFIG_DM_PMIC_PFUZE100=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
include/configs/imx8mm-mx8menlo.h +0 -3
index fd1831622f0..530ecd1d460 100644
@@ -30,7 +30,4 @@
 	"initrd_addr=0x43800000\0"					\
 	"kernel_image=fitImage\0"
 
-#undef CONFIG_MXC_UART_BASE
-#define CONFIG_MXC_UART_BASE		UART2_BASE_ADDR
-
 #endif /* __IMX8MM_MX8MENLO_H */
Signature · 1 line
2.36.0
#6 lore raw

Re: [PATCH 03/15] imx: imx8mm_mx8menlo: Enable DM_SERIAL

Quoted 33 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already marked with u-boot,dm-spl.

---
  board/menlo/mx8menlo/mx8menlo.c   | 9 ---------
  configs/imx8mm-mx8menlo_defconfig | 1 +
  include/configs/imx8mm-mx8menlo.h | 3 ---
  3 files changed, 1 insertion(+), 12 deletions(-)
board/menlo/mx8menlo/mx8menlo.c +0 -7
index a4d0becdcc8..95ff95ad360 100644
@@ -12,15 +12,8 @@
  #include <asm/mach-imx/iomux-v3.h>
  #include <spl.h>
 
-#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[] = {
-	IMX8MM_PAD_SAI3_TXFS_UART2_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MM_PAD_SAI3_TXC_UART2_TX | 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),
  };

board/menlo/mx8menlo/mx8menlo.c void board_early_init(void) · line 44

Quoted 6 lines
board/menlo/mx8menlo/mx8menlo.c +0 -2
@@ -48,8 +41,6 @@ void board_early_init(void)
 
  	set_wdog_reset(wdog);
 
-	imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
  	init_uart_clk(1);

But that means the UART is available much later in SPL ?

Also, init_uart_clk(1) still hard-codes UART number , can the UART driver init those UART clock instead too ?

#7 lore raw

Re: [PATCH 03/15] imx: imx8mm_mx8menlo: Enable DM_SERIAL

Quoted 38 lines · Marek Vasut
Quoted 36 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already marked with u-boot,dm-spl.

---
  board/menlo/mx8menlo/mx8menlo.c   | 9 ---------
  configs/imx8mm-mx8menlo_defconfig | 1 +
  include/configs/imx8mm-mx8menlo.h | 3 ---
  3 files changed, 1 insertion(+), 12 deletions(-)
board/menlo/mx8menlo/mx8menlo.c +0 -7
index a4d0becdcc8..95ff95ad360 100644
@@ -12,15 +12,8 @@
  #include <asm/mach-imx/iomux-v3.h>
  #include <spl.h>
 
-#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[] = {
-     IMX8MM_PAD_SAI3_TXFS_UART2_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-     IMX8MM_PAD_SAI3_TXC_UART2_TX | 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),
  };
@@ -48,8 +41,6 @@ void board_early_init(void)
 
      set_wdog_reset(wdog);
 
Quoted 8 lines

board/menlo/mx8menlo/mx8menlo.c void board_early_init(void) · line 44

Quoted 3 lines
board/menlo/mx8menlo/mx8menlo.c +0 -2
-     imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
      init_uart_clk(1);

But that means the UART is available much later in SPL ?

Also, init_uart_clk(1) still hard-codes UART number , can the UART driver init those UART clock instead too ?

I just submitted an RFC to address that [1]. The RTC is based on the work Peng did.

If people are OK with my proposal or changing the serial driver, I can work on porting the 8mn and 8mp clocks to let the drivers enable the clocks.

[1] - https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

adam

[1] - https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

#8 lore raw

Re: [PATCH 03/15] imx: imx8mm_mx8menlo: Enable DM_SERIAL

Quoted 48 lines · Adam Ford
Quoted 38 lines · Marek Vasut
Quoted 36 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already marked with u-boot,dm-spl.

---
   board/menlo/mx8menlo/mx8menlo.c   | 9 ---------
   configs/imx8mm-mx8menlo_defconfig | 1 +
   include/configs/imx8mm-mx8menlo.h | 3 ---
   3 files changed, 1 insertion(+), 12 deletions(-)
board/menlo/mx8menlo/mx8menlo.c +0 -7
index a4d0becdcc8..95ff95ad360 100644
@@ -12,15 +12,8 @@
   #include <asm/mach-imx/iomux-v3.h>
   #include <spl.h>
 
-#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[] = {
-     IMX8MM_PAD_SAI3_TXFS_UART2_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-     IMX8MM_PAD_SAI3_TXC_UART2_TX | 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),
   };
@@ -48,8 +41,6 @@ void board_early_init(void)
 
       set_wdog_reset(wdog);
 
Quoted 8 lines

board/menlo/mx8menlo/mx8menlo.c void board_early_init(void) · line 44

Quoted 3 lines
board/menlo/mx8menlo/mx8menlo.c +0 -2
-     imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
       init_uart_clk(1);

But that means the UART is available much later in SPL ?

Also, init_uart_clk(1) still hard-codes UART number , can the UART driver init those UART clock instead too ?

Quoted 8 lines

I just submitted an RFC to address that [1]. The RTC is based on the work Peng did.

If people are OK with my proposal or changing the serial driver, I can work on porting the 8mn and 8mp clocks to let the drivers enable the clocks.

[1] - https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

That still works only after spl_early_init() is called, right ?

#9 lore raw

Re: [PATCH 03/15] imx: imx8mm_mx8menlo: Enable DM_SERIAL

Quoted 53 lines · Marek Vasut
Quoted 51 lines · Adam Ford
Quoted 38 lines · Marek Vasut
Quoted 36 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already marked with u-boot,dm-spl.

---
   board/menlo/mx8menlo/mx8menlo.c   | 9 ---------
   configs/imx8mm-mx8menlo_defconfig | 1 +
   include/configs/imx8mm-mx8menlo.h | 3 ---
   3 files changed, 1 insertion(+), 12 deletions(-)
board/menlo/mx8menlo/mx8menlo.c +0 -7
index a4d0becdcc8..95ff95ad360 100644
@@ -12,15 +12,8 @@
   #include <asm/mach-imx/iomux-v3.h>
   #include <spl.h>
 
-#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[] = {
-     IMX8MM_PAD_SAI3_TXFS_UART2_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-     IMX8MM_PAD_SAI3_TXC_UART2_TX | 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),
   };
@@ -48,8 +41,6 @@ void board_early_init(void)
 
       set_wdog_reset(wdog);
 
Quoted 8 lines

board/menlo/mx8menlo/mx8menlo.c void board_early_init(void) · line 44

Quoted 3 lines
board/menlo/mx8menlo/mx8menlo.c +0 -2
-     imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
       init_uart_clk(1);

But that means the UART is available much later in SPL ?

Also, init_uart_clk(1) still hard-codes UART number , can the UART driver init those UART clock instead too ?

I just submitted an RFC to address that [1]. The RTC is based on the work Peng did.

Quoted 7 lines
Quoted 5 lines

If people are OK with my proposal or changing the serial driver, I can work on porting the 8mn and 8mp clocks to let the drivers enable the clocks.

[1] - https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

That still works only after spl_early_init() is called, right ?

As far as I can tell, we need spl init to run to get the device tree stuff functional in order to enable either the clocks or the serial port. However, I have noticed the README states that board_init_f should not call board_init_r directly and BSS isn't not available. It seems like there might be more work to do on cleaning up the various board_init_f functions. It seems like everyone clears BSS and calls board_init_r directly.

I wonder if we could consolidate all these boards files into a platform specific startup function and let people who have board-specific stuff they need done to do it in early init or something.

adam

#10 lore raw

PATCH 4/15 imx: imx8m[m/n]_beacon: Enable SPL_DM_SERIAL

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_SPL_DM_SERIAL. uart2 and its pinmux was already marked with u-boot,dm-spl.
Move preloader_console_init after spl_init to make sure driver model work.

---
 board/beacon/imx8mm/spl.c          | 12 ++----------
 board/beacon/imx8mn/spl.c          | 11 ++---------
 configs/imx8mm_beacon_defconfig    |  1 -
 configs/imx8mn_beacon_2g_defconfig |  1 -
 configs/imx8mn_beacon_defconfig    |  1 -
 include/configs/imx8mm_beacon.h    |  2 --
 include/configs/imx8mn_beacon.h    |  2 --
 7 files changed, 4 insertions(+), 26 deletions(-)
board/beacon/imx8mm/spl.c +2 -10
index 12266b22a42..f92b4c3ed0a 100644
@@ -59,14 +59,8 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#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)
 
-static iomux_v3_cfg_t const uart_pads[] = {
-	IMX8MM_PAD_UART2_RXD_UART2_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MM_PAD_UART2_TXD_UART2_TX | 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),
 };
@@ -79,8 +73,6 @@ int board_early_init_f(void)
 
 	set_wdog_reset(wdog);
 
-	imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
 	return 0;
 }
 
@@ -128,8 +120,6 @@ void board_init_f(ulong dummy)
 
 	timer_init();
 
-	preloader_console_init();
-
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -139,6 +129,8 @@ void board_init_f(ulong dummy)
 		hang();
 	}
 
+	preloader_console_init();
+
 	ret = uclass_get_device_by_name(UCLASS_CLK,
 					"clock-controller@30380000",
 					&dev);
board/beacon/imx8mn/spl.c +2 -9
index bb51be01c52..4563446db19 100644
@@ -68,7 +68,6 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#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)
 #define PWM1_PAD_CTRL (PAD_CTL_FSEL2 | PAD_CTL_DSE6)
 
@@ -76,11 +75,6 @@ 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 uart_pads[] = {
-	IMX8MN_PAD_UART2_RXD__UART2_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MN_PAD_UART2_TXD__UART2_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
 static iomux_v3_cfg_t const wdog_pads[] = {
 	IMX8MN_PAD_GPIO1_IO02__WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
 };
@@ -95,7 +89,6 @@ int board_early_init_f(void)
 	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(1);
 
 	return 0;
@@ -114,14 +107,14 @@ void board_init_f(ulong dummy)
 
 	timer_init();
 
-	preloader_console_init();
-
 	ret = spl_init();
 	if (ret) {
 		debug("spl_init() failed: %d\n", ret);
 		hang();
 	}
 
+	preloader_console_init();
+
 	enable_tzc380();
 
 	/* DDR initialization */
configs/imx8mm_beacon_defconfig +0 -1
index 9cd8ac97285..a8981975f66 100644
@@ -112,7 +112,6 @@ CONFIG_SPL_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_CONS_INDEX=2
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
configs/imx8mn_beacon_2g_defconfig +0 -1
index 145f96d491d..cf1720725d0 100644
@@ -114,7 +114,6 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_DM_RESET=y
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
configs/imx8mn_beacon_defconfig +0 -1
index 9052e68e967..882a6044989 100644
@@ -118,7 +118,6 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_DM_RESET=y
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
include/configs/imx8mm_beacon.h +0 -2
index 7c17f14964f..4c9b5491f78 100644
@@ -91,8 +91,6 @@
 #define PHYS_SDRAM			0x40000000
 #define PHYS_SDRAM_SIZE		0x80000000 /* 2GB DDR */
 
-#define CONFIG_MXC_UART_BASE		UART2_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		2048
 #define CONFIG_SYS_MAXARGS		64
include/configs/imx8mn_beacon.h +0 -2
index 41ce3c1c8ce..c16dda5e22c 100644
@@ -107,8 +107,6 @@
 #define PHYS_SDRAM_SIZE		0x40000000 /* 1GB DDR */
 #endif
 
-#define CONFIG_MXC_UART_BASE		UART2_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE              2048
 #define CONFIG_SYS_MAXARGS             64
Signature · 1 line
2.36.0
Tested-by on v1 4/15
#11 lore raw

Re: [PATCH 04/15] imx: imx8m[m/n]_beacon: Enable SPL_DM_SERIAL

Quoted 7 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_SPL_DM_SERIAL. uart2 and its pinmux was already marked with u-boot,dm-spl.
Move preloader_console_init after spl_init to make sure driver model work.

Thanks for doing this!

Quoted 1 line
Quoted 171 lines
---
 board/beacon/imx8mm/spl.c          | 12 ++----------
 board/beacon/imx8mn/spl.c          | 11 ++---------
 configs/imx8mm_beacon_defconfig    |  1 -
 configs/imx8mn_beacon_2g_defconfig |  1 -
 configs/imx8mn_beacon_defconfig    |  1 -
 include/configs/imx8mm_beacon.h    |  2 --
 include/configs/imx8mn_beacon.h    |  2 --
 7 files changed, 4 insertions(+), 26 deletions(-)
board/beacon/imx8mm/spl.c +2 -10
index 12266b22a42..f92b4c3ed0a 100644
@@ -59,14 +59,8 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#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)
 
-static iomux_v3_cfg_t const uart_pads[] = {
-       IMX8MM_PAD_UART2_RXD_UART2_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-       IMX8MM_PAD_UART2_TXD_UART2_TX | 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),
 };
@@ -79,8 +73,6 @@ int board_early_init_f(void)
 
        set_wdog_reset(wdog);
 
-       imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
        return 0;
 }
 
@@ -128,8 +120,6 @@ void board_init_f(ulong dummy)
 
        timer_init();
 
-       preloader_console_init();
-
        /* Clear the BSS. */
        memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -139,6 +129,8 @@ void board_init_f(ulong dummy)
                hang();
        }
 
+       preloader_console_init();
+
        ret = uclass_get_device_by_name(UCLASS_CLK,
                                        "clock-controller@30380000",
                                        &dev);
board/beacon/imx8mn/spl.c +2 -9
index bb51be01c52..4563446db19 100644
@@ -68,7 +68,6 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#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)
 #define PWM1_PAD_CTRL (PAD_CTL_FSEL2 | PAD_CTL_DSE6)
 
@@ -76,11 +75,6 @@ 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 uart_pads[] = {
-       IMX8MN_PAD_UART2_RXD__UART2_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-       IMX8MN_PAD_UART2_TXD__UART2_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
 static iomux_v3_cfg_t const wdog_pads[] = {
        IMX8MN_PAD_GPIO1_IO02__WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
 };
@@ -95,7 +89,6 @@ int board_early_init_f(void)
        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(1);
 
        return 0;
@@ -114,14 +107,14 @@ void board_init_f(ulong dummy)
 
        timer_init();
 
-       preloader_console_init();
-
        ret = spl_init();
        if (ret) {
                debug("spl_init() failed: %d\n", ret);
                hang();
        }
 
+       preloader_console_init();
+
        enable_tzc380();
 
        /* DDR initialization */
configs/imx8mm_beacon_defconfig +0 -1
index 9cd8ac97285..a8981975f66 100644
@@ -112,7 +112,6 @@ CONFIG_SPL_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_CONS_INDEX=2
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
configs/imx8mn_beacon_2g_defconfig +0 -1
index 145f96d491d..cf1720725d0 100644
@@ -114,7 +114,6 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_DM_RESET=y
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
configs/imx8mn_beacon_defconfig +0 -1
index 9052e68e967..882a6044989 100644
@@ -118,7 +118,6 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_DM_RESET=y
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
include/configs/imx8mm_beacon.h +0 -2
index 7c17f14964f..4c9b5491f78 100644
@@ -91,8 +91,6 @@
 #define PHYS_SDRAM                     0x40000000
 #define PHYS_SDRAM_SIZE                0x80000000 /* 2GB DDR */
 
-#define CONFIG_MXC_UART_BASE           UART2_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE              2048
 #define CONFIG_SYS_MAXARGS             64
include/configs/imx8mn_beacon.h +0 -3
index 41ce3c1c8ce..c16dda5e22c 100644
@@ -107,8 +107,6 @@
 #define PHYS_SDRAM_SIZE                0x40000000 /* 1GB DDR */
 #endif
 
-#define CONFIG_MXC_UART_BASE           UART2_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE              2048
 #define CONFIG_SYS_MAXARGS             64
--

2.36.0

#12 lore raw

PATCH 5/15 imx: imx8mm-cl-iot-gate: Enable DM_SERIAL

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_DM_SERIAL. uart3 and its pinmux was already marked with u-boot,dm-spl.
Move preloader_console_init after spl_early_init to make sure driver model work.

---
 board/compulab/imx8mm-cl-iot-gate/spl.c    | 12 ++----------
 configs/imx8mm-cl-iot-gate-optee_defconfig |  1 +
 configs/imx8mm-cl-iot-gate_defconfig       |  1 +
 include/configs/imx8mm-cl-iot-gate.h       |  2 --
 4 files changed, 4 insertions(+), 12 deletions(-)
board/compulab/imx8mm-cl-iot-gate/spl.c +2 -10
index 2dc62d6682e..f183704c9d2 100644
@@ -83,14 +83,8 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#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)
 
-static iomux_v3_cfg_t const uart_pads[] = {
-	IMX8MM_PAD_UART3_RXD_UART3_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MM_PAD_UART3_TXD_UART3_TX | 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),
 };
@@ -103,8 +97,6 @@ int board_early_init_f(void)
 
 	set_wdog_reset(wdog);
 
-	imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
 	return 0;
 }
 
@@ -155,8 +147,6 @@ void board_init_f(ulong dummy)
 
 	timer_init();
 
-	preloader_console_init();
-
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -166,6 +156,8 @@ void board_init_f(ulong dummy)
 		hang();
 	}
 
+	preloader_console_init();
+
 	ret = uclass_get_device_by_name(UCLASS_CLK,
 					"clock-controller@30380000",
 					&dev);
configs/imx8mm-cl-iot-gate-optee_defconfig +1 -0
index 0bde51a91f5..bcabc0d91d8 100644
@@ -110,6 +110,7 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_ABX80X=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
configs/imx8mm-cl-iot-gate_defconfig +1 -0
index d734586a60c..2088ad47dbf 100644
@@ -113,6 +113,7 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_ABX80X=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
include/configs/imx8mm-cl-iot-gate.h +0 -2
index c20c32b6951..fcb46c16605 100644
@@ -145,8 +145,6 @@
 #define PHYS_SDRAM			0x40000000
 #define PHYS_SDRAM_SIZE			0x80000000 /* 2GB DDR */
 
-#define CONFIG_MXC_UART_BASE		UART3_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		2048
 #define CONFIG_SYS_MAXARGS		64
Signature · 1 line
2.36.0
#13 lore raw

PATCH 6/15 imx: imx8mm_icore: Enable SPL_DM_SERIAL

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_SPL_DM_SERIAL. uart2 and its pinmux was already marked with u-boot,dm-spl.
Move preloader_console_init after spl_early_init to make sure driver model work.

---
 board/engicam/imx8mm/spl.c                    | 14 +++-----------
 configs/imx8mm-icore-mx8mm-ctouch2_defconfig  |  1 -
 configs/imx8mm-icore-mx8mm-edimm2.2_defconfig |  1 -
 include/configs/imx8mm_icore_mx8mm.h          |  3 ---
 4 files changed, 3 insertions(+), 16 deletions(-)
board/engicam/imx8mm/spl.c +3 -11
index f9be769ec59..f75f2dc634c 100644
@@ -54,19 +54,11 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#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)
 
-static iomux_v3_cfg_t const uart_pads[] = {
-	IMX8MM_PAD_UART2_RXD_UART2_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MM_PAD_UART2_TXD_UART2_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
 int board_early_init_f(void)
 {
-	imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
-	return 0;
+       return 0;
 }
 
 void board_init_f(ulong dummy)
@@ -81,8 +73,6 @@ void board_init_f(ulong dummy)
 
 	timer_init();
 
-	preloader_console_init();
-
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -92,6 +82,8 @@ void board_init_f(ulong dummy)
 		hang();
 	}
 
+	preloader_console_init();
+
 	enable_tzc380();
 
 	/* DDR initialization */
configs/imx8mm-icore-mx8mm-ctouch2_defconfig +0 -1
index 535ff6dcba5..d95a74a7237 100644
@@ -74,7 +74,6 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_CONS_INDEX=2
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
configs/imx8mm-icore-mx8mm-edimm2.2_defconfig +0 -1
index 101d5a00bc7..43c697a39d8 100644
@@ -74,7 +74,6 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_CONS_INDEX=2
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
include/configs/imx8mm_icore_mx8mm.h +0 -3
index f521add5b04..1a439370c09 100644
@@ -65,9 +65,6 @@
 #define PHYS_SDRAM_SIZE			SZ_2G /* 2GB DDR */
 #define CONFIG_SYS_BOOTM_LEN		SZ_256M
 
-/* UART */
-#define CONFIG_MXC_UART_BASE		UART2_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		2048
 #define CONFIG_SYS_MAXARGS		64
Signature · 1 line
2.36.0
#14 lore raw

PATCH 7/15 imx: imx8m[m/p]_phycore: Enable DM_SERIAL

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_DM_SERIAL. uart and its pinmux was already marked with u-boot,dm-spl.
Move preloader_console_init after spl_early_init to make sure driver model work.

---
 board/phytec/phycore_imx8mm/spl.c | 12 ++----------
 board/phytec/phycore_imx8mp/spl.c |  8 --------
 configs/phycore-imx8mm_defconfig  |  1 +
 configs/phycore-imx8mp_defconfig  |  1 +
 include/configs/phycore_imx8mm.h  |  3 ---
 include/configs/phycore_imx8mp.h  |  3 ---
 6 files changed, 4 insertions(+), 24 deletions(-)
board/phytec/phycore_imx8mm/spl.c +2 -10
index d54145ef995..7f24a3affc8 100644
@@ -57,14 +57,8 @@ int board_fit_config_name_match(const char *name)
 	return 0;
 }
 
-#define UART_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_FSEL1)
 #define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE)
 
-static iomux_v3_cfg_t const uart_pads[] = {
-	IMX8MM_PAD_UART3_RXD_UART3_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MM_PAD_UART3_TXD_UART3_TX | 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),
 };
@@ -77,8 +71,6 @@ int board_early_init_f(void)
 
 	set_wdog_reset(wdog);
 
-	imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
 	return 0;
 }
 
@@ -92,8 +84,6 @@ void board_init_f(ulong dummy)
 
 	board_early_init_f();
 
-	preloader_console_init();
-
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -103,6 +93,8 @@ void board_init_f(ulong dummy)
 		hang();
 	}
 
+	preloader_console_init();
+
 	enable_tzc380();
 
 	/* DDR initialization */
board/phytec/phycore_imx8mp/spl.c +0 -8
index 19c486e5517..38a581bef57 100644
@@ -89,14 +89,8 @@ int board_fit_config_name_match(const char *name)
 	return 0;
 }
 
-#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)
 
-static iomux_v3_cfg_t const uart_pads[] = {
-	MX8MP_PAD_UART1_RXD__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	MX8MP_PAD_UART1_TXD__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
 static iomux_v3_cfg_t const wdog_pads[] = {
 	MX8MP_PAD_GPIO1_IO02__WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
 };
@@ -109,8 +103,6 @@ int board_early_init_f(void)
 
 	set_wdog_reset(wdog);
 
-	imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
 	return 0;
 }
 
configs/phycore-imx8mm_defconfig +1 -0
index ba5833f7060..9da222afc54 100644
@@ -107,6 +107,7 @@ CONFIG_PINCTRL_IMX8M=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
configs/phycore-imx8mp_defconfig +1 -0
index 86d0f4df7f6..a851b1bdccb 100644
@@ -98,6 +98,7 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_SPL_POWER_I2C=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
include/configs/phycore_imx8mm.h +0 -3
index 71f0c42ec0c..564b8125ba3 100644
@@ -83,9 +83,6 @@
 #define PHYS_SDRAM			0x40000000
 #define PHYS_SDRAM_SIZE                 SZ_2G /* 2GB DDR */
 
-/* UART */
-#define CONFIG_MXC_UART_BASE		UART3_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		SZ_2K
 #define CONFIG_SYS_MAXARGS		64
include/configs/phycore_imx8mp.h +0 -3
index 0c963b62b3b..3e4315f2b81 100644
@@ -83,9 +83,6 @@
 #define PHYS_SDRAM			0x40000000
 #define PHYS_SDRAM_SIZE			0x80000000
 
-/* UART */
-#define CONFIG_MXC_UART_BASE		UART1_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		SZ_2K
 #define CONFIG_SYS_MAXARGS		64
Signature · 1 line
2.36.0
Tested-by on v1 7/15
#15 lore raw

Re: [PATCH 07/15] imx: imx8m[m/p]_phycore: Enable DM_SERIAL

Hello Peng,

Am Samstag, dem 30.04.2022 um 20:43 +0800 schrieb Peng Fan (OSS):

Quoted 6 lines

From: Peng Fan <[email protected]>

Enable CONFIG_DM_SERIAL. uart and its pinmux was already marked with u-boot,dm-spl.
Move preloader_console_init after spl_early_init to make sure driver model work.

thank you for the patch.
Works for phyCORE-i.MX8MM and phyCORE-i.MX8MP.

Regards,
Teresa

Quoted 150 lines
---
 board/phytec/phycore_imx8mm/spl.c | 12 ++----------
 board/phytec/phycore_imx8mp/spl.c |  8 --------
 configs/phycore-imx8mm_defconfig  |  1 +
 configs/phycore-imx8mp_defconfig  |  1 +
 include/configs/phycore_imx8mm.h  |  3 ---
 include/configs/phycore_imx8mp.h  |  3 ---
 6 files changed, 4 insertions(+), 24 deletions(-)
board/phytec/phycore_imx8mm/spl.c +0 -6
index d54145ef995..7f24a3affc8 100644
@@ -57,14 +57,8 @@ int board_fit_config_name_match(const char *name)
 	return 0;
 }
 
-#define UART_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_FSEL1)
 #define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE)
 
-static iomux_v3_cfg_t const uart_pads[] = {
-	IMX8MM_PAD_UART3_RXD_UART3_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MM_PAD_UART3_TXD_UART3_TX | 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),

};

board/phytec/phycore_imx8mm/spl.c +2 -4
@@ -77,8 +71,6 @@ int board_early_init_f(void)
 
 	set_wdog_reset(wdog);
 
-	imx_iomux_v3_setup_multiple_pads(uart_pads,
 ARRAY_SIZE(uart_pads));
-
 	return 0;
 }
@@ -92,8 +84,6 @@ void board_init_f(ulong dummy)
 
 	board_early_init_f();
 
-	preloader_console_init();
-
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -103,6 +93,8 @@ void board_init_f(ulong dummy)
 		hang();
 	}
 
+	preloader_console_init();
+
 	enable_tzc380();
 
 	/* DDR initialization */
board/phytec/phycore_imx8mp/spl.c +0 -6
index 19c486e5517..38a581bef57 100644
@@ -89,14 +89,8 @@ int board_fit_config_name_match(const char *name)
 	return 0;
 }
 
-#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)
 
-static iomux_v3_cfg_t const uart_pads[] = {
-	MX8MP_PAD_UART1_RXD__UART1_DCE_RX |
 MUX_PAD_CTRL(UART_PAD_CTRL),
-	MX8MP_PAD_UART1_TXD__UART1_DCE_TX |
 MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-

static iomux_v3_cfg_t const wdog_pads[] = {
MX8MP_PAD_GPIO1_IO02__WDOG1_WDOG_B |
MUX_PAD_CTRL(WDOG_PAD_CTRL),
};

board/phytec/phycore_imx8mp/spl.c +0 -2
@@ -109,8 +103,6 @@ int board_early_init_f(void)
 
 	set_wdog_reset(wdog);
 
-	imx_iomux_v3_setup_multiple_pads(uart_pads,
 ARRAY_SIZE(uart_pads));
-
 	return 0;
 }
configs/phycore- renamed from configs/phycore-imx8mm_defconfig +0 -0

imx8mm_defconfig
index ba5833f7060..9da222afc54 100644

configs/phycore-imx8mm_defconfig +1 -0
@@ -107,6 +107,7 @@ CONFIG_PINCTRL_IMX8M=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
configs/phycore- renamed from configs/phycore-imx8mp_defconfig +0 -0

imx8mp_defconfig
index 86d0f4df7f6..a851b1bdccb 100644

configs/phycore-imx8mp_defconfig +1 -0
@@ -98,6 +98,7 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_SPL_POWER_I2C=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
include/configs/phycore_imx8mm.h +0 -3
index 71f0c42ec0c..564b8125ba3 100644
@@ -83,9 +83,6 @@
 #define PHYS_SDRAM			0x40000000
 #define PHYS_SDRAM_SIZE                 SZ_2G /* 2GB DDR */
 
-/* UART */
-#define CONFIG_MXC_UART_BASE		UART3_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		SZ_2K
 #define CONFIG_SYS_MAXARGS		64
include/configs/phycore_imx8mp.h +0 -3
index 0c963b62b3b..3e4315f2b81 100644
@@ -83,9 +83,6 @@
 #define PHYS_SDRAM			0x40000000
 #define PHYS_SDRAM_SIZE			0x80000000
 
-/* UART */
-#define CONFIG_MXC_UART_BASE		UART1_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		SZ_2K
 #define CONFIG_SYS_MAXARGS		64
Signature · 5 lines
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
#16 lore raw

PATCH 8/15 imx: imx8mn_var_som: enable DM_SERIAL

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_DM_SERIAL. uart and its pinmux was already marked with u-boot,dm-spl.
Move preloader_console_init after spl_init to make sure driver model work.

---
 board/variscite/imx8mn_var_som/spl.c | 11 ++---------
 configs/imx8mn_var_som_defconfig     |  1 +
 include/configs/imx8mn_var_som.h     |  2 --
 3 files changed, 3 insertions(+), 11 deletions(-)
board/variscite/imx8mn_var_som/spl.c +2 -9
index 32703c5f0b3..1a8b64fc0a9 100644
@@ -40,14 +40,8 @@ void spl_board_init(void)
 		puts("Failed to find clock node. Check device tree\n");
 }
 
-#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)
 
-static const iomux_v3_cfg_t uart_pads[] = {
-	IMX8MN_PAD_UART4_RXD__UART4_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MN_PAD_UART4_TXD__UART4_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
 static const iomux_v3_cfg_t wdog_pads[] = {
 	IMX8MN_PAD_GPIO1_IO02__WDOG1_WDOG_B | MUX_PAD_CTRL(WDOG_PAD_CTRL),
 };
@@ -59,7 +53,6 @@ int board_early_init_f(void)
 	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(3);
 
 	return 0;
@@ -78,14 +71,14 @@ void board_init_f(ulong dummy)
 
 	timer_init();
 
-	preloader_console_init();
-
 	ret = spl_init();
 	if (ret) {
 		debug("spl_init() failed: %d\n", ret);
 		hang();
 	}
 
+	preloader_console_init();
+
 	/* DDR initialization */
 	spl_dram_init();
 
configs/imx8mn_var_som_defconfig +1 -0
index 5ec82f2a926..39209f62c46 100644
@@ -83,6 +83,7 @@ CONFIG_SPL_DM_PMIC_BD71837=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
 CONFIG_SYSRESET_PSCI=y
include/configs/imx8mn_var_som.h +0 -2
index 318289b76bc..6ce60b0d704 100644
@@ -64,8 +64,6 @@
 #define PHYS_SDRAM			0x40000000
 #define PHYS_SDRAM_SIZE			SZ_1G /* 1GB DDR */
 
-#define CONFIG_MXC_UART_BASE		UART4_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		SZ_2K
 #define CONFIG_SYS_MAXARGS		64
Signature · 1 line
2.36.0
Reviewed-by on v1 8/15
#17 lore raw

Re: [PATCH 08/15] imx: imx8mn_var_som: enable DM_SERIAL

Hi Peng,

Quoted 7 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_DM_SERIAL. uart and its pinmux was already marked with u-boot,dm-spl.
Move preloader_console_init after spl_init to make sure driver model work.

Quoted 6 lines
---
 board/variscite/imx8mn_var_som/spl.c | 11 ++---------
 configs/imx8mn_var_som_defconfig     |  1 +
 include/configs/imx8mn_var_som.h     |  2 --
 3 files changed, 3 insertions(+), 11 deletions(-)

Thanks!

#18 lore raw

PATCH 9/15 imx: imx8mm_edm_sbc: Enable SPL_DM_SERIAL

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_SPL_DM_SERIAL. uart and its pinmux was already marked with u-boot,dm-spl.
Move preloader_console_init after spl_early_init to make sure driver model work.

---
 board/data_modul/imx8mm_edm_sbc/spl.c       | 12 ++----------
 configs/imx8mm_data_modul_edm_sbc_defconfig |  1 -
 include/configs/imx8mm_data_modul_edm_sbc.h |  2 --
 3 files changed, 2 insertions(+), 13 deletions(-)
board/data_modul/imx8mm_edm_sbc/spl.c +2 -10
index 36cad14fc41..f5063eb8c19 100644
@@ -28,14 +28,8 @@
 
 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)
 
-static const iomux_v3_cfg_t uart_pads[] = {
-	IMX8MM_PAD_UART3_RXD_UART3_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MM_PAD_UART3_TXD_UART3_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
 static const iomux_v3_cfg_t wdog_pads[] = {
 	IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
 };
@@ -47,8 +41,6 @@ static void data_modul_imx8mm_edm_sbc_early_init_f(void)
 	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));
 }
 
 static int data_modul_imx8mm_edm_sbc_board_power_init(void)
@@ -149,8 +141,6 @@ void board_init_f(ulong dummy)
 
 	data_modul_imx8mm_edm_sbc_early_init_f();
 
-	preloader_console_init();
-
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -160,6 +150,8 @@ void board_init_f(ulong dummy)
 		hang();
 	}
 
+	preloader_console_init();
+
 	ret = uclass_get_device_by_name(UCLASS_CLK,
 					"clock-controller@30380000",
 					&dev);
configs/imx8mm_data_modul_edm_sbc_defconfig +0 -1
index afc8c43ca99..dd3c2e19e52 100644
@@ -200,7 +200,6 @@ CONFIG_DM_RTC=y
 CONFIG_RTC_M41T62=y
 CONFIG_CONS_INDEX=2
 CONFIG_DM_SERIAL=y
-# CONFIG_SPL_DM_SERIAL is not set
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
include/configs/imx8mm_data_modul_edm_sbc.h +0 -2
index 33778a2365e..ff98095d27d 100644
@@ -41,8 +41,6 @@
 #define PHYS_SDRAM			0x40000000
 #define PHYS_SDRAM_SIZE			0x40000000 /* Minimum 1 GiB DDR */
 
-#define CONFIG_MXC_UART_BASE		UART3_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		2048
 #define CONFIG_SYS_MAXARGS		64
Signature · 1 line
2.36.0
#19 lore raw

PATCH 10/15 imx: kontron-sl-mx8mm: enable DM_SERIAL

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable CONFIG_DM_SERIAL. uart and its pinmux was already marked with u-boot,dm-spl.
Move preloader_console_init after spl_init to make sure driver model work.

---
 board/kontron/sl-mx8mm/spl.c       | 12 ++----------
 configs/kontron-sl-mx8mm_defconfig |  1 +
 include/configs/kontron-sl-mx8mm.h |  1 -
 3 files changed, 3 insertions(+), 11 deletions(-)
board/kontron/sl-mx8mm/spl.c +2 -10
index 4ef03c8c172..a58a75dc958 100644
@@ -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 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)
 
 #define TOUCH_RESET_GPIO	IMX_GPIO_NR(3, 23)
@@ -51,11 +50,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 uart_pads[] = {
-	IMX8MM_PAD_UART3_RXD_UART3_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MM_PAD_UART3_TXD_UART3_TX | 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),
 };
@@ -230,8 +224,6 @@ int board_early_init_f(void)
 
 	set_wdog_reset(wdog);
 
-	imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
 	return 0;
 }
 
@@ -273,8 +265,6 @@ void board_init_f(ulong dummy)
 
 	timer_init();
 
-	preloader_console_init();
-
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -284,6 +274,8 @@ void board_init_f(ulong dummy)
 		hang();
 	}
 
+	preloader_console_init();
+
 	enable_tzc380();
 
 	/* PMIC initialization */
configs/kontron-sl-mx8mm_defconfig +1 -0
index 1375c78a8c4..44ed4f3fb1f 100644
@@ -103,6 +103,7 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_RV8803=y
 CONFIG_CONS_INDEX=2
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
include/configs/kontron-sl-mx8mm.h +0 -1
index 1b429f7dbe2..20f7f7a74f5 100644
@@ -28,7 +28,6 @@
 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
 /* Board and environment settings */
-#define CONFIG_MXC_UART_BASE		UART3_BASE_ADDR
 #define CONFIG_HOSTNAME			"kontron-mx8mm"
 
 #ifdef CONFIG_USB_EHCI_HCD
Signature · 1 line
2.36.0
Acked-by on v1 10/15
#20 lore raw

Re: [PATCH 10/15] imx: kontron-sl-mx8mm: enable DM_SERIAL

Am 30.04.22 um 14:43 schrieb Peng Fan (OSS):

Quoted 8 lines

From: Peng Fan <[email protected]>

Enable CONFIG_DM_SERIAL. uart and its pinmux was already marked with u-boot,dm-spl.
Move preloader_console_init after spl_init to make sure driver model work.

Quoted 81 lines
---
 board/kontron/sl-mx8mm/spl.c       | 12 ++----------
 configs/kontron-sl-mx8mm_defconfig |  1 +
 include/configs/kontron-sl-mx8mm.h |  1 -
 3 files changed, 3 insertions(+), 11 deletions(-)
board/kontron/sl-mx8mm/spl.c +2 -10
index 4ef03c8c172..a58a75dc958 100644
@@ -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 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)
 
 #define TOUCH_RESET_GPIO	IMX_GPIO_NR(3, 23)
@@ -51,11 +50,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 uart_pads[] = {
-	IMX8MM_PAD_UART3_RXD_UART3_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MM_PAD_UART3_TXD_UART3_TX | 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),
 };
@@ -230,8 +224,6 @@ int board_early_init_f(void)
 
 	set_wdog_reset(wdog);
 
-	imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
 	return 0;
 }
 
@@ -273,8 +265,6 @@ void board_init_f(ulong dummy)
 
 	timer_init();
 
-	preloader_console_init();
-
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -284,6 +274,8 @@ void board_init_f(ulong dummy)
 		hang();
 	}
 
+	preloader_console_init();
+
 	enable_tzc380();
 
 	/* PMIC initialization */
configs/kontron-sl-mx8mm_defconfig +1 -0
index 1375c78a8c4..44ed4f3fb1f 100644
@@ -103,6 +103,7 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_RV8803=y
 CONFIG_CONS_INDEX=2
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
include/configs/kontron-sl-mx8mm.h +0 -1
index 1b429f7dbe2..20f7f7a74f5 100644
@@ -28,7 +28,6 @@
 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
 /* Board and environment settings */
-#define CONFIG_MXC_UART_BASE		UART3_BASE_ADDR
 #define CONFIG_HOSTNAME			"kontron-mx8mm"
 
 #ifdef CONFIG_USB_EHCI_HCD
#21 lore raw

PATCH 11/15 imx: imx8mn_bsh_smm_s2: drop CONFIG_MXC_UART_BASE

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

CONFIG_DM_SERIAL is enabled, this macro not needed.

---
 include/configs/imx8mn_bsh_smm_s2_common.h | 2 --
 1 file changed, 2 deletions(-)
include/configs/imx8mn_bsh_smm_s2_common.h +0 -2
index 6387576c2da..57be38d9433 100644
@@ -45,8 +45,6 @@
 #define CONFIG_SYS_SDRAM_BASE		0x40000000
 #define PHYS_SDRAM			0x40000000
 
-#define CONFIG_MXC_UART_BASE		UART4_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		SZ_2K
 #define CONFIG_SYS_MAXARGS		64
Signature · 1 line
2.36.0
Reviewed-by on v1 11/15
#22 lore raw

Re: [PATCH 11/15] imx: imx8mn_bsh_smm_s2: drop CONFIG_MXC_UART_BASE

Hi

Il sab 30 apr 2022, 14:02 Peng Fan (OSS) <[email protected]> ha scritto:

Quoted 24 lines

From: Peng Fan <[email protected]>

CONFIG_DM_SERIAL is enabled, this macro not needed.

---
 include/configs/imx8mn_bsh_smm_s2_common.h | 2 --
 1 file changed, 2 deletions(-)
include/configs/imx8mn_bsh_smm_s2_common.h +0 -3
index 6387576c2da..57be38d9433 100644
@@ -45,8 +45,6 @@
 #define CONFIG_SYS_SDRAM_BASE          0x40000000
 #define PHYS_SDRAM                     0x40000000
 
-#define CONFIG_MXC_UART_BASE           UART4_BASE_ADDR
-
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE              SZ_2K
 #define CONFIG_SYS_MAXARGS             64
--
Quoted 2 lines

2.36.0

Thank you

Quoted 1 line
#23 lore raw

Re: [PATCH 11/15] imx: imx8mn_bsh_smm_s2: drop CONFIG_MXC_UART_BASE

In reply to Peng Fan (OSS)

Hi Stefano,

Quoted 3 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

CONFIG_DM_SERIAL is enabled, this macro not needed.

I squashed this patch to

"[PATCH V2] imx: drop CONFIG_MXC_UART_BASE"

Thanks,
Peng.

Quoted 20 lines
---
  include/configs/imx8mn_bsh_smm_s2_common.h | 2 --
  1 file changed, 2 deletions(-)
include/configs/imx8mn_bsh_smm_s2_common.h +0 -2
index 6387576c2da..57be38d9433 100644
@@ -45,8 +45,6 @@
  #define CONFIG_SYS_SDRAM_BASE		0x40000000
  #define PHYS_SDRAM			0x40000000
 
-#define CONFIG_MXC_UART_BASE		UART4_BASE_ADDR
-
  /* Monitor Command Prompt */
  #define CONFIG_SYS_CBSIZE		SZ_2K
  #define CONFIG_SYS_MAXARGS		64
#24 lore raw

PATCH 12/15 imx: dts: move common changes to imx8mq-u-boot.dtsi

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Move some common changes to imx8mq-u-boot.dtsi, so others could reuse it

---
 arch/arm/dts/imx8mq-evk-u-boot.dtsi | 24 ------------------------
 arch/arm/dts/imx8mq-u-boot.dtsi     | 24 ++++++++++++++++++++++++
 2 files changed, 24 insertions(+), 24 deletions(-)
arch/arm/dts/imx8mq-evk-u-boot.dtsi +0 -24
index 919c1f66d38..67da69a2eb3 100644
@@ -2,30 +2,6 @@
 
 #include "imx8mq-u-boot.dtsi"
 
-&{/soc@0} {
-	u-boot,dm-spl;
-};
-
-&{/soc@0/bus@30000000} {
-	u-boot,dm-spl;
-};
-
-&{/soc@0/bus@30400000} {
-	u-boot,dm-spl;
-};
-
-&{/soc@0/bus@30800000} {
-	u-boot,dm-spl;
-};
-
-&{/soc@0/bus@32c00000} {
-	u-boot,dm-spl;
-};
-
-&iomuxc {
-	u-boot,dm-spl;
-};
-
 &pinctrl_uart1 {
 	u-boot,dm-spl;
 };
arch/arm/dts/imx8mq-u-boot.dtsi +24 -0
index 1dc060ce0c2..912a3d4a356 100644
@@ -10,6 +10,30 @@
 
 };
 
+&{/soc@0} {
+	u-boot,dm-spl;
+};
+
+&{/soc@0/bus@30000000} {
+	u-boot,dm-spl;
+};
+
+&{/soc@0/bus@30400000} {
+	u-boot,dm-spl;
+};
+
+&{/soc@0/bus@30800000} {
+	u-boot,dm-spl;
+};
+
+&{/soc@0/bus@32c00000} {
+	u-boot,dm-spl;
+};
+
+&iomuxc {
+	u-boot,dm-spl;
+};
+
 &binman {
 	u-boot-spl-ddr {
 		align = <4>;
Signature · 1 line
2.36.0
#25 lore raw

PATCH 13/15 imx: imx8mq-cm: enable CONFIG_DM_SERIAL

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Marked related nodes as u-boot,dm-spl for serial driver model Enable CONFIG_DM_SERIAL

---
 arch/arm/dts/imx8mq-cm-u-boot.dtsi | 8 ++++++++
 configs/imx8mq_cm_defconfig        | 1 +
 2 files changed, 9 insertions(+)
arch/arm/dts/imx8mq-cm-u-boot.dtsi +8 -0
index 476a8e3dba2..e2f4b0e740d 100644
@@ -9,6 +9,14 @@
 	};
 };
 
+&pinctrl_uart1 {
+	u-boot,dm-spl;
+};
+
+&uart1 {
+	u-boot,dm-spl;
+};
+
 &binman {
 	 u-boot-spl-ddr {
 		filename = "u-boot-spl-ddr.bin";
configs/imx8mq_cm_defconfig +1 -0
index 1cca21ec55a..8e024604378 100644
@@ -78,6 +78,7 @@ CONFIG_DM_PMIC_BD71837=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
Signature · 1 line
2.36.0
#26 lore raw

PATCH 14/15 imx: imx8mq-pico: enable CONFIG_DM_SERIAL

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Marked related nodes as u-boot,dm-spl for serial driver model Enable CONFIG_DM_SERIAL

---
 arch/arm/dts/imx8mq-pico-pi-u-boot.dtsi | 9 +++++++++
 configs/pico-imx8mq_defconfig           | 1 +
 2 files changed, 10 insertions(+)
 create mode 100644 arch/arm/dts/imx8mq-pico-pi-u-boot.dtsi
arch/arm/dts/imx8mq-pico-pi-u-boot.dtsi new file +9 -0
new file mode 100644
index 00000000000..9537aedf29e
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+&pinctrl_uart1 {
+	u-boot,dm-spl;
+};
+
+&uart1 {
+	u-boot,dm-spl;
+};
configs/pico-imx8mq_defconfig +1 -0
index 1b0d12cf8d4..91aca29e830 100644
@@ -83,5 +83,6 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_SPL_POWER_I2C=y
 CONFIG_DM_RESET=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_DM_THERMAL=y
Signature · 1 line
2.36.0
#27 lore raw

PATCH 15/15 imx: imx8mq-phandle: enable CONFIG_DM_SERIAL

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Marked related nodes as u-boot,dm-spl for serial driver model Enable CONFIG_DM_SERIAL

---
 arch/arm/dts/imx8mq-phanbell-u-boot.dtsi | 8 ++++++++
 configs/imx8mq_phanbell_defconfig        | 1 +
 2 files changed, 9 insertions(+)
arch/arm/dts/imx8mq-phanbell-u-boot.dtsi +8 -0
index a65a942ee7a..8d6f3058295 100644
@@ -5,3 +5,11 @@
 &reg_usdhc2_vmmc {
 	u-boot,off-on-delay-us = <20000>;
 };
+
+&uart1 {
+	u-boot,dm-spl;
+};
+
+&pinctrl_uart1 {
+	u-boot,dm-spl;
+};
configs/imx8mq_phanbell_defconfig +1 -0
index a86311b7cc5..095e42e6ba1 100644
@@ -83,5 +83,6 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_SPL_POWER_I2C=y
 CONFIG_DM_RESET=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_DM_THERMAL=y
Signature · 1 line
2.36.0
reviewer Reviewed-by on the v1 series
#28 lore raw
In reply to Peng Fan (OSS)

Hi Peng,

Quoted 7 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

This patchset is to convert some i.MX8M boards to DM SERIAL

Note: this is based on my experience on i.MX8M*-EVK from NXP, I not have the following boards. If possible, please test.

The series looks good, thanks.

Just one minor comment on the last patch:

Quoted 8 lines

Peng Fan (15):
imx: imx8mp_rsb3720a1: convert to DM_SERIAL
imx: imx8m[m/n/p]_venice: Enable SPL_DM_SERIAL
imx: imx8mm_mx8menlo: Enable DM_SERIAL
imx: imx8m[m/n]_beacon: Enable SPL_DM_SERIAL
imx: imx8mm-cl-iot-gate: Enable DM_SERIAL
imx: imx8mm_icore: Enable SPL_DM_SERIAL
imx: imx8m[m/p]_phycore: Enable DM_SERIAL

Quoted 8 lines

imx: imx8mn_var_som: enable DM_SERIAL
imx: imx8mm_edm_sbc: Enable SPL_DM_SERIAL
imx: kontron-sl-mx8mm: enable DM_SERIAL
imx: imx8mn_bsh_smm_s2: drop CONFIG_MXC_UART_BASE
imx: dts: move common changes to imx8mq-u-boot.dtsi
imx: imx8mq-cm: enable CONFIG_DM_SERIAL
imx: imx8mq-pico: enable CONFIG_DM_SERIAL
imx: imx8mq-phandle: enable CONFIG_DM_SERIAL

In the Subject: s/phandle/phanbell