aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2019-01-11 13:12:58 +0000
committerSandrine Bailleux <sandrine.bailleux@arm.com>2019-01-25 08:23:20 +0000
commit09a00ef98c6108fec75dafcc7dbdddacb2ee2e91 (patch)
tree77b585708a4fd850f0dac3a3f0fcaf34576fa8c9
parent9e550b6f75f064b53d74a4ad3c8672332d87451c (diff)
downloadtf-a-tests-09a00ef98c6108fec75dafcc7dbdddacb2ee2e91.tar.gz
Sanitise includes of include/drivers across codebase
Enforce full include path for includes. 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 with the same name). Change-Id: I45e912b16c9fff81f50840dad7e7f90ed6637b2a Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
-rw-r--r--drivers/arm/gic/arm_gic_v2.c2
-rw-r--r--drivers/arm/gic/arm_gic_v2v3.c6
-rw-r--r--drivers/arm/gic/gic_common.c4
-rw-r--r--drivers/arm/gic/gic_v2.c6
-rw-r--r--drivers/arm/gic/gic_v3.c6
-rw-r--r--drivers/arm/pl011/aarch32/pl011_console.S5
-rw-r--r--drivers/arm/pl011/aarch64/pl011_console.S5
-rw-r--r--drivers/arm/sp805/sp805.c2
-rw-r--r--drivers/arm/timer/sp804.c6
-rw-r--r--drivers/arm/timer/system_timer.c6
-rw-r--r--drivers/io/io_fip.c4
-rw-r--r--drivers/io/io_memmap.c2
-rw-r--r--drivers/io/io_storage.c2
-rw-r--r--drivers/io/vexpress_nor/io_vexpress_nor_internal.h4
-rw-r--r--fwu/ns_bl1u/ns_bl1u.mk4
-rw-r--r--fwu/ns_bl1u/ns_bl1u_main.c2
-rw-r--r--fwu/ns_bl1u/ns_bl1u_tests.c2
-rw-r--r--fwu/ns_bl2u/ns_bl2u.mk4
-rw-r--r--include/drivers/arm/sp804.h2
-rw-r--r--include/drivers/arm/system_timer.h2
-rw-r--r--lib/irq/irq.c2
-rw-r--r--lib/power_management/hotplug/hotplug.c4
-rw-r--r--lib/power_management/suspend/tftf_suspend.c4
-rw-r--r--lib/psci/psci.c2
-rw-r--r--lib/sdei/sdei.c2
-rw-r--r--lib/stdlib/putchar.c2
-rw-r--r--plat/arm/common/arm_fwu_io_storage.c6
-rw-r--r--plat/arm/common/arm_io_storage.c4
-rw-r--r--plat/arm/common/arm_setup.c6
-rw-r--r--plat/arm/common/arm_timers.c2
-rw-r--r--plat/arm/fvp/aarch32/plat_helpers.S2
-rw-r--r--plat/arm/fvp/aarch64/plat_helpers.S2
-rw-r--r--plat/arm/fvp/plat_setup.c2
-rw-r--r--plat/arm/juno/aarch32/plat_helpers.S2
-rw-r--r--plat/arm/juno/aarch64/plat_helpers.S2
-rw-r--r--plat/arm/juno/juno_timers.c2
-rw-r--r--plat/arm/juno/plat_setup.c2
-rw-r--r--plat/arm/sgi/common/aarch64/plat_helpers.S2
-rw-r--r--plat/arm/sgi/common/plat_setup.c2
-rw-r--r--plat/common/fwu_nvm_accessors.c2
-rw-r--r--plat/common/image_loader.c6
-rw-r--r--plat/common/plat_common.c4
-rw-r--r--spm/cactus/cactus.mk2
-rw-r--r--spm/cactus/cactus_main.c4
-rw-r--r--spm/ivy/ivy.mk2
-rw-r--r--spm/ivy/ivy_main.c4
-rw-r--r--tftf/framework/debug.c2
-rw-r--r--tftf/framework/framework.mk4
-rw-r--r--tftf/framework/main.c2
-rw-r--r--tftf/framework/timer/timer_framework.c2
-rw-r--r--tftf/tests/framework_validation_tests/test_validation_irq.c2
-rw-r--r--tftf/tests/framework_validation_tests/test_validation_sgi.c2
-rw-r--r--tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c2
-rw-r--r--tftf/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c2
-rw-r--r--tftf/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c4
-rw-r--r--tftf/tests/runtime_services/standard_service/psci/api_tests/validate_power_state/test_validate_power_state.c2
-rw-r--r--tftf/tests/runtime_services/standard_service/psci/system_tests/test_psci_system_suspend_stress.c4
-rw-r--r--tftf/tests/runtime_services/standard_service/sdei/system_tests/test_sdei.c2
-rw-r--r--tftf/tests/runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c6
-rw-r--r--tftf/tests/runtime_services/trusted_os/tsp/test_irq_spurious_gicv2.c6
-rw-r--r--tftf/tests/runtime_services/trusted_os/tsp/test_normal_int_switch.c2
61 files changed, 96 insertions, 100 deletions
diff --git a/drivers/arm/gic/arm_gic_v2.c b/drivers/arm/gic/arm_gic_v2.c
index 025d48d3..82666263 100644
--- a/drivers/arm/gic/arm_gic_v2.c
+++ b/drivers/arm/gic/arm_gic_v2.c
@@ -8,7 +8,7 @@
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
-#include <gic_v2.h>
+#include <drivers/arm/gic_v2.h>
void arm_gic_enable_interrupts_local(void)
{
diff --git a/drivers/arm/gic/arm_gic_v2v3.c b/drivers/arm/gic/arm_gic_v2v3.c
index 576c6112..a3f84d07 100644
--- a/drivers/arm/gic/arm_gic_v2v3.c
+++ b/drivers/arm/gic/arm_gic_v2v3.c
@@ -8,9 +8,9 @@
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
-#include <gic_common.h>
-#include <gic_v2.h>
-#include <gic_v3.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gic_v2.h>
+#include <drivers/arm/gic_v3.h>
/* Record whether a GICv3 was detected on the system */
static unsigned int gicv3_detected;
diff --git a/drivers/arm/gic/gic_common.c b/drivers/arm/gic/gic_common.c
index 207ee15a..d9c9fcee 100644
--- a/drivers/arm/gic/gic_common.c
+++ b/drivers/arm/gic/gic_common.c
@@ -7,8 +7,8 @@
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
-#include <gic_common.h>
-#include <gic_v3.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gic_v3.h>
#include <mmio.h>
/*******************************************************************************
diff --git a/drivers/arm/gic/gic_v2.c b/drivers/arm/gic/gic_v2.c
index 48ee29e2..7904ed12 100644
--- a/drivers/arm/gic/gic_v2.c
+++ b/drivers/arm/gic/gic_v2.c
@@ -6,10 +6,10 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
-#include <gic_common.h>
-#include <gic_v2.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gic_v2.h>
#include <mmio.h>
#include <platform.h>
diff --git a/drivers/arm/gic/gic_v3.c b/drivers/arm/gic/gic_v3.c
index 76b08639..5a777cb3 100644
--- a/drivers/arm/gic/gic_v3.c
+++ b/drivers/arm/gic/gic_v3.c
@@ -6,11 +6,11 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
#include <debug.h>
-#include <gic_common.h>
-#include <gic_v3.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gic_v3.h>
#include <mmio.h>
#include <platform.h>
diff --git a/drivers/arm/pl011/aarch32/pl011_console.S b/drivers/arm/pl011/aarch32/pl011_console.S
index 96da6f92..4c7bfe7f 100644
--- a/drivers/arm/pl011/aarch32/pl011_console.S
+++ b/drivers/arm/pl011/aarch32/pl011_console.S
@@ -3,10 +3,11 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <arch.h>
#include <asm_macros.S>
-#include <console.h>
-#include <pl011.h>
+#include <drivers/arm/pl011.h>
+#include <drivers/console.h>
.globl console_init
.globl console_putc
diff --git a/drivers/arm/pl011/aarch64/pl011_console.S b/drivers/arm/pl011/aarch64/pl011_console.S
index d87982a6..4e7ad2d5 100644
--- a/drivers/arm/pl011/aarch64/pl011_console.S
+++ b/drivers/arm/pl011/aarch64/pl011_console.S
@@ -3,10 +3,11 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <arch.h>
#include <asm_macros.S>
-#include <console.h>
-#include <pl011.h>
+#include <drivers/arm/pl011.h>
+#include <drivers/console.h>
.globl console_init
.globl console_putc
diff --git a/drivers/arm/sp805/sp805.c b/drivers/arm/sp805/sp805.c
index 72a668d2..2318c40d 100644
--- a/drivers/arm/sp805/sp805.c
+++ b/drivers/arm/sp805/sp805.c
@@ -6,9 +6,9 @@
#include <assert.h>
#include <debug.h>
+#include <drivers/arm/sp805.h>
#include <mmio.h>
#include <platform_def.h>
-#include <sp805.h>
#include <stdint.h>
static inline uint32_t sp805_read_wdog_load(unsigned long base)
diff --git a/drivers/arm/timer/sp804.c b/drivers/arm/timer/sp804.c
index de88cda2..dba8af67 100644
--- a/drivers/arm/timer/sp804.c
+++ b/drivers/arm/timer/sp804.c
@@ -6,11 +6,11 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
-#include <gic_v2.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/arm/gic_v2.h>
+#include <drivers/arm/sp804.h>
#include <mmio.h>
-#include <sp804.h>
static unsigned int sp804_freq;
static uintptr_t sp804_base;
diff --git a/drivers/arm/timer/system_timer.c b/drivers/arm/timer/system_timer.c
index 6cc3cef3..e1f8fb07 100644
--- a/drivers/arm/timer/system_timer.c
+++ b/drivers/arm/timer/system_timer.c
@@ -6,13 +6,13 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/arm/gic_v2.h>
+#include <drivers/arm/system_timer.h>
#include <debug.h>
-#include <gic_v2.h>
#include <irq.h>
#include <mmio.h>
-#include <system_timer.h>
static uintptr_t g_systimer_base;
diff --git a/drivers/io/io_fip.c b/drivers/io/io_fip.c
index 8b5af6ec..6f272d94 100644
--- a/drivers/io/io_fip.c
+++ b/drivers/io/io_fip.c
@@ -6,11 +6,11 @@
#include <assert.h>
#include <debug.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_fip.h>
#include <errno.h>
#include <firmware_image_package.h>
#include <image_loader.h>
-#include <io_driver.h>
-#include <io_fip.h>
#include <io_storage.h>
#include <platform.h>
#include <platform_def.h>
diff --git a/drivers/io/io_memmap.c b/drivers/io/io_memmap.c
index 3f4b2dbb..231040bf 100644
--- a/drivers/io/io_memmap.c
+++ b/drivers/io/io_memmap.c
@@ -6,7 +6,7 @@
#include <assert.h>
#include <debug.h>
-#include <io_driver.h>
+#include <drivers/io/io_driver.h>
#include <io_storage.h>
#include <string.h>
diff --git a/drivers/io/io_storage.c b/drivers/io/io_storage.c
index 57dc7614..9a45da2d 100644
--- a/drivers/io/io_storage.c
+++ b/drivers/io/io_storage.c
@@ -5,7 +5,7 @@
*/
#include <assert.h>
-#include <io_driver.h>
+#include <drivers/io/io_driver.h>
#include <io_storage.h>
#include <platform_def.h>
#include <stddef.h>
diff --git a/drivers/io/vexpress_nor/io_vexpress_nor_internal.h b/drivers/io/vexpress_nor/io_vexpress_nor_internal.h
index e06d492e..328be069 100644
--- a/drivers/io/vexpress_nor/io_vexpress_nor_internal.h
+++ b/drivers/io/vexpress_nor/io_vexpress_nor_internal.h
@@ -7,8 +7,8 @@
#ifndef __IO_VEXPRESS_NOR_INTERNAL_H__
#define __IO_VEXPRESS_NOR_INTERNAL_H__
-#include <io_driver.h>
-#include <io_nor_flash.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_nor_flash.h>
#include <io_storage.h>
#define IS_FLASH_ADDRESS_BLOCK_ALIGNED(fp, addr) \
diff --git a/fwu/ns_bl1u/ns_bl1u.mk b/fwu/ns_bl1u/ns_bl1u.mk
index d5c78069..edc77bef 100644
--- a/fwu/ns_bl1u/ns_bl1u.mk
+++ b/fwu/ns_bl1u/ns_bl1u.mk
@@ -10,11 +10,9 @@ include lib/compiler-rt/compiler-rt.mk
NS_BL1U_INCLUDES := \
-I${AUTOGEN_DIR} \
-Itftf/framework/include \
+ -Iinclude \
-Iinclude/common \
-Iinclude/common/${ARCH} \
- -Iinclude/drivers \
- -Iinclude/drivers/arm \
- -Iinclude/drivers/io \
-Iinclude/lib \
-Iinclude/lib/${ARCH} \
-Iinclude/lib/stdlib \
diff --git a/fwu/ns_bl1u/ns_bl1u_main.c b/fwu/ns_bl1u/ns_bl1u_main.c
index 4a15e860..55cea903 100644
--- a/fwu/ns_bl1u/ns_bl1u_main.c
+++ b/fwu/ns_bl1u/ns_bl1u_main.c
@@ -8,9 +8,9 @@
#include <assert.h>
#include <bl1.h>
#include <debug.h>
+#include <drivers/io/io_fip.h>
#include <errno.h>
#include <image_loader.h>
-#include <io_fip.h>
#include <io_storage.h>
#include <mmio.h>
#include <nvm.h>
diff --git a/fwu/ns_bl1u/ns_bl1u_tests.c b/fwu/ns_bl1u/ns_bl1u_tests.c
index 16ae2591..c5e18378 100644
--- a/fwu/ns_bl1u/ns_bl1u_tests.c
+++ b/fwu/ns_bl1u/ns_bl1u_tests.c
@@ -11,8 +11,8 @@
#include <bl1.h>
#include <debug.h>
+#include <drivers/io/io_fip.h>
#include <errno.h>
-#include <io_fip.h>
#include <platform_def.h>
#include <smccc.h>
#include <status.h>
diff --git a/fwu/ns_bl2u/ns_bl2u.mk b/fwu/ns_bl2u/ns_bl2u.mk
index abd5ac55..8c3924d3 100644
--- a/fwu/ns_bl2u/ns_bl2u.mk
+++ b/fwu/ns_bl2u/ns_bl2u.mk
@@ -10,11 +10,9 @@ include lib/compiler-rt/compiler-rt.mk
NS_BL2U_INCLUDES := \
-I${AUTOGEN_DIR} \
-Itftf/framework/include \
+ -Iinclude \
-Iinclude/common \
-Iinclude/common/${ARCH} \
- -Iinclude/drivers \
- -Iinclude/drivers/arm \
- -Iinclude/drivers/io \
-Iinclude/lib \
-Iinclude/lib/${ARCH} \
-Iinclude/lib/stdlib \
diff --git a/include/drivers/arm/sp804.h b/include/drivers/arm/sp804.h
index 7ca55676..004fb769 100644
--- a/include/drivers/arm/sp804.h
+++ b/include/drivers/arm/sp804.h
@@ -7,6 +7,8 @@
#ifndef __SP804_H__
#define __SP804_H__
+#include <stdint.h>
+
#define SP804_LOAD_OFFSET 0x0
#define SP804_CURRENT_VALUE_OFFSET 0x4
#define SP804_CTRL_OFFSET 0x8
diff --git a/include/drivers/arm/system_timer.h b/include/drivers/arm/system_timer.h
index 8cd0c8e6..3bb5dfac 100644
--- a/include/drivers/arm/system_timer.h
+++ b/include/drivers/arm/system_timer.h
@@ -7,6 +7,8 @@
#ifndef __SYSTEM_TIMER_H__
#define __SYSTEM_TIMER_H__
+#include <stdint.h>
+
/*
* Program systimer to fire an interrupt after time_out_ms
*
diff --git a/lib/irq/irq.c b/lib/irq/irq.c
index c7d671fe..70c321b1 100644
--- a/lib/irq/irq.c
+++ b/lib/irq/irq.c
@@ -5,9 +5,9 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
#include <irq.h>
#include <plat_topology.h>
#include <platform.h>
diff --git a/lib/power_management/hotplug/hotplug.c b/lib/power_management/hotplug/hotplug.c
index 7c3a988f..37bfc06b 100644
--- a/lib/power_management/hotplug/hotplug.c
+++ b/lib/power_management/hotplug/hotplug.c
@@ -5,11 +5,11 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
#include <cdefs.h> /* For __dead2 */
-#include <console.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/console.h>
#include <irq.h>
#include <platform.h>
#include <platform_def.h>
diff --git a/lib/power_management/suspend/tftf_suspend.c b/lib/power_management/suspend/tftf_suspend.c
index d6c989af..ee6f9caa 100644
--- a/lib/power_management/suspend/tftf_suspend.c
+++ b/lib/power_management/suspend/tftf_suspend.c
@@ -5,9 +5,9 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
-#include <console.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/console.h>
#include <platform.h>
#include <power_management.h>
#include <psci.h>
diff --git a/lib/psci/psci.c b/lib/psci/psci.c
index 520c7243..857b01e5 100644
--- a/lib/psci/psci.c
+++ b/lib/psci/psci.c
@@ -5,8 +5,8 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
#include <irq.h>
#include <platform.h>
#include <power_management.h>
diff --git a/lib/sdei/sdei.c b/lib/sdei/sdei.c
index 264da28a..157ab6cd 100644
--- a/lib/sdei/sdei.c
+++ b/lib/sdei/sdei.c
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_gic.h>
#include <assert.h>
+#include <drivers/arm/arm_gic.h>
#include <sdei.h>
#include <smccc.h>
#include <stdint.h>
diff --git a/lib/stdlib/putchar.c b/lib/stdlib/putchar.c
index 6b6f75eb..d330f582 100644
--- a/lib/stdlib/putchar.c
+++ b/lib/stdlib/putchar.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <console.h>
+#include <drivers/console.h>
#include <stdio.h>
/* Putchar() should either return the character printed or EOF in case of error.
diff --git a/plat/arm/common/arm_fwu_io_storage.c b/plat/arm/common/arm_fwu_io_storage.c
index 184f2af4..5af3e060 100644
--- a/plat/arm/common/arm_fwu_io_storage.c
+++ b/plat/arm/common/arm_fwu_io_storage.c
@@ -7,11 +7,11 @@
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_fip.h>
+#include <drivers/io/io_memmap.h>
#include <firmware_image_package.h>
#include <image_loader.h>
-#include <io_driver.h>
-#include <io_fip.h>
-#include <io_memmap.h>
#include <io_storage.h>
#include <platform.h>
#include <platform_def.h>
diff --git a/plat/arm/common/arm_io_storage.c b/plat/arm/common/arm_io_storage.c
index d9d8a389..3fdaf8c2 100644
--- a/plat/arm/common/arm_io_storage.c
+++ b/plat/arm/common/arm_io_storage.c
@@ -5,8 +5,8 @@
*/
#include <assert.h>
-#include <io_driver.h>
-#include <io_nor_flash.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_nor_flash.h>
#include <io_storage.h>
#include <platform.h>
#include <tftf.h>
diff --git a/plat/arm/common/arm_setup.c b/plat/arm/common/arm_setup.c
index 79f46317..e345fd80 100644
--- a/plat/arm/common/arm_setup.c
+++ b/plat/arm/common/arm_setup.c
@@ -4,11 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_gic.h>
-#include <console.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/arm/pl011.h>
+#include <drivers/console.h>
#include <io_storage.h>
-#include <pl011.h>
#include <plat_arm.h>
#include <platform.h>
#include <platform_def.h>
diff --git a/plat/arm/common/arm_timers.c b/plat/arm/common/arm_timers.c
index c84cb845..f43fdaa0 100644
--- a/plat/arm/common/arm_timers.c
+++ b/plat/arm/common/arm_timers.c
@@ -5,9 +5,9 @@
*/
#include <assert.h>
+#include <drivers/arm/system_timer.h>
#include <platform.h>
#include <stddef.h>
-#include <system_timer.h>
#include <timer.h>
#pragma weak plat_initialise_timer_ops
diff --git a/plat/arm/fvp/aarch32/plat_helpers.S b/plat/arm/fvp/aarch32/plat_helpers.S
index 1d923ad6..5865aaa1 100644
--- a/plat/arm/fvp/aarch32/plat_helpers.S
+++ b/plat/arm/fvp/aarch32/plat_helpers.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <pl011.h>
+#include <drivers/arm/pl011.h>
#include "../fvp_def.h"
.globl platform_get_core_pos
diff --git a/plat/arm/fvp/aarch64/plat_helpers.S b/plat/arm/fvp/aarch64/plat_helpers.S
index 4bd9f3d6..18cbbd4d 100644
--- a/plat/arm/fvp/aarch64/plat_helpers.S
+++ b/plat/arm/fvp/aarch64/plat_helpers.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <pl011.h>
+#include <drivers/arm/pl011.h>
#include "../fvp_def.h"
.globl platform_get_core_pos
diff --git a/plat/arm/fvp/plat_setup.c b/plat/arm/fvp/plat_setup.c
index 0d816863..fa978142 100644
--- a/plat/arm/fvp/plat_setup.c
+++ b/plat/arm/fvp/plat_setup.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_gic.h>
+#include <drivers/arm/arm_gic.h>
#include <plat_arm.h>
#include <platform.h>
diff --git a/plat/arm/juno/aarch32/plat_helpers.S b/plat/arm/juno/aarch32/plat_helpers.S
index 99fedb48..68fb67ab 100644
--- a/plat/arm/juno/aarch32/plat_helpers.S
+++ b/plat/arm/juno/aarch32/plat_helpers.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <pl011.h>
+#include <drivers/arm/pl011.h>
#include "../juno_def.h"
.globl platform_get_core_pos
diff --git a/plat/arm/juno/aarch64/plat_helpers.S b/plat/arm/juno/aarch64/plat_helpers.S
index 1efee4fb..c221f6e0 100644
--- a/plat/arm/juno/aarch64/plat_helpers.S
+++ b/plat/arm/juno/aarch64/plat_helpers.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <pl011.h>
+#include <drivers/arm/pl011.h>
#include "../juno_def.h"
.globl platform_get_core_pos
diff --git a/plat/arm/juno/juno_timers.c b/plat/arm/juno/juno_timers.c
index 1d1ce488..604a2ddd 100644
--- a/plat/arm/juno/juno_timers.c
+++ b/plat/arm/juno/juno_timers.c
@@ -5,9 +5,9 @@
*/
#include <assert.h>
+#include <drivers/arm/sp804.h>
#include <platform.h>
#include <platform_def.h>
-#include <sp804.h>
#include <stddef.h>
#include <timer.h>
diff --git a/plat/arm/juno/plat_setup.c b/plat/arm/juno/plat_setup.c
index 8792cb34..324c9e66 100644
--- a/plat/arm/juno/plat_setup.c
+++ b/plat/arm/juno/plat_setup.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_gic.h>
+#include <drivers/arm/arm_gic.h>
#include <mmio.h>
#include <plat_arm.h>
#include <platform.h>
diff --git a/plat/arm/sgi/common/aarch64/plat_helpers.S b/plat/arm/sgi/common/aarch64/plat_helpers.S
index 056a2f59..9fe2ba96 100644
--- a/plat/arm/sgi/common/aarch64/plat_helpers.S
+++ b/plat/arm/sgi/common/aarch64/plat_helpers.S
@@ -5,7 +5,7 @@
*/
#include <asm_macros.S>
-#include <pl011.h>
+#include <drivers/arm/pl011.h>
#include <platform_def.h>
.globl platform_get_core_pos
diff --git a/plat/arm/sgi/common/plat_setup.c b/plat/arm/sgi/common/plat_setup.c
index 211e8d41..4b15f1a7 100644
--- a/plat/arm/sgi/common/plat_setup.c
+++ b/plat/arm/sgi/common/plat_setup.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_gic.h>
+#include <drivers/arm/arm_gic.h>
#include <xlat_tables_v2.h>
static const mmap_region_t mmap[] = {
diff --git a/plat/common/fwu_nvm_accessors.c b/plat/common/fwu_nvm_accessors.c
index 5b32151d..ec8bb719 100644
--- a/plat/common/fwu_nvm_accessors.c
+++ b/plat/common/fwu_nvm_accessors.c
@@ -6,9 +6,9 @@
#include <assert.h>
#include <debug.h>
+#include <drivers/io/io_fip.h>
#include <firmware_image_package.h>
#include <fwu_nvm.h>
-#include <io_fip.h>
#include <io_storage.h>
#include <platform.h>
#include <platform_def.h>
diff --git a/plat/common/image_loader.c b/plat/common/image_loader.c
index 9b27f6f4..ffc997a4 100644
--- a/plat/common/image_loader.c
+++ b/plat/common/image_loader.c
@@ -7,11 +7,11 @@
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_fip.h>
+#include <drivers/io/io_memmap.h>
#include <firmware_image_package.h>
#include <image_loader.h>
-#include <io_driver.h>
-#include <io_fip.h>
-#include <io_memmap.h>
#include <io_storage.h>
#include <platform.h>
#include <platform_def.h>
diff --git a/plat/common/plat_common.c b/plat/common/plat_common.c
index 57138711..c5f4592c 100644
--- a/plat/common/plat_common.c
+++ b/plat/common/plat_common.c
@@ -5,10 +5,10 @@
*/
#include <arch_helpers.h>
-#include <console.h>
#include <debug.h>
+#include <drivers/arm/sp805.h>
+#include <drivers/console.h>
#include <platform.h>
-#include <sp805.h>
#include <xlat_tables_v2.h>
/*
diff --git a/spm/cactus/cactus.mk b/spm/cactus/cactus.mk
index 03d809d1..056b4a7a 100644
--- a/spm/cactus/cactus.mk
+++ b/spm/cactus/cactus.mk
@@ -12,8 +12,6 @@ CACTUS_INCLUDES := \
-Iinclude \
-Iinclude/common \
-Iinclude/common/${ARCH} \
- -Iinclude/drivers \
- -Iinclude/drivers/arm \
-Iinclude/lib \
-Iinclude/lib/${ARCH} \
-Iinclude/lib/stdlib \
diff --git a/spm/cactus/cactus_main.c b/spm/cactus/cactus_main.c
index a062ef01..4580f23e 100644
--- a/spm/cactus/cactus_main.c
+++ b/spm/cactus/cactus_main.c
@@ -6,10 +6,10 @@
#include <assert.h>
#include <cactus_def.h>
-#include <console.h>
#include <debug.h>
+#include <drivers/arm/pl011.h>
+#include <drivers/console.h>
#include <errno.h>
-#include <pl011.h>
#include <plat_arm.h>
#include <platform_def.h>
#include <sp_helpers.h>
diff --git a/spm/ivy/ivy.mk b/spm/ivy/ivy.mk
index c7726f4f..244d2096 100644
--- a/spm/ivy/ivy.mk
+++ b/spm/ivy/ivy.mk
@@ -12,8 +12,6 @@ IVY_INCLUDES := \
-Iinclude \
-Iinclude/common \
-Iinclude/common/${ARCH} \
- -Iinclude/drivers \
- -Iinclude/drivers/arm \
-Iinclude/lib \
-Iinclude/lib/${ARCH} \
-Iinclude/lib/stdlib \
diff --git a/spm/ivy/ivy_main.c b/spm/ivy/ivy_main.c
index 1f1c5e4d..8542150b 100644
--- a/spm/ivy/ivy_main.c
+++ b/spm/ivy/ivy_main.c
@@ -5,11 +5,11 @@
*/
#include <assert.h>
-#include <console.h>
#include <debug.h>
+#include <drivers/console.h>
+#include <drivers/arm/pl011.h>
#include <errno.h>
#include <ivy_def.h>
-#include <pl011.h>
#include <plat_arm.h>
#include <platform_def.h>
#include <sp_helpers.h>
diff --git a/tftf/framework/debug.c b/tftf/framework/debug.c
index 0927ed47..66fc03bf 100644
--- a/tftf/framework/debug.c
+++ b/tftf/framework/debug.c
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <console.h>
#include <debug.h>
+#include <drivers/console.h>
void __attribute__((__noreturn__)) do_panic(const char *file, int line)
{
diff --git a/tftf/framework/framework.mk b/tftf/framework/framework.mk
index 81061d45..4e5dc2e6 100644
--- a/tftf/framework/framework.mk
+++ b/tftf/framework/framework.mk
@@ -12,11 +12,9 @@ include lib/compiler-rt/compiler-rt.mk
TFTF_INCLUDES := \
-I${AUTOGEN_DIR} \
-Itftf/framework/include \
+ -Iinclude \
-Iinclude/common \
-Iinclude/common/${ARCH} \
- -Iinclude/drivers \
- -Iinclude/drivers/arm \
- -Iinclude/drivers/io \
-Iinclude/lib \
-Iinclude/lib/${ARCH} \
-Iinclude/lib/extensions \
diff --git a/tftf/framework/main.c b/tftf/framework/main.c
index 02b54386..7f987c05 100644
--- a/tftf/framework/main.c
+++ b/tftf/framework/main.c
@@ -5,9 +5,9 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
#include <irq.h>
#include <mmio.h>
#include <nvm.h>
diff --git a/tftf/framework/timer/timer_framework.c b/tftf/framework/timer/timer_framework.c
index 0b0a7a53..38106cfc 100644
--- a/tftf/framework/timer/timer_framework.c
+++ b/tftf/framework/timer/timer_framework.c
@@ -6,8 +6,8 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
#include <errno.h>
#include <irq.h>
#include <mmio.h>
diff --git a/tftf/tests/framework_validation_tests/test_validation_irq.c b/tftf/tests/framework_validation_tests/test_validation_irq.c
index 2e9e3732..67f5c295 100644
--- a/tftf/tests/framework_validation_tests/test_validation_irq.c
+++ b/tftf/tests/framework_validation_tests/test_validation_irq.c
@@ -5,7 +5,7 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
+#include <drivers/arm/arm_gic.h>
#include <irq.h>
#include <platform.h>
#include <sgi.h>
diff --git a/tftf/tests/framework_validation_tests/test_validation_sgi.c b/tftf/tests/framework_validation_tests/test_validation_sgi.c
index 806bc581..7f81b2b2 100644
--- a/tftf/tests/framework_validation_tests/test_validation_sgi.c
+++ b/tftf/tests/framework_validation_tests/test_validation_sgi.c
@@ -5,8 +5,8 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
#include <irq.h>
#include <platform.h>
#include <sgi.h>
diff --git a/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c b/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c
index 5f9393d1..9afd9102 100644
--- a/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c
+++ b/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c
@@ -6,8 +6,8 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
+#include <drivers/arm/arm_gic.h>
#include <events.h>
#include <irq.h>
#include <plat_topology.h>
diff --git a/tftf/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c b/tftf/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c
index 64f6c81e..4732796c 100644
--- a/tftf/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c
+++ b/tftf/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c
@@ -6,10 +6,10 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
#include <cassert.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
#include <events.h>
#include <irq.h>
#include <math_utils.h>
diff --git a/tftf/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c b/tftf/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c
index 78e8799b..afb352b4 100644
--- a/tftf/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c
+++ b/tftf/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c
@@ -6,11 +6,11 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/arm/gic_v2.h>
#include <events.h>
-#include <gic_v2.h>
#include <irq.h>
#include <plat_topology.h>
#include <platform.h>
diff --git a/tftf/tests/runtime_services/standard_service/psci/api_tests/validate_power_state/test_validate_power_state.c b/tftf/tests/runtime_services/standard_service/psci/api_tests/validate_power_state/test_validate_power_state.c
index 55de1fa8..1690ca36 100644
--- a/tftf/tests/runtime_services/standard_service/psci/api_tests/validate_power_state/test_validate_power_state.c
+++ b/tftf/tests/runtime_services/standard_service/psci/api_tests/validate_power_state/test_validate_power_state.c
@@ -5,8 +5,8 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
#include <events.h>
#include <irq.h>
#include <plat_topology.h>
diff --git a/tftf/tests/runtime_services/standard_service/psci/system_tests/test_psci_system_suspend_stress.c b/tftf/tests/runtime_services/standard_service/psci/system_tests/test_psci_system_suspend_stress.c
index 5b500beb..6f629e81 100644
--- a/tftf/tests/runtime_services/standard_service/psci/system_tests/test_psci_system_suspend_stress.c
+++ b/tftf/tests/runtime_services/standard_service/psci/system_tests/test_psci_system_suspend_stress.c
@@ -6,11 +6,11 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/arm/gic_v2.h>
#include <events.h>
-#include <gic_v2.h>
#include <irq.h>
#include <plat_topology.h>
#include <platform.h>
diff --git a/tftf/tests/runtime_services/standard_service/sdei/system_tests/test_sdei.c b/tftf/tests/runtime_services/standard_service/sdei/system_tests/test_sdei.c
index dc357c16..ca8b63d2 100644
--- a/tftf/tests/runtime_services/standard_service/sdei/system_tests/test_sdei.c
+++ b/tftf/tests/runtime_services/standard_service/sdei/system_tests/test_sdei.c
@@ -6,11 +6,11 @@
#include <arch_helpers.h>
#include <debug.h>
+#include <drivers/arm/private_timer.h>
#include <events.h>
#include <plat_topology.h>
#include <platform.h>
#include <power_management.h>
-#include <private_timer.h>
#include <sdei.h>
#include <tftf_lib.h>
#include <timer.h>
diff --git a/tftf/tests/runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c b/tftf/tests/runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c
index b8bfcfe5..c206c3d2 100644
--- a/tftf/tests/runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c
+++ b/tftf/tests/runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c
@@ -5,11 +5,11 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gic_v2.h>
#include <events.h>
-#include <gic_common.h>
-#include <gic_v2.h>
#include <irq.h>
#include <plat_topology.h>
#include <platform.h>
diff --git a/tftf/tests/runtime_services/trusted_os/tsp/test_irq_spurious_gicv2.c b/tftf/tests/runtime_services/trusted_os/tsp/test_irq_spurious_gicv2.c
index 6eaf0465..a52f67a3 100644
--- a/tftf/tests/runtime_services/trusted_os/tsp/test_irq_spurious_gicv2.c
+++ b/tftf/tests/runtime_services/trusted_os/tsp/test_irq_spurious_gicv2.c
@@ -5,11 +5,11 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gic_v2.h>
#include <events.h>
-#include <gic_common.h>
-#include <gic_v2.h>
#include <irq.h>
#include <plat_topology.h>
#include <platform.h>
diff --git a/tftf/tests/runtime_services/trusted_os/tsp/test_normal_int_switch.c b/tftf/tests/runtime_services/trusted_os/tsp/test_normal_int_switch.c
index 0128ffae..19f37812 100644
--- a/tftf/tests/runtime_services/trusted_os/tsp/test_normal_int_switch.c
+++ b/tftf/tests/runtime_services/trusted_os/tsp/test_normal_int_switch.c
@@ -5,9 +5,9 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
#include <irq.h>
#include <mmio.h>
#include <platform.h>