summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/cpu/armv7/vf610/generic.c42
-rw-r--r--arch/arm/imx-common/Kconfig2
-rw-r--r--arch/arm/imx-common/Makefile4
-rw-r--r--arch/arm/include/asm/arch-vf610/sys_proto.h8
-rw-r--r--configs/colibri_vf_defconfig1
5 files changed, 55 insertions, 2 deletions
diff --git a/arch/arm/cpu/armv7/vf610/generic.c b/arch/arm/cpu/armv7/vf610/generic.c
index 50eb0c6b97..0456aba0d6 100644
--- a/arch/arm/cpu/armv7/vf610/generic.c
+++ b/arch/arm/cpu/armv7/vf610/generic.c
@@ -371,3 +371,45 @@ void enable_caches(void)
mmu_set_region_dcache_behaviour(IRAM_BASE_ADDR, IRAM_SIZE, option);
}
#endif
+
+#ifdef CONFIG_IMX_BOOTAUX
+#define CCM_CCOWR_START 0x00015a5a
+
+const struct memorymap hostmap[] = {
+ { .auxcore = 0x00000000, .host = 0x00000000, .size = 0x18000 },
+ { .auxcore = 0x1f000000, .host = 0x3f000000, .size = 0x80000 },
+ { .auxcore = 0x1f800000, .host = 0x1f800000, .size = 0x8000 },
+ { .auxcore = 0x3f000000, .host = 0x3f000000, .size = 0x80000 },
+ { .auxcore = 0x3f800000, .host = 0x3f800000, .size = 0x8000 },
+ { .auxcore = 0x00800000, .host = 0x80800000, .size = 0x0f800000 },
+ { .auxcore = 0x80000000, .host = 0x80000000, .size = 0xe0000000 },
+ { /* sentinel */ }
+};
+
+/* The Cortex-M4 starts from the address present in SRC_GPR2 */
+int arch_auxiliary_core_up(u32 core_id, u32 stack, u32 pc)
+{
+ struct src *src = (struct src *)SRC_BASE_ADDR;
+ struct ccm_reg *ccm = (struct ccm_reg *)CCM_BASE_ADDR;
+
+ /* Set the PC for the Cortex-M4 */
+ writel(pc, &src->gpr2);
+
+ /* Enable M4 */
+ writel(CCM_CCOWR_START, &ccm->ccowr);
+
+ return 0;
+}
+
+int arch_auxiliary_core_check_up(u32 core_id)
+{
+ uint32_t val;
+ struct ccm_reg *ccm = (struct ccm_reg *)CCM_BASE_ADDR;
+
+ val = readl(&ccm->ccowr);
+ if (val & 0x00010000)
+ return 1;
+
+ return 0;
+}
+#endif
diff --git a/arch/arm/imx-common/Kconfig b/arch/arm/imx-common/Kconfig
index a6b61ad20a..f70aa30a91 100644
--- a/arch/arm/imx-common/Kconfig
+++ b/arch/arm/imx-common/Kconfig
@@ -14,7 +14,7 @@ config IMX_RDC
config IMX_BOOTAUX
bool "Support boot auxiliary core"
- depends on ARCH_MX7 || ARCH_MX6
+ depends on ARCH_MX7 || ARCH_MX6 || ARCH_VF610
help
bootaux [addr] to boot auxiliary core.
diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index e59291041b..fca4d87975 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -28,9 +28,11 @@ obj-y += cache.o init.o
obj-$(CONFIG_CMD_SATA) += sata.o
obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o
obj-$(CONFIG_IMX_RDC) += rdc-sema.o
-obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
obj-$(CONFIG_SECURE_BOOT) += hab.o
endif
+ifeq ($(SOC),$(filter $(SOC),mx6 mx7 vf610))
+obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
+endif
ifeq ($(SOC),$(filter $(SOC),vf610))
obj-y += ddrmc-vf610.o
endif
diff --git a/arch/arm/include/asm/arch-vf610/sys_proto.h b/arch/arm/include/asm/arch-vf610/sys_proto.h
new file mode 100644
index 0000000000..2a39816c7b
--- /dev/null
+++ b/arch/arm/include/asm/arch-vf610/sys_proto.h
@@ -0,0 +1,8 @@
+/*
+ * (C) Copyright 2017
+ * Stefan Agner, Toradex
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <asm/imx-common/sys_proto.h>
diff --git a/configs/colibri_vf_defconfig b/configs/colibri_vf_defconfig
index 1467c39974..88b3682422 100644
--- a/configs/colibri_vf_defconfig
+++ b/configs/colibri_vf_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
CONFIG_ARCH_VF610=y
CONFIG_DM_SERIAL=y
CONFIG_TARGET_COLIBRI_VF=y
+CONFIG_IMX_BOOTAUX=y
CONFIG_DEFAULT_DEVICE_TREE="vf610-colibri"
CONFIG_FIT=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,ENV_IS_IN_NAND,IMX_NAND"