imx8m: convert to DM_SERIAL
Subsystems (2)
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
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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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.
Movepreloader_console_initafterspl_early_initto make sure driver model work.Signed-off-by Peng Fan <[email protected]>--- 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@@ -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@@ -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=yconfigs/imx8mn_venice_defconfig +0
-1@@ -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=yconfigs/imx8mp_venice_defconfig +0
-1@@ -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=yinclude/configs/imx8mm_venice.h +0
-3@@ -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 64include/configs/imx8mn_venice.h +0
-3@@ -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 64include/configs/imx8mp_venice.h +0
-4@@ -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
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.
Movepreloader_console_initafterspl_early_initto make sure driver model work.Signed-off-by Peng Fan <[email protected]>--- 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@@ -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@@ -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=yconfigs/imx8mn_venice_defconfig +0
-1@@ -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=yconfigs/imx8mp_venice_defconfig +0
-1@@ -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=yinclude/configs/imx8mm_venice.h +0
-3@@ -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 64include/configs/imx8mn_venice.h +0
-3@@ -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 64include/configs/imx8mp_venice.h +0
-4@@ -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.
Acked-by Tim Harvey <[email protected]>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
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
@@ -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
@@ -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
@@ -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
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.Signed-off-by Peng Fan <[email protected]>--- 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@@ -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 ?
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.Signed-off-by Peng Fan <[email protected]>--- 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@@ -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]/
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.Signed-off-by Peng Fan <[email protected]>--- 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@@ -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 ?
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.Signed-off-by Peng Fan <[email protected]>--- 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@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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.
Movepreloader_console_initafterspl_initto make sure driver model work.
Thanks for doing this!
Quoted 1 line
Quoted 171 lines
Signed-off-by Peng Fan <[email protected]>--- 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@@ -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@@ -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@@ -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=yconfigs/imx8mn_beacon_2g_defconfig +0
-1@@ -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=yconfigs/imx8mn_beacon_defconfig +0
-1@@ -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=yinclude/configs/imx8mm_beacon.h +0
-2@@ -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 64include/configs/imx8mn_beacon.h +0
-3@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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.
Movepreloader_console_initafterspl_early_initto make sure driver model work.
thank you for the patch.
Works for phyCORE-i.MX8MM and phyCORE-i.MX8MP.
Regards,
Teresa
Quoted 150 lines
Signed-off-by Peng Fan <[email protected]>--- 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@@ -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@@ -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_tconst 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
indexba5833f7060..9da222afc54100644configs/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=yconfigs/phycore- renamed from configs/phycore-imx8mp_defconfig +0
-0
imx8mp_defconfig
index86d0f4df7f6..a851b1bdccb100644configs/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=yinclude/configs/phycore_imx8mm.h +0
-3@@ -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 64include/configs/phycore_imx8mp.h +0
-3@@ -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
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
@@ -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
@@ -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
@@ -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
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.
Movepreloader_console_initafterspl_initto make sure driver model work.
Quoted 6 lines
Signed-off-by Peng Fan <[email protected]>--- 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!
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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
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.
Movepreloader_console_initafterspl_initto make sure driver model work.Signed-off-by Peng Fan <[email protected]>
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@@ -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@@ -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=yinclude/configs/kontron-sl-mx8mm.h +0
-1@@ -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
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
@@ -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
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_SERIALis enabled, this macro not needed.Signed-off-by Peng Fan <[email protected]>--- include/configs/imx8mn_bsh_smm_s2_common.h | 2 -- 1 file changed, 2 deletions(-)include/configs/imx8mn_bsh_smm_s2_common.h +0
-3@@ -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
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_SERIALis enabled, this macro not needed.
I squashed this patch to
"[PATCH V2] imx: drop CONFIG_MXC_UART_BASE"
Thanks,
Peng.
Quoted 20 lines
Signed-off-by Peng Fan <[email protected]>--- include/configs/imx8mn_bsh_smm_s2_common.h | 2 -- 1 file changed, 2 deletions(-)include/configs/imx8mn_bsh_smm_s2_common.h +0
-2@@ -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
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
@@ -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
@@ -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
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
@@ -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
@@ -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
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
@@ -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
@@ -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
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
@@ -5,3 +5,11 @@ ®_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
@@ -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
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 toDM_SERIAL
imx: imx8m[m/n/p]_venice: EnableSPL_DM_SERIAL
imx:imx8mm_mx8menlo: EnableDM_SERIAL
imx: imx8m[m/n]_beacon: EnableSPL_DM_SERIAL
imx: imx8mm-cl-iot-gate: EnableDM_SERIAL
imx:imx8mm_icore: EnableSPL_DM_SERIAL
imx: imx8m[m/p]_phycore: EnableDM_SERIAL
Quoted 8 lines
imx:
imx8mn_var_som: enableDM_SERIAL
imx:imx8mm_edm_sbc: EnableSPL_DM_SERIAL
imx: kontron-sl-mx8mm: enableDM_SERIAL
imx:imx8mn_bsh_smm_s2: dropCONFIG_MXC_UART_BASE
imx: dts: move common changes toimx8mq-u-boot.dtsi
imx: imx8mq-cm: enableCONFIG_DM_SERIAL
imx: imx8mq-pico: enableCONFIG_DM_SERIAL
imx: imx8mq-phandle: enableCONFIG_DM_SERIAL
In the Subject: s/phandle/phanbell