public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jesse Taube <mr.bossman075@gmail.com>
To: u-boot@lists.denx.de
Cc: sbabic@denx.de, festevam@gmail.com, festevam@denx.de,
	uboot-imx@nxp.com, giulio.benetti@benettiengineering.com,
	lukma@denx.de, seanga2@gmail.com, sjg@chromium.org,
	jagan@amarulasolutions.com, kever.yang@rock-chips.com,
	andre.przywara@arm.com, pbrobinson@gmail.com,
	tharvey@gateworks.com, paul.liu@linaro.org,
	christianshewitt@gmail.com, Mr.Bossman075@gmail.com,
	samuel@sholland.org
Subject: [PATCH v2 1/8] imx: imxrt1170-evk: Add support for the NXP i.MXRT1170-EVK
Date: Fri, 17 Jun 2022 12:42:30 -0400	[thread overview]
Message-ID: <20220617164237.1350241-2-Mr.Bossman075@gmail.com> (raw)
In-Reply-To: <20220617164237.1350241-1-Mr.Bossman075@gmail.com>

This commit adds board support for i.MXRT1170-EVK from NXP. This board
is an evaluation kit provided by NXP for i.MXRT117x processor family.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
---
V1 -> V2:
* Nothing done
---
 arch/arm/include/asm/arch-imx/cpu.h           |  1 +
 arch/arm/mach-imx/imxrt/Kconfig               |  9 +++
 arch/arm/mach-imx/imxrt/soc.c                 |  2 +
 board/freescale/imxrt1170-evk/Kconfig         | 22 +++++
 board/freescale/imxrt1170-evk/MAINTAINERS     |  7 ++
 board/freescale/imxrt1170-evk/Makefile        |  6 ++
 board/freescale/imxrt1170-evk/imximage.cfg    | 32 ++++++++
 board/freescale/imxrt1170-evk/imxrt1170-evk.c | 80 +++++++++++++++++++
 8 files changed, 159 insertions(+)
 create mode 100644 board/freescale/imxrt1170-evk/Kconfig
 create mode 100644 board/freescale/imxrt1170-evk/MAINTAINERS
 create mode 100644 board/freescale/imxrt1170-evk/Makefile
 create mode 100644 board/freescale/imxrt1170-evk/imximage.cfg
 create mode 100644 board/freescale/imxrt1170-evk/imxrt1170-evk.c

diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h
index 4f63803765..09767be1ca 100644
--- a/arch/arm/include/asm/arch-imx/cpu.h
+++ b/arch/arm/include/asm/arch-imx/cpu.h
@@ -56,6 +56,7 @@
 
 #define MXC_CPU_IMXRT1020	0xB4 /* dummy ID */
 #define MXC_CPU_IMXRT1050	0xB6 /* dummy ID */
+#define MXC_CPU_IMXRT1170	0xBA /* dummy ID */
 
 #define MXC_CPU_MX7ULP		0xE1 /* Temporally hard code */
 #define MXC_CPU_VF610		0xF6 /* dummy ID */
diff --git a/arch/arm/mach-imx/imxrt/Kconfig b/arch/arm/mach-imx/imxrt/Kconfig
index 8c89133965..c1d6b09e77 100644
--- a/arch/arm/mach-imx/imxrt/Kconfig
+++ b/arch/arm/mach-imx/imxrt/Kconfig
@@ -12,6 +12,10 @@ config IMXRT1050
 	bool
 	select IMXRT
 
+config IMXRT1170
+	bool
+	select IMXRT
+
 config SYS_SOC
 	default "imxrt"
 
@@ -27,9 +31,14 @@ config TARGET_IMXRT1050_EVK
 	bool "Support imxrt1050 EVK board"
 	select IMXRT1050
 
+config TARGET_IMXRT1170_EVK
+	bool "Support imxrt1170 EVK board"
+	select IMXRT1170
+
 endchoice
 
 source "board/freescale/imxrt1020-evk/Kconfig"
 source "board/freescale/imxrt1050-evk/Kconfig"
+source "board/freescale/imxrt1170-evk/Kconfig"
 
 endif
diff --git a/arch/arm/mach-imx/imxrt/soc.c b/arch/arm/mach-imx/imxrt/soc.c
index ba015992ee..34162a3976 100644
--- a/arch/arm/mach-imx/imxrt/soc.c
+++ b/arch/arm/mach-imx/imxrt/soc.c
@@ -43,6 +43,8 @@ u32 get_cpu_rev(void)
 	return MXC_CPU_IMXRT1020 << 12;
 #elif defined(CONFIG_IMXRT1050)
 	return MXC_CPU_IMXRT1050 << 12;
+#elif defined(CONFIG_IMXRT1170)
+	return MXC_CPU_IMXRT1170 << 12;
 #else
 #error This IMXRT SoC is not supported
 #endif
diff --git a/board/freescale/imxrt1170-evk/Kconfig b/board/freescale/imxrt1170-evk/Kconfig
new file mode 100644
index 0000000000..c61fc57971
--- /dev/null
+++ b/board/freescale/imxrt1170-evk/Kconfig
@@ -0,0 +1,22 @@
+if TARGET_IMXRT1170_EVK
+
+config SYS_BOARD
+	string
+	default "imxrt1170-evk"
+
+config SYS_VENDOR
+	string
+	default "freescale"
+
+config SYS_SOC
+	string
+	default "imxrt1170"
+
+config SYS_CONFIG_NAME
+	string
+	default "imxrt1170-evk"
+
+config IMX_CONFIG
+	default "board/freescale/imxrt1170-evk/imximage.cfg"
+
+endif
diff --git a/board/freescale/imxrt1170-evk/MAINTAINERS b/board/freescale/imxrt1170-evk/MAINTAINERS
new file mode 100644
index 0000000000..1fc3179c00
--- /dev/null
+++ b/board/freescale/imxrt1170-evk/MAINTAINERS
@@ -0,0 +1,7 @@
+IMXRT1170 EVALUATION KIT
+M:	Giulio Benetti <giulio.benetti@benettiengineering.com>
+M:	Jesse Taube <Mr.Bossman075@gmail.com>
+S:	Maintained
+F:	board/freescale/imxrt1170-evk
+F:	include/configs/imxrt1170-evk.h
+F:	configs/imxrt1170-evk_defconfig
diff --git a/board/freescale/imxrt1170-evk/Makefile b/board/freescale/imxrt1170-evk/Makefile
new file mode 100644
index 0000000000..857a168b09
--- /dev/null
+++ b/board/freescale/imxrt1170-evk/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2019
+# Author(s): Giulio Benetti <giulio.benetti@benettiengineering.com>
+
+obj-y	:= imxrt1170-evk.o
diff --git a/board/freescale/imxrt1170-evk/imximage.cfg b/board/freescale/imxrt1170-evk/imximage.cfg
new file mode 100644
index 0000000000..3354672825
--- /dev/null
+++ b/board/freescale/imxrt1170-evk/imximage.cfg
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2022
+ * Author(s): Jesse Taube <Mr.Bossman075@gmail.com>
+ * Giulio Benetti <giulio.benetti@benettiengineering.com>
+ */
+
+#define __ASSEMBLY__
+#include <config.h>
+
+/* image version */
+
+IMAGE_VERSION 2
+
+/*
+ * Boot Device : one of
+ * spi/sd/nand/onenand, qspi/nor
+ */
+
+BOOT_FROM	sd
+
+/*
+ * Device Configuration Data (DCD)
+ *
+ * Each entry must have the format:
+ * Addr-type           Address        Value
+ *
+ * where:
+ *	Addr-type register length (1,2 or 4 bytes)
+ *	Address	  absolute address of the register
+ *	value	  value to be stored in the register
+ */
diff --git a/board/freescale/imxrt1170-evk/imxrt1170-evk.c b/board/freescale/imxrt1170-evk/imxrt1170-evk.c
new file mode 100644
index 0000000000..4b82ee5e9c
--- /dev/null
+++ b/board/freescale/imxrt1170-evk/imxrt1170-evk.c
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019
+ * Author(s): Giulio Benetti <giulio.benetti@benettiengineering.com>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <init.h>
+#include <log.h>
+#include <ram.h>
+#include <spl.h>
+#include <asm/global_data.h>
+#include <asm/io.h>
+#include <asm/armv7m.h>
+#include <serial.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int dram_init(void)
+{
+#ifndef CONFIG_SUPPORT_SPL
+	int rv;
+	struct udevice *dev;
+
+	rv = uclass_get_device(UCLASS_RAM, 0, &dev);
+	if (rv) {
+		debug("DRAM init failed: %d\n", rv);
+		return rv;
+	}
+
+#endif
+	return fdtdec_setup_mem_size_base();
+}
+
+int dram_init_banksize(void)
+{
+	return fdtdec_setup_memory_banksize();
+}
+
+#ifdef CONFIG_SPL_BUILD
+#ifdef CONFIG_SPL_OS_BOOT
+int spl_start_uboot(void)
+{
+	debug("SPL: booting kernel\n");
+	/* break into full u-boot on 'c' */
+	return serial_tstc() && serial_getc() == 'c';
+}
+#endif
+
+int spl_dram_init(void)
+{
+	struct udevice *dev;
+	int rv;
+
+	rv = uclass_get_device(UCLASS_RAM, 0, &dev);
+	if (rv)
+		debug("DRAM init failed: %d\n", rv);
+	return rv;
+}
+
+void spl_board_init(void)
+{
+	preloader_console_init();
+	spl_dram_init();
+	arch_cpu_init(); /* to configure mpu for sdram rw permissions */
+}
+
+u32 spl_boot_device(void)
+{
+	return BOOT_DEVICE_MMC1;
+}
+#endif
+
+int board_init(void)
+{
+	gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
+
+	return 0;
+}
-- 
2.36.1


  reply	other threads:[~2022-06-17 16:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17 16:42 [PATCH v2 0/8] Add support for the i.MXRT1170 Jesse Taube
2022-06-17 16:42 ` Jesse Taube [this message]
2022-06-17 16:42 ` [PATCH v2 2/8] ARM: dts: imxrt11170-pinfunc: Add pinctrl binding header Jesse Taube
2022-06-17 16:42 ` [PATCH v2 3/8] dt-bindings: imx: Add clock binding for i.MXRT1170 Jesse Taube
2022-06-17 16:42 ` [PATCH v2 4/8] clk: imx: Add i.MXRT11xx pllv3 variant Jesse Taube
2022-06-17 16:42 ` [PATCH v2 5/8] clk: imx: Add initial support for i.MXRT1170 clock driver Jesse Taube
2022-06-17 16:42 ` [PATCH v2 6/8] RAM: Add changes for i.MXRT11xx series Jesse Taube
2022-06-17 16:42 ` [PATCH v2 7/8] ARM: dts: imx: add i.MXRT1170-EVK support Jesse Taube
2022-06-17 16:42 ` [PATCH v2 8/8] ARM: imxrt1170_defconfig: Add i.MXRT1170 defconfig Jesse Taube
2022-06-18  0:43   ` Fabio Estevam
2022-06-18 14:32     ` Giulio Benetti
2022-06-21 14:52       ` Fabio Estevam
2022-07-25 13:34 ` [PATCH v2 0/8] Add support for the i.MXRT1170 Stefano Babic
2022-07-26  2:53   ` Jesse Taube

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220617164237.1350241-2-Mr.Bossman075@gmail.com \
    --to=mr.bossman075@gmail.com \
    --cc=andre.przywara@arm.com \
    --cc=christianshewitt@gmail.com \
    --cc=festevam@denx.de \
    --cc=festevam@gmail.com \
    --cc=giulio.benetti@benettiengineering.com \
    --cc=jagan@amarulasolutions.com \
    --cc=kever.yang@rock-chips.com \
    --cc=lukma@denx.de \
    --cc=paul.liu@linaro.org \
    --cc=pbrobinson@gmail.com \
    --cc=samuel@sholland.org \
    --cc=sbabic@denx.de \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox