Sanitise includes across codebase
Enforce full include path for includes. Deprecate old paths.
The following folders inside include/lib have been left unchanged:
- include/lib/cpus/${ARCH}
- include/lib/el3_runtime/${ARCH}
The reason for this change is that having a global namespace for
includes isn't a good idea. It defeats one of the advantages of having
folders and it introduces problems that are sometimes subtle (because
you may not know the header you are actually including if there are two
of them).
For example, this patch had to be created because two headers were
called the same way: e0ea0928d5b7 ("Fix gpio includes of mt8173 platform
to avoid collision."). More recently, this patch has had similar
problems: 46f9b2c3a282 ("drivers: add tzc380 support").
This problem was introduced in commit 4ecca33988b9 ("Move include and
source files to logical locations"). At that time, there weren't too
many headers so it wasn't a real issue. However, time has shown that
this creates problems.
Platforms that want to preserve the way they include headers may add the
removed paths to PLAT_INCLUDES, but this is discouraged.
Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
diff --git a/plat/rockchip/common/aarch64/plat_helpers.S b/plat/rockchip/common/aarch64/plat_helpers.S
index f0136b0..4af052b 100644
--- a/plat/rockchip/common/aarch64/plat_helpers.S
+++ b/plat/rockchip/common/aarch64/plat_helpers.S
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <cortex_a53.h>
#include <cortex_a72.h>
#include <plat_private.h>
-#include <platform_def.h>
#include <plat_pmu_macros.S>
.globl cpuson_entry_point
diff --git a/plat/rockchip/common/aarch64/platform_common.c b/plat/rockchip/common/aarch64/platform_common.c
index 9a74314..81e8520 100644
--- a/plat/rockchip/common/aarch64/platform_common.c
+++ b/plat/rockchip/common/aarch64/platform_common.c
@@ -4,15 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <bl_common.h>
-#include <cci.h>
-#include <debug.h>
-#include <plat_private.h>
-#include <platform_def.h>
#include <string.h>
-#include <utils.h>
-#include <xlat_tables.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/arm/cci.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables.h>
+
+#include <plat_private.h>
#ifdef PLAT_RK_CCI_BASE
static const int cci_map[] = {
diff --git a/plat/rockchip/common/bl31_plat_setup.c b/plat/rockchip/common/bl31_plat_setup.c
index 7a9f7a9..2c970eb 100644
--- a/plat/rockchip/common/bl31_plat_setup.c
+++ b/plat/rockchip/common/bl31_plat_setup.c
@@ -5,16 +5,18 @@
*/
#include <assert.h>
-#include <bl_common.h>
-#include <console.h>
-#include <coreboot.h>
-#include <debug.h>
-#include <generic_delay_timer.h>
-#include <mmio.h>
-#include <plat_private.h>
-#include <platform.h>
+
#include <platform_def.h>
-#include <uart_16550.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <drivers/generic_delay_timer.h>
+#include <drivers/ti/uart/uart_16550.h>
+#include <lib/coreboot.h>
+#include <lib/mmio.h>
+#include <plat_private.h>
+#include <plat/common/platform.h>
/*
* The next 2 constants identify the extents of the code & RO data region.
diff --git a/plat/rockchip/common/drivers/parameter/ddr_parameter.c b/plat/rockchip/common/drivers/parameter/ddr_parameter.c
index ea77757..e89fe1e 100644
--- a/plat/rockchip/common/drivers/parameter/ddr_parameter.c
+++ b/plat/rockchip/common/drivers/parameter/ddr_parameter.c
@@ -4,15 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <console.h>
-#include <debug.h>
-#include <delay_timer.h>
-#include <mmio.h>
-#include <plat_private.h>
-#include <platform_def.h>
-#include <soc.h>
#include <string.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
+
+#include <plat_private.h>
+#include <soc.h>
+
#include "ddr_parameter.h"
/*
diff --git a/plat/rockchip/common/drivers/parameter/ddr_parameter.h b/plat/rockchip/common/drivers/parameter/ddr_parameter.h
index 69c4e18..61349c4 100644
--- a/plat/rockchip/common/drivers/parameter/ddr_parameter.h
+++ b/plat/rockchip/common/drivers/parameter/ddr_parameter.h
@@ -7,16 +7,19 @@
#ifndef DDR_PARAMETER_H
#define DDR_PARAMETER_H
-#include <arch_helpers.h>
-#include <console.h>
-#include <debug.h>
-#include <delay_timer.h>
-#include <mmio.h>
-#include <plat_private.h>
-#include <platform_def.h>
-#include <soc.h>
#include <string.h>
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
+
+#include <plat_private.h>
+#include <soc.h>
+
#define DDR_REGION_NR_MAX 10
#define REGION_NR_OFFSET 0
#define REGION_ADDR_OFFSET 8
diff --git a/plat/rockchip/common/include/plat_macros.S b/plat/rockchip/common/include/plat_macros.S
index 9ee4e83..691beeb 100644
--- a/plat/rockchip/common/include/plat_macros.S
+++ b/plat/rockchip/common/include/plat_macros.S
@@ -6,10 +6,10 @@
#ifndef ROCKCHIP_PLAT_MACROS_S
#define ROCKCHIP_PLAT_MACROS_S
-#include <cci.h>
-#include <gic_common.h>
-#include <gicv2.h>
-#include <gicv3.h>
+#include <drivers/arm/cci.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gicv2.h>
+#include <drivers/arm/gicv3.h>
#include <platform_def.h>
.section .rodata.gic_reg_name, "aS"
diff --git a/plat/rockchip/common/include/plat_private.h b/plat/rockchip/common/include/plat_private.h
index 955ca64..e8750a5 100644
--- a/plat/rockchip/common/include/plat_private.h
+++ b/plat/rockchip/common/include/plat_private.h
@@ -8,10 +8,12 @@
#define PLAT_PRIVATE_H
#ifndef __ASSEMBLY__
-#include <mmio.h>
-#include <psci.h>
+
#include <stdint.h>
-#include <xlat_tables.h>
+
+#include <lib/psci/psci.h>
+#include <lib/xlat_tables/xlat_tables.h>
+#include <lib/mmio.h>
#define __sramdata __attribute__((section(".sram.data")))
#define __sramconst __attribute__((section(".sram.rodata")))
diff --git a/plat/rockchip/common/params_setup.c b/plat/rockchip/common/params_setup.c
index a7ba83e..3d1b40b 100644
--- a/plat/rockchip/common/params_setup.c
+++ b/plat/rockchip/common/params_setup.c
@@ -5,16 +5,18 @@
*/
#include <assert.h>
-#include <bl_common.h>
-#include <console.h>
-#include <coreboot.h>
-#include <debug.h>
-#include <gpio.h>
-#include <mmio.h>
+#include <string.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <drivers/gpio.h>
+#include <lib/coreboot.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
#include <plat_params.h>
#include <plat_private.h>
-#include <platform.h>
-#include <string.h>
static struct gpio_info param_reset;
static struct gpio_info param_poweroff;
diff --git a/plat/rockchip/common/plat_pm.c b/plat/rockchip/common/plat_pm.c
index 352dbc8..c9563c9 100644
--- a/plat/rockchip/common/plat_pm.c
+++ b/plat/rockchip/common/plat_pm.c
@@ -4,15 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <console.h>
-#include <debug.h>
-#include <delay_timer.h>
#include <errno.h>
-#include <plat_private.h>
+
#include <platform_def.h>
-#include <psci.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <drivers/delay_timer.h>
+#include <lib/psci/psci.h>
+
+#include <plat_private.h>
/* Macros to read the rk power domain state */
#define RK_CORE_PWR_STATE(state) \
diff --git a/plat/rockchip/common/plat_topology.c b/plat/rockchip/common/plat_topology.c
index 49d063c..a31e410 100644
--- a/plat/rockchip/common/plat_topology.c
+++ b/plat/rockchip/common/plat_topology.c
@@ -4,10 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <plat_private.h>
#include <platform_def.h>
-#include <psci.h>
+
+#include <arch.h>
+#include <lib/psci/psci.h>
+
+#include <plat_private.h>
/*******************************************************************************
* This function returns the RockChip default topology tree information.
diff --git a/plat/rockchip/common/rockchip_gicv2.c b/plat/rockchip/common/rockchip_gicv2.c
index 4705042..222a882 100644
--- a/plat/rockchip/common/rockchip_gicv2.c
+++ b/plat/rockchip/common/rockchip_gicv2.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
-#include <gicv2.h>
-#include <interrupt_props.h>
#include <platform_def.h>
-#include <utils.h>
+
+#include <common/bl_common.h>
+#include <common/interrupt_props.h>
+#include <drivers/arm/gicv2.h>
+#include <lib/utils.h>
/******************************************************************************
* The following functions are defined as weak to allow a platform to override
diff --git a/plat/rockchip/common/rockchip_gicv3.c b/plat/rockchip/common/rockchip_gicv3.c
index efbf1d1..edae2ef 100644
--- a/plat/rockchip/common/rockchip_gicv3.c
+++ b/plat/rockchip/common/rockchip_gicv3.c
@@ -4,12 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
-#include <gicv3.h>
-#include <interrupt_props.h>
-#include <platform.h>
#include <platform_def.h>
-#include <utils.h>
+
+#include <common/bl_common.h>
+#include <common/interrupt_props.h>
+#include <drivers/arm/gicv3.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
/******************************************************************************
* The following functions are defined as weak to allow a platform to override
diff --git a/plat/rockchip/common/rockchip_sip_svc.c b/plat/rockchip/common/rockchip_sip_svc.c
index d690e92..27ef042 100644
--- a/plat/rockchip/common/rockchip_sip_svc.c
+++ b/plat/rockchip/common/rockchip_sip_svc.c
@@ -5,12 +5,14 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <mmio.h>
+
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <lib/mmio.h>
+#include <tools_share/uuid.h>
+
#include <plat_sip_calls.h>
#include <rockchip_sip_svc.h>
-#include <runtime_svc.h>
-#include <uuid.h>
/* Rockchip SiP Service UUID */
DEFINE_SVC_UUID2(rk_sip_svc_uid,
diff --git a/plat/rockchip/rk3328/drivers/pmu/pmu.c b/plat/rockchip/rk3328/drivers/pmu/pmu.c
index 835c3a6..c215ee2 100644
--- a/plat/rockchip/rk3328/drivers/pmu/pmu.c
+++ b/plat/rockchip/rk3328/drivers/pmu/pmu.c
@@ -4,18 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bakery_lock.h>
-#include <bl31.h>
-#include <console.h>
-#include <debug.h>
-#include <delay_timer.h>
#include <errno.h>
-#include <mmio.h>
-#include <plat_private.h>
-#include <platform.h>
+
#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <bl31/bl31.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <drivers/delay_timer.h>
+#include <lib/bakery_lock.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
+#include <plat_private.h>
#include <pmu.h>
#include <pmu_com.h>
#include <rk3328_def.h>
diff --git a/plat/rockchip/rk3328/drivers/soc/soc.c b/plat/rockchip/rk3328/drivers/soc/soc.c
index ce344d6..d216020 100644
--- a/plat/rockchip/rk3328/drivers/soc/soc.c
+++ b/plat/rockchip/rk3328/drivers/soc/soc.c
@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <console.h>
-#include <ddr_parameter.h>
-#include <debug.h>
-#include <delay_timer.h>
-#include <mmio.h>
-#include <plat_private.h>
#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
+
+#include <ddr_parameter.h>
+#include <plat_private.h>
#include <rk3328_def.h>
#include <soc.h>
diff --git a/plat/rockchip/rk3328/include/platform_def.h b/plat/rockchip/rk3328/include/platform_def.h
index 9b20b41..b62c868 100644
--- a/plat/rockchip/rk3328/include/platform_def.h
+++ b/plat/rockchip/rk3328/include/platform_def.h
@@ -8,7 +8,8 @@
#define PLATFORM_DEF_H
#include <arch.h>
-#include <common_def.h>
+#include <plat/common/common_def.h>
+
#include <rk3328_def.h>
/*******************************************************************************
diff --git a/plat/rockchip/rk3368/drivers/ddr/ddr_rk3368.c b/plat/rockchip/rk3368/drivers/ddr/ddr_rk3368.c
index 1c33763..84d2654 100644
--- a/plat/rockchip/rk3368/drivers/ddr/ddr_rk3368.c
+++ b/plat/rockchip/rk3368/drivers/ddr/ddr_rk3368.c
@@ -4,15 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
-#include <ddr_rk3368.h>
-#include <debug.h>
+#include <stdint.h>
+#include <string.h>
+
#include <platform_def.h>
+
+#include <common/debug.h>
+#include <lib/mmio.h>
+
+#include <ddr_rk3368.h>
#include <pmu.h>
#include <rk3368_def.h>
#include <soc.h>
-#include <stdint.h>
-#include <string.h>
/* GRF_SOC_STATUS0 */
#define DPLL_LOCK (0x1 << 2)
diff --git a/plat/rockchip/rk3368/drivers/pmu/pmu.c b/plat/rockchip/rk3368/drivers/pmu/pmu.c
index cb323e6..e277a18 100644
--- a/plat/rockchip/rk3368/drivers/pmu/pmu.c
+++ b/plat/rockchip/rk3368/drivers/pmu/pmu.c
@@ -4,16 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <ddr_rk3368.h>
-#include <debug.h>
-#include <delay_timer.h>
#include <errno.h>
-#include <mmio.h>
-#include <plat_private.h>
-#include <platform.h>
+
#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
+#include <ddr_rk3368.h>
+#include <plat_private.h>
#include <pmu.h>
#include <pmu_com.h>
#include <rk3368_def.h>
diff --git a/plat/rockchip/rk3368/drivers/soc/soc.c b/plat/rockchip/rk3368/drivers/soc/soc.c
index d6979a8..0c34554 100644
--- a/plat/rockchip/rk3368/drivers/soc/soc.c
+++ b/plat/rockchip/rk3368/drivers/soc/soc.c
@@ -4,11 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <debug.h>
-#include <mmio.h>
-#include <plat_private.h>
#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/mmio.h>
+
+#include <plat_private.h>
#include <rk3368_def.h>
#include <soc.h>
diff --git a/plat/rockchip/rk3368/include/platform_def.h b/plat/rockchip/rk3368/include/platform_def.h
index 4083938..815650f 100644
--- a/plat/rockchip/rk3368/include/platform_def.h
+++ b/plat/rockchip/rk3368/include/platform_def.h
@@ -8,9 +8,10 @@
#define PLATFORM_DEF_H
#include <arch.h>
-#include <common_def.h>
+#include <lib/utils_def.h>
+#include <plat/common/common_def.h>
+
#include <rk3368_def.h>
-#include <utils_def.h>
/*******************************************************************************
* Platform binary types for linking
diff --git a/plat/rockchip/rk3368/plat_sip_calls.c b/plat/rockchip/rk3368/plat_sip_calls.c
index c0f43db..5918d58 100644
--- a/plat/rockchip/rk3368/plat_sip_calls.c
+++ b/plat/rockchip/rk3368/plat_sip_calls.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <lib/mmio.h>
+
#include <plat_sip_calls.h>
#include <rockchip_sip_svc.h>
-#include <runtime_svc.h>
uintptr_t rockchip_plat_sip_handler(uint32_t smc_fid,
u_register_t x1,
diff --git a/plat/rockchip/rk3399/drivers/dp/cdn_dp.c b/plat/rockchip/rk3399/drivers/dp/cdn_dp.c
index 73a75bb..aa71fde 100644
--- a/plat/rockchip/rk3399/drivers/dp/cdn_dp.c
+++ b/plat/rockchip/rk3399/drivers/dp/cdn_dp.c
@@ -6,11 +6,13 @@
#include <assert.h>
#include <cdefs.h>
-#include <cdn_dp.h>
-#include <smccc.h>
#include <stdlib.h>
#include <string.h>
+#include <lib/smccc.h>
+
+#include <cdn_dp.h>
+
__asm__(
".pushsection .text.hdcp_handler, \"ax\", %progbits\n"
".global hdcp_handler\n"
diff --git a/plat/rockchip/rk3399/drivers/dram/dfs.c b/plat/rockchip/rk3399/drivers/dram/dfs.c
index e6d39a1..45fd924 100644
--- a/plat/rockchip/rk3399/drivers/dram/dfs.c
+++ b/plat/rockchip/rk3399/drivers/dram/dfs.c
@@ -5,10 +5,11 @@
*/
#include <arch_helpers.h>
-#include <debug.h>
-#include <delay_timer.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
+
#include <m0_ctl.h>
-#include <mmio.h>
#include <plat_private.h>
#include "dfs.h"
#include "dram.h"
diff --git a/plat/rockchip/rk3399/drivers/dram/dram.h b/plat/rockchip/rk3399/drivers/dram/dram.h
index ded511e..0eb12cf 100644
--- a/plat/rockchip/rk3399/drivers/dram/dram.h
+++ b/plat/rockchip/rk3399/drivers/dram/dram.h
@@ -7,9 +7,10 @@
#ifndef DRAM_H
#define DRAM_H
+#include <stdint.h>
+
#include <dram_regs.h>
#include <plat_private.h>
-#include <stdint.h>
enum {
DDR3 = 3,
diff --git a/plat/rockchip/rk3399/drivers/dram/dram_spec_timing.c b/plat/rockchip/rk3399/drivers/dram/dram_spec_timing.c
index 3527f0e..3cdb7a2 100644
--- a/plat/rockchip/rk3399/drivers/dram/dram_spec_timing.c
+++ b/plat/rockchip/rk3399/drivers/dram/dram_spec_timing.c
@@ -4,10 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <dram.h>
#include <stdint.h>
#include <string.h>
-#include <utils.h>
+
+#include <lib/utils.h>
+
+#include <dram.h>
+
#include "dram_spec_timing.h"
static const uint8_t ddr3_cl_cwl[][7] = {
diff --git a/plat/rockchip/rk3399/drivers/dram/suspend.c b/plat/rockchip/rk3399/drivers/dram/suspend.c
index dd97581..8bc66e1 100644
--- a/plat/rockchip/rk3399/drivers/dram/suspend.c
+++ b/plat/rockchip/rk3399/drivers/dram/suspend.c
@@ -4,11 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
#include <arch_helpers.h>
-#include <debug.h>
+#include <common/debug.h>
+
#include <dram.h>
#include <plat_private.h>
-#include <platform_def.h>
#include <pmu.h>
#include <pmu_bits.h>
#include <pmu_regs.h>
diff --git a/plat/rockchip/rk3399/drivers/gpio/rk3399_gpio.c b/plat/rockchip/rk3399/drivers/gpio/rk3399_gpio.c
index e74c4d9..b8cba6d 100644
--- a/plat/rockchip/rk3399/drivers/gpio/rk3399_gpio.c
+++ b/plat/rockchip/rk3399/drivers/gpio/rk3399_gpio.c
@@ -3,15 +3,19 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <assert.h>
-#include <debug.h>
-#include <delay_timer.h>
#include <errno.h>
-#include <gpio.h>
-#include <mmio.h>
-#include <plat_private.h>
-#include <platform.h>
+
#include <platform_def.h>
+
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/gpio.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
+#include <plat_private.h>
#include <soc.h>
uint32_t gpio_port[] = {
diff --git a/plat/rockchip/rk3399/drivers/pmu/m0_ctl.c b/plat/rockchip/rk3399/drivers/pmu/m0_ctl.c
index 3f258b7..d919fa1 100644
--- a/plat/rockchip/rk3399/drivers/pmu/m0_ctl.c
+++ b/plat/rockchip/rk3399/drivers/pmu/m0_ctl.c
@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <delay_timer.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
+
#include <m0_ctl.h>
-#include <mmio.h>
#include <plat_private.h>
#include <rk3399_def.h>
#include <secure.h>
diff --git a/plat/rockchip/rk3399/drivers/pmu/pmu.c b/plat/rockchip/rk3399/drivers/pmu/pmu.c
index 04446d6..42589b9 100644
--- a/plat/rockchip/rk3399/drivers/pmu/pmu.c
+++ b/plat/rockchip/rk3399/drivers/pmu/pmu.c
@@ -4,29 +4,32 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bakery_lock.h>
-#include <bl31.h>
-#include <debug.h>
-#include <delay_timer.h>
-#include <dfs.h>
#include <errno.h>
-#include <gicv3.h>
-#include <gpio.h>
+#include <string.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <bl31/bl31.h>
+#include <common/debug.h>
+#include <drivers/arm/gicv3.h>
+#include <drivers/delay_timer.h>
+#include <drivers/gpio.h>
+#include <lib/bakery_lock.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
+#include <dfs.h>
#include <m0_ctl.h>
-#include <mmio.h>
#include <plat_params.h>
#include <plat_private.h>
-#include <platform.h>
-#include <platform_def.h>
#include <pmu.h>
#include <pmu_com.h>
#include <pwm.h>
#include <rk3399_def.h>
#include <secure.h>
#include <soc.h>
-#include <string.h>
#include <suspend.h>
DEFINE_BAKERY_LOCK(rockchip_pd_lock);
diff --git a/plat/rockchip/rk3399/drivers/secure/secure.c b/plat/rockchip/rk3399/drivers/secure/secure.c
index 1937b13..8286f17 100644
--- a/plat/rockchip/rk3399/drivers/secure/secure.c
+++ b/plat/rockchip/rk3399/drivers/secure/secure.c
@@ -4,10 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <delay_timer.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+
#include <plat_private.h>
#include <secure.h>
#include <soc.h>
diff --git a/plat/rockchip/rk3399/drivers/soc/soc.c b/plat/rockchip/rk3399/drivers/soc/soc.c
index 741adde..c877dbd 100644
--- a/plat/rockchip/rk3399/drivers/soc/soc.c
+++ b/plat/rockchip/rk3399/drivers/soc/soc.c
@@ -4,16 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <delay_timer.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
+
#include <dfs.h>
#include <dram.h>
#include <m0_ctl.h>
-#include <mmio.h>
#include <plat_private.h>
-#include <platform_def.h>
#include <rk3399_def.h>
#include <secure.h>
#include <soc.h>
diff --git a/plat/rockchip/rk3399/drivers/soc/soc.h b/plat/rockchip/rk3399/drivers/soc/soc.h
index 1f7ec07..8539337 100644
--- a/plat/rockchip/rk3399/drivers/soc/soc.h
+++ b/plat/rockchip/rk3399/drivers/soc/soc.h
@@ -7,7 +7,7 @@
#ifndef SOC_H
#define SOC_H
-#include <utils.h>
+#include <lib/utils.h>
#define GLB_SRST_FST_CFG_VAL 0xfdb9
#define GLB_SRST_SND_CFG_VAL 0xeca8
diff --git a/plat/rockchip/rk3399/include/plat.ld.S b/plat/rockchip/rk3399/include/plat.ld.S
index 5045ba8..cfa912f 100644
--- a/plat/rockchip/rk3399/include/plat.ld.S
+++ b/plat/rockchip/rk3399/include/plat.ld.S
@@ -6,7 +6,7 @@
#ifndef ROCKCHIP_PLAT_LD_S
#define ROCKCHIP_PLAT_LD_S
-#include <xlat_tables_defs.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
MEMORY {
SRAM (rwx): ORIGIN = SRAM_BASE, LENGTH = SRAM_SIZE
diff --git a/plat/rockchip/rk3399/include/platform_def.h b/plat/rockchip/rk3399/include/platform_def.h
index cb798fb..2861a7d 100644
--- a/plat/rockchip/rk3399/include/platform_def.h
+++ b/plat/rockchip/rk3399/include/platform_def.h
@@ -8,10 +8,11 @@
#define PLATFORM_DEF_H
#include <arch.h>
+#include <lib/utils_def.h>
+#include <plat/common/common_def.h>
+
#include <bl31_param.h>
-#include <common_def.h>
#include <rk3399_def.h>
-#include <utils_def.h>
/*******************************************************************************
* Platform binary types for linking
diff --git a/plat/rockchip/rk3399/plat_sip_calls.c b/plat/rockchip/rk3399/plat_sip_calls.c
index 3f0f619..c2cc5b1 100644
--- a/plat/rockchip/rk3399/plat_sip_calls.c
+++ b/plat/rockchip/rk3399/plat_sip_calls.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <lib/mmio.h>
+
#include <cdn_dp.h>
-#include <debug.h>
#include <dfs.h>
-#include <mmio.h>
#include <plat_sip_calls.h>
#include <rockchip_sip_svc.h>
-#include <runtime_svc.h>
#define RK_SIP_DDR_CFG 0x82000008
#define DRAM_INIT 0x00