Skip to contentSkip to conversation

ARM: imx8mm: verdin-imx8mm: Rework board_early_init()

PATCH New Marek Vasut 2 participants 4 messages Apr 8, 2022 – Apr 12, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: imx8mm: verdin-imx8mm: Rework board_early_init()

Rename board_early_init_f() to board_early_init(), since this function has nothing to do with actual board_early_init_f() as used throughout U-Boot. The board_early_init() is function local to this board used to configure UART and WDT pinmux. Wrap init_uart_clk() into this function so that early UART init would be all in one place. Turn the function into __weak one, so it could be overridden in case custom carrier board uses different UART or needs custom IOMUX settings.

Cc Fabio Estevam <[email protected]>
Cc Marcel Ziswiler <[email protected]>
Cc Max Krummenacher <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 board/toradex/verdin-imx8mm/spl.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
board/toradex/verdin-imx8mm/spl.c +4 -6
index 97d6a31da15..4e6128c3314 100644
@@ -88,17 +88,17 @@ static iomux_v3_cfg_t const wdog_pads[] = {
 	IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
 };
 
-int board_early_init_f(void)
+__weak void board_early_init(void)
 {
 	struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR;
 
+	init_uart_clk(0);
+
 	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));
-
-	return 0;
 }
 
 int power_init_board(void)
@@ -140,9 +140,7 @@ void board_init_f(ulong dummy)
 
 	arch_cpu_init();
 
-	init_uart_clk(0);
-
-	board_early_init_f();
+	board_early_init();
 
 	timer_init();
 
Signature · 1 line
2.35.1
#1 lore raw

PATCH 2/2 ARM: dts: imx8mm: Add i.MX8M Mini Toradex Verdin based Menlo board

Add new board based on the Toradex Verdin iMX8M Mini SoM, the MX8Menlo. The board is a compatible replacement for i.MX53 M53Menlo and features USB, multiple UARTs, ethernet, LEDs, SD and eMMC.

Cc Fabio Estevam <[email protected]>
Cc Marcel Ziswiler <[email protected]>
Cc Max Krummenacher <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/dts/Makefile                    |   1 +
 arch/arm/dts/imx8mm-mx8menlo-u-boot.dtsi |  38 +++
 arch/arm/dts/imx8mm-mx8menlo.dts         | 325 +++++++++++++++++++++++
 arch/arm/mach-imx/imx8m/Kconfig          |   8 +
 board/menlo/mx8menlo/Kconfig             |  39 +++
 board/menlo/mx8menlo/MAINTAINERS         |   7 +
 board/menlo/mx8menlo/Makefile            |  25 ++
 board/menlo/mx8menlo/mx8menlo.c          |  56 ++++
 configs/imx8mm-mx8menlo_defconfig        | 120 +++++++++
 include/configs/imx8mm-mx8menlo.h        |  36 +++
 10 files changed, 655 insertions(+)
 create mode 100644 arch/arm/dts/imx8mm-mx8menlo-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mm-mx8menlo.dts
 create mode 100644 board/menlo/mx8menlo/Kconfig
 create mode 100644 board/menlo/mx8menlo/MAINTAINERS
 create mode 100644 board/menlo/mx8menlo/Makefile
 create mode 100644 board/menlo/mx8menlo/mx8menlo.c
 create mode 100644 configs/imx8mm-mx8menlo_defconfig
 create mode 100644 include/configs/imx8mm-mx8menlo.h
arch/arm/dts/Makefile +1 -0
index cd9a820f956..d80ebc4f26c 100644
@@ -905,6 +905,7 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
 	imx8mm-icore-mx8mm-edimm2.2.dtb \
 	imx8mm-kontron-n801x-s.dtb \
 	imx8mm-kontron-n801x-s-lvds.dtb \
+	imx8mm-mx8menlo.dtb \
 	imx8mm-venice.dtb \
 	imx8mm-venice-gw71xx-0x.dtb \
 	imx8mm-venice-gw72xx-0x.dtb \
arch/arm/dts/imx8mm-mx8menlo-u-boot.dtsi new file +38 -0
new file mode 100644
index 00000000000..b87cef9bf99
@@ -0,0 +1,38 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * Copyright 2021-2022 Marek Vasut <[email protected]>
+ */
+#include "imx8mm-verdin-u-boot.dtsi"
+
+/ {
+	chosen {
+		stdout-path = &uart2;
+	};
+
+	aliases {
+		/delete-property/ eeprom1;
+		/delete-property/ eeprom2;
+		usbphy0 = &usbphynop1;
+		usbphy1 = &usbphynop2;
+	};
+};
+
+&i2c4 {
+	/delete-node/ codec@1a;
+};
+
+&pinctrl_uart1 {
+	/delete-property/ u-boot,dm-spl;
+};
+
+&pinctrl_uart2 {
+	u-boot,dm-spl;
+};
+
+&uart1 {
+	/delete-property/ u-boot,dm-spl;
+};
+
+&uart2 {
+	u-boot,dm-spl;
+};
arch/arm/dts/imx8mm-mx8menlo.dts new file +325 -0

325 lines not on this page · raw message

arch/arm/mach-imx/imx8m/Kconfig +8 -0
index fae70499953..2b3c7bb9afd 100644
@@ -71,6 +71,13 @@ config TARGET_IMX8MM_ICORE_MX8MM
 	  * i.Core MX8M Mini needs to mount on top of this Carrier board
 	    for creating complete i.Core MX8M Mini C.TOUCH 2.0 board.
 
+config TARGET_IMX8MM_MX8MENLO
+	bool "Support i.MX8M Mini MX8Menlo board based on Toradex Verdin SoM"
+	select BINMAN
+	select IMX8MM
+	select SUPPORT_SPL
+	select IMX8M_LPDDR4
+
 config TARGET_IMX8MM_VENICE
 	bool "Support Gateworks Venice iMX8M Mini module"
 	select BINMAN
@@ -218,6 +225,7 @@ source "board/gateworks/venice/Kconfig"
 source "board/google/imx8mq_phanbell/Kconfig"
 source "board/kontron/pitx_imx8m/Kconfig"
 source "board/kontron/sl-mx8mm/Kconfig"
+source "board/menlo/mx8menlo/Kconfig"
 source "board/phytec/phycore_imx8mm/Kconfig"
 source "board/phytec/phycore_imx8mp/Kconfig"
 source "board/ronetix/imx8mq-cm/Kconfig"
board/menlo/mx8menlo/Kconfig new file +39 -0
new file mode 100644
index 00000000000..51d0ee355eb
@@ -0,0 +1,39 @@
+if TARGET_IMX8MM_MX8MENLO
+
+config SYS_BOARD
+	default "mx8menlo"
+
+config SYS_VENDOR
+	default "menlo"
+
+config SYS_CONFIG_NAME
+	default "imx8mm-mx8menlo"
+
+config TDX_CFG_BLOCK
+	default y
+
+config TDX_CFG_BLOCK_EXTRA
+	default y
+
+config TDX_HAVE_MMC
+	default y
+
+config TDX_HAVE_EEPROM_EXTRA
+	default y
+
+config TDX_CFG_BLOCK_DEV
+	default "0"
+
+config TDX_CFG_BLOCK_PART
+	default "1"
+
+# Toradex config block in eMMC, at the end of 1st "boot sector"
+config TDX_CFG_BLOCK_OFFSET
+	default "-512"
+
+config IMX_CONFIG
+	default "board/toradex/verdin-imx8mm/imximage.cfg"
+
+source "board/toradex/common/Kconfig"
+
+endif
board/menlo/mx8menlo/MAINTAINERS new file +7 -0
new file mode 100644
index 00000000000..09e6aef6c3e
@@ -0,0 +1,7 @@
+MX8MENLO BOARD
+M:	Marek Vasut <[email protected]>
+M:	Olaf Mandel <[email protected]>
+S:	Maintained
+F:	board/menlo/mx8menlo/
+F:	include/configs/imx8mm-mx8menlo.h
+F:	configs/imx8mm-mx8menlo_defconfig
board/menlo/mx8menlo/Makefile new file +25 -0
new file mode 100644
index 00000000000..fd5ec826336
@@ -0,0 +1,25 @@
+#
+# Menlosystems MX8Menlo
+# Copyright (C) 2021-2022 Marek Vasut <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= mx8menlo.o
+
+obj-y += ../../toradex/verdin-imx8mm/verdin-imx8mm.o
+
+ifdef CONFIG_SPL_BUILD
+obj-y += ../../toradex/verdin-imx8mm/spl.o
+obj-$(CONFIG_IMX8M_LPDDR4) += ../../toradex/verdin-imx8mm/lpddr4_timing.o
+endif
+
+# Common for all Toradex modules
+ifeq ($(CONFIG_SPL_BUILD),y)
+# Necessary to create built-in.o
+obj- := __dummy__.o
+else
+obj-$(CONFIG_TDX_CFG_BLOCK) += ../../toradex/common/tdx-cfg-block.o
+obj-y += ../../toradex/common/tdx-common.o
+obj-y += ../../toradex/common/tdx-eeprom.o
+endif
board/menlo/mx8menlo/mx8menlo.c new file +56 -0

56 lines not on this page · raw message

configs/imx8mm-mx8menlo_defconfig new file +120 -0

120 lines not on this page · raw message

include/configs/imx8mm-mx8menlo.h new file +36 -0
new file mode 100644
index 00000000000..fd1831622f0
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2021-2022 Marek Vasut <[email protected]>
+ */
+
+#ifndef __IMX8MM_MX8MENLO_H
+#define __IMX8MM_MX8MENLO_H
+
+#include <configs/verdin-imx8mm.h>
+
+/* Custom initial environment variables */
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#define CONFIG_EXTRA_ENV_SETTINGS					\
+	BOOTENV								\
+	MEM_LAYOUT_ENV_SETTINGS						\
+	"devtype=mmc\0"							\
+	"devnum=1\0"							\
+	"distro_bootpart=1\0"						\
+	"altbootcmd="							\
+		"mmc partconf 0 mmcpart ; "				\
+		"if test ${mmcpart} -eq 1 ; then "			\
+			"mmc partconf 0 1 2 0 ; "			\
+		"else "							\
+			"mmc partconf 0 1 1 0 ; "			\
+		"fi ; "							\
+		"boot\0"						\
+	"boot_file=fitImage\0"						\
+	"console=ttymxc1\0"						\
+	"fdt_addr=0x43000000\0"						\
+	"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.35.1
#2 lore raw

PATCH 2/2 ARM: dts: imx8mm: Add i.MX8M Mini Toradex Verdin based Menlo board

Quoted 9 lines

Add new board based on the Toradex Verdin iMX8M Mini SoM, the MX8Menlo. The board is a compatible replacement for i.MX53 M53Menlo and features USB, multiple UARTs, ethernet, LEDs, SD and eMMC.

Cc Fabio Estevam <[email protected]>
Cc Marcel Ziswiler <[email protected]>
Cc Max Krummenacher <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#3 lore raw

PATCH 1/2 ARM: imx8mm: verdin-imx8mm: Rework board_early_init()

In reply to Marek Vasut
Quoted 7 lines

Rename board_early_init_f() to board_early_init(), since this function has nothing to do with actual board_early_init_f() as used throughout U-Boot. The board_early_init() is function local to this board used to configure UART and WDT pinmux. Wrap init_uart_clk() into this function so that early UART init would be all in one place. Turn the function into __weak one, so it could be overridden in case custom carrier board uses different UART or needs custom IOMUX settings.

Quoted 6 lines
Cc Fabio Estevam <[email protected]>
Cc Marcel Ziswiler <[email protected]>
Cc Max Krummenacher <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================