Skip to contentSkip to conversation

imx8mn_var_som: Add support for Variscite VAR-SOM-MX8M-NANO board

PATCH Superseded Ariel D'Alessandro 3 participants 6 messages Nov 16, 2021

Subsystems (3)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v3 cover imx8mn_var_som: Add support for Variscite VAR-SOM-MX8M-NANO board

Changes in v3:
* Picked device tree from kernel.
* Properly added MAINTAINERS entry.
* Removed CONFIG_SPL_BUILD anti-pattern in board config.

Changes in v2:
* Reordered dt properties alphabetically.
* Removed downstream stuff in bootargs.
* Fixed binman configuration.
* Several code styling fixes.

Ariel D'Alessandro (1):
imx8mn_var_som: Add support for Variscite VAR-SOM-MX8M-NANO board

 arch/arm/dts/Makefile                         |   1 +
 .../dts/imx8mn-var-som-symphony-u-boot.dtsi   | 256 ++++++++
 arch/arm/dts/imx8mn-var-som-symphony.dts      | 240 ++++++++
 arch/arm/dts/imx8mn-var-som.dtsi              | 547 ++++++++++++++++++
 arch/arm/mach-imx/imx8m/Kconfig               |   9 +
 board/variscite/imx8mn_var_som/Kconfig        |  17 +
 board/variscite/imx8mn_var_som/MAINTAINERS    |   7 +
 board/variscite/imx8mn_var_som/Makefile       |  12 +
 board/variscite/imx8mn_var_som/ddr4_timing.c  | 528 +++++++++++++++++
 .../variscite/imx8mn_var_som/imx8mn_var_som.c |  30 +
 .../imx8mn_var_som/imximage-8mn-ddr4.cfg      |  10 +
 board/variscite/imx8mn_var_som/spl.c          |  93 +++
 configs/imx8mn_var_som_defconfig              |  98 ++++
 include/configs/imx8mn_var_som.h              |  95 +++
 14 files changed, 1943 insertions(+)
 create mode 100644 arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mn-var-som-symphony.dts
 create mode 100644 arch/arm/dts/imx8mn-var-som.dtsi
 create mode 100644 board/variscite/imx8mn_var_som/Kconfig
 create mode 100644 board/variscite/imx8mn_var_som/MAINTAINERS
 create mode 100644 board/variscite/imx8mn_var_som/Makefile
 create mode 100644 board/variscite/imx8mn_var_som/ddr4_timing.c
 create mode 100644 board/variscite/imx8mn_var_som/imx8mn_var_som.c
 create mode 100644 board/variscite/imx8mn_var_som/imximage-8mn-ddr4.cfg
 create mode 100644 board/variscite/imx8mn_var_som/spl.c
 create mode 100644 configs/imx8mn_var_som_defconfig
 create mode 100644 include/configs/imx8mn_var_som.h
Signature · 1 line
2.30.2
#1 lore raw

PATCH v3 1/1 imx8mn_var_som: Add support for Variscite VAR-SOM-MX8M-NANO board

Add support for iMX8MN VAR-SOM-MX8M-NANO board. Enables support for:

- 1GiB DDR4 RAM
- 16 GiB eMMC
- SD card
- Gigabit ethernet
- USBOTG1 peripheral - fastboot

---
 arch/arm/dts/Makefile                         |   1 +
 .../dts/imx8mn-var-som-symphony-u-boot.dtsi   | 256 ++++++++
 arch/arm/dts/imx8mn-var-som-symphony.dts      | 240 ++++++++
 arch/arm/dts/imx8mn-var-som.dtsi              | 547 ++++++++++++++++++
 arch/arm/mach-imx/imx8m/Kconfig               |   9 +
 board/variscite/imx8mn_var_som/Kconfig        |  17 +
 board/variscite/imx8mn_var_som/MAINTAINERS    |   7 +
 board/variscite/imx8mn_var_som/Makefile       |  12 +
 board/variscite/imx8mn_var_som/ddr4_timing.c  | 528 +++++++++++++++++
 .../variscite/imx8mn_var_som/imx8mn_var_som.c |  30 +
 .../imx8mn_var_som/imximage-8mn-ddr4.cfg      |  10 +
 board/variscite/imx8mn_var_som/spl.c          |  93 +++
 configs/imx8mn_var_som_defconfig              |  98 ++++
 include/configs/imx8mn_var_som.h              |  95 +++
 14 files changed, 1943 insertions(+)
 create mode 100644 arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mn-var-som-symphony.dts
 create mode 100644 arch/arm/dts/imx8mn-var-som.dtsi
 create mode 100644 board/variscite/imx8mn_var_som/Kconfig
 create mode 100644 board/variscite/imx8mn_var_som/MAINTAINERS
 create mode 100644 board/variscite/imx8mn_var_som/Makefile
 create mode 100644 board/variscite/imx8mn_var_som/ddr4_timing.c
 create mode 100644 board/variscite/imx8mn_var_som/imx8mn_var_som.c
 create mode 100644 board/variscite/imx8mn_var_som/imximage-8mn-ddr4.cfg
 create mode 100644 board/variscite/imx8mn_var_som/spl.c
 create mode 100644 configs/imx8mn_var_som_defconfig
 create mode 100644 include/configs/imx8mn_var_som.h
arch/arm/dts/Makefile +1 -0
index cc34da7bd83..8d27876fa0e 100644
@@ -901,6 +901,7 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
 	imx8mn-ddr4-evk.dtb \
 	imx8mq-cm.dtb \
 	imx8mn-evk.dtb \
+	imx8mn-var-som-symphony.dtb \
 	imx8mq-evk.dtb \
 	imx8mm-beacon-kit.dtb \
 	imx8mn-beacon-kit.dtb \
arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi new file +256 -0

256 lines not on this page · raw message

arch/arm/dts/imx8mn-var-som-symphony.dts new file +240 -0

240 lines not on this page · raw message

arch/arm/dts/imx8mn-var-som.dtsi new file +547 -0

547 lines not on this page · raw message

arch/arm/mach-imx/imx8m/Kconfig +9 -0
index 276b8bd9742..82a5ab8ad00 100644
@@ -108,6 +108,14 @@ config TARGET_PICO_IMX8MQ
 	select IMX8MQ
 	select IMX8M_LPDDR4
 
+config TARGET_IMX8MN_VAR_SOM
+	bool "imx8mn_var_som"
+	select BINMAN
+	select IMX8MN
+	select SUPPORT_SPL
+	select IMX8M_DDR4
+	select IMX8M_BOARD_INIT_DRAM
+
 config TARGET_VERDIN_IMX8MM
 	bool "Support Toradex Verdin iMX8M Mini module"
 	select BINMAN
@@ -171,6 +179,7 @@ source "board/phytec/phycore_imx8mm/Kconfig"
 source "board/phytec/phycore_imx8mp/Kconfig"
 source "board/ronetix/imx8mq-cm/Kconfig"
 source "board/technexion/pico-imx8mq/Kconfig"
+source "board/variscite/imx8mn_var_som/Kconfig"
 source "board/toradex/verdin-imx8mm/Kconfig"
 
 endif
board/variscite/imx8mn_var_som/Kconfig new file +17 -0
new file mode 100644
index 00000000000..cfe6fc8c2c7
@@ -0,0 +1,17 @@
+if TARGET_IMX8MN_VAR_SOM
+
+config SYS_BOARD
+	default "imx8mn_var_som"
+
+config SYS_VENDOR
+	default "variscite"
+
+config SYS_CONFIG_NAME
+	default "imx8mn_var_som"
+
+config IMX_CONFIG
+	default "board/variscite/imx8mn_var_som/imximage-8mn-ddr4.cfg"
+
+source "board/freescale/common/Kconfig"
+
+endif
board/variscite/imx8mn_var_som/MAINTAINERS new file +7 -0
new file mode 100644
index 00000000000..993bcfbf476
@@ -0,0 +1,7 @@
+ARM i.MX8MN VARISCITE VAR-SOM-MX8MN MODULE
+M:	Ariel D'Alessandro <[email protected]>
+S:	Maintained
+F:	arch/arm/dts/arch/arm/dts/imx8mn-var-som*
+F:	board/variscite/imx8mn_var_som/
+F:	configs/imx8mn_var_som_defconfig
+F:	include/configs/imx8mn_var_som.h
board/variscite/imx8mn_var_som/Makefile new file +12 -0
new file mode 100644
index 00000000000..a8b6a343ffc
@@ -0,0 +1,12 @@
+#
+# Copyright 2021 Collabora Ltd.
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+
+obj-y += imx8mn_var_som.o
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+obj-y += ddr4_timing.o
+endif
board/variscite/imx8mn_var_som/ddr4_timing.c new file +528 -0

528 lines not on this page · raw message

board/variscite/imx8mn_var_som/imx8mn_var_som.c new file +30 -0
new file mode 100644
index 00000000000..e274e0e0a4c
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2021 Collabora Ltd.
+ */
+
+#include <common.h>
+#include <env.h>
+#include <asm/io.h>
+
+static void setup_fec(void)
+{
+	struct iomuxc_gpr_base_regs *gpr =
+		(struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
+
+	/* Use 125M anatop REF_CLK1 for ENET1, not from external */
+	clrsetbits_le32(&gpr->gpr[1], 0x2000, 0);
+}
+
+int board_init(void)
+{
+	if (CONFIG_IS_ENABLED(FEC_MXC))
+		setup_fec();
+
+	return 0;
+}
+
+int board_mmc_get_env_dev(int devno)
+{
+	return devno;
+}
board/variscite/imx8mn_var_som/imximage-8mn-ddr4.cfg new file +10 -0
new file mode 100644
index 00000000000..2083233e500
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2021 Collabora Ltd.
+ */
+
+#define __ASSEMBLY__
+
+ROM_VERSION	v2
+BOOT_FROM	sd
+LOADER		u-boot-spl-ddr.bin	0x912000
board/variscite/imx8mn_var_som/spl.c new file +93 -0

93 lines not on this page · raw message

configs/imx8mn_var_som_defconfig new file +98 -0

98 lines not on this page · raw message

include/configs/imx8mn_var_som.h new file +95 -0

95 lines not on this page · raw message

Signature · 1 line
2.30.2
reviewer
#2 lore raw

Hi Ariel,

The patch looks good. Only some minor comments:

Quoted 10 lines · Ariel D'Alessandro

Add support for iMX8MN VAR-SOM-MX8M-NANO board. Enables support for:

- 1GiB DDR4 RAM
- 16 GiB eMMC
- SD card
- Gigabit ethernet
- USBOTG1 peripheral - fastboot

It would be nice to have a README file so that the users can know how to build and flash mainline
U-Boot in this board.

include/configs/imx8mn_var_som.h line 75

Quoted 4 lines
include/configs/imx8mn_var_som.h new file +4 -0
+#define PHYS_SDRAM                     0x40000000
+#define PHYS_SDRAM_SIZE                        SZ_1G /* 1GB DDR */
+
+#define CONFIG_BAUDRATE                        115200

This is the default. No need to be specified here.

include/configs/imx8mn_var_som.h line 87

Quoted 11 lines
include/configs/imx8mn_var_som.h new file +11 -0
+#define CONFIG_MXC_UART_BASE           UART4_BASE_ADDR
+
+/* Monitor Command Prompt */
+#define CONFIG_SYS_CBSIZE              SZ_2K
+#define CONFIG_SYS_MAXARGS             64
+#define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
+#define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE + \
+                                        sizeof(CONFIG_SYS_PROMPT) + 16)
+
+/* USDHC */
+#define CONFIG_FSL_USDHC

This should be placed in defconfig.

Quoted 1 line

+#define CONFIG_SYS_FSL_USDHC_NUM 2

This is not used. Please remove it.

#3 lore raw
Quoted 15 lines · Fabio Estevam

Hi Ariel,

The patch looks good. Only some minor comments:

Quoted 9 lines · Ariel D'Alessandro

Add support for iMX8MN VAR-SOM-MX8M-NANO board. Enables support for:

- 1GiB DDR4 RAM
- 16 GiB eMMC
- SD card
- Gigabit ethernet
- USBOTG1 peripheral - fastboot

Quoted 5 lines
Quoted 1 line

It would be nice to have a README file so that the users can know how to build and flash mainline
U-Boot in this board.

And that means an entry under doc/board/variscite/ to be clear.

Signature · 1 line
Tom
#4 lore raw

Hi Tom,

Quoted 16 lines · Tom Rini
Quoted 15 lines · Fabio Estevam

Hi Ariel,

The patch looks good. Only some minor comments:

Quoted 9 lines · Ariel D'Alessandro

Add support for iMX8MN VAR-SOM-MX8M-NANO board. Enables support for:

- 1GiB DDR4 RAM
- 16 GiB eMMC
- SD card
- Gigabit ethernet
- USBOTG1 peripheral - fastboot

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

It would be nice to have a README file so that the users can know how to build and flash mainline
U-Boot in this board.

And that means an entry under doc/board/variscite/ to be clear.

Yes :-) thanks, will add it in v4.

#5 lore raw
In reply to Fabio Estevam

Hi Fabio,

Quoted 15 lines · Fabio Estevam

Hi Ariel,

The patch looks good. Only some minor comments:

Quoted 9 lines · Ariel D'Alessandro

Add support for iMX8MN VAR-SOM-MX8M-NANO board. Enables support for:

- 1GiB DDR4 RAM
- 16 GiB eMMC
- SD card
- Gigabit ethernet
- USBOTG1 peripheral - fastboot

Quoted 5 lines
Quoted 1 line

It would be nice to have a README file so that the users can know how to build and flash mainline
U-Boot in this board.

Added that to doc/board/variscite/imx8mn_var_som.rst Will submit in v4.

Quoted 7 lines

include/configs/imx8mn_var_som.h line 75

Quoted 5 lines
include/configs/imx8mn_var_som.h new file +4 -0
+#define PHYS_SDRAM                     0x40000000
+#define PHYS_SDRAM_SIZE                        SZ_1G /* 1GB DDR */
+
+#define CONFIG_BAUDRATE                        115200

This is the default. No need to be specified here.

Ack.

Quoted 14 lines

include/configs/imx8mn_var_som.h line 87

Quoted 12 lines
include/configs/imx8mn_var_som.h new file +11 -0
+#define CONFIG_MXC_UART_BASE           UART4_BASE_ADDR
+
+/* Monitor Command Prompt */
+#define CONFIG_SYS_CBSIZE              SZ_2K
+#define CONFIG_SYS_MAXARGS             64
+#define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
+#define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE + \
+                                        sizeof(CONFIG_SYS_PROMPT) + 16)
+
+/* USDHC */
+#define CONFIG_FSL_USDHC

This should be placed in defconfig.

Done.

Quoted 4 lines
Quoted 2 lines

+#define CONFIG_SYS_FSL_USDHC_NUM 2

This is not used. Please remove it.

Done.

Thanks a lot,
Ariel