summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/keystone/init.c
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2014-04-29 17:41:19 +0200
committerStefano Babic <sbabic@denx.de>2014-04-29 17:41:19 +0200
commit3deb22a4844cbda1a05c60dd29d8926e4dddaa4e (patch)
tree767063f0d9e0acfd7445db47abf0d4ac94abdc1d /arch/arm/cpu/armv7/keystone/init.c
parent3b31605aef069d183a9d0c1e3aa6f957503cd56b (diff)
parentc9aab0f9dd23fddcebf5984dc19e62b514e759a7 (diff)
downloadu-boot-imx-3deb22a4844cbda1a05c60dd29d8926e4dddaa4e.zip
u-boot-imx-3deb22a4844cbda1a05c60dd29d8926e4dddaa4e.tar.gz
u-boot-imx-3deb22a4844cbda1a05c60dd29d8926e4dddaa4e.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-arm
Diffstat (limited to 'arch/arm/cpu/armv7/keystone/init.c')
-rw-r--r--arch/arm/cpu/armv7/keystone/init.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/keystone/init.c b/arch/arm/cpu/armv7/keystone/init.c
new file mode 100644
index 0000000..044015a
--- /dev/null
+++ b/arch/arm/cpu/armv7/keystone/init.c
@@ -0,0 +1,56 @@
+/*
+ * Keystone2: Architecture initialization
+ *
+ * (C) Copyright 2012-2014
+ * Texas Instruments Incorporated, <www.ti.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/hardware.h>
+
+void chip_configuration_unlock(void)
+{
+ __raw_writel(KEYSTONE_KICK0_MAGIC, KEYSTONE_KICK0);
+ __raw_writel(KEYSTONE_KICK1_MAGIC, KEYSTONE_KICK1);
+}
+
+int arch_cpu_init(void)
+{
+ chip_configuration_unlock();
+ icache_enable();
+
+#ifdef CONFIG_SOC_K2HK
+ share_all_segments(8);
+ share_all_segments(9);
+ share_all_segments(10); /* QM PDSP */
+ share_all_segments(11); /* PCIE */
+#endif
+
+ return 0;
+}
+
+void reset_cpu(ulong addr)
+{
+ volatile u32 *rstctrl = (volatile u32 *)(KS2_RSTCTRL);
+ u32 tmp;
+
+ tmp = *rstctrl & KS2_RSTCTRL_MASK;
+ *rstctrl = tmp | KS2_RSTCTRL_KEY;
+
+ *rstctrl &= KS2_RSTCTRL_SWRST;
+
+ for (;;)
+ ;
+}
+
+void enable_caches(void)
+{
+#ifndef CONFIG_SYS_DCACHE_OFF
+ /* Enable D-cache. I-cache is already enabled in start.S */
+ dcache_enable();
+#endif
+}