From: Giulio Benetti <giulio.benetti@benettiengineering.com>
To: u-boot@lists.denx.de
Subject: [PATCH 1/6] ARM: IMXRT: introduce is_imxrt*() macros and get_cpu_rev()
Date: Thu, 20 May 2021 16:10:13 +0200 [thread overview]
Message-ID: <20210520141018.2972320-2-giulio.benetti@benettiengineering.com> (raw)
In-Reply-To: <20210520141018.2972320-1-giulio.benetti@benettiengineering.com>
We need those macros to instruct drivers on how to behave for SoC specific
quirks, so let's add it as done for other i.MX SoCs.
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
arch/arm/include/asm/arch-imx/cpu.h | 3 +++
arch/arm/include/asm/mach-imx/sys_proto.h | 4 ++++
arch/arm/mach-imx/imxrt/soc.c | 12 ++++++++++++
3 files changed, 19 insertions(+)
diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h
index bb13e07b66..267a094e5a 100644
--- a/arch/arm/include/asm/arch-imx/cpu.h
+++ b/arch/arm/include/asm/arch-imx/cpu.h
@@ -50,6 +50,8 @@
#define MXC_CPU_IMX8QXP_A0 0x90 /* dummy ID */
#define MXC_CPU_IMX8QM 0x91 /* dummy ID */
#define MXC_CPU_IMX8QXP 0x92 /* dummy ID */
+#define MXC_CPU_IMXRT1020 0xB4 /* dummy ID */
+#define MXC_CPU_IMXRT1050 0xB6 /* dummy ID */
#define MXC_CPU_MX7ULP 0xE1 /* Temporally hard code */
#define MXC_CPU_VF610 0xF6 /* dummy ID */
@@ -57,6 +59,7 @@
#define MXC_SOC_MX7 0x70
#define MXC_SOC_IMX8M 0x80
#define MXC_SOC_IMX8 0x90 /* dummy */
+#define MXC_SOC_IMXRT 0xB0 /* dummy */
#define MXC_SOC_MX7ULP 0xE0 /* dummy */
#define CHIP_REV_1_0 0x10
diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h
index c7668ffc4d..b612189849 100644
--- a/arch/arm/include/asm/mach-imx/sys_proto.h
+++ b/arch/arm/include/asm/mach-imx/sys_proto.h
@@ -31,6 +31,7 @@ struct bd_info;
#define is_mx7() (is_soc_type(MXC_SOC_MX7))
#define is_imx8m() (is_soc_type(MXC_SOC_IMX8M))
#define is_imx8() (is_soc_type(MXC_SOC_IMX8))
+#define is_imxrt() (is_soc_type(MXC_SOC_IMXRT))
#define is_mx6dqp() (is_cpu_type(MXC_CPU_MX6QP) || is_cpu_type(MXC_CPU_MX6DP))
#define is_mx6dq() (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D))
@@ -78,6 +79,9 @@ struct bd_info;
#define is_imx8qxp() (is_cpu_type(MXC_CPU_IMX8QXP))
+#define is_imxrt1020() (is_cpu_type(MXC_CPU_IMXRT1020))
+#define is_imxrt1050() (is_cpu_type(MXC_CPU_IMXRT1050))
+
#ifdef CONFIG_MX6
#define IMX6_SRC_GPR10_BMODE BIT(28)
#define IMX6_SRC_GPR10_PERSIST_SECONDARY_BOOT BIT(30)
diff --git a/arch/arm/mach-imx/imxrt/soc.c b/arch/arm/mach-imx/imxrt/soc.c
index c533f3554a..ba015992ee 100644
--- a/arch/arm/mach-imx/imxrt/soc.c
+++ b/arch/arm/mach-imx/imxrt/soc.c
@@ -8,6 +8,7 @@
#include <init.h>
#include <asm/io.h>
#include <asm/armv7_mpu.h>
+#include <asm/mach-imx/sys_proto.h>
#include <linux/bitops.h>
int arch_cpu_init(void)
@@ -35,3 +36,14 @@ int arch_cpu_init(void)
return 0;
}
+
+u32 get_cpu_rev(void)
+{
+#if defined(CONFIG_IMXRT1020)
+ return MXC_CPU_IMXRT1020 << 12;
+#elif defined(CONFIG_IMXRT1050)
+ return MXC_CPU_IMXRT1050 << 12;
+#else
+#error This IMXRT SoC is not supported
+#endif
+}
--
2.25.1
next prev parent reply other threads:[~2021-05-20 14:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-20 14:10 [PATCH 0/6] i.MXRT1050 add Usb Host support Giulio Benetti
2021-05-20 14:10 ` Giulio Benetti [this message]
2021-06-09 13:43 ` [PATCH 1/6] ARM: IMXRT: introduce is_imxrt*() macros and get_cpu_rev() sbabic
2021-05-20 14:10 ` [PATCH 2/6] clk: imx: clk-imxrt1050: introduce IMXRT1050_CLK_USBOH3 Giulio Benetti
2021-06-09 13:44 ` sbabic
2021-05-20 14:10 ` [PATCH 3/6] usb: ehci-mx6: add support for i.MXRT Giulio Benetti
2021-05-20 15:06 ` Marek Vasut
2021-06-09 13:42 ` sbabic
2021-05-20 14:10 ` [PATCH 4/6] ARM: dts: imxrt1050: add usbotg1, usbphy1 and usbmisc nodes Giulio Benetti
2021-05-20 15:08 ` Marek Vasut
2021-06-09 13:42 ` sbabic
2021-05-20 14:10 ` [PATCH 5/6] ARM: dts: imxrt1050-evk: enable usbotg1 node as host Giulio Benetti
2021-06-09 13:42 ` sbabic
2021-05-20 14:10 ` [PATCH 6/6] configs: imxrt1050-evk: enable host usb support and its command Giulio Benetti
2021-06-09 13:42 ` sbabic
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=20210520141018.2972320-2-giulio.benetti@benettiengineering.com \
--to=giulio.benetti@benettiengineering.com \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.