Skip to contentSkip to conversation

ARM: imx: add imx7d-m4

PATCH New Oleksij Rempel 5 participants 13 messages Apr 5, 2018 – Jul 2, 2018

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx: add imx7d-m4

Provide basic support for Cortex-M4 located on NXP iMX7D. This code was tested in combination with imx-rproc driver which will upload with specially formatted ELF image containing kernel, device and CPIO rootfs.

---
 arch/arm/boot/dts/Makefile         |  2 +-
 arch/arm/mach-imx/Kconfig          | 33 +++++++++++++++++++++------------
 arch/arm/mach-imx/Makefile         |  3 ++-
 arch/arm/mach-imx/mach-imx7d-cm4.c | 21 +++++++++++++++++++++
 4 files changed, 45 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/mach-imx/mach-imx7d-cm4.c
arch/arm/boot/dts/Makefile +1 -1
index 852452515bea..d49bb9a58aee 100644
@@ -527,7 +527,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
 	imx6ul-tx6ul-0011.dtb \
 	imx6ul-tx6ul-mainboard.dtb \
 	imx6ull-14x14-evk.dtb
-dtb-$(CONFIG_SOC_IMX7D) += \
+dtb-$(CONFIG_SOC_IMX7D_CA7) += \
 	imx7d-cl-som-imx7.dtb \
 	imx7d-colibri-emmc-eval-v3.dtb \
 	imx7d-colibri-eval-v3.dtb \
arch/arm/mach-imx/Kconfig +21 -12
index 782699e67600..101c8599d952 100644
@@ -528,18 +528,6 @@ config SOC_IMX6UL
 	help
 	  This enables support for Freescale i.MX6 UltraLite processor.
 
-config SOC_IMX7D
-	bool "i.MX7 Dual support"
-	select PINCTRL_IMX7D
-	select ARM_GIC
-	select HAVE_ARM_ARCH_TIMER
-	select HAVE_IMX_ANATOP
-	select HAVE_IMX_MMDC
-	select HAVE_IMX_SRC
-	select IMX_GPCV2
-	help
-		This enables support for Freescale i.MX7 Dual processor.
-
 config SOC_LS1021A
 	bool "Freescale LS1021A support"
 	select ARM_GIC
@@ -554,6 +542,27 @@ comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms"
 
 if ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
 
+config SOC_IMX7D_CA7
+	bool
+	select ARM_GIC
+	select HAVE_ARM_ARCH_TIMER
+	select HAVE_IMX_ANATOP
+	select HAVE_IMX_MMDC
+	select HAVE_IMX_SRC
+	select IMX_GPCV2
+
+config SOC_IMX7D_CM4
+	bool
+	select ARMV7M_SYSTICK
+
+config SOC_IMX7D
+	bool "i.MX7 Dual support"
+	select PINCTRL_IMX7D
+	select SOC_IMX7D_CA7 if ARCH_MULTI_V7
+	select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
+	help
+		This enables support for Freescale i.MX7 Dual processor.
+
 config SOC_VF610
 	bool "Vybrid Family VF610 support"
 	select ARM_GIC if ARCH_MULTI_V7
arch/arm/mach-imx/Makefile +2 -1
index 8ff71058207d..68640f100ef3 100644
@@ -80,7 +80,8 @@ obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o
 obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o
 obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
 obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o
-obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CA7) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CM4) += mach-imx7d-cm4.o
 
 ifeq ($(CONFIG_SUSPEND),y)
 AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
arch/arm/mach-imx/mach-imx7d-cm4.c new file +21 -0
new file mode 100644
index 000000000000..c36dea79aeb8
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017 Pengutronix
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <asm/v7m.h>
+#include <asm/mach/arch.h>
+
+static const char * const imx7d_cm4_dt_compat[] __initconst = {
+	"fsl,imx7d-cm4",
+	NULL,
+};
+
+DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual Cortex-M4 (Device Tree)")
+	.dt_compat = imx7d_cm4_dt_compat,
+	.restart = armv7m_restart,
+MACHINE_END
Signature · 1 line
2.16.1
#1 lore raw

PATCH 1/1 ARM: imx: add imx7d-m4

Hi all,

this patch was send 05.04.2018. Any comments?

@Shawn, can you please take it?

Quoted 110 lines · Oleksij Rempel

Provide basic support for Cortex-M4 located on NXP iMX7D. This code was tested in combination with imx-rproc driver which will upload with specially formatted ELF image containing kernel, device and CPIO rootfs.

---
 arch/arm/boot/dts/Makefile         |  2 +-
 arch/arm/mach-imx/Kconfig          | 33 +++++++++++++++++++++------------
 arch/arm/mach-imx/Makefile         |  3 ++-
 arch/arm/mach-imx/mach-imx7d-cm4.c | 21 +++++++++++++++++++++
 4 files changed, 45 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/mach-imx/mach-imx7d-cm4.c
arch/arm/boot/dts/Makefile +1 -1
index 852452515bea..d49bb9a58aee 100644
@@ -527,7 +527,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
 	imx6ul-tx6ul-0011.dtb \
 	imx6ul-tx6ul-mainboard.dtb \
 	imx6ull-14x14-evk.dtb
-dtb-$(CONFIG_SOC_IMX7D) += \
+dtb-$(CONFIG_SOC_IMX7D_CA7) += \
 	imx7d-cl-som-imx7.dtb \
 	imx7d-colibri-emmc-eval-v3.dtb \
 	imx7d-colibri-eval-v3.dtb \
arch/arm/mach-imx/Kconfig +21 -12
index 782699e67600..101c8599d952 100644
@@ -528,18 +528,6 @@ config SOC_IMX6UL
 	help
 	  This enables support for Freescale i.MX6 UltraLite processor.
 
-config SOC_IMX7D
-	bool "i.MX7 Dual support"
-	select PINCTRL_IMX7D
-	select ARM_GIC
-	select HAVE_ARM_ARCH_TIMER
-	select HAVE_IMX_ANATOP
-	select HAVE_IMX_MMDC
-	select HAVE_IMX_SRC
-	select IMX_GPCV2
-	help
-		This enables support for Freescale i.MX7 Dual processor.
-
 config SOC_LS1021A
 	bool "Freescale LS1021A support"
 	select ARM_GIC
@@ -554,6 +542,27 @@ comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms"
 
 if ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
 
+config SOC_IMX7D_CA7
+	bool
+	select ARM_GIC
+	select HAVE_ARM_ARCH_TIMER
+	select HAVE_IMX_ANATOP
+	select HAVE_IMX_MMDC
+	select HAVE_IMX_SRC
+	select IMX_GPCV2
+
+config SOC_IMX7D_CM4
+	bool
+	select ARMV7M_SYSTICK
+
+config SOC_IMX7D
+	bool "i.MX7 Dual support"
+	select PINCTRL_IMX7D
+	select SOC_IMX7D_CA7 if ARCH_MULTI_V7
+	select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
+	help
+		This enables support for Freescale i.MX7 Dual processor.
+
 config SOC_VF610
 	bool "Vybrid Family VF610 support"
 	select ARM_GIC if ARCH_MULTI_V7
arch/arm/mach-imx/Makefile +2 -1
index 8ff71058207d..68640f100ef3 100644
@@ -80,7 +80,8 @@ obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o
 obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o
 obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
 obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o
-obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CA7) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CM4) += mach-imx7d-cm4.o
 
 ifeq ($(CONFIG_SUSPEND),y)
 AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
arch/arm/mach-imx/mach-imx7d-cm4.c new file +11 -0
new file mode 100644
index 000000000000..c36dea79aeb8
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017 Pengutronix
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <asm/v7m.h>
+#include <asm/mach/arch.h>

arch/arm/mach-imx/mach-imx7d-cm4.c line 21

Quoted 10 lines
arch/arm/mach-imx/mach-imx7d-cm4.c new file +10 -0
+
+static const char * const imx7d_cm4_dt_compat[] __initconst = {
+	"fsl,imx7d-cm4",
+	NULL,
+};
+
+DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual Cortex-M4 (Device Tree)")
+	.dt_compat = imx7d_cm4_dt_compat,
+	.restart = armv7m_restart,
+MACHINE_END

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180611/6e28fea3/attachment.sig>

#2 lore raw

PATCH 1/1 ARM: imx: add imx7d-m4

Quoted 5 lines · Oleksij Rempel

Hi all,

this patch was send 05.04.2018. Any comments?

@Shawn, can you please take it?

Honestly I'm not sure how useful it will be. If we can have some i.MX developers ACK on it, I will be more comfortable to take it.

Shawn

Quoted 123 lines · Oleksij Rempel
Quoted 120 lines

Provide basic support for Cortex-M4 located on NXP iMX7D. This code was tested in combination with imx-rproc driver which will upload with specially formatted ELF image containing kernel, device and CPIO rootfs.

---
 arch/arm/boot/dts/Makefile         |  2 +-
 arch/arm/mach-imx/Kconfig          | 33 +++++++++++++++++++++------------
 arch/arm/mach-imx/Makefile         |  3 ++-
 arch/arm/mach-imx/mach-imx7d-cm4.c | 21 +++++++++++++++++++++
 4 files changed, 45 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/mach-imx/mach-imx7d-cm4.c
arch/arm/boot/dts/Makefile +1 -1
index 852452515bea..d49bb9a58aee 100644
@@ -527,7 +527,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
 	imx6ul-tx6ul-0011.dtb \
 	imx6ul-tx6ul-mainboard.dtb \
 	imx6ull-14x14-evk.dtb
-dtb-$(CONFIG_SOC_IMX7D) += \
+dtb-$(CONFIG_SOC_IMX7D_CA7) += \
 	imx7d-cl-som-imx7.dtb \
 	imx7d-colibri-emmc-eval-v3.dtb \
 	imx7d-colibri-eval-v3.dtb \
arch/arm/mach-imx/Kconfig +21 -12
index 782699e67600..101c8599d952 100644
@@ -528,18 +528,6 @@ config SOC_IMX6UL
 	help
 	  This enables support for Freescale i.MX6 UltraLite processor.
 
-config SOC_IMX7D
-	bool "i.MX7 Dual support"
-	select PINCTRL_IMX7D
-	select ARM_GIC
-	select HAVE_ARM_ARCH_TIMER
-	select HAVE_IMX_ANATOP
-	select HAVE_IMX_MMDC
-	select HAVE_IMX_SRC
-	select IMX_GPCV2
-	help
-		This enables support for Freescale i.MX7 Dual processor.
-
 config SOC_LS1021A
 	bool "Freescale LS1021A support"
 	select ARM_GIC
@@ -554,6 +542,27 @@ comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms"
 
 if ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
 
+config SOC_IMX7D_CA7
+	bool
+	select ARM_GIC
+	select HAVE_ARM_ARCH_TIMER
+	select HAVE_IMX_ANATOP
+	select HAVE_IMX_MMDC
+	select HAVE_IMX_SRC
+	select IMX_GPCV2
+
+config SOC_IMX7D_CM4
+	bool
+	select ARMV7M_SYSTICK
+
+config SOC_IMX7D
+	bool "i.MX7 Dual support"
+	select PINCTRL_IMX7D
+	select SOC_IMX7D_CA7 if ARCH_MULTI_V7
+	select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
+	help
+		This enables support for Freescale i.MX7 Dual processor.
+
 config SOC_VF610
 	bool "Vybrid Family VF610 support"
 	select ARM_GIC if ARCH_MULTI_V7
arch/arm/mach-imx/Makefile +2 -1
index 8ff71058207d..68640f100ef3 100644
@@ -80,7 +80,8 @@ obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o
 obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o
 obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
 obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o
-obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CA7) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CM4) += mach-imx7d-cm4.o
 
 ifeq ($(CONFIG_SUSPEND),y)
 AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
arch/arm/mach-imx/mach-imx7d-cm4.c new file +21 -0
new file mode 100644
index 000000000000..c36dea79aeb8
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017 Pengutronix
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <asm/v7m.h>
+#include <asm/mach/arch.h>
+
+static const char * const imx7d_cm4_dt_compat[] __initconst = {
+	"fsl,imx7d-cm4",
+	NULL,
+};
+
+DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual Cortex-M4 (Device Tree)")
+	.dt_compat = imx7d_cm4_dt_compat,
+	.restart = armv7m_restart,
+MACHINE_END
#3 lore raw

PATCH 1/1 ARM: imx: add imx7d-m4

Hi Shawn,

Am Montag, den 11.06.2018, 16:20 +0800 schrieb Shawn Guo:

Quoted 9 lines · Oleksij Rempel
Quoted 5 lines

Hi all,

this patch was send 05.04.2018. Any comments?

@Shawn, can you please take it?

Honestly I'm not sure how useful it will be.??If we can have some i.MX developers ACK on it, I will be more comfortable to take it.

This is all highly experimental and in PoC stage, but we see some value in running a second Linux system on the M4 coprocessor. There are lots of things that still need to be figured out, but we are working on this from time to time when there are some hours to spare.

This patch seems like a good step in the right direction and IMHO the amount of code and changes is small enough to carry it upstream without impacting anything else. I would be happy if this could be pulled in.

Regards,
Lucas

Quoted 130 lines
Quoted 118 lines · Oleksij Rempel
Quoted 116 lines

Provide basic support for Cortex-M4 located on NXP iMX7D. This code was tested in combination with imx-rproc driver which will upload with specially formatted ELF image containing kernel, device and CPIO rootfs.

Quoted 1 line
Quoted 1 line
Quoted 1 line

---

?arch/arm/boot/dts/Makefile?????????|??2 +-
?arch/arm/mach-imx/Kconfig??????????| 33 +++++++++++++++++++++------------
?arch/arm/mach-imx/Makefile?????????|??3 ++-
?arch/arm/mach-imx/mach-imx7d-cm4.c | 21 +++++++++++++++++++++

?4 files changed, 45 insertions(+), 14 deletions(-) ?create mode 100644 arch/arm/mach-imx/mach-imx7d-cm4.c

arch/arm/boot/dts/Makefile +0 -0
index 852452515bea..d49bb9a58aee 100644
@@ -527,7 +527,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
 > > > ?	imx6ul-tx6ul-0011.dtb \
 > > > ?	imx6ul-tx6ul-mainboard.dtb \
Quoted 1 line
Quoted 1 line
Quoted 1 line

? imx6ull-14x14-evk.dtb

arch/arm/boot/dts/Makefile +1 -1
-dtb-$(CONFIG_SOC_IMX7D) += \
+dtb-$(CONFIG_SOC_IMX7D_CA7) += \
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

? imx7d-cl-som-imx7.dtb \
? imx7d-colibri-emmc-eval-v3.dtb \
? imx7d-colibri-eval-v3.dtb \

arch/arm/mach-imx/Kconfig +0 -0
index 782699e67600..101c8599d952 100644
@@ -528,18 +528,6 @@ config SOC_IMX6UL
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

? help
? ??This enables support for Freescale i.MX6 UltraLite processor.

?
-config SOC_IMX7D

Quoted 10 lines
Quoted 10 lines

arch/arm/mach-imx/Kconfig config SOC_IMX6UL · line 541

Quoted 10 lines
arch/arm/mach-imx/Kconfig +0 -10
-	bool "i.MX7 Dual support"
-	select PINCTRL_IMX7D
-	select ARM_GIC
-	select HAVE_ARM_ARCH_TIMER
-	select HAVE_IMX_ANATOP
-	select HAVE_IMX_MMDC
-	select HAVE_IMX_SRC
-	select IMX_GPCV2
-	help
-		This enables support for Freescale i.MX7 Dual processor.

-
?config SOC_LS1021A

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

? bool "Freescale LS1021A support"
? select ARM_GIC

arch/arm/mach-imx/Kconfig +0 -0
@@ -554,6 +542,27 @@ comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms"

?
?if ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
?
+config SOC_IMX7D_CA7

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
arch/arm/mach-imx/Kconfig +7 -0
+	bool
+	select ARM_GIC
+	select HAVE_ARM_ARCH_TIMER
+	select HAVE_IMX_ANATOP
+	select HAVE_IMX_MMDC
+	select HAVE_IMX_SRC
+	select IMX_GPCV2
arch/arm/mach-imx/Kconfig +2 -0
+
+config SOC_IMX7D_CM4
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
(quoted diff) +2 -0
+	bool
+	select ARMV7M_SYSTICK
arch/arm/mach-imx/Kconfig +2 -0
+
+config SOC_IMX7D
Quoted 6 lines
Quoted 6 lines

arch/arm/mach-imx/Kconfig comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms" · line 564

Quoted 6 lines
arch/arm/mach-imx/Kconfig +6 -0
+	bool "i.MX7 Dual support"
+	select PINCTRL_IMX7D
+	select SOC_IMX7D_CA7 if ARCH_MULTI_V7
+	select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
+	help
+		This enables support for Freescale i.MX7 Dual processor.

+
?config SOC_VF610

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

? bool "Vybrid Family VF610 support"
? select ARM_GIC if ARCH_MULTI_V7

arch/arm/mach-imx/Makefile +0 -0
index 8ff71058207d..68640f100ef3 100644
@@ -80,7 +80,8 @@ obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o

?obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o
?obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
?obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o

arch/arm/mach-imx/Makefile +2 -1
-obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CA7) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CM4) += mach-imx7d-cm4.o

?
?ifeq ($(CONFIG_SUSPEND),y)
?AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a

arch/arm/mach-imx/mach-imx7d-cm4.c new file +13 -0
new file mode 100644
index 000000000000..c36dea79aeb8
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017 Pengutronix
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <asm/v7m.h>
+#include <asm/mach/arch.h>
+
+static const char * const imx7d_cm4_dt_compat[] __initconst = {
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
arch/arm/mach-imx/mach-imx7d-cm4.c new file +2 -0
+	"fsl,imx7d-cm4",
+	NULL,
arch/arm/mach-imx/mach-imx7d-cm4.c new file +3 -0
+};
+
+DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual Cortex-M4 (Device Tree)")
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

arch/arm/mach-imx/mach-imx7d-cm4.c line 20

Quoted 2 lines
arch/arm/mach-imx/mach-imx7d-cm4.c new file +2 -0
+	.dt_compat = imx7d_cm4_dt_compat,
+	.restart = armv7m_restart,

+MACHINE_END

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#4 lore raw

PATCH 1/1 ARM: imx: add imx7d-m4

Quoted 13 lines · Lucas Stach

Hi Shawn,

Am Montag, den 11.06.2018, 16:20 +0800 schrieb Shawn Guo:

Quoted 9 lines · Oleksij Rempel
Quoted 5 lines

Hi all,

this patch was send 05.04.2018. Any comments?

@Shawn, can you please take it?

Honestly I'm not sure how useful it will be.??If we can have some i.MX developers ACK on it, I will be more comfortable to take it.

Quoted 8 lines

This is all highly experimental and in PoC stage, but we see some value in running a second Linux system on the M4 coprocessor. There are lots of things that still need to be figured out, but we are working on this from time to time when there are some hours to spare.

This patch seems like a good step in the right direction and IMHO the amount of code and changes is small enough to carry it upstream without impacting anything else. I would be happy if this could be pulled in.

I agree with Lucas here, this is rather minimal and not invasive.

Out of interest, on what memory region do you run Linux? Do you use caches? In some experiments a while ago I noticed that only 2MiB/(or 4MiB) of DDR memory can use caches, which is somewhat tight to run Linux on.

https://blog.printk.io/2017/05/i-mx-7-cortex-m4-memory-locations-and-performance/

--
Stefan

Quoted 135 lines
Quoted 126 lines
Quoted 118 lines · Oleksij Rempel
Quoted 116 lines

Provide basic support for Cortex-M4 located on NXP iMX7D. This code was tested in combination with imx-rproc driver which will upload with specially formatted ELF image containing kernel, device and CPIO rootfs.

Quoted 1 line
Quoted 1 line
Quoted 1 line

---

?arch/arm/boot/dts/Makefile?????????|??2 +-
?arch/arm/mach-imx/Kconfig??????????| 33 +++++++++++++++++++++------------
?arch/arm/mach-imx/Makefile?????????|??3 ++-
?arch/arm/mach-imx/mach-imx7d-cm4.c | 21 +++++++++++++++++++++

?4 files changed, 45 insertions(+), 14 deletions(-) ?create mode 100644 arch/arm/mach-imx/mach-imx7d-cm4.c

arch/arm/boot/dts/Makefile +0 -0
index 852452515bea..d49bb9a58aee 100644
@@ -527,7 +527,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
 > > > ?	imx6ul-tx6ul-0011.dtb \
 > > > ?	imx6ul-tx6ul-mainboard.dtb \
Quoted 1 line
Quoted 1 line
Quoted 1 line

? imx6ull-14x14-evk.dtb

arch/arm/boot/dts/Makefile +1 -1
-dtb-$(CONFIG_SOC_IMX7D) += \
+dtb-$(CONFIG_SOC_IMX7D_CA7) += \
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

? imx7d-cl-som-imx7.dtb \
? imx7d-colibri-emmc-eval-v3.dtb \
? imx7d-colibri-eval-v3.dtb \

arch/arm/mach-imx/Kconfig +0 -0
index 782699e67600..101c8599d952 100644
@@ -528,18 +528,6 @@ config SOC_IMX6UL
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

? help
? ??This enables support for Freescale i.MX6 UltraLite processor.

?
-config SOC_IMX7D

Quoted 10 lines
Quoted 10 lines

arch/arm/mach-imx/Kconfig config SOC_IMX6UL · line 541

Quoted 10 lines
arch/arm/mach-imx/Kconfig +0 -10
-	bool "i.MX7 Dual support"
-	select PINCTRL_IMX7D
-	select ARM_GIC
-	select HAVE_ARM_ARCH_TIMER
-	select HAVE_IMX_ANATOP
-	select HAVE_IMX_MMDC
-	select HAVE_IMX_SRC
-	select IMX_GPCV2
-	help
-		This enables support for Freescale i.MX7 Dual processor.

-
?config SOC_LS1021A

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

? bool "Freescale LS1021A support"
? select ARM_GIC

arch/arm/mach-imx/Kconfig +0 -0
@@ -554,6 +542,27 @@ comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms"

?
?if ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
?
+config SOC_IMX7D_CA7

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
arch/arm/mach-imx/Kconfig +7 -0
+	bool
+	select ARM_GIC
+	select HAVE_ARM_ARCH_TIMER
+	select HAVE_IMX_ANATOP
+	select HAVE_IMX_MMDC
+	select HAVE_IMX_SRC
+	select IMX_GPCV2
arch/arm/mach-imx/Kconfig +2 -0
+
+config SOC_IMX7D_CM4
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
(quoted diff) +2 -0
+	bool
+	select ARMV7M_SYSTICK
arch/arm/mach-imx/Kconfig +2 -0
+
+config SOC_IMX7D
Quoted 6 lines
Quoted 6 lines

arch/arm/mach-imx/Kconfig comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms" · line 564

Quoted 6 lines
arch/arm/mach-imx/Kconfig +6 -0
+	bool "i.MX7 Dual support"
+	select PINCTRL_IMX7D
+	select SOC_IMX7D_CA7 if ARCH_MULTI_V7
+	select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
+	help
+		This enables support for Freescale i.MX7 Dual processor.

+
?config SOC_VF610

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

? bool "Vybrid Family VF610 support"
? select ARM_GIC if ARCH_MULTI_V7

arch/arm/mach-imx/Makefile +0 -0
index 8ff71058207d..68640f100ef3 100644
@@ -80,7 +80,8 @@ obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o

?obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o
?obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
?obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o

arch/arm/mach-imx/Makefile +2 -1
-obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CA7) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CM4) += mach-imx7d-cm4.o

?
?ifeq ($(CONFIG_SUSPEND),y)
?AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a

arch/arm/mach-imx/mach-imx7d-cm4.c new file +13 -0
new file mode 100644
index 000000000000..c36dea79aeb8
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017 Pengutronix
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <asm/v7m.h>
+#include <asm/mach/arch.h>
+
+static const char * const imx7d_cm4_dt_compat[] __initconst = {
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
arch/arm/mach-imx/mach-imx7d-cm4.c new file +2 -0
+	"fsl,imx7d-cm4",
+	NULL,
arch/arm/mach-imx/mach-imx7d-cm4.c new file +3 -0
+};
+
+DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual Cortex-M4 (Device Tree)")
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

arch/arm/mach-imx/mach-imx7d-cm4.c line 20

Quoted 2 lines
arch/arm/mach-imx/mach-imx7d-cm4.c new file +2 -0
+	.dt_compat = imx7d_cm4_dt_compat,
+	.restart = armv7m_restart,

+MACHINE_END

Quoted 4 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#5 lore raw

PATCH 1/1 ARM: imx: add imx7d-m4

Quoted 26 lines · Stefan Agner
Quoted 13 lines · Lucas Stach

Hi Shawn,

Am Montag, den 11.06.2018, 16:20 +0800 schrieb Shawn Guo:

Quoted 9 lines · Oleksij Rempel
Quoted 5 lines

Hi all,

this patch was send 05.04.2018. Any comments?

@Shawn, can you please take it?

Honestly I'm not sure how useful it will be.??If we can have some i.MX developers ACK on it, I will be more comfortable to take it.

Quoted 8 lines

This is all highly experimental and in PoC stage, but we see some value in running a second Linux system on the M4 coprocessor. There are lots of things that still need to be figured out, but we are working on this from time to time when there are some hours to spare.

This patch seems like a good step in the right direction and IMHO the amount of code and changes is small enough to carry it upstream without impacting anything else. I would be happy if this could be pulled in.

I agree with Lucas here, this is rather minimal and not invasive.

Quoted 6 lines

Out of interest, on what memory region do you run Linux? Do you use caches? In some experiments a while ago I noticed that only 2MiB/(or 4MiB) of DDR memory can use caches, which is somewhat tight to run Linux on.

https://blog.printk.io/2017/05/i-mx-7-cortex-m4-memory-locations-and-performance/

here is DT part for master system on Cortex A7 to run Linux on Cortex M4:

        memory {
                device_type = "memory";
                reg = <0x80000000 0x40000000>;
        };

        reserved-memory {
                #address-cells = <1>;
                #size-cells = <1>;
                ranges;

                m4_reserved_sysmem1: rproc at 88000000 {
                        reg = <0x88000000 0x4000000>;
                        no-map;
                };

                /* not really needed node. used as example */
                m4_reserved_sysmem2: rproc at 88080000 {
                        reg = <0x8c000000 0x80000>;
                        no-map;
                };
        };

        mailbox_test {
                compatible      = "mailbox-test";
                reg             = <0x00900000 0x00020000>, <0x00920000
0x00020000>;
                mboxes          = <&mu0a 0>, <&mu0a 0>;
                mbox-names      = "tx", "rx";
        };
};

/* node reserved for rproc */

&uart1 {
        assigned-clock-rates = <240000000>;
        status = "disabled";
};
&gpt2 {
        assigned-clock-rates = <24000000>;
        status = "disabled";
};
&mu0a {
        status = "okay";
        #mbox-cells = <1>;
};
&imx_rproc {
        status = "okay";
        memory-region = <&m4_reserved_sysmem1>,
                        <&m4_reserved_sysmem2>;

        remote-nodes = <&gpt2>, <&uart1>;
};
Quoted 141 lines

--
Stefan

Quoted 135 lines
Quoted 126 lines
Quoted 118 lines · Oleksij Rempel
Quoted 116 lines

Provide basic support for Cortex-M4 located on NXP iMX7D. This code was tested in combination with imx-rproc driver which will upload with specially formatted ELF image containing kernel, device and CPIO rootfs.

Quoted 1 line
Quoted 1 line
Quoted 1 line

---

?arch/arm/boot/dts/Makefile?????????|??2 +-
?arch/arm/mach-imx/Kconfig??????????| 33 +++++++++++++++++++++------------
?arch/arm/mach-imx/Makefile?????????|??3 ++-
?arch/arm/mach-imx/mach-imx7d-cm4.c | 21 +++++++++++++++++++++

?4 files changed, 45 insertions(+), 14 deletions(-) ?create mode 100644 arch/arm/mach-imx/mach-imx7d-cm4.c

arch/arm/boot/dts/Makefile +0 -0
index 852452515bea..d49bb9a58aee 100644
@@ -527,7 +527,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
 >>> ?	imx6ul-tx6ul-0011.dtb \
 >>> ?	imx6ul-tx6ul-mainboard.dtb \
Quoted 1 line
Quoted 1 line
Quoted 1 line

? imx6ull-14x14-evk.dtb

arch/arm/boot/dts/Makefile +1 -1
-dtb-$(CONFIG_SOC_IMX7D) += \
+dtb-$(CONFIG_SOC_IMX7D_CA7) += \
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

? imx7d-cl-som-imx7.dtb \
? imx7d-colibri-emmc-eval-v3.dtb \
? imx7d-colibri-eval-v3.dtb \

arch/arm/mach-imx/Kconfig +0 -0
index 782699e67600..101c8599d952 100644
@@ -528,18 +528,6 @@ config SOC_IMX6UL
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

? help
? ??This enables support for Freescale i.MX6 UltraLite processor.

?
-config SOC_IMX7D

Quoted 10 lines
Quoted 10 lines

arch/arm/mach-imx/Kconfig config SOC_IMX6UL · line 541

Quoted 10 lines
arch/arm/mach-imx/Kconfig +0 -10
-	bool "i.MX7 Dual support"
-	select PINCTRL_IMX7D
-	select ARM_GIC
-	select HAVE_ARM_ARCH_TIMER
-	select HAVE_IMX_ANATOP
-	select HAVE_IMX_MMDC
-	select HAVE_IMX_SRC
-	select IMX_GPCV2
-	help
-		This enables support for Freescale i.MX7 Dual processor.

-
?config SOC_LS1021A

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

? bool "Freescale LS1021A support"
? select ARM_GIC

arch/arm/mach-imx/Kconfig +0 -0
@@ -554,6 +542,27 @@ comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms"

?
?if ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
?
+config SOC_IMX7D_CA7

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
arch/arm/mach-imx/Kconfig +7 -0
+	bool
+	select ARM_GIC
+	select HAVE_ARM_ARCH_TIMER
+	select HAVE_IMX_ANATOP
+	select HAVE_IMX_MMDC
+	select HAVE_IMX_SRC
+	select IMX_GPCV2
arch/arm/mach-imx/Kconfig +2 -0
+
+config SOC_IMX7D_CM4
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
(quoted diff) +2 -0
+	bool
+	select ARMV7M_SYSTICK
arch/arm/mach-imx/Kconfig +2 -0
+
+config SOC_IMX7D
Quoted 6 lines
Quoted 6 lines

arch/arm/mach-imx/Kconfig comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms" · line 564

Quoted 6 lines
arch/arm/mach-imx/Kconfig +6 -0
+	bool "i.MX7 Dual support"
+	select PINCTRL_IMX7D
+	select SOC_IMX7D_CA7 if ARCH_MULTI_V7
+	select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
+	help
+		This enables support for Freescale i.MX7 Dual processor.

+
?config SOC_VF610

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

? bool "Vybrid Family VF610 support"
? select ARM_GIC if ARCH_MULTI_V7

arch/arm/mach-imx/Makefile +0 -0
index 8ff71058207d..68640f100ef3 100644
@@ -80,7 +80,8 @@ obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o

?obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o
?obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
?obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o

arch/arm/mach-imx/Makefile +2 -1
-obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CA7) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CM4) += mach-imx7d-cm4.o

?
?ifeq ($(CONFIG_SUSPEND),y)
?AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a

arch/arm/mach-imx/mach-imx7d-cm4.c new file +13 -0
new file mode 100644
index 000000000000..c36dea79aeb8
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017 Pengutronix
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <asm/v7m.h>
+#include <asm/mach/arch.h>
+
+static const char * const imx7d_cm4_dt_compat[] __initconst = {
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
arch/arm/mach-imx/mach-imx7d-cm4.c new file +2 -0
+	"fsl,imx7d-cm4",
+	NULL,
arch/arm/mach-imx/mach-imx7d-cm4.c new file +3 -0
+};
+
+DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual Cortex-M4 (Device Tree)")
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

arch/arm/mach-imx/mach-imx7d-cm4.c line 20

Quoted 2 lines
arch/arm/mach-imx/mach-imx7d-cm4.c new file +2 -0
+	.dt_compat = imx7d_cm4_dt_compat,
+	.restart = armv7m_restart,

+MACHINE_END

Quoted 4 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180611/f252f40a/attachment.sig>

#6 lore raw

PATCH 1/1 ARM: imx: add imx7d-m4

Quoted 36 lines · Oleksij Rempel
Quoted 26 lines · Stefan Agner
Quoted 13 lines · Lucas Stach

Hi Shawn,

Am Montag, den 11.06.2018, 16:20 +0800 schrieb Shawn Guo:

Quoted 9 lines · Oleksij Rempel
Quoted 5 lines

Hi all,

this patch was send 05.04.2018. Any comments?

@Shawn, can you please take it?

Honestly I'm not sure how useful it will be.??If we can have some i.MX developers ACK on it, I will be more comfortable to take it.

Quoted 8 lines

This is all highly experimental and in PoC stage, but we see some value in running a second Linux system on the M4 coprocessor. There are lots of things that still need to be figured out, but we are working on this from time to time when there are some hours to spare.

This patch seems like a good step in the right direction and IMHO the amount of code and changes is small enough to carry it upstream without impacting anything else. I would be happy if this could be pulled in.

I agree with Lucas here, this is rather minimal and not invasive.

Quoted 6 lines

Out of interest, on what memory region do you run Linux? Do you use caches? In some experiments a while ago I noticed that only 2MiB/(or 4MiB) of DDR memory can use caches, which is somewhat tight to run Linux on.

https://blog.printk.io/2017/05/i-mx-7-cortex-m4-memory-locations-and-performance/

here is DT part for master system on Cortex A7 to run Linux on Cortex M4:

Quoted 14 lines
        memory {
                device_type = "memory";
                reg = <0x80000000 0x40000000>;
        };

        reserved-memory {
                #address-cells = <1>;
                #size-cells = <1>;
                ranges;

                m4_reserved_sysmem1: rproc at 88000000 {
                        reg = <0x88000000 0x4000000>;
                        no-map;
                };

So I guess that is where Linux on the M4 goes? Afaik this is in the uncacheable area, so it is rather slow?

--
Stefan

Quoted 190 lines
                /* not really needed node. used as example */
                m4_reserved_sysmem2: rproc at 88080000 {
                        reg = <0x8c000000 0x80000>;
                        no-map;
                };
        };

        mailbox_test {
                compatible      = "mailbox-test";
                reg             = <0x00900000 0x00020000>, <0x00920000
0x00020000>;
                mboxes          = <&mu0a 0>, <&mu0a 0>;
                mbox-names      = "tx", "rx";
        };
};

/* node reserved for rproc */

&uart1 {
        assigned-clock-rates = <240000000>;
        status = "disabled";
};
&gpt2 {
        assigned-clock-rates = <24000000>;
        status = "disabled";
};
&mu0a {
        status = "okay";
        #mbox-cells = <1>;
};
&imx_rproc {
        status = "okay";
        memory-region = <&m4_reserved_sysmem1>,
                        <&m4_reserved_sysmem2>;

        remote-nodes = <&gpt2>, <&uart1>;
};
Quoted 141 lines

--
Stefan

Quoted 135 lines
Quoted 126 lines
Quoted 118 lines · Oleksij Rempel
Quoted 116 lines

Provide basic support for Cortex-M4 located on NXP iMX7D. This code was tested in combination with imx-rproc driver which will upload with specially formatted ELF image containing kernel, device and CPIO rootfs.

Quoted 1 line
Quoted 1 line
Quoted 1 line

---

?arch/arm/boot/dts/Makefile?????????|??2 +-
?arch/arm/mach-imx/Kconfig??????????| 33 +++++++++++++++++++++------------
?arch/arm/mach-imx/Makefile?????????|??3 ++-
?arch/arm/mach-imx/mach-imx7d-cm4.c | 21 +++++++++++++++++++++

?4 files changed, 45 insertions(+), 14 deletions(-) ?create mode 100644 arch/arm/mach-imx/mach-imx7d-cm4.c

arch/arm/boot/dts/Makefile +0 -0
index 852452515bea..d49bb9a58aee 100644
@@ -527,7 +527,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
 >>> ?	imx6ul-tx6ul-0011.dtb \
 >>> ?	imx6ul-tx6ul-mainboard.dtb \
Quoted 1 line
Quoted 1 line
Quoted 1 line

? imx6ull-14x14-evk.dtb

arch/arm/boot/dts/Makefile +1 -1
-dtb-$(CONFIG_SOC_IMX7D) += \
+dtb-$(CONFIG_SOC_IMX7D_CA7) += \
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

? imx7d-cl-som-imx7.dtb \
? imx7d-colibri-emmc-eval-v3.dtb \
? imx7d-colibri-eval-v3.dtb \

arch/arm/mach-imx/Kconfig +0 -0
index 782699e67600..101c8599d952 100644
@@ -528,18 +528,6 @@ config SOC_IMX6UL
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

? help
? ??This enables support for Freescale i.MX6 UltraLite processor.

?
-config SOC_IMX7D

Quoted 10 lines
Quoted 10 lines

arch/arm/mach-imx/Kconfig config SOC_IMX6UL · line 541

Quoted 10 lines
arch/arm/mach-imx/Kconfig +0 -10
-	bool "i.MX7 Dual support"
-	select PINCTRL_IMX7D
-	select ARM_GIC
-	select HAVE_ARM_ARCH_TIMER
-	select HAVE_IMX_ANATOP
-	select HAVE_IMX_MMDC
-	select HAVE_IMX_SRC
-	select IMX_GPCV2
-	help
-		This enables support for Freescale i.MX7 Dual processor.

-
?config SOC_LS1021A

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

? bool "Freescale LS1021A support"
? select ARM_GIC

arch/arm/mach-imx/Kconfig +0 -0
@@ -554,6 +542,27 @@ comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms"

?
?if ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
?
+config SOC_IMX7D_CA7

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
arch/arm/mach-imx/Kconfig +7 -0
+	bool
+	select ARM_GIC
+	select HAVE_ARM_ARCH_TIMER
+	select HAVE_IMX_ANATOP
+	select HAVE_IMX_MMDC
+	select HAVE_IMX_SRC
+	select IMX_GPCV2
arch/arm/mach-imx/Kconfig +2 -0
+
+config SOC_IMX7D_CM4
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
(quoted diff) +2 -0
+	bool
+	select ARMV7M_SYSTICK
arch/arm/mach-imx/Kconfig +2 -0
+
+config SOC_IMX7D
Quoted 6 lines
Quoted 6 lines

arch/arm/mach-imx/Kconfig comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms" · line 564

Quoted 6 lines
arch/arm/mach-imx/Kconfig +6 -0
+	bool "i.MX7 Dual support"
+	select PINCTRL_IMX7D
+	select SOC_IMX7D_CA7 if ARCH_MULTI_V7
+	select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
+	help
+		This enables support for Freescale i.MX7 Dual processor.

+
?config SOC_VF610

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

? bool "Vybrid Family VF610 support"
? select ARM_GIC if ARCH_MULTI_V7

arch/arm/mach-imx/Makefile +0 -0
index 8ff71058207d..68640f100ef3 100644
@@ -80,7 +80,8 @@ obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o

?obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o
?obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
?obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o

arch/arm/mach-imx/Makefile +2 -1
-obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CA7) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CM4) += mach-imx7d-cm4.o

?
?ifeq ($(CONFIG_SUSPEND),y)
?AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a

arch/arm/mach-imx/mach-imx7d-cm4.c new file +13 -0
new file mode 100644
index 000000000000..c36dea79aeb8
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017 Pengutronix
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <asm/v7m.h>
+#include <asm/mach/arch.h>
+
+static const char * const imx7d_cm4_dt_compat[] __initconst = {
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
arch/arm/mach-imx/mach-imx7d-cm4.c new file +2 -0
+	"fsl,imx7d-cm4",
+	NULL,
arch/arm/mach-imx/mach-imx7d-cm4.c new file +3 -0
+};
+
+DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual Cortex-M4 (Device Tree)")
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

arch/arm/mach-imx/mach-imx7d-cm4.c line 20

Quoted 2 lines
arch/arm/mach-imx/mach-imx7d-cm4.c new file +2 -0
+	.dt_compat = imx7d_cm4_dt_compat,
+	.restart = armv7m_restart,

+MACHINE_END

Quoted 4 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#7 lore raw

PATCH 1/1 ARM: imx: add imx7d-m4

Quoted 47 lines · Stefan Agner
Quoted 46 lines · Oleksij Rempel
Quoted 26 lines · Stefan Agner
Quoted 13 lines · Lucas Stach

Hi Shawn,

Am Montag, den 11.06.2018, 16:20 +0800 schrieb Shawn Guo:

Quoted 9 lines · Oleksij Rempel
Quoted 5 lines

Hi all,

this patch was send 05.04.2018. Any comments?

@Shawn, can you please take it?

Honestly I'm not sure how useful it will be.??If we can have some i.MX developers ACK on it, I will be more comfortable to take it.

Quoted 8 lines

This is all highly experimental and in PoC stage, but we see some value in running a second Linux system on the M4 coprocessor. There are lots of things that still need to be figured out, but we are working on this from time to time when there are some hours to spare.

This patch seems like a good step in the right direction and IMHO the amount of code and changes is small enough to carry it upstream without impacting anything else. I would be happy if this could be pulled in.

I agree with Lucas here, this is rather minimal and not invasive.

Quoted 6 lines

Out of interest, on what memory region do you run Linux? Do you use caches? In some experiments a while ago I noticed that only 2MiB/(or 4MiB) of DDR memory can use caches, which is somewhat tight to run Linux on.

https://blog.printk.io/2017/05/i-mx-7-cortex-m4-memory-locations-and-performance/

here is DT part for master system on Cortex A7 to run Linux on Cortex M4:

        memory {
                device_type = "memory";
                reg = <0x80000000 0x40000000>;
        };

        reserved-memory {
                #address-cells = <1>;
                #size-cells = <1>;
                ranges;
Quoted 7 lines
Quoted 4 lines
                m4_reserved_sysmem1: rproc at 88000000 {
                        reg = <0x88000000 0x4000000>;
                        no-map;
                };

So I guess that is where Linux on the M4 goes? Afaik this is in the uncacheable area, so it is rather slow?

I didn't made any performance optimization or comparison.

Signature · 11 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180611/ccc21651/attachment.sig>
reviewer
#8 lore raw

PATCH 1/1 ARM: imx: add imx7d-m4

In reply to Stefan Agner
Quoted 19 lines · Stefan Agner
Quoted 18 lines · Lucas Stach

Hi Shawn,

Am Montag, den 11.06.2018, 16:20 +0800 schrieb Shawn Guo:

Quoted 9 lines · Oleksij Rempel
Quoted 5 lines

Hi all,

this patch was send 05.04.2018. Any comments?

@Shawn, can you please take it?

Honestly I'm not sure how useful it will be. If we can have some i.MX developers ACK on it, I will be more comfortable to take it.

This is all highly experimental and in PoC stage, but we see some value in running a second Linux system on the M4 coprocessor. There are lots of things that still need to be figured out, but we are working on this from time to time when there are some hours to spare.

Quoted 5 lines
Quoted 3 lines

This patch seems like a good step in the right direction and IMHO the amount of code and changes is small enough to carry it upstream without impacting anything else. I would be happy if this could be pulled in.

I agree with Lucas here, this is rather minimal and not invasive.

Agreed here as well.

It would be nice if we could start improving the CortexM4 support in general with mainline.

Thanks

#9 lore raw

PATCH 1/1 ARM: imx: add imx7d-m4

In reply to Oleksij Rempel
Quoted 19 lines · Oleksij Rempel

Provide basic support for Cortex-M4 located on NXP iMX7D. This code was tested in combination with imx-rproc driver which will upload with specially formatted ELF image containing kernel, device and CPIO rootfs.

---
 arch/arm/boot/dts/Makefile         |  2 +-
 arch/arm/mach-imx/Kconfig          | 33 +++++++++++++++++++++------------
 arch/arm/mach-imx/Makefile         |  3 ++-
 arch/arm/mach-imx/mach-imx7d-cm4.c | 21 +++++++++++++++++++++
 4 files changed, 45 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/mach-imx/mach-imx7d-cm4.c
arch/arm/boot/dts/Makefile +0 -0
index 852452515bea..d49bb9a58aee 100644

arch/arm/boot/dts/Makefile dtb-$(CONFIG_SOC_IMX6UL) += \ · line 530

Quoted 5 lines
arch/arm/boot/dts/Makefile +1 -1
@@ -527,7 +527,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
 	imx6ul-tx6ul-0011.dtb \
 	imx6ul-tx6ul-mainboard.dtb \
 	imx6ull-14x14-evk.dtb
-dtb-$(CONFIG_SOC_IMX7D) += \
+dtb-$(CONFIG_SOC_IMX7D_CA7) += \

I would keep this unchanged, and have future IMX7D_CM4 DTBs just covered by CONFIG_SOC_IMX7D as well.

Shawn

Quoted 98 lines
arch/arm/boot/dts/Makefile +0 -0
 	imx7d-cl-som-imx7.dtb \
 	imx7d-colibri-emmc-eval-v3.dtb \
 	imx7d-colibri-eval-v3.dtb \
arch/arm/mach-imx/Kconfig +21 -12
index 782699e67600..101c8599d952 100644
@@ -528,18 +528,6 @@ config SOC_IMX6UL
 	help
 	  This enables support for Freescale i.MX6 UltraLite processor.
 
-config SOC_IMX7D
-	bool "i.MX7 Dual support"
-	select PINCTRL_IMX7D
-	select ARM_GIC
-	select HAVE_ARM_ARCH_TIMER
-	select HAVE_IMX_ANATOP
-	select HAVE_IMX_MMDC
-	select HAVE_IMX_SRC
-	select IMX_GPCV2
-	help
-		This enables support for Freescale i.MX7 Dual processor.
-
 config SOC_LS1021A
 	bool "Freescale LS1021A support"
 	select ARM_GIC
@@ -554,6 +542,27 @@ comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms"
 
 if ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
 
+config SOC_IMX7D_CA7
+	bool
+	select ARM_GIC
+	select HAVE_ARM_ARCH_TIMER
+	select HAVE_IMX_ANATOP
+	select HAVE_IMX_MMDC
+	select HAVE_IMX_SRC
+	select IMX_GPCV2
+
+config SOC_IMX7D_CM4
+	bool
+	select ARMV7M_SYSTICK
+
+config SOC_IMX7D
+	bool "i.MX7 Dual support"
+	select PINCTRL_IMX7D
+	select SOC_IMX7D_CA7 if ARCH_MULTI_V7
+	select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
+	help
+		This enables support for Freescale i.MX7 Dual processor.
+
 config SOC_VF610
 	bool "Vybrid Family VF610 support"
 	select ARM_GIC if ARCH_MULTI_V7
arch/arm/mach-imx/Makefile +2 -1
index 8ff71058207d..68640f100ef3 100644
@@ -80,7 +80,8 @@ obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o
 obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o
 obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
 obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o
-obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CA7) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CM4) += mach-imx7d-cm4.o
 
 ifeq ($(CONFIG_SUSPEND),y)
 AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
arch/arm/mach-imx/mach-imx7d-cm4.c new file +21 -0
new file mode 100644
index 000000000000..c36dea79aeb8
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017 Pengutronix
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <asm/v7m.h>
+#include <asm/mach/arch.h>
+
+static const char * const imx7d_cm4_dt_compat[] __initconst = {
+	"fsl,imx7d-cm4",
+	NULL,
+};
+
+DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual Cortex-M4 (Device Tree)")
+	.dt_compat = imx7d_cm4_dt_compat,
+	.restart = armv7m_restart,
+MACHINE_END
Signature · 1 line
2.16.1
#10 lore raw

PATCH 1/1 ARM: imx: add imx7d-m4

Quoted 15 lines · Shawn Guo
Quoted 14 lines · Oleksij Rempel

Provide basic support for Cortex-M4 located on NXP iMX7D. This code was tested in combination with imx-rproc driver which will upload with specially formatted ELF image containing kernel, device and CPIO rootfs.

---
 arch/arm/boot/dts/Makefile         |  2 +-
 arch/arm/mach-imx/Kconfig          | 33 +++++++++++++++++++++------------
 arch/arm/mach-imx/Makefile         |  3 ++-
 arch/arm/mach-imx/mach-imx7d-cm4.c | 21 +++++++++++++++++++++
 4 files changed, 45 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/mach-imx/mach-imx7d-cm4.c
Quoted 13 lines

arch/arm/boot/dts/Makefile dtb-$(CONFIG_SOC_IMX6UL) += \ · line 530

Quoted 10 lines
arch/arm/boot/dts/Makefile +1 -1
index 852452515bea..d49bb9a58aee 100644
@@ -527,7 +527,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
 	imx6ul-tx6ul-0011.dtb \
 	imx6ul-tx6ul-mainboard.dtb \
 	imx6ull-14x14-evk.dtb
-dtb-$(CONFIG_SOC_IMX7D) += \
+dtb-$(CONFIG_SOC_IMX7D_CA7) += \

I would keep this unchanged, and have future IMX7D_CM4 DTBs just covered by CONFIG_SOC_IMX7D as well.

ok, done

Quoted 92 lines

Shawn

Quoted 90 lines
arch/arm/boot/dts/Makefile +0 -0
 	imx7d-cl-som-imx7.dtb \
 	imx7d-colibri-emmc-eval-v3.dtb \
 	imx7d-colibri-eval-v3.dtb \
arch/arm/mach-imx/Kconfig +21 -12
index 782699e67600..101c8599d952 100644
@@ -528,18 +528,6 @@ config SOC_IMX6UL
 	help
 	  This enables support for Freescale i.MX6 UltraLite processor.
 
-config SOC_IMX7D
-	bool "i.MX7 Dual support"
-	select PINCTRL_IMX7D
-	select ARM_GIC
-	select HAVE_ARM_ARCH_TIMER
-	select HAVE_IMX_ANATOP
-	select HAVE_IMX_MMDC
-	select HAVE_IMX_SRC
-	select IMX_GPCV2
-	help
-		This enables support for Freescale i.MX7 Dual processor.
-
 config SOC_LS1021A
 	bool "Freescale LS1021A support"
 	select ARM_GIC
@@ -554,6 +542,27 @@ comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms"
 
 if ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
 
+config SOC_IMX7D_CA7
+	bool
+	select ARM_GIC
+	select HAVE_ARM_ARCH_TIMER
+	select HAVE_IMX_ANATOP
+	select HAVE_IMX_MMDC
+	select HAVE_IMX_SRC
+	select IMX_GPCV2
+
+config SOC_IMX7D_CM4
+	bool
+	select ARMV7M_SYSTICK
+
+config SOC_IMX7D
+	bool "i.MX7 Dual support"
+	select PINCTRL_IMX7D
+	select SOC_IMX7D_CA7 if ARCH_MULTI_V7
+	select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
+	help
+		This enables support for Freescale i.MX7 Dual processor.
+
 config SOC_VF610
 	bool "Vybrid Family VF610 support"
 	select ARM_GIC if ARCH_MULTI_V7
arch/arm/mach-imx/Makefile +2 -1
index 8ff71058207d..68640f100ef3 100644
@@ -80,7 +80,8 @@ obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o
 obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o
 obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
 obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o
-obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CA7) += mach-imx7d.o
+obj-$(CONFIG_SOC_IMX7D_CM4) += mach-imx7d-cm4.o
 
 ifeq ($(CONFIG_SUSPEND),y)
 AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
arch/arm/mach-imx/mach-imx7d-cm4.c new file +16 -0
new file mode 100644
index 000000000000..c36dea79aeb8
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017 Pengutronix
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <asm/v7m.h>
+#include <asm/mach/arch.h>
+
+static const char * const imx7d_cm4_dt_compat[] __initconst = {
+	"fsl,imx7d-cm4",
+	NULL,
+};
Quoted 9 lines
Quoted 8 lines
arch/arm/mach-imx/mach-imx7d-cm4.c new file +5 -0
+
+DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual Cortex-M4 (Device Tree)")
+	.dt_compat = imx7d_cm4_dt_compat,
+	.restart = armv7m_restart,
+MACHINE_END
Signature · 1 line
2.16.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180702/3da5e6fb/attachment.sig>

#11 lore raw

PATCH 1/1 ARM: imx: add imx7d-m4

In reply to Oleksij Rempel
Quoted 6 lines · Oleksij Rempel

Provide basic support for Cortex-M4 located on NXP iMX7D. This code was tested in combination with imx-rproc driver which will upload with specially formatted ELF image containing kernel, device and CPIO rootfs.

Can we make the patch subject a bit more complete, at least like "ARM: imx: add imx7d-m4 support" or something?

Shawn

#12 lore raw

PATCH 1/1 ARM: imx: add imx7d-m4

Quoted 10 lines · Shawn Guo
Quoted 6 lines · Oleksij Rempel

Provide basic support for Cortex-M4 located on NXP iMX7D. This code was tested in combination with imx-rproc driver which will upload with specially formatted ELF image containing kernel, device and CPIO rootfs.

Can we make the patch subject a bit more complete, at least like "ARM: imx: add imx7d-m4 support" or something?

ok.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180702/bebf1ca0/attachment.sig>