From 560293bb6f92fa4bbebea13113bac56ab50b7905 Mon Sep 17 00:00:00 2001
From: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Date: Wed, 23 Jan 2019 21:50:09 +0000
Subject: [PATCH] fvp: pwrc: Move to drivers/ folder

Change-Id: I670ea80e0331c2d4b2ccfa563a45469a43f6902d
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
---
 .../arm/board/fvp/drivers/pwrc => drivers/arm/fvp}/fvp_pwrc.c | 4 +---
 .../fvp/drivers/pwrc => include/drivers/arm/fvp}/fvp_pwrc.h   | 2 ++
 plat/arm/board/fvp/aarch32/fvp_helpers.S                      | 3 +--
 plat/arm/board/fvp/aarch64/fvp_helpers.S                      | 3 +--
 plat/arm/board/fvp/fvp_pm.c                                   | 2 +-
 plat/arm/board/fvp/fvp_topology.c                             | 3 +--
 plat/arm/board/fvp/platform.mk                                | 4 ++--
 plat/arm/board/fvp/sp_min/sp_min-fvp.mk                       | 4 ++--
 plat/arm/board/fvp/tsp/tsp-fvp.mk                             | 4 ++--
 9 files changed, 13 insertions(+), 16 deletions(-)
 rename {plat/arm/board/fvp/drivers/pwrc => drivers/arm/fvp}/fvp_pwrc.c (96%)
 rename {plat/arm/board/fvp/drivers/pwrc => include/drivers/arm/fvp}/fvp_pwrc.h (98%)

diff --git a/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c b/drivers/arm/fvp/fvp_pwrc.c
similarity index 96%
rename from plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c
rename to drivers/arm/fvp/fvp_pwrc.c
index 9080e22f8..75a2b66c5 100644
--- a/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c
+++ b/drivers/arm/fvp/fvp_pwrc.c
@@ -4,14 +4,12 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include <drivers/arm/fvp/fvp_pwrc.h>
 #include <lib/bakery_lock.h>
 #include <lib/mmio.h>
 #include <plat/arm/common/plat_arm.h>
 #include <platform_def.h>
 
-#include "../../fvp_private.h"
-#include "fvp_pwrc.h"
-
 /*
  * TODO: Someday there will be a generic power controller api. At the moment
  * each platform has its own pwrc so just exporting functions is fine.
diff --git a/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.h b/include/drivers/arm/fvp/fvp_pwrc.h
similarity index 98%
rename from plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.h
rename to include/drivers/arm/fvp/fvp_pwrc.h
index 324f3e253..ca173f36f 100644
--- a/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.h
+++ b/include/drivers/arm/fvp/fvp_pwrc.h
@@ -37,6 +37,8 @@
 
 #ifndef __ASSEMBLY__
 
+#include <stdint.h>
+
 /*******************************************************************************
  * Function & variable prototypes
  ******************************************************************************/
diff --git a/plat/arm/board/fvp/aarch32/fvp_helpers.S b/plat/arm/board/fvp/aarch32/fvp_helpers.S
index f68955753..9985c1ddb 100644
--- a/plat/arm/board/fvp/aarch32/fvp_helpers.S
+++ b/plat/arm/board/fvp/aarch32/fvp_helpers.S
@@ -6,10 +6,9 @@
 
 #include <arch.h>
 #include <asm_macros.S>
+#include <drivers/arm/fvp/fvp_pwrc.h>
 #include <platform_def.h>
 
-#include "../drivers/pwrc/fvp_pwrc.h"
-
 	.globl	plat_secondary_cold_boot_setup
 	.globl	plat_get_my_entrypoint
 	.globl	plat_is_my_cpu_primary
diff --git a/plat/arm/board/fvp/aarch64/fvp_helpers.S b/plat/arm/board/fvp/aarch64/fvp_helpers.S
index 02a3c7c99..09f19f6c3 100644
--- a/plat/arm/board/fvp/aarch64/fvp_helpers.S
+++ b/plat/arm/board/fvp/aarch64/fvp_helpers.S
@@ -8,10 +8,9 @@
 #include <asm_macros.S>
 #include <drivers/arm/gicv2.h>
 #include <drivers/arm/gicv3.h>
+#include <drivers/arm/fvp/fvp_pwrc.h>
 #include <platform_def.h>
 
-#include "../drivers/pwrc/fvp_pwrc.h"
-
 	.globl	plat_secondary_cold_boot_setup
 	.globl	plat_get_my_entrypoint
 	.globl	plat_is_my_cpu_primary
diff --git a/plat/arm/board/fvp/fvp_pm.c b/plat/arm/board/fvp/fvp_pm.c
index a51fa1718..ecf0b0135 100644
--- a/plat/arm/board/fvp/fvp_pm.c
+++ b/plat/arm/board/fvp/fvp_pm.c
@@ -10,6 +10,7 @@
 #include <arch_helpers.h>
 #include <common/debug.h>
 #include <drivers/arm/gicv3.h>
+#include <drivers/arm/fvp/fvp_pwrc.h>
 #include <lib/extensions/spe.h>
 #include <lib/mmio.h>
 #include <lib/psci/psci.h>
@@ -18,7 +19,6 @@
 #include <plat/common/platform.h>
 #include <platform_def.h>
 
-#include "drivers/pwrc/fvp_pwrc.h"
 #include "fvp_private.h"
 
 
diff --git a/plat/arm/board/fvp/fvp_topology.c b/plat/arm/board/fvp/fvp_topology.c
index 5e066eaab..9823fb3b3 100644
--- a/plat/arm/board/fvp/fvp_topology.c
+++ b/plat/arm/board/fvp/fvp_topology.c
@@ -7,13 +7,12 @@
 #include <platform_def.h>
 
 #include <arch.h>
+#include <drivers/arm/fvp/fvp_pwrc.h>
 #include <lib/cassert.h>
 #include <plat/arm/common/arm_config.h>
 #include <plat/arm/common/plat_arm.h>
 #include <plat/common/platform.h>
 
-#include "drivers/pwrc/fvp_pwrc.h"
-
 /* The FVP power domain tree descriptor */
 static unsigned char fvp_power_domain_tree_desc[FVP_CLUSTER_COUNT + 2];
 
diff --git a/plat/arm/board/fvp/platform.mk b/plat/arm/board/fvp/platform.mk
index a174214ae..f79ac466b 100644
--- a/plat/arm/board/fvp/platform.mk
+++ b/plat/arm/board/fvp/platform.mk
@@ -146,14 +146,14 @@ endif
 BL2U_SOURCES		+=	plat/arm/board/fvp/fvp_bl2u_setup.c		\
 				${FVP_SECURITY_SOURCES}
 
-BL31_SOURCES		+=	drivers/arm/smmu/smmu_v3.c			\
+BL31_SOURCES		+=	drivers/arm/fvp/fvp_pwrc.c			\
+				drivers/arm/smmu/smmu_v3.c			\
 				drivers/cfi/v2m/v2m_flash.c			\
 				lib/utils/mem_region.c				\
 				plat/arm/board/fvp/fvp_bl31_setup.c		\
 				plat/arm/board/fvp/fvp_pm.c			\
 				plat/arm/board/fvp/fvp_topology.c		\
 				plat/arm/board/fvp/aarch64/fvp_helpers.S	\
-				plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c	\
 				plat/arm/common/arm_nor_psci_mem_protect.c	\
 				${FVP_CPU_LIBS}					\
 				${FVP_GIC_SOURCES}				\
diff --git a/plat/arm/board/fvp/sp_min/sp_min-fvp.mk b/plat/arm/board/fvp/sp_min/sp_min-fvp.mk
index 8b17c9b73..0250a5f1a 100644
--- a/plat/arm/board/fvp/sp_min/sp_min-fvp.mk
+++ b/plat/arm/board/fvp/sp_min/sp_min-fvp.mk
@@ -5,10 +5,10 @@
 #
 
 # SP_MIN source files specific to FVP platform
-BL32_SOURCES		+=	drivers/cfi/v2m/v2m_flash.c			\
+BL32_SOURCES		+=	drivers/arm/fvp/fvp_pwrc.c			\
+				drivers/cfi/v2m/v2m_flash.c			\
 				lib/utils/mem_region.c				\
 				plat/arm/board/fvp/aarch32/fvp_helpers.S	\
-				plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c	\
 				plat/arm/board/fvp/fvp_pm.c			\
 				plat/arm/board/fvp/fvp_topology.c		\
 				plat/arm/board/fvp/sp_min/fvp_sp_min_setup.c	\
diff --git a/plat/arm/board/fvp/tsp/tsp-fvp.mk b/plat/arm/board/fvp/tsp/tsp-fvp.mk
index 861fe7208..ab3f225a4 100644
--- a/plat/arm/board/fvp/tsp/tsp-fvp.mk
+++ b/plat/arm/board/fvp/tsp/tsp-fvp.mk
@@ -5,8 +5,8 @@
 #
 
 # TSP source files specific to FVP platform
-BL32_SOURCES		+=	plat/arm/board/fvp/aarch64/fvp_helpers.S	\
-				plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c	\
+BL32_SOURCES		+=	drivers/arm/fvp/fvp_pwrc.c			\
+				plat/arm/board/fvp/aarch64/fvp_helpers.S	\
 				plat/arm/board/fvp/fvp_topology.c		\
 				plat/arm/board/fvp/tsp/fvp_tsp_setup.c		\
 				${FVP_GIC_SOURCES}
-- 
GitLab