summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-rockchip
diff options
context:
space:
mode:
authorBeniamino Galvani <b.galvani@gmail.com>2014-04-27 11:30:36 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-04-29 08:12:33 +0200
commit036f0f1c6016939b88f0de0a339919f6076aa134 (patch)
tree5a47fd375fd1174d12ea007fd751888ac7ff0929 /arch/arm/mach-rockchip
parent8fe4e0058f7082a090988fdbf881a3eebf08cf57 (diff)
downloadbarebox-036f0f1c6016939b88f0de0a339919f6076aa134.tar.gz
barebox-036f0f1c6016939b88f0de0a339919f6076aa134.tar.xz
ARM: add basic support for Rockchip SoCs
This patch adds a basic support for the ARM-based Rockchip SoCs of the RK3xxx family. Signed-off-by: Beniamino Galvani <b.galvani@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-rockchip')
-rw-r--r--arch/arm/mach-rockchip/Kconfig7
-rw-r--r--arch/arm/mach-rockchip/Makefile1
-rw-r--r--arch/arm/mach-rockchip/core.c28
-rw-r--r--arch/arm/mach-rockchip/include/mach/rockchip-regs.h25
4 files changed, 61 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
new file mode 100644
index 0000000000..dfaf146a69
--- /dev/null
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -0,0 +1,7 @@
+if ARCH_ROCKCHIP
+
+config ARCH_TEXT_BASE
+ hex
+ default 0x68000000
+
+endif
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
new file mode 100644
index 0000000000..820eb10ac2
--- /dev/null
+++ b/arch/arm/mach-rockchip/Makefile
@@ -0,0 +1 @@
+obj-y += core.o
diff --git a/arch/arm/mach-rockchip/core.c b/arch/arm/mach-rockchip/core.c
new file mode 100644
index 0000000000..bab06df63c
--- /dev/null
+++ b/arch/arm/mach-rockchip/core.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com>
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <asm/io.h>
+#include <common.h>
+#include <mach/rockchip-regs.h>
+
+void __noreturn reset_cpu(unsigned long addr)
+{
+ /* Map bootrom from address 0 */
+ writel(RK_SOC_CON0_REMAP << 16, RK_GRF_BASE + RK_GRF_SOC_CON0);
+ /* Reset */
+ writel(0xeca8, RK_CRU_BASE + RK_CRU_GLB_SRST_SND);
+
+ while (1)
+ ;
+}
+EXPORT_SYMBOL(reset_cpu);
diff --git a/arch/arm/mach-rockchip/include/mach/rockchip-regs.h b/arch/arm/mach-rockchip/include/mach/rockchip-regs.h
new file mode 100644
index 0000000000..a6a1c640d6
--- /dev/null
+++ b/arch/arm/mach-rockchip/include/mach/rockchip-regs.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com>
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __MACH_ROCKCHIP_REGS_H
+#define __MACH_ROCKCHIP_REGS_H
+
+#define RK_CRU_BASE 0x20000000
+#define RK_GRF_BASE 0x20008000
+
+#define RK_CRU_GLB_SRST_SND 0x0104
+#define RK_GRF_SOC_CON0 0x00a0
+
+#define RK_SOC_CON0_REMAP (1 << 12)
+
+#endif /* __MACH_ROCKCHIP_REGS_H */