Skip to contentSkip to conversation

board: avnet: Add imx8mm sm2s SoM reference board

PATCH Superseded Michael Trimarchi 1 participant 1 message Jan 10, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: avnet: Add imx8mm sm2s SoM reference board

https://www.avnet.com/wps/portal/integrated/products/embedded-boards/smarc-modules/

- Single, Dual or Quad core ARM Cortex-A53 Applications Processor up to 1.8GHz
- ARM Cortex-M4 Real Time Processor at 400MHz
- Vivante GC NanoUltra 2D/3D Graphics Processor
1080p60 H.265 decode, 1080p60 H.264 encode (VPU not available on ”Mini Lite“)
- Up to 4GB LPDDR4 SDRAM
- Up to 64GB eMMC Flash
- Dual-channel LVDS / Dual MIPI-DSI x4 (optional)
- MIPI CSI-2 Camera Interface
- PCI Express x1 Gen. 2

- 4x USB 2.0 Host interface
- 1x USB 2.0 Host/Device interface
- Gigabit Ethernet
- Wireless Module (optional)
- Micro SD Card Socket (optional)
- MMC/SD/SDIO interface
- 2x CAN interface (optional)
- 2x I2S Audio Interface
- UART, SPI, I2C
- SMARC 2.0 Compliant

Peripheral supported in bootloader

- console uart1
- mmc
- emmc
- eeprom and memory configuration according to the specific one
- create fdt_file compatible with msc/avnet yocto distribuition

---
 arch/arm/dts/Makefile                         |    1 +
 arch/arm/dts/imx8mm-sm2s-u-boot.dtsi          |  127 ++
 arch/arm/dts/imx8mm-sm2s.dts                  |   16 +
 arch/arm/dts/imx8mm-sm2s.dtsi                 |  317 +++
 arch/arm/mach-imx/imx8m/Kconfig               |    7 +
 board/avnet/common/Kconfig                    |   13 +
 board/avnet/common/Makefile                   |   24 +
 board/avnet/common/boardinfo.c                |  200 ++
 board/avnet/common/boardinfo.h                |  105 +
 board/avnet/common/i2c_eeprom.c               |  156 ++
 board/avnet/common/i2c_eeprom.h               |   19 +
 board/avnet/common/mmc.c                      |   49 +
 board/avnet/common/mx8m_common.c              |   26 +
 board/avnet/common/mx8m_common.h              |   11 +
 board/avnet/imx8mm_sm2s/Kconfig               |   12 +
 board/avnet/imx8mm_sm2s/MAINTAINERS           |    7 +
 board/avnet/imx8mm_sm2s/Makefile              |   14 +
 board/avnet/imx8mm_sm2s/README                |   37 +
 board/avnet/imx8mm_sm2s/boardinfo.c           |   52 +
 board/avnet/imx8mm_sm2s/ddr_timings.h         |   21 +
 board/avnet/imx8mm_sm2s/imx8mm_sm2s.c         |  156 ++
 ...mt53d512m32d2ds_1gib_2chn_1cs_dv1_timing.c | 1846 ++++++++++++++++
 ...mt53d512m32d2ds_2gib_2chn_2cs_dv1_timing.c | 1846 ++++++++++++++++
 ...mt53d512m32d2ds_2gib_2chn_2cs_dv2_timing.c | 1849 +++++++++++++++++
 board/avnet/imx8mm_sm2s/spl.c                 |  239 +++
 configs/imx8mm_sm2s_defconfig                 |   93 +
 include/configs/imx8mm_sm2s.h                 |  162 ++
 27 files changed, 7405 insertions(+)
 create mode 100644 arch/arm/dts/imx8mm-sm2s-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mm-sm2s.dts
 create mode 100644 arch/arm/dts/imx8mm-sm2s.dtsi
 create mode 100644 board/avnet/common/Kconfig
 create mode 100644 board/avnet/common/Makefile
 create mode 100644 board/avnet/common/boardinfo.c
 create mode 100644 board/avnet/common/boardinfo.h
 create mode 100644 board/avnet/common/i2c_eeprom.c
 create mode 100644 board/avnet/common/i2c_eeprom.h
 create mode 100644 board/avnet/common/mmc.c
 create mode 100644 board/avnet/common/mx8m_common.c
 create mode 100644 board/avnet/common/mx8m_common.h
 create mode 100644 board/avnet/imx8mm_sm2s/Kconfig
 create mode 100644 board/avnet/imx8mm_sm2s/MAINTAINERS
 create mode 100644 board/avnet/imx8mm_sm2s/Makefile
 create mode 100644 board/avnet/imx8mm_sm2s/README
 create mode 100644 board/avnet/imx8mm_sm2s/boardinfo.c
 create mode 100644 board/avnet/imx8mm_sm2s/ddr_timings.h
 create mode 100644 board/avnet/imx8mm_sm2s/imx8mm_sm2s.c
 create mode 100644 board/avnet/imx8mm_sm2s/lpddr4_mt53d512m32d2ds_1gib_2chn_1cs_dv1_timing.c
 create mode 100644 board/avnet/imx8mm_sm2s/lpddr4_mt53d512m32d2ds_2gib_2chn_2cs_dv1_timing.c
 create mode 100644 board/avnet/imx8mm_sm2s/lpddr4_mt53d512m32d2ds_2gib_2chn_2cs_dv2_timing.c
 create mode 100644 board/avnet/imx8mm_sm2s/spl.c
 create mode 100644 configs/imx8mm_sm2s_defconfig
 create mode 100644 include/configs/imx8mm_sm2s.h
arch/arm/dts/Makefile +1 -0
index 0127a91a82..dccb58b41a 100644
@@ -671,6 +671,7 @@ dtb-$(CONFIG_ARCH_IMX8) += \
 
 dtb-$(CONFIG_ARCH_IMX8M) += \
 	imx8mm-evk.dtb \
+	imx8mm-sm2s.dtb \
 	imx8mn-ddr4-evk.dtb \
 	imx8mq-evk.dtb
 
arch/arm/dts/imx8mm-sm2s-u-boot.dtsi new file +127 -0

127 lines not on this page · raw message

arch/arm/dts/imx8mm-sm2s.dts new file +16 -0
new file mode 100644
index 0000000000..2e193208f0
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2020 Amarula Solutions B.V.
+ * Copyright 2019 AVNET
+ */
+
+#include "imx8mm-sm2s.dtsi"
+
+/ {
+	model = "MSC SM2S-IMX8MM";
+	compatible = "msc,sm2s-imx8mm", "fsl,imx8mm";
+
+	chosen {
+		stdout-path = &uart1;
+	};
+};
arch/arm/dts/imx8mm-sm2s.dtsi new file +317 -0

317 lines not on this page · raw message

arch/arm/mach-imx/imx8m/Kconfig +7 -0
index eb4a73b3e2..7a65266fd9 100644
@@ -34,6 +34,12 @@ config TARGET_IMX8MM_EVK
 	select SUPPORT_SPL
 	select IMX8M_LPDDR4
 
+config TARGET_IMX8MM_SM2S
+	bool "imx8mm LPDDR4 SM2S board"
+	select IMX8MM
+	select SUPPORT_SPL
+	select IMX8M_LPDDR4
+
 config TARGET_IMX8MN_EVK
 	bool "imx8mn DDR4 EVK board"
 	select IMX8MN
@@ -45,5 +51,6 @@ endchoice
 source "board/freescale/imx8mq_evk/Kconfig"
 source "board/freescale/imx8mm_evk/Kconfig"
 source "board/freescale/imx8mn_evk/Kconfig"
+source "board/avnet/imx8mm_sm2s/Kconfig"
 
 endif
board/avnet/common/Kconfig new file +13 -0
new file mode 100644
index 0000000000..6e5d09a504
@@ -0,0 +1,13 @@
+#
+# Copyright (C) 2019 AVNET Integrated, MSC Technologies GmbH
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+
+menu "MSC board/module specific features"
+
+config BOARDINFO_EEPROM
+	bool "Board information EEPROM storage"
+	default y
+	help
+	  Enable board information storage in EEPROM
board/avnet/common/Makefile new file +24 -0
new file mode 100644
index 0000000000..413c95f8d7
@@ -0,0 +1,24 @@
+#
+# Copyright (C) 2019 AVNET Integrated, MSC Technologies GmbH
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+
+MINIMAL=
+
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_INIT_MINIMAL
+MINIMAL=y
+endif
+endif
+
+ifdef MINIMAL
+# necessary to create built-in.o
+obj- := __dummy__.o
+else
+
+obj-y += i2c_eeprom.o
+obj-y += mmc.o
+obj-y += boardinfo.o
+obj-$(CONFIG_IMX8M) += mx8m_common.o
+endif
board/avnet/common/boardinfo.c new file +200 -0

200 lines not on this page · raw message

board/avnet/common/boardinfo.h new file +105 -0

105 lines not on this page · raw message

board/avnet/common/i2c_eeprom.c new file +156 -0

156 lines not on this page · raw message

board/avnet/common/i2c_eeprom.h new file +19 -0
new file mode 100644
index 0000000000..4dc4657f11
@@ -0,0 +1,19 @@
+#ifndef __MSC_I2C_EEPROM_H__
+#define __MSC_I2C_EEPROM_H__
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019 AVNET
+ */
+
+typedef struct i2c_eeprom {
+	unsigned	bus_id;
+	unsigned	dev_addr;
+	unsigned	alen;
+	unsigned	rw_blk_size;
+	unsigned	write_delay_ms;
+} i2c_eeprom_t;
+
+int i2c_eeprom_read(const i2c_eeprom_t *eeprom, unsigned offset, uchar *buffer, unsigned cnt);
+int i2c_eeprom_write(const i2c_eeprom_t *eeprom, unsigned offset, uchar *buffer, unsigned cnt);
+
+#endif /* __MSC_I2C_EEPROM_H__ */
board/avnet/common/mmc.c new file +49 -0

49 lines not on this page · raw message

board/avnet/common/mx8m_common.c new file +26 -0
new file mode 100644
index 0000000000..42dddf6ae9
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019 AVNET
+ */
+
+#include <asm/arch/sys_proto.h>
+#include "mx8m_common.h"
+
+const char* mx8m_get_plat_str(void)
+{
+	switch (get_cpu_type()) {
+	case MXC_CPU_IMX8MM:
+		return "imx8mm";
+	}
+
+	return "N/A";
+}
+
+const char* mx8m_get_proc_str(void)
+{
+	switch (get_cpu_type()) {
+	case MXC_CPU_IMX8MM:
+		return "qc";
+	}
+	return "N/A";
+}
board/avnet/common/mx8m_common.h new file +11 -0
new file mode 100644
index 0000000000..bf6e25cbc8
@@ -0,0 +1,11 @@
+#ifndef __MSC_MX8M_COMMON_H__
+#define __MSC_MX8M_COMMON_H__
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019 AVNET
+ */
+
+const char* mx8m_get_plat_str(void);
+const char* mx8m_get_proc_str(void);
+
+#endif /* __MSC_MX8M_COMMON_H__ */
board/avnet/imx8mm_sm2s/Kconfig new file +12 -0
new file mode 100644
index 0000000000..535adb351a
@@ -0,0 +1,12 @@
+if TARGET_IMX8MM_SM2S
+
+config SYS_BOARD
+	default "imx8mm_sm2s"
+
+config SYS_VENDOR
+	default "avnet"
+
+config SYS_CONFIG_NAME
+	default "imx8mm_sm2s"
+
+endif
board/avnet/imx8mm_sm2s/MAINTAINERS new file +7 -0
new file mode 100644
index 0000000000..2dc63ae26d
@@ -0,0 +1,7 @@
+i.MX8MM SM2S BOARD
+M:	Michael Trimarchi <[email protected]>
+M:	Waldemar Glensk <[email protected]>
+S:	Maintained
+F:	board/avnet/imx8mm_sm2s/
+F:	include/configs/imx8mm_sm2s.h
+F:	configs/imx8mm_sm2s_defconfig
board/avnet/imx8mm_sm2s/Makefile new file +14 -0
new file mode 100644
index 0000000000..642123169a
@@ -0,0 +1,14 @@
+#
+# Copyright (C) 2019 AVNET Integrated, MSC Technologies GmbH
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+
+obj-y += imx8mm_sm2s.o boardinfo.o
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+obj-$(CONFIG_IMX8M_LPDDR4) += lpddr4_mt53d512m32d2ds_1gib_2chn_1cs_dv1_timing.o
+obj-$(CONFIG_IMX8M_LPDDR4) += lpddr4_mt53d512m32d2ds_2gib_2chn_2cs_dv1_timing.o
+obj-$(CONFIG_IMX8M_LPDDR4) += lpddr4_mt53d512m32d2ds_2gib_2chn_2cs_dv2_timing.o
+endif
board/avnet/imx8mm_sm2s/README new file +37 -0
new file mode 100644
index 0000000000..4b628b64a0
@@ -0,0 +1,37 @@
+U-Boot for the AVNET i.MX8MM SM2S board
+
+Quick Start
+===========
+- Build the ARM Trusted firmware binary
+- Get ddr fimware
+- Build U-Boot
+- Boot
+
+Get and Build the ARM Trusted firmware
+======================================
+Note: srctree is U-Boot source directory
+Get ATF from: https://source.codeaurora.org/external/imx/imx-atf
+branch: imx_4.19.35_1.1.0
+$ make PLAT=imx8mm bl31
+$ cp build/imx8mm/release/bl31.bin $(srctree)
+
+Get the ddr and hdmi firmware
+=============================
+$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-7.9.bin
+$ chmod +x firmware-imx-7.9.bin
+$ ./firmware-imx-7.9
+$ cp firmware-imx-7.9/firmware/ddr/synopsys/lpddr4*.bin $(srctree)
+
+Build U-Boot
+============
+$ export CROSS_COMPILE=aarch64-poky-linux-
+$ make imx8mm_sm2s_defconfig
+$ export ATF_LOAD_ADDR=0x920000
+$ make flash.bin
+
+Burn the flash.bin to MicroSD card offset 33KB
+$sudo dd if=flash.bin of=/dev/sd[x] bs=1024 seek=33
+
+Boot
+====
+Set Boot switch to SD boot
board/avnet/imx8mm_sm2s/boardinfo.c new file +52 -0

52 lines not on this page · raw message

board/avnet/imx8mm_sm2s/ddr_timings.h new file +21 -0
new file mode 100644
index 0000000000..d4b39cdb27
@@ -0,0 +1,21 @@
+#ifndef SM2S_IMX8MM_DDR_TIMINGS_H
+#define SM2S_IMX8MM_DDR_TIMINGS_H
+
+/*
+ * Copyright (C) 2019 AVNET Integrated, MSC Technologies GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+extern struct dram_timing_info lpddr4_mt53d512m32d2ds_1gib_2chn_1cs_dv1_timing;
+extern struct dram_timing_info lpddr4_mt53d512m32d2ds_2gib_2chn_2cs_dv1_timing;
+extern struct dram_timing_info lpddr4_mt53d512m32d2ds_2gib_2chn_2cs_dv2_timing;
+
+#endif /* SM2S_IMX8MM_DDR_TIMINGS_H */
board/avnet/imx8mm_sm2s/imx8mm_sm2s.c new file +156 -0

156 lines not on this page · raw message

board/avnet/imx8mm_sm2s/lpddr4_mt53d512m32d2ds_1gib_2chn_1cs_dv1_timing.c new file +1846 -0

1,613 lines not on this page · raw message

board/avnet/imx8mm_sm2s/lpddr4_mt53d512m32d2ds_2gib_2chn_2cs_dv1_timing.c new file +1846 -0

1,846 lines not on this page · raw message

board/avnet/imx8mm_sm2s/lpddr4_mt53d512m32d2ds_2gib_2chn_2cs_dv2_timing.c new file +1849 -0

1,849 lines not on this page · raw message

board/avnet/imx8mm_sm2s/spl.c new file +239 -0

239 lines not on this page · raw message

configs/imx8mm_sm2s_defconfig new file +93 -0

93 lines not on this page · raw message

include/configs/imx8mm_sm2s.h new file +162 -0

162 lines not on this page · raw message

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

Signature · 1 line
2.17.1

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