]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
arm: rmobile: rcar: Move arch_preboot_os function to rcar-gen2-common/common.c
authorNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Tue, 2 Dec 2014 07:52:20 +0000 (16:52 +0900)
committerNobuhiro Iwamatsu <iwamatsu@nigauri.org>
Fri, 5 Dec 2014 02:04:52 +0000 (11:04 +0900)
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>
board/renesas/alt/Makefile
board/renesas/alt/alt.c
board/renesas/gose/Makefile
board/renesas/gose/gose.c
board/renesas/koelsch/Makefile
board/renesas/koelsch/koelsch.c
board/renesas/lager/Makefile
board/renesas/lager/lager.c
board/renesas/rcar-gen2-common/common.c [new file with mode: 0644]

index 9ed12bd87d2b4985fc76a37fda62534f1301b525..6904e39b12800b7bf9600e41d7075824597868a4 100644 (file)
@@ -6,4 +6,4 @@
 # SPDX-License-Identifier: GPL-2.0
 #
 
-obj-y  := alt.o qos.o
+obj-y  := alt.o qos.o ../rcar-gen2-common/common.o
index e3cfe54824b0a77565b1f0fddc0d65e5da48a47c..c794d43ee4fc587d11cb1eda497ffb3afbdf448d 100644 (file)
@@ -60,12 +60,6 @@ int board_early_init_f(void)
        return 0;
 }
 
-void arch_preboot_os(void)
-{
-       /* Disable TMU0 */
-       mstp_setbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125);
-}
-
 int board_init(void)
 {
        /* adress of boot parameters */
index a4fb6cc43de12353e78d71a210ca0e930dc749aa..2dac748efbe74b2db616750e2f51936111b7338c 100644 (file)
@@ -6,4 +6,4 @@
 # SPDX-License-Identifier: GPL-2.0
 #
 
-obj-y  := gose.o qos.o
+obj-y  := gose.o qos.o ../rcar-gen2-common/common.o
index 0b2d9048f8c43661141cf0d8e1a0cba1052f84e7..677b976aafda78e222e5f01db841a1535f6a5b58 100644 (file)
@@ -60,16 +60,6 @@ int board_early_init_f(void)
        return 0;
 }
 
-#define TSTR0          0x04
-#define TSTR0_STR0     0x01
-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);
-}
-
 #define PUPR5          0xE6060114
 #define PUPR5_ETH      0x3FFC0000
 #define PUPR5_ETH_MAGIC        (1 << 27)
index b4d0183b3b7ba82bb98a98b72e395976099fff30..c10bba5682c27ecf910d1be65cdb49426d8cc3c3 100644 (file)
@@ -6,4 +6,4 @@
 # SPDX-License-Identifier: GPL-2.0
 #
 
-obj-y  := koelsch.o qos.o
+obj-y  := koelsch.o qos.o ../rcar-gen2-common/common.o
index 5ebbfcf14ea99cf25e6aec1740b46a9e8cfacfb9..10fa571d07fa607d1f3b2e7becb5e14da7a7b1f0 100644 (file)
@@ -61,12 +61,6 @@ int board_early_init_f(void)
        return 0;
 }
 
-void arch_preboot_os(void)
-{
-       /* Disable TMU0 */
-       mstp_setbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125);
-}
-
 /* LSI pin pull-up control */
 #define PUPR5 0xe6060114
 #define PUPR5_ETH 0x3FFC0000
index 034c6f8c076259e1c316f9cffe9c062b5213fcae..8d034611a471eae0afe302d75815d7d4ead59ceb 100644 (file)
@@ -6,4 +6,4 @@
 # SPDX-License-Identifier: GPL-2.0
 #
 
-obj-y  := lager.o qos.o
+obj-y  := lager.o qos.o ../rcar-gen2-common/common.o
index 47cf51bdcd2f2785a8a4c5380d39a2f56f1cd7b4..4afb1ac355593646c94be0b72088a89cd0fb9397 100644 (file)
@@ -67,12 +67,6 @@ int board_early_init_f(void)
        return 0;
 }
 
-void arch_preboot_os(void)
-{
-       /* Disable TMU0 */
-       mstp_setbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125);
-}
-
 DECLARE_GLOBAL_DATA_PTR;
 int board_init(void)
 {
diff --git a/board/renesas/rcar-gen2-common/common.c b/board/renesas/rcar-gen2-common/common.c
new file mode 100644 (file)
index 0000000..23010ee
--- /dev/null
@@ -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);
+}