summaryrefslogtreecommitdiff
path: root/board/renesas/rcar-gen2-common
diff options
context:
space:
mode:
authorNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>2014-12-02 16:52:20 +0900
committerNobuhiro Iwamatsu <iwamatsu@nigauri.org>2014-12-05 11:04:52 +0900
commit72fd3838c6cc861e5061d99316c35eed62a3fb85 (patch)
tree85dcf36fe07d4afa87d51842117ca096a072ad98 /board/renesas/rcar-gen2-common
parent44e1eebf86efc917010b8fd482951b10c3b06453 (diff)
downloadu-boot-imx-72fd3838c6cc861e5061d99316c35eed62a3fb85.zip
u-boot-imx-72fd3838c6cc861e5061d99316c35eed62a3fb85.tar.gz
u-boot-imx-72fd3838c6cc861e5061d99316c35eed62a3fb85.tar.bz2
arm: rmobile: rcar: Move arch_preboot_os function to rcar-gen2-common/common.c
The arch_preboot_os function used in boards using R-Car ARM SoC (r8a7790, r8a7791, r8a7793 and r8a7794) is common. This makes rcar-gen2-common/common.c file providing common function for R-Car ARM SoC, and moves this function to this file. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Diffstat (limited to 'board/renesas/rcar-gen2-common')
-rw-r--r--board/renesas/rcar-gen2-common/common.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/board/renesas/rcar-gen2-common/common.c b/board/renesas/rcar-gen2-common/common.c
new file mode 100644
index 0000000..23010ee
--- /dev/null
+++ b/board/renesas/rcar-gen2-common/common.c
@@ -0,0 +1,27 @@
+/*
+ * board/renesas/rcar-gen2-common/common.c
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ * Copyright (C) 2013 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/rmobile.h>
+#include <asm/arch/rcar-mstp.h>
+
+#define TSTR0 0x04
+#define TSTR0_STR0 0x01
+
+#define TMU0_MSTP125 (1 << 25)
+void arch_preboot_os(void)
+{
+ /* stop TMU0 */
+ mstp_clrbits_le32(TMU_BASE + TSTR0, TMU_BASE + TSTR0, TSTR0_STR0);
+
+ /* Disable TMU0 */
+ mstp_setbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125);
+}