Skip to contentSkip to conversation

ARM: dts: imx: Add support for Data Modul i.MX8M Mini eDM SBC

PATCH Superseded Marek Vasut 2 participants 2 messages Feb 21, 2022 – Feb 26, 2022

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: imx: Add support for Data Modul i.MX8M Mini eDM SBC

Add support for Data Modul i.MX8M Mini eDM SBC board. This is an evaluation board for various custom display units. Currently supported are serial console, ethernet, eMMC, SD, SPI NOR, USB host and USB OTG.

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/dts/Makefile                         |    1 +
 .../dts/imx8mm-data-modul-edm-sbc-u-boot.dtsi |  116 ++
 arch/arm/dts/imx8mm-data-modul-edm-sbc.dts    |  996 +++++++++
 arch/arm/mach-imx/imx8m/Kconfig               |    8 +
 board/data_modul/imx8mm_edm_sbc/Kconfig       |   12 +
 board/data_modul/imx8mm_edm_sbc/MAINTAINERS   |    8 +
 board/data_modul/imx8mm_edm_sbc/Makefile      |   13 +
 board/data_modul/imx8mm_edm_sbc/common.c      |   37 +
 .../imx8mm_data_modul_edm_sbc.c               |   91 +
 board/data_modul/imx8mm_edm_sbc/imximage.cfg  |    8 +
 .../data_modul/imx8mm_edm_sbc/lpddr4_timing.h |   14 +
 .../imx8mm_edm_sbc/lpddr4_timing_2G_32.c      | 1845 +++++++++++++++++
 .../imx8mm_edm_sbc/lpddr4_timing_4G_32.c      | 1842 ++++++++++++++++
 board/data_modul/imx8mm_edm_sbc/spl.c         |  163 ++
 configs/imx8mm_data_modul_edm_sbc_defconfig   |  229 ++
 include/configs/imx8mm_data_modul_edm_sbc.h   |  134 ++
 16 files changed, 5517 insertions(+)
 create mode 100644 arch/arm/dts/imx8mm-data-modul-edm-sbc-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mm-data-modul-edm-sbc.dts
 create mode 100644 board/data_modul/imx8mm_edm_sbc/Kconfig
 create mode 100644 board/data_modul/imx8mm_edm_sbc/MAINTAINERS
 create mode 100644 board/data_modul/imx8mm_edm_sbc/Makefile
 create mode 100644 board/data_modul/imx8mm_edm_sbc/common.c
 create mode 100644 board/data_modul/imx8mm_edm_sbc/imx8mm_data_modul_edm_sbc.c
 create mode 100644 board/data_modul/imx8mm_edm_sbc/imximage.cfg
 create mode 100644 board/data_modul/imx8mm_edm_sbc/lpddr4_timing.h
 create mode 100644 board/data_modul/imx8mm_edm_sbc/lpddr4_timing_2G_32.c
 create mode 100644 board/data_modul/imx8mm_edm_sbc/lpddr4_timing_4G_32.c
 create mode 100644 board/data_modul/imx8mm_edm_sbc/spl.c
 create mode 100644 configs/imx8mm_data_modul_edm_sbc_defconfig
 create mode 100644 include/configs/imx8mm_data_modul_edm_sbc.h
arch/arm/dts/Makefile +1 -0
index 960f1a9fd4d..ca546b31fb6 100644
@@ -898,6 +898,7 @@ dtb-$(CONFIG_ARCH_IMX8ULP) += \
 	imx8ulp-evk.dtb
 
 dtb-$(CONFIG_ARCH_IMX8M) += \
+	imx8mm-data-modul-edm-sbc.dtb \
 	imx8mm-evk.dtb \
 	imx8mm-icore-mx8mm-ctouch2.dtb \
 	imx8mm-icore-mx8mm-edimm2.2.dtb \
arch/arm/dts/imx8mm-data-modul-edm-sbc-u-boot.dtsi new file +116 -0

116 lines not on this page · raw message

arch/arm/dts/imx8mm-data-modul-edm-sbc.dts new file +996 -0

996 lines not on this page · raw message

arch/arm/mach-imx/imx8m/Kconfig +8 -0
index fae70499953..7f09d7b26a8 100644
@@ -46,6 +46,13 @@ config TARGET_IMX8MQ_PHANBELL
 	select IMX8MQ
 	select IMX8M_LPDDR4
 
+config TARGET_IMX8MM_DATA_MODUL_EDM_SBC
+	bool "Data Modul eDM SBC i.MX8M Mini"
+	select BINMAN
+	select IMX8MM
+	select IMX8M_LPDDR4
+	select SUPPORT_SPL
+
 config TARGET_IMX8MM_EVK
 	bool "imx8mm LPDDR4 EVK board"
 	select BINMAN
@@ -209,6 +216,7 @@ source "board/advantech/imx8mp_rsb3720a1/Kconfig"
 source "board/beacon/imx8mm/Kconfig"
 source "board/beacon/imx8mn/Kconfig"
 source "board/compulab/imx8mm-cl-iot-gate/Kconfig"
+source "board/data_modul/imx8mm_edm_sbc/Kconfig"
 source "board/engicam/imx8mm/Kconfig"
 source "board/freescale/imx8mq_evk/Kconfig"
 source "board/freescale/imx8mm_evk/Kconfig"
board/data_modul/imx8mm_edm_sbc/Kconfig new file +12 -0
new file mode 100644
index 00000000000..df9871c2240
@@ -0,0 +1,12 @@
+if TARGET_IMX8MM_DATA_MODUL_EDM_SBC
+
+config SYS_BOARD
+	default "imx8mm_edm_sbc"
+
+config SYS_VENDOR
+	default "data_modul"
+
+config SYS_CONFIG_NAME
+	default "imx8mm_data_modul_edm_sbc"
+
+endif
board/data_modul/imx8mm_edm_sbc/MAINTAINERS new file +8 -0
new file mode 100644
index 00000000000..72659c081e2
@@ -0,0 +1,8 @@
+Data Modul eDM SBC i.MX8M Mini
+M:	Marek Vasut <[email protected]>
+S:	Maintained
+F:	arch/arm/dts/imx8mm-data-modul-edm-sbc.dts
+F:	arch/arm/dts/imx8mm-data-modul-edm-sbc-u-boot.dtsi
+F:	board/data_modul/imx8mm_data_modul_edm_sbc/
+F:	configs/imx8mm_data_modul_edm_sbc_defconfig
+F:	include/configs/imx8mm_data_modul_edm_sbc.h
board/data_modul/imx8mm_edm_sbc/Makefile new file +13 -0
new file mode 100644
index 00000000000..eaba85d65b8
@@ -0,0 +1,13 @@
+#
+# Copyright (C) 2022 Marek Vasut <[email protected]>
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o lpddr4_timing_2G_32.o lpddr4_timing_4G_32.o
+else
+obj-y += imx8mm_data_modul_edm_sbc.o
+endif
+
+obj-y += common.o
board/data_modul/imx8mm_edm_sbc/common.c new file +37 -0
new file mode 100644
index 00000000000..713f789da67
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2022 Marek Vasut <[email protected]>
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm-generic/gpio.h>
+
+#include "lpddr4_timing.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+u8 dmo_get_memcfg(void)
+{
+	struct gpio_desc gpio[4];
+	u8 memcfg = 0;
+	ofnode node;
+	int i, ret;
+
+	node = ofnode_path("/config");
+	if (!ofnode_valid(node)) {
+		printf("%s: no /config node?\n", __func__);
+		return BIT(2) | BIT(0);
+	}
+
+	ret = gpio_request_list_by_name_nodev(node,
+					      "dmo,ram-coding-gpios",
+					      gpio, ARRAY_SIZE(gpio),
+					      GPIOD_IS_IN);
+	for (i = 0; i < ret; i++)
+		memcfg |= !!dm_gpio_get_value(&(gpio[i])) << i;
+
+	gpio_free_list_nodev(gpio, ret);
+
+	return memcfg;
+}
board/data_modul/imx8mm_edm_sbc/imx8mm_data_modul_edm_sbc.c new file +91 -0

91 lines not on this page · raw message

board/data_modul/imx8mm_edm_sbc/imximage.cfg new file +8 -0
new file mode 100644
index 00000000000..fa0b618128a
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2019 NXP
+ */
+
+FIT
+BOOT_FROM	sd
+LOADER		u-boot-spl-ddr.bin	0x7E1000
board/data_modul/imx8mm_edm_sbc/lpddr4_timing.h new file +14 -0
new file mode 100644
index 00000000000..1fab9b14051
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2022 Marek Vasut <[email protected]>
+ */
+
+#ifndef __LPDDR4_TIMING_H__
+#define __LPDDR4_TIMING_H__
+
+extern struct dram_timing_info dmo_imx8mm_sbc_dram_timing_16_32;
+extern struct dram_timing_info dmo_imx8mm_sbc_dram_timing_32_32;
+
+u8 dmo_get_memcfg(void);
+
+#endif /* __LPDDR4_TIMING_H__ */
board/data_modul/imx8mm_edm_sbc/lpddr4_timing_2G_32.c new file +1845 -0

1,678 lines not on this page · raw message

board/data_modul/imx8mm_edm_sbc/lpddr4_timing_4G_32.c new file +1842 -0

1,842 lines not on this page · raw message

board/data_modul/imx8mm_edm_sbc/spl.c new file +163 -0

163 lines not on this page · raw message

configs/imx8mm_data_modul_edm_sbc_defconfig new file +229 -0

229 lines not on this page · raw message

include/configs/imx8mm_data_modul_edm_sbc.h new file +134 -0

134 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.34.1

Part of the diff is not shown here. View the raw message.

reviewer Reviewed-by on v1 1/1
#1 lore raw

Hi Marek,

Quoted 10 lines · Marek Vasut

Add support for Data Modul i.MX8M Mini eDM SBC board. This is an evaluation board for various custom display units. Currently supported are serial console, ethernet, eMMC, SD, SPI NOR, USB host and USB OTG.

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>

This looks good: