Skip to contentSkip to conversation

board: emcraft: Add support for Emcraft Systems NavQ+

PATCH Superseded Gilles Talis 2 participants 3 messages Oct 25, 2024 – Oct 27, 2024

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 board: emcraft: Add support for Emcraft Systems NavQ+

The Emcraft Systems NavQ+ kit is a mobile robotics platform based on NXP i.MX8 MPlus SoC.

The following interfaces and devices are enabled:
- eMMC
- Gigabit Ethernet (through eQOS interface)
- SD-Card
- UART console

The device tree file is taken from upstream Linux Kernel through OF_UPSTREAM

---
Changes v1 --> v2:
- Removed unused usdhc properties from dtsi
- Moved to correct ethernet PHY driver (REALTEK -> ATHEROS)
- Removed empty board_late_init() function
- Moved env variables to an env file

---
 arch/arm/dts/imx8mp-navqp-u-boot.dtsi         |  110 +
 arch/arm/mach-imx/imx8m/Kconfig               |    8 +
 board/emcraft/imx8mp_navqp/Kconfig            |   15 +
 board/emcraft/imx8mp_navqp/MAINTAINERS        |    8 +
 board/emcraft/imx8mp_navqp/Makefile           |   13 +
 board/emcraft/imx8mp_navqp/imx8mp_navqp.c     |   22 +
 board/emcraft/imx8mp_navqp/imx8mp_navqp.env   |   13 +
 .../imx8mp_navqp/imximage-8mp-lpddr4.cfg      |    8 +
 board/emcraft/imx8mp_navqp/lpddr4_timing.c    | 1842 +++++++++++++++++
 board/emcraft/imx8mp_navqp/spl.c              |  132 ++
 configs/imx8mp_navqp_defconfig                |  104 +
 doc/board/emcraft/imx8mp_navqp.rst            |   65 +
 doc/board/emcraft/index.rst                   |    9 +
 include/configs/imx8mp_navqp.h                |   42 +
 14 files changed, 2391 insertions(+)
 create mode 100644 arch/arm/dts/imx8mp-navqp-u-boot.dtsi
 create mode 100644 board/emcraft/imx8mp_navqp/Kconfig
 create mode 100644 board/emcraft/imx8mp_navqp/MAINTAINERS
 create mode 100644 board/emcraft/imx8mp_navqp/Makefile
 create mode 100644 board/emcraft/imx8mp_navqp/imx8mp_navqp.c
 create mode 100644 board/emcraft/imx8mp_navqp/imx8mp_navqp.env
 create mode 100644 board/emcraft/imx8mp_navqp/imximage-8mp-lpddr4.cfg
 create mode 100644 board/emcraft/imx8mp_navqp/lpddr4_timing.c
 create mode 100644 board/emcraft/imx8mp_navqp/spl.c
 create mode 100644 configs/imx8mp_navqp_defconfig
 create mode 100644 doc/board/emcraft/imx8mp_navqp.rst
 create mode 100644 doc/board/emcraft/index.rst
 create mode 100644 include/configs/imx8mp_navqp.h
arch/arm/dts/imx8mp-navqp-u-boot.dtsi new file +110 -0
new file mode 100644
index 0000000000..fe41d81813
@@ -0,0 +1,110 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019, 2021 NXP
+ * Copyright 2024 Gilles Talis <[email protected]>
+ */
+
+#include "imx8mp-u-boot.dtsi"
+
+/ {
+	wdt-reboot {
+		compatible = "wdt-reboot";
+		wdt = <&wdog1>;
+		bootph-pre-ram;
+	};
+
+	firmware {
+		optee {
+			compatible = "linaro,optee-tz";
+			method = "smc";
+		};
+	};
+};
+
+&{/soc@0/bus@30800000/i2c@30a20000/pmic@25} {
+	bootph-all;
+};
+
+&{/soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators} {
+	bootph-all;
+};
+
+&gpio1 {
+	bootph-pre-ram;
+};
+
+&gpio2 {
+	bootph-pre-ram;
+};
+
+&gpio3 {
+	bootph-pre-ram;
+};
+
+&gpio4 {
+	bootph-pre-ram;
+};
+
+&gpio5 {
+	bootph-pre-ram;
+};
+
+&i2c1 {
+	bootph-all;
+};
+
+&pinctrl_i2c1 {
+	bootph-pre-ram;
+};
+
+&pinctrl_pmic {
+	bootph-pre-ram;
+};
+
+&pinctrl_uart2 {
+	bootph-pre-ram;
+};
+
+&pinctrl_usdhc2_gpio {
+	bootph-pre-ram;
+};
+
+&pinctrl_usdhc2 {
+	bootph-pre-ram;
+};
+
+&pinctrl_usdhc3 {
+	bootph-pre-ram;
+};
+
+&pinctrl_wdog {
+	bootph-pre-ram;
+};
+
+&reg_usdhc2_vmmc {
+	u-boot,off-on-delay-us = <20000>;
+};
+
+&reg_usdhc2_vmmc {
+	bootph-pre-ram;
+};
+
+&uart2 {
+	bootph-pre-ram;
+};
+
+&usdhc1 {
+	bootph-pre-ram;
+};
+
+&usdhc2 {
+	bootph-pre-ram;
+};
+
+&usdhc3 {
+	bootph-pre-ram;
+};
+
+&wdog1 {
+	bootph-pre-ram;
+};
arch/arm/mach-imx/imx8m/Kconfig +8 -0
index 9d1fabe91c..b254a50b09 100644
@@ -228,6 +228,13 @@ config TARGET_IMX8MP_EVK
 	select SPL_CRYPTO if SPL
 	imply OF_UPSTREAM
 
+config TARGET_IMX8MP_NAVQP
+	bool "Emcraft Systems i.MX8M Plus NavQ+ board"
+	select IMX8MP
+	select IMX8M_LPDDR4
+	select SUPPORT_SPL
+	imply OF_UPSTREAM
+
 config TARGET_IMX8MP_VENICE
 	bool "Support Gateworks Venice iMX8M Plus module"
 	select IMX8MP
@@ -358,6 +365,7 @@ source "board/compulab/imx8mm-cl-iot-gate/Kconfig"
 source "board/data_modul/imx8mm_edm_sbc/Kconfig"
 source "board/data_modul/imx8mp_edm_sbc/Kconfig"
 source "board/dhelectronics/dh_imx8mp/Kconfig"
+source "board/emcraft/imx8mp_navqp/Kconfig"
 source "board/engicam/imx8mm/Kconfig"
 source "board/engicam/imx8mp/Kconfig"
 source "board/freescale/imx8mq_evk/Kconfig"
board/emcraft/imx8mp_navqp/Kconfig new file +15 -0
new file mode 100644
index 0000000000..20b09b68c7
@@ -0,0 +1,15 @@
+if TARGET_IMX8MP_NAVQP
+
+config SYS_BOARD
+	default "imx8mp_navqp"
+
+config SYS_VENDOR
+	default "emcraft"
+
+config SYS_CONFIG_NAME
+	default "imx8mp_navqp"
+
+config IMX_CONFIG
+	default "board/emcraft/imx8mp_navqp/imximage-8mp-lpddr4.cfg"
+
+endif
board/emcraft/imx8mp_navqp/MAINTAINERS new file +8 -0
new file mode 100644
index 0000000000..d91605e461
@@ -0,0 +1,8 @@
+Emcraft Systems NavQ+ board (i.MX8M Plus)
+M:	Gilles Talis <[email protected]>
+S:	Maintained
+F:	arch/arm/dts/imx8mp-navqp-u-boot.dtsi
+F:	board/emcraft/imx8mp_navqp/
+F:	configs/imx8mp_navqp_defconfig
+F:	doc/board/emcraft/
+F:	include/configs/imx8mp_navqp.h
board/emcraft/imx8mp_navqp/Makefile new file +13 -0
new file mode 100644
index 0000000000..a5890b009e
@@ -0,0 +1,13 @@
+#
+# Copyright 2019 NXP
+# Copyright 2024 Gilles Talis <[email protected]>
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+
+obj-y += imx8mp_navqp.o
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+obj-$(CONFIG_IMX8M_LPDDR4) += lpddr4_timing.o
+endif
board/emcraft/imx8mp_navqp/imx8mp_navqp.c new file +22 -0
new file mode 100644
index 0000000000..ce6452b749
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019 NXP
+ * Copyright 2024 Gilles Talis <[email protected]>
+ */
+
+#include <miiphy.h>
+
+#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
+int board_phy_config(struct phy_device *phydev)
+{
+	if (phydev->drv->config)
+		phydev->drv->config(phydev);
+
+	return 0;
+}
+#endif
+
+int board_init(void)
+{
+	return 0;
+}
board/emcraft/imx8mp_navqp/imx8mp_navqp.env new file +13 -0
new file mode 100644
index 0000000000..a8b76574b4
@@ -0,0 +1,13 @@
+#include <config_distro_bootcmd.h>
+
+scriptaddr=CONFIG_SYS_LOAD_ADDR
+kernel_addr_r=CONFIG_SYS_LOAD_ADDR
+image=Image
+console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200
+fdt_addr_r=0x43000000
+boot_fdt=try
+fdtfile=CONFIG_DEFAULT_FDT_FILE
+initrd_addr=0x43800000
+bootm_size=0x10000000
+mmcpart=1
+mmcroot=/dev/mmcblk1p2 rootwait rw
board/emcraft/imx8mp_navqp/imximage-8mp-lpddr4.cfg new file +8 -0
new file mode 100644
index 0000000000..0a23408049
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2021, 2024 NXP
+ */
+
+ROM_VERSION	v2
+BOOT_FROM	sd
+LOADER		u-boot-spl-ddr.bin	0x920000
board/emcraft/imx8mp_navqp/lpddr4_timing.c new file +1842 -0

1,842 lines not on this page · raw message

board/emcraft/imx8mp_navqp/spl.c new file +132 -0

132 lines not on this page · raw message

configs/imx8mp_navqp_defconfig new file +104 -0

104 lines not on this page · raw message

doc/board/emcraft/imx8mp_navqp.rst new file +65 -0

65 lines not on this page · raw message

doc/board/emcraft/index.rst new file +9 -0
new file mode 100644
index 0000000000..564552cb36
@@ -0,0 +1,9 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Emcraft
+=======
+
+.. toctree::
+   :maxdepth: 2
+
+   imx8mp-navqp
include/configs/imx8mp_navqp.h new file +42 -0

42 lines not on this page · raw message

base-commit: 7036abbd5c3934059b020d5fd5bcb8b3bf3c788c

Signature · 1 line
2.43.0
reviewer
#1 lore raw

Hi Gilles,

Quoted 13 lines · Gilles Talis

The Emcraft Systems NavQ+ kit is a mobile robotics platform based on NXP i.MX8 MPlus SoC.

The following interfaces and devices are enabled:
- eMMC
- Gigabit Ethernet (through eQOS interface)
- SD-Card
- UART console

The device tree file is taken from upstream Linux Kernel through OF_UPSTREAM

Quoted 7 lines

---
Changes v1 --> v2:
- Removed unused usdhc properties from dtsi
- Moved to correct ethernet PHY driver (REALTEK -> ATHEROS)
- Removed empty board_late_init() function
- Moved env variables to an env file

This version looks better, thanks.

CI reports an error.

Warning, treated as error:
142/builds/u-boot/custodians/u-boot-imx/doc/board/emcraft/index.rst:6:toctree contains reference to nonexisting document 'board/emcraft/imx8mp-navqp'
143make[1]: *** [doc/Makefile:70: htmldocs] Error 2
144make: *** [Makefile:2445: htmldocs] Error 2

Please fix and resend.

board/emcraft/imx8mp_navqp/imx8mp_navqp.c line 15

Quoted 9 lines
board/emcraft/imx8mp_navqp/imx8mp_navqp.c new file +9 -0
+#include <miiphy.h>
+
+#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
+int board_phy_config(struct phy_device *phydev)
+{
+       if (phydev->drv->config)
+               phydev->drv->config(phydev);
+
+       return 0;

Can't board_phy_config() be removed now?

board/emcraft/imx8mp_navqp/imx8mp_navqp.env

Quoted 6 lines
board/emcraft/imx8mp_navqp/imx8mp_navqp.env new file +0 -0
new file mode 100644
index 0000000000..a8b76574b4
@@ -0,0 +1,13 @@

SPDX header is missing for this file.

board/emcraft/imx8mp_navqp/imx8mp_navqp.env line 7

Quoted 7 lines
board/emcraft/imx8mp_navqp/imx8mp_navqp.env new file +7 -0
+int board_fit_config_name_match(const char *name)
+{
+       if (is_imx8mp() &&
+           !strcmp(name, "imx8mp-navqp"))
+               return 0;
+
+       return -1;

return -EINVAL;

board/emcraft/imx8mp_navqp/imx8mp_navqp.env line 9

Quoted 2 lines
board/emcraft/imx8mp_navqp/imx8mp_navqp.env new file +2 -0
+#if defined(CONFIG_CMD_NET)
+#define CFG_FEC_MXC_PHYADDR          1

With DM, this is no longer used, right?

#2 lore raw

Hi Fabio,
thank you for the second review!

Quoted 29 lines · Fabio Estevam

Hi Gilles,

Quoted 13 lines · Gilles Talis

The Emcraft Systems NavQ+ kit is a mobile robotics platform based on NXP i.MX8 MPlus SoC.

The following interfaces and devices are enabled:
- eMMC
- Gigabit Ethernet (through eQOS interface)
- SD-Card
- UART console

The device tree file is taken from upstream Linux Kernel through OF_UPSTREAM

Quoted 7 lines

---
Changes v1 --> v2:
- Removed unused usdhc properties from dtsi
- Moved to correct ethernet PHY driver (REALTEK -> ATHEROS)
- Removed empty board_late_init() function
- Moved env variables to an env file

This version looks better, thanks.

CI reports an error.

Quoted 8 lines

Warning, treated as error:
142/builds/u-boot/custodians/u-boot-imx/doc/board/emcraft/index.rst:6:toctree contains reference to nonexisting document 'board/emcraft/imx8mp-navqp'
143make[1]: *** [doc/Makefile:70: htmldocs] Error 2
144make: *** [Makefile:2445: htmldocs] Error 2

Please fix and resend.

Good catch! I will fix this.

Quoted 12 lines

board/emcraft/imx8mp_navqp/imx8mp_navqp.c line 15

Quoted 10 lines
board/emcraft/imx8mp_navqp/imx8mp_navqp.c new file +9 -0
+#include <miiphy.h>
+
+#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
+int board_phy_config(struct phy_device *phydev)
+{
+       if (phydev->drv->config)
+               phydev->drv->config(phydev);
+
+       return 0;

Can't board_phy_config() be removed now?

Indeed. Will do.

Quoted 9 lines

board/emcraft/imx8mp_navqp/imx8mp_navqp.env

Quoted 7 lines
board/emcraft/imx8mp_navqp/imx8mp_navqp.env new file +0 -0
new file mode 100644
index 0000000000..a8b76574b4
@@ -0,0 +1,13 @@

SPDX header is missing for this file.

OK. Will do.

Quoted 10 lines

board/emcraft/imx8mp_navqp/imx8mp_navqp.env line 7

Quoted 8 lines
board/emcraft/imx8mp_navqp/imx8mp_navqp.env new file +7 -0
+int board_fit_config_name_match(const char *name)
+{
+       if (is_imx8mp() &&
+           !strcmp(name, "imx8mp-navqp"))
+               return 0;
+
+       return -1;

return -EINVAL;

OK.

Quoted 5 lines

board/emcraft/imx8mp_navqp/imx8mp_navqp.env line 9

Quoted 3 lines
board/emcraft/imx8mp_navqp/imx8mp_navqp.env new file +2 -0
+#if defined(CONFIG_CMD_NET)
+#define CFG_FEC_MXC_PHYADDR          1

With DM, this is no longer used, right?

Indeed. Will remove.