From bd57db531665f701cdf4705449205d6399fdb759 Mon Sep 17 00:00:00 2001
From: Marek Vasut <marek.vasut+renesas@gmail.com>
Date: Fri, 28 Dec 2018 11:26:03 +0100
Subject: [PATCH] rcar_gen3: drivers: cpld: Move rcar_cpld_reset_cpu() into
 header

Move the rcar_cpld_reset_cpu() function into header file and zap the externs.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
---
 drivers/renesas/rcar/cpld/ulcb_cpld.c |  1 +
 drivers/renesas/rcar/cpld/ulcb_cpld.h | 12 ++++++++++++
 plat/renesas/rcar/plat_pm.c           |  5 +----
 plat/renesas/rcar/platform.mk         |  1 +
 4 files changed, 15 insertions(+), 4 deletions(-)
 create mode 100644 drivers/renesas/rcar/cpld/ulcb_cpld.h

diff --git a/drivers/renesas/rcar/cpld/ulcb_cpld.c b/drivers/renesas/rcar/cpld/ulcb_cpld.c
index d7192f48d..6b0361497 100644
--- a/drivers/renesas/rcar/cpld/ulcb_cpld.c
+++ b/drivers/renesas/rcar/cpld/ulcb_cpld.c
@@ -5,6 +5,7 @@
  */
 
 #include <lib/mmio.h>
+#include "ulcb_cpld.h"
 
 #define SCLK			8	/* GP_6_8 */
 #define SSTBZ			3	/* GP_2_3 */
diff --git a/drivers/renesas/rcar/cpld/ulcb_cpld.h b/drivers/renesas/rcar/cpld/ulcb_cpld.h
new file mode 100644
index 000000000..1616d711b
--- /dev/null
+++ b/drivers/renesas/rcar/cpld/ulcb_cpld.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2018, Renesas Electronics Corporation. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef RCAR_ULCB_CPLD_H__
+#define RCAR_ULCB_CPLD_H__
+
+extern void rcar_cpld_reset_cpu(void);
+
+#endif /* RCAR_ULCB_CPLD_H__ */
diff --git a/plat/renesas/rcar/plat_pm.c b/plat/renesas/rcar/plat_pm.c
index dbf3ac54d..245a45a32 100644
--- a/plat/renesas/rcar/plat_pm.c
+++ b/plat/renesas/rcar/plat_pm.c
@@ -22,6 +22,7 @@
 #include "pwrc.h"
 #include "rcar_def.h"
 #include "rcar_private.h"
+#include "ulcb_cpld.h"
 
 #define	DVFS_SET_VID_0V		(0x00)
 #define	P_ALL_OFF		(0x80)
@@ -41,10 +42,6 @@ extern void plat_rcar_gic_driver_init(void);
 extern void plat_rcar_gic_init(void);
 extern u_register_t rcar_boot_mpidr;
 
-#if (RCAR_GEN3_ULCB == 1)
-extern void rcar_cpld_reset_cpu(void);
-#endif
-
 static uintptr_t rcar_sec_entrypoint;
 
 static void rcar_program_mailbox(uint64_t mpidr, uint64_t address)
diff --git a/plat/renesas/rcar/platform.mk b/plat/renesas/rcar/platform.mk
index b897601e8..5d1f5f603 100644
--- a/plat/renesas/rcar/platform.mk
+++ b/plat/renesas/rcar/platform.mk
@@ -311,6 +311,7 @@ PLAT_INCLUDES	:=	-Iinclude/common/tbbr			\
 			-Idrivers/staging/renesas/rcar/qos	\
 			-Idrivers/renesas/rcar/iic_dvfs		\
 			-Idrivers/renesas/rcar/board		\
+			-Idrivers/renesas/rcar/cpld/		\
 			-Idrivers/renesas/rcar/avs		\
 			-Idrivers/renesas/rcar/delay		\
 			-Idrivers/renesas/rcar/rom		\
-- 
GitLab