aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile14
-rw-r--r--bl1/aarch32/bl1_context_mgmt.c10
-rw-r--r--bl1/aarch32/bl1_entrypoint.S2
-rw-r--r--bl1/aarch32/bl1_exceptions.S6
-rw-r--r--bl1/aarch64/bl1_context_mgmt.c10
-rw-r--r--bl1/aarch64/bl1_exceptions.S4
-rw-r--r--bl1/bl1.ld.S3
-rw-r--r--bl1/bl1_fwu.c23
-rw-r--r--bl1/bl1_main.c25
-rw-r--r--bl1/bl1_private.h3
-rw-r--r--bl1/tbbr/tbbr_img_desc.c7
-rw-r--r--bl2/aarch32/bl2_el3_entrypoint.S3
-rw-r--r--bl2/aarch32/bl2_el3_exceptions.S2
-rw-r--r--bl2/aarch32/bl2_entrypoint.S3
-rw-r--r--bl2/aarch64/bl2_el3_entrypoint.S2
-rw-r--r--bl2/aarch64/bl2_el3_exceptions.S4
-rw-r--r--bl2/aarch64/bl2_entrypoint.S2
-rw-r--r--bl2/bl2.ld.S3
-rw-r--r--bl2/bl2_el3.ld.S3
-rw-r--r--bl2/bl2_image_load_v2.c20
-rw-r--r--bl2/bl2_main.c15
-rw-r--r--bl2u/aarch32/bl2u_entrypoint.S3
-rw-r--r--bl2u/aarch64/bl2u_entrypoint.S3
-rw-r--r--bl2u/bl2u.ld.S3
-rw-r--r--bl2u/bl2u_main.c21
-rw-r--r--bl31/aarch64/bl31_entrypoint.S11
-rw-r--r--bl31/aarch64/crash_reporting.S10
-rw-r--r--bl31/aarch64/ea_delegate.S4
-rw-r--r--bl31/aarch64/runtime_exceptions.S13
-rw-r--r--bl31/bl31.ld.S7
-rw-r--r--bl31/bl31_context_mgmt.c12
-rw-r--r--bl31/bl31_main.c27
-rw-r--r--bl31/ehf.c19
-rw-r--r--bl31/interrupt_mgmt.c9
-rw-r--r--bl32/sp_min/aarch32/entrypoint.S6
-rw-r--r--bl32/sp_min/sp_min.ld.S7
-rw-r--r--bl32/sp_min/sp_min_main.c32
-rw-r--r--bl32/tsp/aarch64/tsp_entrypoint.S5
-rw-r--r--bl32/tsp/aarch64/tsp_exceptions.S5
-rw-r--r--bl32/tsp/aarch64/tsp_request.S2
-rw-r--r--bl32/tsp/tsp.ld.S2
-rw-r--r--bl32/tsp/tsp_interrupt.c11
-rw-r--r--bl32/tsp/tsp_main.c14
-rw-r--r--bl32/tsp/tsp_private.h9
-rw-r--r--bl32/tsp/tsp_timer.c7
-rw-r--r--common/aarch64/debug.S2
-rw-r--r--common/aarch64/early_exceptions.S2
-rw-r--r--common/backtrace/backtrace.c7
-rw-r--r--common/bl_common.c19
-rw-r--r--common/desc_image_load.c7
-rw-r--r--common/fdt_wrappers.c8
-rw-r--r--common/image_decompress.c9
-rw-r--r--common/runtime_svc.c5
-rw-r--r--common/tf_log.c7
-rw-r--r--docs/exception-handling.rst4
-rw-r--r--drivers/allwinner/sunxi_rsb.c8
-rw-r--r--drivers/arm/cci/cci.c11
-rw-r--r--drivers/arm/ccn/ccn.c12
-rw-r--r--drivers/arm/gic/common/gic_common.c6
-rw-r--r--drivers/arm/gic/common/gic_common_private.h5
-rw-r--r--drivers/arm/gic/v2/gicv2_helpers.c12
-rw-r--r--drivers/arm/gic/v2/gicv2_main.c15
-rw-r--r--drivers/arm/gic/v2/gicv2_private.h5
-rw-r--r--drivers/arm/gic/v3/arm_gicv3_common.c7
-rw-r--r--drivers/arm/gic/v3/gic600.c5
-rw-r--r--drivers/arm/gic/v3/gicv3_helpers.c10
-rw-r--r--drivers/arm/gic/v3/gicv3_main.c12
-rw-r--r--drivers/arm/gic/v3/gicv3_private.h8
-rw-r--r--drivers/arm/pl011/aarch32/pl011_console.S2
-rw-r--r--drivers/arm/pl011/aarch64/pl011_console.S2
-rw-r--r--drivers/arm/pl061/pl061_gpio.c13
-rw-r--r--drivers/arm/smmu/smmu_v3.c5
-rw-r--r--drivers/arm/sp804/sp804_delay_timer.c5
-rw-r--r--drivers/arm/sp805/sp805.c5
-rw-r--r--drivers/arm/tzc/tzc380.c7
-rw-r--r--drivers/arm/tzc/tzc400.c8
-rw-r--r--drivers/arm/tzc/tzc_common_private.h4
-rw-r--r--drivers/arm/tzc/tzc_dmc500.c10
-rw-r--r--drivers/arm/tzc/tzc_dmc620.c7
-rw-r--r--drivers/auth/auth_mod.c18
-rw-r--r--drivers/auth/crypto_mod.c5
-rw-r--r--drivers/auth/cryptocell/cryptocell_crypto.c26
-rw-r--r--drivers/auth/cryptocell/cryptocell_crypto.mk4
-rw-r--r--drivers/auth/img_parser_mod.c9
-rw-r--r--drivers/auth/mbedtls/mbedtls_common.c12
-rw-r--r--drivers/auth/mbedtls/mbedtls_common.mk3
-rw-r--r--drivers/auth/mbedtls/mbedtls_crypto.c9
-rw-r--r--drivers/auth/mbedtls/mbedtls_x509_parser.c9
-rw-r--r--drivers/auth/tbbr/tbbr_cot.c7
-rw-r--r--drivers/cadence/uart/aarch64/cdns_console.S2
-rw-r--r--drivers/cfi/v2m/v2m_flash.c5
-rw-r--r--drivers/console/multi_console.c1
-rw-r--r--drivers/coreboot/cbmem_console/aarch64/cbmem_console.S2
-rw-r--r--drivers/delay_timer/delay_timer.c6
-rw-r--r--drivers/delay_timer/generic_delay_timer.c13
-rw-r--r--drivers/gpio/gpio.c3
-rw-r--r--drivers/imx/timer/imx_gpt.c6
-rw-r--r--drivers/imx/uart/imx_uart.c8
-rw-r--r--drivers/imx/usdhc/imx_usdhc.c16
-rw-r--r--drivers/imx/usdhc/imx_usdhc.h2
-rw-r--r--drivers/io/io_block.c14
-rw-r--r--drivers/io/io_dummy.c9
-rw-r--r--drivers/io/io_fip.c22
-rw-r--r--drivers/io/io_memmap.c14
-rw-r--r--drivers/io/io_semihosting.c10
-rw-r--r--drivers/io/io_storage.c7
-rw-r--r--drivers/marvell/amb_adec.c5
-rw-r--r--drivers/marvell/ap807_clocks_init.c7
-rw-r--r--drivers/marvell/cache_llc.c10
-rw-r--r--drivers/marvell/ccu.c7
-rw-r--r--drivers/marvell/comphy/phy-comphy-3700.c11
-rw-r--r--drivers/marvell/comphy/phy-comphy-cp110.c10
-rw-r--r--drivers/marvell/gwin.c7
-rw-r--r--drivers/marvell/io_win.c7
-rw-r--r--drivers/marvell/iob.c9
-rw-r--r--drivers/marvell/mc_trustzone/mc_trustzone.c8
-rw-r--r--drivers/marvell/mc_trustzone/mc_trustzone.h2
-rw-r--r--drivers/marvell/mci.c9
-rw-r--r--drivers/marvell/mochi/ap807_setup.c15
-rw-r--r--drivers/marvell/mochi/apn806_setup.c15
-rw-r--r--drivers/marvell/mochi/cp110_setup.c11
-rw-r--r--drivers/marvell/thermal.c4
-rw-r--r--drivers/marvell/uart/a3700_console.S2
-rw-r--r--drivers/mentor/i2c/mi2cv.c10
-rw-r--r--drivers/meson/console/aarch64/meson_console.S2
-rw-r--r--drivers/mmc/mmc.c11
-rw-r--r--drivers/partition/gpt.c7
-rw-r--r--drivers/partition/partition.c13
-rw-r--r--drivers/renesas/rcar/auth/auth_mod.c12
-rw-r--r--drivers/renesas/rcar/avs/avs_driver.c7
-rw-r--r--drivers/renesas/rcar/board/board.c5
-rw-r--r--drivers/renesas/rcar/common.c3
-rw-r--r--drivers/renesas/rcar/console/rcar_printf.c16
-rw-r--r--drivers/renesas/rcar/cpld/ulcb_cpld.c2
-rw-r--r--drivers/renesas/rcar/delay/micro_delay.h2
-rw-r--r--drivers/renesas/rcar/dma/dma_driver.c8
-rw-r--r--drivers/renesas/rcar/emmc/emmc_cmd.c3
-rw-r--r--drivers/renesas/rcar/emmc/emmc_init.c4
-rw-r--r--drivers/renesas/rcar/emmc/emmc_interrupt.c6
-rw-r--r--drivers/renesas/rcar/emmc/emmc_mount.c5
-rw-r--r--drivers/renesas/rcar/emmc/emmc_read.c2
-rw-r--r--drivers/renesas/rcar/emmc/emmc_utility.c3
-rw-r--r--drivers/renesas/rcar/iic_dvfs/iic_dvfs.c5
-rw-r--r--drivers/renesas/rcar/io/io_emmcdrv.c7
-rw-r--r--drivers/renesas/rcar/io/io_memdrv.c7
-rw-r--r--drivers/renesas/rcar/io/io_rcar.c24
-rw-r--r--drivers/renesas/rcar/pwrc/pwrc.c14
-rw-r--r--drivers/renesas/rcar/rom/rom_api.c4
-rw-r--r--drivers/renesas/rcar/rpc/rpc_driver.c6
-rw-r--r--drivers/renesas/rcar/watchdog/swdt.c7
-rw-r--r--drivers/st/clk/stm32mp1_clk.c31
-rw-r--r--drivers/st/clk/stm32mp1_clkfunc.c9
-rw-r--r--drivers/st/ddr/stm32mp1_ddr.c27
-rw-r--r--drivers/st/ddr/stm32mp1_ddr_helpers.c7
-rw-r--r--drivers/st/ddr/stm32mp1_ram.c24
-rw-r--r--drivers/st/gpio/stm32_gpio.c9
-rw-r--r--drivers/st/io/io_mmc.c13
-rw-r--r--drivers/st/io/io_stm32image.c19
-rw-r--r--drivers/st/mmc/stm32_sdmmc2.c28
-rw-r--r--drivers/st/pmic/stm32_i2c.c9
-rw-r--r--drivers/st/pmic/stm32mp1_pmic.c24
-rw-r--r--drivers/st/pmic/stpmu1.c7
-rw-r--r--drivers/st/reset/stm32mp1_reset.c14
-rw-r--r--drivers/st/uart/aarch32/stm32_console.S4
-rw-r--r--drivers/staging/renesas/rcar/ddr/ddr_a/ddr_init_e3.c4
-rw-r--r--drivers/staging/renesas/rcar/ddr/ddr_b/boot_init_dram.c6
-rw-r--r--drivers/staging/renesas/rcar/ddr/dram_sub_func.c5
-rw-r--r--drivers/staging/renesas/rcar/pfc/E3/pfc_init_e3.c4
-rw-r--r--drivers/staging/renesas/rcar/pfc/H3/pfc_init_h3_v1.c4
-rw-r--r--drivers/staging/renesas/rcar/pfc/H3/pfc_init_h3_v2.c4
-rw-r--r--drivers/staging/renesas/rcar/pfc/M3/pfc_init_m3.c4
-rw-r--r--drivers/staging/renesas/rcar/pfc/M3N/pfc_init_m3n.c4
-rw-r--r--drivers/staging/renesas/rcar/pfc/pfc_init.c6
-rw-r--r--drivers/staging/renesas/rcar/qos/E3/qos_init_e3_v10.c4
-rw-r--r--drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v10.c4
-rw-r--r--drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v11.c5
-rw-r--r--drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v20.c4
-rw-r--r--drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v30.c4
-rw-r--r--drivers/staging/renesas/rcar/qos/H3/qos_init_h3n_v30.c4
-rw-r--r--drivers/staging/renesas/rcar/qos/M3/qos_init_m3_v10.c4
-rw-r--r--drivers/staging/renesas/rcar/qos/M3/qos_init_m3_v11.c4
-rw-r--r--drivers/staging/renesas/rcar/qos/M3N/qos_init_m3n_v10.c4
-rw-r--r--drivers/staging/renesas/rcar/qos/qos_init.c6
-rw-r--r--drivers/synopsys/emmc/dw_mmc.c15
-rw-r--r--drivers/synopsys/ufs/dw_ufs.c9
-rw-r--r--drivers/ti/uart/aarch64/16550_console.S2
-rw-r--r--drivers/ufs/ufs.c14
-rw-r--r--include/arch/aarch32/arch.h2
-rw-r--r--include/arch/aarch32/arch_helpers.h3
-rw-r--r--include/arch/aarch32/asm_macros.S4
-rw-r--r--include/arch/aarch32/console_macros.S2
-rw-r--r--include/arch/aarch32/smccc_helpers.h6
-rw-r--r--include/arch/aarch64/arch.h2
-rw-r--r--include/arch/aarch64/arch_helpers.h3
-rw-r--r--include/arch/aarch64/asm_macros.S4
-rw-r--r--include/arch/aarch64/console_macros.S2
-rw-r--r--include/arch/aarch64/smccc_helpers.h6
-rw-r--r--include/bl1/bl1.h5
-rw-r--r--include/bl1/tbbr/tbbr_img_desc.h2
-rw-r--r--include/bl31/ehf.h3
-rw-r--r--include/bl31/interrupt_mgmt.h2
-rw-r--r--include/bl32/payloads/tlk.h2
-rw-r--r--include/common/bl_common.h10
-rw-r--r--include/common/debug.h6
-rw-r--r--include/common/desc_image_load.h2
-rw-r--r--include/common/ep_info.h7
-rw-r--r--include/common/param_header.h3
-rw-r--r--include/common/runtime_svc.h6
-rw-r--r--include/common/tbbr/tbbr_img_def.h2
-rw-r--r--include/drivers/arm/cci.h2
-rw-r--r--include/drivers/arm/gic_common.h2
-rw-r--r--include/drivers/arm/gicv2.h5
-rw-r--r--include/drivers/arm/gicv3.h9
-rw-r--r--include/drivers/arm/pl011.h2
-rw-r--r--include/drivers/arm/pl061_gpio.h2
-rw-r--r--include/drivers/arm/smmu_v3.h3
-rw-r--r--include/drivers/arm/sp804_delay_timer.h2
-rw-r--r--include/drivers/arm/sp805.h2
-rw-r--r--include/drivers/arm/tzc380.h4
-rw-r--r--include/drivers/arm/tzc400.h4
-rw-r--r--include/drivers/arm/tzc_common.h2
-rw-r--r--include/drivers/arm/tzc_dmc500.h4
-rw-r--r--include/drivers/arm/tzc_dmc620.h2
-rw-r--r--include/drivers/auth/auth_mod.h8
-rw-r--r--include/drivers/auth/img_parser_mod.h2
-rw-r--r--include/drivers/cadence/cdns_uart.h2
-rw-r--r--include/drivers/console.h6
-rw-r--r--include/drivers/console_assertions.h2
-rw-r--r--include/drivers/coreboot/cbmem_console.h2
-rw-r--r--include/drivers/io/io_block.h2
-rw-r--r--include/drivers/io/io_driver.h2
-rw-r--r--include/drivers/io/io_storage.h2
-rw-r--r--include/drivers/marvell/ccu.h2
-rw-r--r--include/drivers/marvell/gwin.h2
-rw-r--r--include/drivers/marvell/io_win.h2
-rw-r--r--include/drivers/marvell/iob.h2
-rw-r--r--include/drivers/marvell/mochi/cp110_setup.h3
-rw-r--r--include/drivers/marvell/uart/a3700_console.h2
-rw-r--r--include/drivers/meson/meson_console.h2
-rw-r--r--include/drivers/mmc.h3
-rw-r--r--include/drivers/partition/gpt.h2
-rw-r--r--include/drivers/partition/partition.h3
-rw-r--r--include/drivers/st/io_mmc.h2
-rw-r--r--include/drivers/st/io_stm32image.h4
-rw-r--r--include/drivers/st/stm32_console.h2
-rw-r--r--include/drivers/st/stm32_gpio.h2
-rw-r--r--include/drivers/st/stm32_i2c.h3
-rw-r--r--include/drivers/st/stm32_sdmmc2.h3
-rw-r--r--include/drivers/st/stm32_uart_regs.h2
-rw-r--r--include/drivers/st/stm32mp1_clk.h3
-rw-r--r--include/drivers/st/stm32mp1_clkfunc.h3
-rw-r--r--include/drivers/st/stm32mp1_ddr_regs.h2
-rw-r--r--include/drivers/st/stm32mp1_pmic.h2
-rw-r--r--include/drivers/st/stm32mp1_pwr.h2
-rw-r--r--include/drivers/st/stm32mp1_rcc.h2
-rw-r--r--include/drivers/st/stpmu1.h4
-rw-r--r--include/drivers/synopsys/dw_mmc.h2
-rw-r--r--include/drivers/ti/uart/uart_16550.h2
-rw-r--r--include/drivers/ufs.h2
-rw-r--r--include/lib/bakery_lock.h3
-rw-r--r--include/lib/cpus/aarch32/cortex_a57.h2
-rw-r--r--include/lib/cpus/aarch32/cortex_a72.h3
-rw-r--r--include/lib/cpus/aarch32/cpu_macros.S2
-rw-r--r--include/lib/cpus/aarch64/cortex_a57.h3
-rw-r--r--include/lib/cpus/aarch64/cortex_a72.h3
-rw-r--r--include/lib/cpus/aarch64/cortex_a75.h2
-rw-r--r--include/lib/cpus/aarch64/cortex_ares.h2
-rw-r--r--include/lib/cpus/aarch64/cpu_macros.S2
-rw-r--r--include/lib/cpus/aarch64/dsu_def.h2
-rw-r--r--include/lib/cpus/errata_report.h4
-rw-r--r--include/lib/el3_runtime/aarch32/context.h5
-rw-r--r--include/lib/el3_runtime/aarch64/context.h8
-rw-r--r--include/lib/el3_runtime/context_mgmt.h3
-rw-r--r--include/lib/el3_runtime/cpu_data.h7
-rw-r--r--include/lib/el3_runtime/pubsub.h3
-rw-r--r--include/lib/el3_runtime/pubsub_events.h2
-rw-r--r--include/lib/extensions/amu.h8
-rw-r--r--include/lib/extensions/ras.h3
-rw-r--r--include/lib/extensions/ras_arch.h2
-rw-r--r--include/lib/libc/assert.h4
-rw-r--r--include/lib/object_pool.h5
-rw-r--r--include/lib/optee_utils.h3
-rw-r--r--include/lib/pmf/pmf.h6
-rw-r--r--include/lib/pmf/pmf_helpers.h7
-rw-r--r--include/lib/psci/psci.h9
-rw-r--r--include/lib/psci/psci_lib.h3
-rw-r--r--include/lib/runtime_instr.h2
-rw-r--r--include/lib/smccc.h9
-rw-r--r--include/lib/utils.h1
-rw-r--r--include/lib/xlat_tables/aarch32/xlat_tables_aarch32.h4
-rw-r--r--include/lib/xlat_tables/aarch64/xlat_tables_aarch64.h4
-rw-r--r--include/lib/xlat_tables/xlat_tables.h5
-rw-r--r--include/lib/xlat_tables/xlat_tables_compat.h4
-rw-r--r--include/lib/xlat_tables/xlat_tables_defs.h4
-rw-r--r--include/lib/xlat_tables/xlat_tables_v2.h7
-rw-r--r--include/lib/xlat_tables/xlat_tables_v2_helpers.h10
-rw-r--r--include/plat/arm/board/common/board_css_def.h7
-rw-r--r--include/plat/arm/board/common/v2m_def.h2
-rw-r--r--include/plat/arm/common/aarch64/arm_macros.S6
-rw-r--r--include/plat/arm/common/aarch64/cci_macros.S2
-rw-r--r--include/plat/arm/common/arm_config.h3
-rw-r--r--include/plat/arm/common/arm_def.h14
-rw-r--r--include/plat/arm/common/arm_sip_svc.h2
-rw-r--r--include/plat/arm/common/arm_spm_def.h5
-rw-r--r--include/plat/arm/common/arm_tzc_dram.ld.S8
-rw-r--r--include/plat/arm/common/plat_arm.h15
-rw-r--r--include/plat/arm/css/common/css_def.h7
-rw-r--r--include/plat/arm/css/common/css_pm.h3
-rw-r--r--include/plat/arm/soc/common/soc_css_def.h5
-rw-r--r--include/plat/common/common_def.h7
-rw-r--r--include/plat/common/platform.h3
-rw-r--r--include/plat/marvell/a3700/common/armada_common.h3
-rw-r--r--include/plat/marvell/a3700/common/marvell_def.h8
-rw-r--r--include/plat/marvell/a3700/common/plat_marvell.h9
-rw-r--r--include/plat/marvell/a8k/common/armada_common.h8
-rw-r--r--include/plat/marvell/a8k/common/marvell_def.h8
-rw-r--r--include/plat/marvell/a8k/common/plat_marvell.h9
-rw-r--r--include/plat/marvell/common/aarch64/cci_macros.S2
-rw-r--r--include/plat/marvell/common/aarch64/marvell_macros.S8
-rw-r--r--include/plat/marvell/common/marvell_plat_priv.h2
-rw-r--r--include/services/mm_svc.h2
-rw-r--r--include/services/sdei.h4
-rw-r--r--include/services/secure_partition.h3
-rw-r--r--include/services/sp_res_desc.h3
-rw-r--r--include/services/sp_res_desc_def.h2
-rw-r--r--include/services/spci_svc.h4
-rw-r--r--include/services/spm_svc.h2
-rw-r--r--include/services/sprt_svc.h4
-rw-r--r--include/tools_share/firmware_image_package.h3
-rw-r--r--lib/aarch64/misc_helpers.S2
-rw-r--r--lib/coreboot/coreboot.mk2
-rw-r--r--lib/coreboot/coreboot_table.c11
-rw-r--r--lib/cpus/aarch32/cortex_a53.S3
-rw-r--r--lib/cpus/aarch32/cortex_a57.S2
-rw-r--r--lib/cpus/aarch32/cortex_a72.S2
-rw-r--r--lib/cpus/aarch32/cpu_helpers.S2
-rw-r--r--lib/cpus/aarch64/cortex_a35.S2
-rw-r--r--lib/cpus/aarch64/cortex_a53.S6
-rw-r--r--lib/cpus/aarch64/cortex_a55.S2
-rw-r--r--lib/cpus/aarch64/cortex_a57.S4
-rw-r--r--lib/cpus/aarch64/cortex_a73.S2
-rw-r--r--lib/cpus/aarch64/cortex_a75_pubsub.c2
-rw-r--r--lib/cpus/aarch64/cortex_a76.S4
-rw-r--r--lib/cpus/aarch64/cortex_ares_pubsub.c2
-rw-r--r--lib/cpus/aarch64/cortex_deimos.S2
-rw-r--r--lib/cpus/aarch64/cortex_helios.S4
-rw-r--r--lib/cpus/aarch64/cpu_helpers.S6
-rw-r--r--lib/cpus/aarch64/cpuamu.c4
-rw-r--r--lib/cpus/aarch64/dsu_helpers.S2
-rw-r--r--lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S2
-rw-r--r--lib/cpus/aarch64/wa_cve_2017_5715_mmu.S2
-rw-r--r--lib/cpus/errata_report.c13
-rw-r--r--lib/el3_runtime/aarch32/context_mgmt.c20
-rw-r--r--lib/el3_runtime/aarch32/cpu_data.S2
-rw-r--r--lib/el3_runtime/aarch64/context_mgmt.c30
-rw-r--r--lib/el3_runtime/aarch64/cpu_data.S2
-rw-r--r--lib/el3_runtime/cpu_data_array.c5
-rw-r--r--lib/extensions/amu/aarch32/amu.c11
-rw-r--r--lib/extensions/amu/aarch64/amu.c13
-rw-r--r--lib/extensions/mpam/mpam.c5
-rw-r--r--lib/extensions/ras/ras_common.c15
-rw-r--r--lib/extensions/ras/std_err_record.c5
-rw-r--r--lib/extensions/spe/spe.c7
-rw-r--r--lib/extensions/sve/sve.c7
-rw-r--r--lib/libc/abort.c3
-rw-r--r--lib/libc/assert.c7
-rw-r--r--lib/libc/printf.c4
-rw-r--r--lib/libc/putchar.c3
-rw-r--r--lib/libc/snprintf.c5
-rw-r--r--lib/locks/bakery/bakery_lock_coherent.c9
-rw-r--r--lib/locks/bakery/bakery_lock_normal.c11
-rw-r--r--lib/optee/optee_utils.c9
-rw-r--r--lib/pmf/pmf_main.c14
-rw-r--r--lib/pmf/pmf_smc.c8
-rw-r--r--lib/psci/aarch32/psci_helpers.S2
-rw-r--r--lib/psci/aarch64/psci_helpers.S2
-rw-r--r--lib/psci/psci_common.c16
-rw-r--r--lib/psci/psci_main.c18
-rw-r--r--lib/psci/psci_mem_protect.c4
-rw-r--r--lib/psci/psci_off.c14
-rw-r--r--lib/psci/psci_on.c16
-rw-r--r--lib/psci/psci_private.h13
-rw-r--r--lib/psci/psci_setup.c14
-rw-r--r--lib/psci/psci_stat.c7
-rw-r--r--lib/psci/psci_suspend.c22
-rw-r--r--lib/psci/psci_system_off.c10
-rw-r--r--lib/romlib/romlib.ld.S2
-rw-r--r--lib/semihosting/semihosting.c3
-rw-r--r--lib/stack_protector/stack_protector.c6
-rw-r--r--lib/utils/mem_region.c3
-rw-r--r--lib/xlat_tables/aarch32/xlat_tables.c13
-rw-r--r--lib/xlat_tables/aarch64/xlat_tables.c19
-rw-r--r--lib/xlat_tables/xlat_tables_common.c19
-rw-r--r--lib/xlat_tables/xlat_tables_private.h5
-rw-r--r--lib/xlat_tables_v2/aarch32/enable_mmu.S2
-rw-r--r--lib/xlat_tables_v2/aarch32/xlat_tables_arch.c15
-rw-r--r--lib/xlat_tables_v2/aarch64/enable_mmu.S2
-rw-r--r--lib/xlat_tables_v2/aarch64/xlat_tables_arch.c12
-rw-r--r--lib/xlat_tables_v2/xlat_tables_context.c8
-rw-r--r--lib/xlat_tables_v2/xlat_tables_core.c14
-rw-r--r--lib/xlat_tables_v2/xlat_tables_private.h6
-rw-r--r--lib/xlat_tables_v2/xlat_tables_utils.c14
-rw-r--r--lib/zlib/tf_gunzip.c5
-rw-r--r--plat/allwinner/common/include/platform_def.h7
-rw-r--r--plat/allwinner/common/sunxi_bl31_setup.c20
-rw-r--r--plat/allwinner/common/sunxi_common.c13
-rw-r--r--plat/allwinner/common/sunxi_cpu_ops.c17
-rw-r--r--plat/allwinner/common/sunxi_pm.c17
-rw-r--r--plat/allwinner/common/sunxi_security.c5
-rw-r--r--plat/allwinner/common/sunxi_topology.c5
-rw-r--r--plat/allwinner/sun50i_a64/sunxi_power.c14
-rw-r--r--plat/allwinner/sun50i_h6/sunxi_power.c12
-rw-r--r--plat/arm/board/common/aarch32/board_arm_helpers.S3
-rw-r--r--plat/arm/board/common/aarch64/board_arm_helpers.S3
-rw-r--r--plat/arm/board/common/board_arm_trusted_boot.c16
-rw-r--r--plat/arm/board/common/board_common.mk3
-rw-r--r--plat/arm/board/fvp/aarch64/fvp_helpers.S4
-rw-r--r--plat/arm/board/fvp/aarch64/fvp_ras.c2
-rw-r--r--plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c6
-rw-r--r--plat/arm/board/fvp/fvp_bl1_setup.c7
-rw-r--r--plat/arm/board/fvp/fvp_bl2_setup.c9
-rw-r--r--plat/arm/board/fvp/fvp_bl2u_setup.c3
-rw-r--r--plat/arm/board/fvp/fvp_bl31_setup.c5
-rw-r--r--plat/arm/board/fvp/fvp_common.c20
-rw-r--r--plat/arm/board/fvp/fvp_def.h2
-rw-r--r--plat/arm/board/fvp/fvp_io_storage.c14
-rw-r--r--plat/arm/board/fvp/fvp_pm.c19
-rw-r--r--plat/arm/board/fvp/fvp_stack_protector.c5
-rw-r--r--plat/arm/board/fvp/fvp_topology.c10
-rw-r--r--plat/arm/board/fvp/fvp_trusted_boot.c5
-rw-r--r--plat/arm/board/fvp/include/platform_def.h8
-rw-r--r--plat/arm/board/juno/aarch32/juno_helpers.S2
-rw-r--r--plat/arm/board/juno/aarch64/juno_helpers.S2
-rw-r--r--plat/arm/board/juno/include/platform_def.h11
-rw-r--r--plat/arm/board/juno/juno_bl1_setup.c12
-rw-r--r--plat/arm/board/juno/juno_bl2_setup.c6
-rw-r--r--plat/arm/board/juno/juno_def.h2
-rw-r--r--plat/arm/board/juno/juno_err.c6
-rw-r--r--plat/arm/board/juno/juno_security.c8
-rw-r--r--plat/arm/board/juno/juno_stack_protector.c5
-rw-r--r--plat/arm/board/juno/juno_topology.c3
-rw-r--r--plat/arm/board/juno/juno_trng.c6
-rw-r--r--plat/arm/board/n1sdp/n1sdp_bl31_setup.c3
-rw-r--r--plat/arm/board/n1sdp/n1sdp_plat.c10
-rw-r--r--plat/arm/board/sgi575/include/platform_def.h3
-rw-r--r--plat/arm/board/sgi575/sgi575_plat.c2
-rw-r--r--plat/arm/board/sgi575/sgi575_security.c5
-rw-r--r--plat/arm/board/sgiclarka/include/platform_def.h3
-rw-r--r--plat/arm/board/sgiclarka/sgiclarka_plat.c2
-rw-r--r--plat/arm/board/sgiclarka/sgiclarka_security.c5
-rw-r--r--plat/arm/board/sgiclarkh/include/platform_def.h3
-rw-r--r--plat/arm/board/sgiclarkh/sgiclarkh_plat.c2
-rw-r--r--plat/arm/board/sgiclarkh/sgiclarkh_security.c5
-rw-r--r--plat/arm/common/aarch32/arm_bl2_mem_params_desc.c6
-rw-r--r--plat/arm/common/aarch64/arm_bl2_mem_params_desc.c6
-rw-r--r--plat/arm/common/aarch64/arm_ehf.c3
-rw-r--r--plat/arm/common/aarch64/arm_sdei.c5
-rw-r--r--plat/arm/common/arm_bl1_fwu.c15
-rw-r--r--plat/arm/common/arm_bl1_setup.c19
-rw-r--r--plat/arm/common/arm_bl2_el3_setup.c9
-rw-r--r--plat/arm/common/arm_bl2_setup.c25
-rw-r--r--plat/arm/common/arm_bl2u_setup.c15
-rw-r--r--plat/arm/common/arm_bl31_setup.c20
-rw-r--r--plat/arm/common/arm_cci.c8
-rw-r--r--plat/arm/common/arm_ccn.c6
-rw-r--r--plat/arm/common/arm_common.c20
-rw-r--r--plat/arm/common/arm_console.c12
-rw-r--r--plat/arm/common/arm_dyn_cfg.c20
-rw-r--r--plat/arm/common/arm_dyn_cfg_helpers.c9
-rw-r--r--plat/arm/common/arm_err.c17
-rw-r--r--plat/arm/common/arm_gicv2.c8
-rw-r--r--plat/arm/common/arm_gicv3.c12
-rw-r--r--plat/arm/common/arm_image_load.c8
-rw-r--r--plat/arm/common/arm_io_storage.c24
-rw-r--r--plat/arm/common/arm_nor_psci_mem_protect.c14
-rw-r--r--plat/arm/common/arm_pm.c13
-rw-r--r--plat/arm/common/arm_sip_svc.c13
-rw-r--r--plat/arm/common/arm_topology.c4
-rw-r--r--plat/arm/common/arm_tzc400.c9
-rw-r--r--plat/arm/common/arm_tzc_dmc500.c11
-rw-r--r--plat/arm/common/execution_state_switch.c16
-rw-r--r--plat/arm/common/sp_min/arm_sp_min_setup.c19
-rw-r--r--plat/arm/common/tsp/arm_tsp_setup.c17
-rw-r--r--plat/arm/css/common/css_bl1_setup.c7
-rw-r--r--plat/arm/css/common/css_bl2_setup.c13
-rw-r--r--plat/arm/css/common/css_bl2u_setup.c8
-rw-r--r--plat/arm/css/common/css_pm.c16
-rw-r--r--plat/arm/css/common/css_topology.c6
-rw-r--r--plat/arm/css/drivers/mhu/css_mhu.c12
-rw-r--r--plat/arm/css/drivers/mhu/css_mhu_doorbell.c4
-rw-r--r--plat/arm/css/drivers/mhu/css_mhu_doorbell.h3
-rw-r--r--plat/arm/css/drivers/scmi/scmi.h7
-rw-r--r--plat/arm/css/drivers/scmi/scmi_ap_core_proto.c6
-rw-r--r--plat/arm/css/drivers/scmi/scmi_common.c7
-rw-r--r--plat/arm/css/drivers/scmi/scmi_pwr_dmn_proto.c6
-rw-r--r--plat/arm/css/drivers/scmi/scmi_sys_pwr_proto.c6
-rw-r--r--plat/arm/css/drivers/scp/css_bom_bootloader.c11
-rw-r--r--plat/arm/css/drivers/scp/css_pm_scmi.c11
-rw-r--r--plat/arm/css/drivers/scp/css_pm_scpi.c7
-rw-r--r--plat/arm/css/drivers/scp/css_scp.h6
-rw-r--r--plat/arm/css/drivers/scp/css_sds.c13
-rw-r--r--plat/arm/css/drivers/scpi/css_scpi.c13
-rw-r--r--plat/arm/css/drivers/sds/sds.c7
-rw-r--r--plat/arm/css/sgi/include/sgi_base_platform_def.h7
-rw-r--r--plat/arm/css/sgi/sgi_bl31_setup.c8
-rw-r--r--plat/arm/css/sgi/sgi_image_load.c10
-rw-r--r--plat/arm/css/sgi/sgi_interconnect.c2
-rw-r--r--plat/arm/css/sgi/sgi_plat.c17
-rw-r--r--plat/arm/css/sgi/sgi_ras.c20
-rw-r--r--plat/arm/css/sgm/include/sgm_base_platform_def.h7
-rw-r--r--plat/arm/css/sgm/include/sgm_plat_config.h4
-rw-r--r--plat/arm/css/sgm/sgm_bl1_setup.c5
-rw-r--r--plat/arm/css/sgm/sgm_bl31_setup.c6
-rw-r--r--plat/arm/css/sgm/sgm_mmap_config.c8
-rw-r--r--plat/arm/css/sgm/sgm_plat_config.c9
-rw-r--r--plat/arm/css/sgm/sgm_security.c5
-rw-r--r--plat/arm/soc/common/soc_css_security.c8
-rw-r--r--plat/common/aarch32/crash_console_helpers.S2
-rw-r--r--plat/common/aarch32/plat_common.c4
-rw-r--r--plat/common/aarch32/plat_sp_min_common.c4
-rw-r--r--plat/common/aarch64/crash_console_helpers.S2
-rw-r--r--plat/common/aarch64/plat_common.c11
-rw-r--r--plat/common/aarch64/platform_helpers.S2
-rw-r--r--plat/common/plat_bl1_common.c12
-rw-r--r--plat/common/plat_bl_common.c13
-rw-r--r--plat/common/plat_gicv2.c10
-rw-r--r--plat/common/plat_gicv3.c16
-rw-r--r--plat/common/plat_log_common.c4
-rw-r--r--plat/common/plat_psci_common.c9
-rw-r--r--plat/common/plat_spm_rd.c13
-rw-r--r--plat/common/plat_spm_sp.c6
-rw-r--r--plat/common/tbbr/plat_tbbr.c9
-rw-r--r--plat/hisilicon/hikey/aarch64/hikey_common.c14
-rw-r--r--plat/hisilicon/hikey/hikey_bl1_setup.c24
-rw-r--r--plat/hisilicon/hikey/hikey_bl2_mem_params_desc.c6
-rw-r--r--plat/hisilicon/hikey/hikey_bl2_setup.c34
-rw-r--r--plat/hisilicon/hikey/hikey_bl31_setup.c21
-rw-r--r--plat/hisilicon/hikey/hikey_bl_common.c10
-rw-r--r--plat/hisilicon/hikey/hikey_ddr.c11
-rw-r--r--plat/hisilicon/hikey/hikey_image_load.c6
-rw-r--r--plat/hisilicon/hikey/hikey_io_storage.c27
-rw-r--r--plat/hisilicon/hikey/hikey_pm.c16
-rw-r--r--plat/hisilicon/hikey/hikey_private.h2
-rw-r--r--plat/hisilicon/hikey/hikey_security.c9
-rw-r--r--plat/hisilicon/hikey/hikey_tbbr.c2
-rw-r--r--plat/hisilicon/hikey/hikey_topology.c6
-rw-r--r--plat/hisilicon/hikey/hisi_dvfs.c19
-rw-r--r--plat/hisilicon/hikey/hisi_ipc.c15
-rw-r--r--plat/hisilicon/hikey/hisi_mcu.c19
-rw-r--r--plat/hisilicon/hikey/hisi_pwrc.c15
-rw-r--r--plat/hisilicon/hikey/hisi_sip_svc.c11
-rw-r--r--plat/hisilicon/hikey/include/hi6553.h3
-rw-r--r--plat/hisilicon/hikey/include/plat_macros.S4
-rw-r--r--plat/hisilicon/hikey/include/platform_def.h7
-rw-r--r--plat/hisilicon/hikey/platform.mk1
-rw-r--r--plat/hisilicon/hikey960/aarch64/hikey960_common.c14
-rw-r--r--plat/hisilicon/hikey960/drivers/ipc/hisi_ipc.c14
-rw-r--r--plat/hisilicon/hikey960/drivers/pwrc/hisi_pwrc.c11
-rw-r--r--plat/hisilicon/hikey960/hikey960_bl1_setup.c34
-rw-r--r--plat/hisilicon/hikey960/hikey960_bl2_mem_params_desc.c6
-rw-r--r--plat/hisilicon/hikey960/hikey960_bl2_setup.c30
-rw-r--r--plat/hisilicon/hikey960/hikey960_bl31_setup.c30
-rw-r--r--plat/hisilicon/hikey960/hikey960_bl_common.c10
-rw-r--r--plat/hisilicon/hikey960/hikey960_boardid.c9
-rw-r--r--plat/hisilicon/hikey960/hikey960_def.h4
-rw-r--r--plat/hisilicon/hikey960/hikey960_image_load.c6
-rw-r--r--plat/hisilicon/hikey960/hikey960_io_storage.c26
-rw-r--r--plat/hisilicon/hikey960/hikey960_mcu_load.c14
-rw-r--r--plat/hisilicon/hikey960/hikey960_pm.c20
-rw-r--r--plat/hisilicon/hikey960/hikey960_private.h2
-rw-r--r--plat/hisilicon/hikey960/hikey960_tbbr.c2
-rw-r--r--plat/hisilicon/hikey960/hikey960_topology.c6
-rw-r--r--plat/hisilicon/hikey960/include/plat_macros.S4
-rw-r--r--plat/hisilicon/hikey960/include/platform_def.h3
-rw-r--r--plat/hisilicon/poplar/aarch64/platform_common.c16
-rw-r--r--plat/hisilicon/poplar/bl1_plat_setup.c29
-rw-r--r--plat/hisilicon/poplar/bl2_plat_mem_params_desc.c6
-rw-r--r--plat/hisilicon/poplar/bl2_plat_setup.c26
-rw-r--r--plat/hisilicon/poplar/bl31_plat_setup.c25
-rw-r--r--plat/hisilicon/poplar/include/hi3798cv200.h2
-rw-r--r--plat/hisilicon/poplar/include/plat_private.h3
-rw-r--r--plat/hisilicon/poplar/include/platform_def.h11
-rw-r--r--plat/hisilicon/poplar/plat_pm.c19
-rw-r--r--plat/hisilicon/poplar/plat_storage.c32
-rw-r--r--plat/hisilicon/poplar/plat_topology.c6
-rw-r--r--plat/hisilicon/poplar/platform.mk4
-rw-r--r--plat/hisilicon/poplar/poplar_gicv2.c5
-rw-r--r--plat/hisilicon/poplar/poplar_image_load.c6
-rw-r--r--plat/imx/common/imx8_psci.c6
-rw-r--r--plat/imx/common/imx8_topology.c2
-rw-r--r--plat/imx/common/imx_aips.c5
-rw-r--r--plat/imx/common/imx_caam.c5
-rw-r--r--plat/imx/common/imx_clock.c7
-rw-r--r--plat/imx/common/imx_csu.c4
-rw-r--r--plat/imx/common/imx_io_mux.c3
-rw-r--r--plat/imx/common/imx_snvs.c3
-rw-r--r--plat/imx/common/imx_wdog.c3
-rw-r--r--plat/imx/common/include/imx8_lpuart.h2
-rw-r--r--plat/imx/common/include/imx_snvs.h1
-rw-r--r--plat/imx/common/include/imx_uart.h2
-rw-r--r--plat/imx/common/include/imx_wdog.h3
-rw-r--r--plat/imx/common/include/plat_imx8.h4
-rw-r--r--plat/imx/common/include/sci/sci_rpc.h3
-rw-r--r--plat/imx/common/plat_imx8_gic.c14
-rw-r--r--plat/imx/common/sci/imx8_mu.c3
-rw-r--r--plat/imx/common/sci/ipc.c6
-rw-r--r--plat/imx/common/sci/svc/pad/pad_rpc_clnt.c3
-rw-r--r--plat/imx/common/sci/svc/pm/pm_rpc_clnt.c4
-rw-r--r--plat/imx/common/sci/svc/rm/rm_rpc_clnt.c4
-rw-r--r--plat/imx/imx7/warp7/include/platform_def.h4
-rw-r--r--plat/imx/imx7/warp7/warp7_bl2_el3_setup.c26
-rw-r--r--plat/imx/imx7/warp7/warp7_bl2_mem_params_desc.c7
-rw-r--r--plat/imx/imx7/warp7/warp7_image_load.c6
-rw-r--r--plat/imx/imx7/warp7/warp7_io_storage.c17
-rw-r--r--plat/imx/imx8m/imx8mq/gpc.c14
-rw-r--r--plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c25
-rw-r--r--plat/imx/imx8m/imx8mq/imx8mq_psci.c10
-rw-r--r--plat/imx/imx8qm/imx8qm_bl31_setup.c25
-rw-r--r--plat/imx/imx8qm/imx8qm_psci.c14
-rw-r--r--plat/imx/imx8qm/include/platform_def.h2
-rw-r--r--plat/imx/imx8qx/imx8qx_bl31_setup.c25
-rw-r--r--plat/imx/imx8qx/imx8qx_psci.c12
-rw-r--r--plat/imx/imx8qx/include/platform_def.h2
-rw-r--r--plat/layerscape/board/ls1043/include/ls_def.h10
-rw-r--r--plat/layerscape/board/ls1043/include/platform_def.h7
-rw-r--r--plat/layerscape/board/ls1043/ls1043_bl1_setup.c7
-rw-r--r--plat/layerscape/board/ls1043/ls1043_bl2_setup.c5
-rw-r--r--plat/layerscape/board/ls1043/ls1043_bl31_setup.c5
-rw-r--r--plat/layerscape/board/ls1043/ls1043_err.c5
-rw-r--r--plat/layerscape/board/ls1043/ls1043_psci.c18
-rw-r--r--plat/layerscape/board/ls1043/ls1043_stack_protector.c3
-rw-r--r--plat/layerscape/board/ls1043/ls1043_topology.c4
-rw-r--r--plat/layerscape/board/ls1043/ls_gic.c9
-rw-r--r--plat/layerscape/board/ls1043/platform.mk4
-rw-r--r--plat/layerscape/common/aarch64/ls_bl2_mem_params_desc.c10
-rw-r--r--plat/layerscape/common/aarch64/ls_helpers.S2
-rw-r--r--plat/layerscape/common/include/ls_16550.h2
-rw-r--r--plat/layerscape/common/include/plat_ls.h3
-rw-r--r--plat/layerscape/common/ls_bl1_setup.c3
-rw-r--r--plat/layerscape/common/ls_bl2_setup.c6
-rw-r--r--plat/layerscape/common/ls_bl31_setup.c11
-rw-r--r--plat/layerscape/common/ls_common.c13
-rw-r--r--plat/layerscape/common/ls_image_load.c3
-rw-r--r--plat/layerscape/common/ls_io_storage.c17
-rw-r--r--plat/layerscape/common/ls_timer.c4
-rw-r--r--plat/layerscape/common/ls_tzc380.c9
-rw-r--r--plat/layerscape/common/ns_access.c9
-rw-r--r--plat/layerscape/common/tsp/ls_tsp_setup.c6
-rw-r--r--plat/marvell/a3700/a3700/board/pm_src.c1
-rw-r--r--plat/marvell/a3700/a3700/plat_bl31_setup.c3
-rw-r--r--plat/marvell/a3700/common/a3700_common.mk4
-rw-r--r--plat/marvell/a3700/common/a3700_sip_svc.c8
-rw-r--r--plat/marvell/a3700/common/dram_win.c6
-rw-r--r--plat/marvell/a3700/common/include/dram_win.h3
-rw-r--r--plat/marvell/a3700/common/include/platform_def.h5
-rw-r--r--plat/marvell/a3700/common/io_addr_dec.c6
-rw-r--r--plat/marvell/a3700/common/marvell_plat_config.c3
-rw-r--r--plat/marvell/a3700/common/plat_pm.c15
-rw-r--r--plat/marvell/a8k/a70x0/board/dram_port.c3
-rw-r--r--plat/marvell/a8k/a70x0_amc/board/dram_port.c3
-rw-r--r--plat/marvell/a8k/a80x0/board/dram_port.c7
-rw-r--r--plat/marvell/a8k/a80x0_mcbin/board/dram_port.c7
-rw-r--r--plat/marvell/a8k/a80x0_mcbin/board/marvell_plat_config.c5
-rw-r--r--plat/marvell/a8k/common/a8k_common.mk2
-rw-r--r--plat/marvell/a8k/common/aarch64/plat_arch_config.c9
-rw-r--r--plat/marvell/a8k/common/ble/ble.mk2
-rw-r--r--plat/marvell/a8k/common/ble/ble_main.c11
-rw-r--r--plat/marvell/a8k/common/include/platform_def.h10
-rw-r--r--plat/marvell/a8k/common/mss/mss_bl2_setup.c14
-rw-r--r--plat/marvell/a8k/common/mss/mss_pm_ipc.c7
-rw-r--r--plat/marvell/a8k/common/plat_bl1_setup.c3
-rw-r--r--plat/marvell/a8k/common/plat_bl31_setup.c12
-rw-r--r--plat/marvell/a8k/common/plat_ble_setup.c15
-rw-r--r--plat/marvell/a8k/common/plat_pm.c20
-rw-r--r--plat/marvell/a8k/common/plat_pm_trace.c5
-rw-r--r--plat/marvell/a8k/common/plat_thermal.c9
-rw-r--r--plat/marvell/common/aarch64/marvell_bl2_mem_params_desc.c8
-rw-r--r--plat/marvell/common/aarch64/marvell_common.c14
-rw-r--r--plat/marvell/common/aarch64/marvell_helpers.S8
-rw-r--r--plat/marvell/common/marvell_bl1_setup.c16
-rw-r--r--plat/marvell/common/marvell_bl2_setup.c19
-rw-r--r--plat/marvell/common/marvell_bl31_setup.c17
-rw-r--r--plat/marvell/common/marvell_cci.c3
-rw-r--r--plat/marvell/common/marvell_console.c13
-rw-r--r--plat/marvell/common/marvell_ddr_info.c6
-rw-r--r--plat/marvell/common/marvell_gicv2.c16
-rw-r--r--plat/marvell/common/marvell_gicv3.c12
-rw-r--r--plat/marvell/common/marvell_image_load.c7
-rw-r--r--plat/marvell/common/marvell_io_storage.c18
-rw-r--r--plat/marvell/common/marvell_pm.c6
-rw-r--r--plat/marvell/common/mrvl_sip_svc.c12
-rw-r--r--plat/marvell/common/mss/mss_ipc_drv.c8
-rw-r--r--plat/marvell/common/mss/mss_ipc_drv.h2
-rw-r--r--plat/marvell/common/mss/mss_scp_bootloader.c10
-rw-r--r--plat/marvell/common/plat_delay_timer.c3
-rw-r--r--plat/mediatek/common/custom/oem_svc.c15
-rw-r--r--plat/mediatek/common/mtk_plat_common.c16
-rw-r--r--plat/mediatek/common/mtk_plat_common.h5
-rw-r--r--plat/mediatek/common/mtk_sip_svc.c13
-rw-r--r--plat/mediatek/mt6795/bl31.ld.S2
-rw-r--r--plat/mediatek/mt6795/bl31_plat_setup.c29
-rw-r--r--plat/mediatek/mt6795/drivers/timer/mt_cpuxgpt.c10
-rw-r--r--plat/mediatek/mt6795/include/mcucfg.h3
-rw-r--r--plat/mediatek/mt6795/include/plat_macros.S2
-rw-r--r--plat/mediatek/mt6795/include/plat_private.h3
-rw-r--r--plat/mediatek/mt6795/include/platform_def.h2
-rw-r--r--plat/mediatek/mt6795/plat_delay_timer.c5
-rw-r--r--plat/mediatek/mt6795/plat_mt_gic.c7
-rw-r--r--plat/mediatek/mt6795/plat_pm.c19
-rw-r--r--plat/mediatek/mt6795/plat_topology.c5
-rw-r--r--plat/mediatek/mt6795/power_tracer.c3
-rw-r--r--plat/mediatek/mt6795/scu.c3
-rw-r--r--plat/mediatek/mt8173/aarch64/platform_common.c15
-rw-r--r--plat/mediatek/mt8173/bl31_plat_setup.c17
-rw-r--r--plat/mediatek/mt8173/drivers/crypt/crypt.c11
-rw-r--r--plat/mediatek/mt8173/drivers/mtcmos/mtcmos.c7
-rw-r--r--plat/mediatek/mt8173/drivers/pmic/pmic_wrap_init.c8
-rw-r--r--plat/mediatek/mt8173/drivers/rtc/rtc.c7
-rw-r--r--plat/mediatek/mt8173/drivers/spm/spm.c8
-rw-r--r--plat/mediatek/mt8173/drivers/spm/spm_hotplug.c6
-rw-r--r--plat/mediatek/mt8173/drivers/spm/spm_mcdi.c11
-rw-r--r--plat/mediatek/mt8173/drivers/spm/spm_suspend.c10
-rw-r--r--plat/mediatek/mt8173/drivers/timer/mt_cpuxgpt.c4
-rw-r--r--plat/mediatek/mt8173/include/mcucfg.h3
-rw-r--r--plat/mediatek/mt8173/include/plat_macros.S6
-rw-r--r--plat/mediatek/mt8173/include/platform_def.h7
-rw-r--r--plat/mediatek/mt8173/plat_mt_gic.c5
-rw-r--r--plat/mediatek/mt8173/plat_pm.c18
-rw-r--r--plat/mediatek/mt8173/plat_sip_calls.c8
-rw-r--r--plat/mediatek/mt8173/plat_topology.c5
-rw-r--r--plat/mediatek/mt8173/power_tracer.c3
-rw-r--r--plat/mediatek/mt8173/scu.c3
-rw-r--r--plat/meson/gxbb/gxbb_bl31_setup.c12
-rw-r--r--plat/meson/gxbb/gxbb_common.c18
-rw-r--r--plat/meson/gxbb/gxbb_def.h2
-rw-r--r--plat/meson/gxbb/gxbb_mhu.c5
-rw-r--r--plat/meson/gxbb/gxbb_pm.c16
-rw-r--r--plat/meson/gxbb/gxbb_scpi.c8
-rw-r--r--plat/meson/gxbb/gxbb_sip_svc.c10
-rw-r--r--plat/meson/gxbb/gxbb_topology.c6
-rw-r--r--plat/meson/gxbb/include/plat_macros.S2
-rw-r--r--plat/meson/gxbb/include/platform_def.h2
-rw-r--r--plat/meson/gxbb/platform.mk3
-rw-r--r--plat/nvidia/tegra/common/drivers/flowctrl/flowctrl.c10
-rw-r--r--plat/nvidia/tegra/common/drivers/memctrl/memctrl_v1.c14
-rw-r--r--plat/nvidia/tegra/common/drivers/memctrl/memctrl_v2.c16
-rw-r--r--plat/nvidia/tegra/common/drivers/pmc/pmc.c8
-rw-r--r--plat/nvidia/tegra/common/drivers/smmu/smmu.c9
-rw-r--r--plat/nvidia/tegra/common/tegra_bl31_setup.c29
-rw-r--r--plat/nvidia/tegra/common/tegra_delay_timer.c5
-rw-r--r--plat/nvidia/tegra/common/tegra_fiq_glue.c16
-rw-r--r--plat/nvidia/tegra/common/tegra_gicv2.c9
-rw-r--r--plat/nvidia/tegra/common/tegra_platform.c3
-rw-r--r--plat/nvidia/tegra/common/tegra_pm.c21
-rw-r--r--plat/nvidia/tegra/common/tegra_sip_calls.c14
-rw-r--r--plat/nvidia/tegra/common/tegra_topology.c5
-rw-r--r--plat/nvidia/tegra/include/drivers/flowctrl.h3
-rw-r--r--plat/nvidia/tegra/include/drivers/mce.h3
-rw-r--r--plat/nvidia/tegra/include/drivers/memctrl_v1.h3
-rw-r--r--plat/nvidia/tegra/include/drivers/memctrl_v2.h2
-rw-r--r--plat/nvidia/tegra/include/drivers/pmc.h5
-rw-r--r--plat/nvidia/tegra/include/drivers/smmu.h3
-rw-r--r--plat/nvidia/tegra/include/drivers/tegra_gic.h2
-rw-r--r--plat/nvidia/tegra/include/platform_def.h5
-rw-r--r--plat/nvidia/tegra/include/t132/tegra_def.h2
-rw-r--r--plat/nvidia/tegra/include/t186/tegra_def.h2
-rw-r--r--plat/nvidia/tegra/include/t210/tegra_def.h2
-rw-r--r--plat/nvidia/tegra/include/tegra_private.h8
-rw-r--r--plat/nvidia/tegra/soc/t132/plat_psci_handlers.c15
-rw-r--r--plat/nvidia/tegra/soc/t132/plat_secondary.c12
-rw-r--r--plat/nvidia/tegra/soc/t132/plat_setup.c5
-rw-r--r--plat/nvidia/tegra/soc/t132/plat_sip_calls.c12
-rw-r--r--plat/nvidia/tegra/soc/t186/drivers/include/mce_private.h3
-rw-r--r--plat/nvidia/tegra/soc/t186/drivers/mce/ari.c14
-rw-r--r--plat/nvidia/tegra/soc/t186/drivers/mce/mce.c16
-rw-r--r--plat/nvidia/tegra/soc/t186/drivers/mce/nvg.c8
-rw-r--r--plat/nvidia/tegra/soc/t186/plat_memctrl.c3
-rw-r--r--plat/nvidia/tegra/soc/t186/plat_psci_handlers.c16
-rw-r--r--plat/nvidia/tegra/soc/t186/plat_secondary.c8
-rw-r--r--plat/nvidia/tegra/soc/t186/plat_setup.c26
-rw-r--r--plat/nvidia/tegra/soc/t186/plat_sip_calls.c14
-rw-r--r--plat/nvidia/tegra/soc/t186/plat_smmu.c3
-rw-r--r--plat/nvidia/tegra/soc/t186/plat_trampoline.S2
-rw-r--r--plat/nvidia/tegra/soc/t210/plat_psci_handlers.c17
-rw-r--r--plat/nvidia/tegra/soc/t210/plat_secondary.c5
-rw-r--r--plat/nvidia/tegra/soc/t210/plat_setup.c7
-rw-r--r--plat/qemu/dt.c12
-rw-r--r--plat/qemu/include/platform_def.h6
-rw-r--r--plat/qemu/qemu_bl1_setup.c9
-rw-r--r--plat/qemu/qemu_bl2_mem_params_desc.c5
-rw-r--r--plat/qemu/qemu_bl2_setup.c21
-rw-r--r--plat/qemu/qemu_bl31_setup.c11
-rw-r--r--plat/qemu/qemu_common.c7
-rw-r--r--plat/qemu/qemu_console.c6
-rw-r--r--plat/qemu/qemu_image_load.c2
-rw-r--r--plat/qemu/qemu_io_storage.c22
-rw-r--r--plat/qemu/qemu_pm.c12
-rw-r--r--plat/qemu/qemu_stack_protector.c5
-rw-r--r--plat/qemu/qemu_trusted_boot.c2
-rw-r--r--plat/qemu/sp_min/sp_min_setup.c23
-rw-r--r--plat/qemu/topology.c7
-rw-r--r--plat/renesas/rcar/aarch64/plat_helpers.S5
-rw-r--r--plat/renesas/rcar/aarch64/platform_common.c20
-rw-r--r--plat/renesas/rcar/bl2_cpg_init.c5
-rw-r--r--plat/renesas/rcar/bl2_interrupt_error.c11
-rw-r--r--plat/renesas/rcar/bl2_plat_mem_params_desc.c9
-rw-r--r--plat/renesas/rcar/bl2_plat_setup.c23
-rw-r--r--plat/renesas/rcar/bl2_secure_setting.c5
-rw-r--r--plat/renesas/rcar/bl31_plat_setup.c18
-rw-r--r--plat/renesas/rcar/include/plat.ld.S2
-rw-r--r--plat/renesas/rcar/include/plat_macros.S7
-rw-r--r--plat/renesas/rcar/include/platform_def.h4
-rw-r--r--plat/renesas/rcar/include/rcar_def.h4
-rw-r--r--plat/renesas/rcar/include/rcar_private.h7
-rw-r--r--plat/renesas/rcar/plat_image_load.c6
-rw-r--r--plat/renesas/rcar/plat_pm.c20
-rw-r--r--plat/renesas/rcar/plat_storage.c13
-rw-r--r--plat/renesas/rcar/plat_topology.c5
-rw-r--r--plat/rockchip/common/aarch64/plat_helpers.S5
-rw-r--r--plat/rockchip/common/aarch64/platform_common.c17
-rw-r--r--plat/rockchip/common/bl31_plat_setup.c20
-rw-r--r--plat/rockchip/common/drivers/parameter/ddr_parameter.c16
-rw-r--r--plat/rockchip/common/drivers/parameter/ddr_parameter.h15
-rw-r--r--plat/rockchip/common/include/plat_macros.S8
-rw-r--r--plat/rockchip/common/include/plat_private.h8
-rw-r--r--plat/rockchip/common/params_setup.c18
-rw-r--r--plat/rockchip/common/plat_pm.c15
-rw-r--r--plat/rockchip/common/plat_topology.c6
-rw-r--r--plat/rockchip/common/rockchip_gicv2.c9
-rw-r--r--plat/rockchip/common/rockchip_gicv3.c11
-rw-r--r--plat/rockchip/common/rockchip_sip_svc.c10
-rw-r--r--plat/rockchip/rk3328/drivers/pmu/pmu.c21
-rw-r--r--plat/rockchip/rk3328/drivers/soc/soc.c12
-rw-r--r--plat/rockchip/rk3328/include/platform_def.h3
-rw-r--r--plat/rockchip/rk3368/drivers/ddr/ddr_rk3368.c13
-rw-r--r--plat/rockchip/rk3368/drivers/pmu/pmu.c17
-rw-r--r--plat/rockchip/rk3368/drivers/soc/soc.c8
-rw-r--r--plat/rockchip/rk3368/include/platform_def.h5
-rw-r--r--plat/rockchip/rk3368/plat_sip_calls.c7
-rw-r--r--plat/rockchip/rk3399/drivers/dp/cdn_dp.c6
-rw-r--r--plat/rockchip/rk3399/drivers/dram/dfs.c7
-rw-r--r--plat/rockchip/rk3399/drivers/dram/dram.h3
-rw-r--r--plat/rockchip/rk3399/drivers/dram/dram_spec_timing.c7
-rw-r--r--plat/rockchip/rk3399/drivers/dram/suspend.c6
-rw-r--r--plat/rockchip/rk3399/drivers/gpio/rk3399_gpio.c16
-rw-r--r--plat/rockchip/rk3399/drivers/pmu/m0_ctl.c10
-rw-r--r--plat/rockchip/rk3399/drivers/pmu/pmu.c27
-rw-r--r--plat/rockchip/rk3399/drivers/secure/secure.c8
-rw-r--r--plat/rockchip/rk3399/drivers/soc/soc.c13
-rw-r--r--plat/rockchip/rk3399/drivers/soc/soc.h2
-rw-r--r--plat/rockchip/rk3399/include/plat.ld.S2
-rw-r--r--plat/rockchip/rk3399/include/platform_def.h5
-rw-r--r--plat/rockchip/rk3399/plat_sip_calls.c7
-rw-r--r--plat/rpi3/aarch64/rpi3_bl2_mem_params_desc.c7
-rw-r--r--plat/rpi3/include/platform_def.h6
-rw-r--r--plat/rpi3/rpi3_bl1_setup.c11
-rw-r--r--plat/rpi3/rpi3_bl2_setup.c16
-rw-r--r--plat/rpi3/rpi3_bl31_setup.c11
-rw-r--r--plat/rpi3/rpi3_common.c16
-rw-r--r--plat/rpi3/rpi3_hw.h2
-rw-r--r--plat/rpi3/rpi3_image_load.c7
-rw-r--r--plat/rpi3/rpi3_io_storage.c16
-rw-r--r--plat/rpi3/rpi3_mbox.c8
-rw-r--r--plat/rpi3/rpi3_pm.c14
-rw-r--r--plat/rpi3/rpi3_rng.c3
-rw-r--r--plat/rpi3/rpi3_stack_protector.c3
-rw-r--r--plat/rpi3/rpi3_topology.c6
-rw-r--r--plat/rpi3/rpi3_trusted_boot.c2
-rw-r--r--plat/socionext/synquacer/drivers/mhu/sq_mhu.c9
-rw-r--r--plat/socionext/synquacer/drivers/scpi/sq_scpi.c9
-rw-r--r--plat/socionext/synquacer/include/platform_def.h4
-rw-r--r--plat/socionext/synquacer/include/sq_common.h3
-rw-r--r--plat/socionext/synquacer/sq_bl31_setup.c15
-rw-r--r--plat/socionext/synquacer/sq_ccn.c5
-rw-r--r--plat/socionext/synquacer/sq_gicv3.c8
-rw-r--r--plat/socionext/synquacer/sq_psci.c15
-rw-r--r--plat/socionext/synquacer/sq_topology.c4
-rw-r--r--plat/socionext/synquacer/sq_xlat_setup.c5
-rw-r--r--plat/socionext/uniphier/include/platform_def.h6
-rw-r--r--plat/socionext/uniphier/tsp/uniphier_tsp_setup.c3
-rw-r--r--plat/socionext/uniphier/uniphier_bl2_setup.c16
-rw-r--r--plat/socionext/uniphier/uniphier_bl31_setup.c16
-rw-r--r--plat/socionext/uniphier/uniphier_boot_device.c5
-rw-r--r--plat/socionext/uniphier/uniphier_cci.c7
-rw-r--r--plat/socionext/uniphier/uniphier_emmc.c12
-rw-r--r--plat/socionext/uniphier/uniphier_gicv3.c8
-rw-r--r--plat/socionext/uniphier/uniphier_image_desc.c6
-rw-r--r--plat/socionext/uniphier/uniphier_io_storage.c18
-rw-r--r--plat/socionext/uniphier/uniphier_nand.c14
-rw-r--r--plat/socionext/uniphier/uniphier_psci.c6
-rw-r--r--plat/socionext/uniphier/uniphier_scp.c4
-rw-r--r--plat/socionext/uniphier/uniphier_soc_info.c2
-rw-r--r--plat/socionext/uniphier/uniphier_syscnt.c2
-rw-r--r--plat/socionext/uniphier/uniphier_tbbr.c2
-rw-r--r--plat/socionext/uniphier/uniphier_topology.c2
-rw-r--r--plat/socionext/uniphier/uniphier_usb.c12
-rw-r--r--plat/socionext/uniphier/uniphier_xlat_setup.c5
-rw-r--r--plat/st/stm32mp1/bl2_io_storage.c37
-rw-r--r--plat/st/stm32mp1/bl2_plat_setup.c39
-rw-r--r--plat/st/stm32mp1/include/platform_def.h7
-rw-r--r--plat/st/stm32mp1/plat_bl2_mem_params_desc.c7
-rw-r--r--plat/st/stm32mp1/plat_image_load.c4
-rw-r--r--plat/st/stm32mp1/platform.mk3
-rw-r--r--plat/st/stm32mp1/sp_min/sp_min_setup.c29
-rw-r--r--plat/st/stm32mp1/stm32mp1.ld.S2
-rw-r--r--plat/st/stm32mp1/stm32mp1_common.c17
-rw-r--r--plat/st/stm32mp1/stm32mp1_context.c9
-rw-r--r--plat/st/stm32mp1/stm32mp1_def.h6
-rw-r--r--plat/st/stm32mp1/stm32mp1_dt.c16
-rw-r--r--plat/st/stm32mp1/stm32mp1_gic.c9
-rw-r--r--plat/st/stm32mp1/stm32mp1_helper.S9
-rw-r--r--plat/st/stm32mp1/stm32mp1_pm.c25
-rw-r--r--plat/st/stm32mp1/stm32mp1_security.c17
-rw-r--r--plat/st/stm32mp1/stm32mp1_stack_protector.c5
-rw-r--r--plat/st/stm32mp1/stm32mp1_topology.c5
-rw-r--r--plat/ti/k3/board/generic/include/board_def.h2
-rw-r--r--plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c14
-rw-r--r--plat/ti/k3/common/drivers/ti_sci/ti_sci.c5
-rw-r--r--plat/ti/k3/common/k3_bl31_setup.c15
-rw-r--r--plat/ti/k3/common/k3_console.c8
-rw-r--r--plat/ti/k3/common/k3_gicv3.c14
-rw-r--r--plat/ti/k3/common/k3_psci.c18
-rw-r--r--plat/ti/k3/common/k3_topology.c3
-rw-r--r--plat/ti/k3/include/platform_def.h3
-rw-r--r--plat/xilinx/versal/aarch64/versal_common.c11
-rw-r--r--plat/xilinx/versal/aarch64/versal_helpers.S2
-rw-r--r--plat/xilinx/versal/bl31_versal_setup.c16
-rw-r--r--plat/xilinx/versal/include/plat_macros.S7
-rw-r--r--plat/xilinx/versal/include/platform_def.h1
-rw-r--r--plat/xilinx/versal/plat_psci.c9
-rw-r--r--plat/xilinx/versal/plat_versal.c4
-rw-r--r--plat/xilinx/versal/sip_svc_setup.c6
-rw-r--r--plat/xilinx/versal/versal_def.h2
-rw-r--r--plat/xilinx/versal/versal_gicv3.c10
-rw-r--r--plat/xilinx/versal/versal_private.h2
-rw-r--r--plat/xilinx/zynqmp/aarch64/zynqmp_common.c12
-rw-r--r--plat/xilinx/zynqmp/aarch64/zynqmp_helpers.S2
-rw-r--r--plat/xilinx/zynqmp/bl31_zynqmp_setup.c12
-rw-r--r--plat/xilinx/zynqmp/include/platform_def.h7
-rw-r--r--plat/xilinx/zynqmp/ipi_mailbox_service/ipi_mailbox_svc.c10
-rw-r--r--plat/xilinx/zynqmp/plat_psci.c14
-rw-r--r--plat/xilinx/zynqmp/plat_startup.c8
-rw-r--r--plat/xilinx/zynqmp/plat_zynqmp.c3
-rw-r--r--plat/xilinx/zynqmp/pm_service/pm_api_clock.c8
-rw-r--r--plat/xilinx/zynqmp/pm_service/pm_api_clock.h3
-rw-r--r--plat/xilinx/zynqmp/pm_service/pm_api_ioctl.c7
-rw-r--r--plat/xilinx/zynqmp/pm_service/pm_api_pinctrl.c6
-rw-r--r--plat/xilinx/zynqmp/pm_service/pm_api_sys.c3
-rw-r--r--plat/xilinx/zynqmp/pm_service/pm_api_sys.h1
-rw-r--r--plat/xilinx/zynqmp/pm_service/pm_client.c14
-rw-r--r--plat/xilinx/zynqmp/pm_service/pm_common.h4
-rw-r--r--plat/xilinx/zynqmp/pm_service/pm_ipi.c7
-rw-r--r--plat/xilinx/zynqmp/pm_service/pm_svc_main.c18
-rw-r--r--plat/xilinx/zynqmp/sip_svc_setup.c5
-rw-r--r--plat/xilinx/zynqmp/tsp/tsp_plat_setup.c8
-rw-r--r--plat/xilinx/zynqmp/zynqmp_def.h2
-rw-r--r--plat/xilinx/zynqmp/zynqmp_ipi.c10
-rw-r--r--plat/xilinx/zynqmp/zynqmp_private.h5
-rw-r--r--services/arm_arch_svc/arm_arch_svc_setup.c14
-rw-r--r--services/spd/opteed/opteed_common.c10
-rw-r--r--services/spd/opteed/opteed_main.c19
-rw-r--r--services/spd/opteed/opteed_pm.c12
-rw-r--r--services/spd/opteed/opteed_private.h10
-rw-r--r--services/spd/opteed/teesmc_opteed_macros.h2
-rw-r--r--services/spd/tlkd/tlkd_common.c8
-rw-r--r--services/spd/tlkd/tlkd_main.c16
-rw-r--r--services/spd/tlkd/tlkd_pm.c11
-rw-r--r--services/spd/tlkd/tlkd_private.h10
-rw-r--r--services/spd/trusty/generic-arm64-smcall.c5
-rw-r--r--services/spd/trusty/trusty.c19
-rw-r--r--services/spd/tspd/tspd_common.c14
-rw-r--r--services/spd/tspd/tspd_main.c22
-rw-r--r--services/spd/tspd/tspd_pm.c14
-rw-r--r--services/spd/tspd/tspd_private.h10
-rw-r--r--services/std_svc/sdei/sdei_event.c4
-rw-r--r--services/std_svc/sdei/sdei_intr_mgmt.c18
-rw-r--r--services/std_svc/sdei/sdei_main.c26
-rw-r--r--services/std_svc/sdei/sdei_private.h21
-rw-r--r--services/std_svc/sdei/sdei_state.c4
-rw-r--r--services/std_svc/spm/aarch64/spm_shim_exceptions.S2
-rw-r--r--services/std_svc/spm/spci.c17
-rw-r--r--services/std_svc/spm/spm_buffers.c4
-rw-r--r--services/std_svc/spm/spm_main.c29
-rw-r--r--services/std_svc/spm/spm_private.h7
-rw-r--r--services/std_svc/spm/spm_setup.c20
-rw-r--r--services/std_svc/spm/spm_shim_private.h3
-rw-r--r--services/std_svc/spm/spm_xlat.c16
-rw-r--r--services/std_svc/spm/sprt.c15
-rw-r--r--services/std_svc/spm_deprecated/aarch64/spm_shim_exceptions.S2
-rw-r--r--services/std_svc/spm_deprecated/spm_main.c27
-rw-r--r--services/std_svc/spm_deprecated/spm_private.h5
-rw-r--r--services/std_svc/spm_deprecated/spm_setup.c17
-rw-r--r--services/std_svc/spm_deprecated/spm_shim_private.h3
-rw-r--r--services/std_svc/spm_deprecated/spm_xlat.c8
-rw-r--r--services/std_svc/std_svc_setup.c23
995 files changed, 4743 insertions, 3501 deletions
diff --git a/Makefile b/Makefile
index 6b5b0803e..742a3ffc8 100644
--- a/Makefile
+++ b/Makefile
@@ -271,11 +271,16 @@ endif
INCLUDES += -Iinclude \
-Iinclude/arch/${ARCH} \
- -Iinclude/bl1 \
+ -Iinclude/lib/cpus/${ARCH} \
+ -Iinclude/lib/el3_runtime/${ARCH} \
+ ${PLAT_INCLUDES} \
+ ${SPD_INCLUDES}
+
+ifeq (${ERROR_DEPRECATED},0)
+INCLUDES += -Iinclude/bl1 \
-Iinclude/bl2 \
-Iinclude/bl2u \
-Iinclude/bl31 \
- -Iinclude/common \
-Iinclude/drivers \
-Iinclude/drivers/arm \
-Iinclude/drivers/auth \
@@ -283,18 +288,15 @@ INCLUDES += -Iinclude \
-Iinclude/drivers/ti/uart \
-Iinclude/lib \
-Iinclude/lib/cpus \
- -Iinclude/lib/cpus/${ARCH} \
-Iinclude/lib/el3_runtime \
- -Iinclude/lib/el3_runtime/${ARCH} \
-Iinclude/lib/extensions \
-Iinclude/lib/pmf \
-Iinclude/lib/psci \
-Iinclude/lib/xlat_tables \
-Iinclude/plat/common \
-Iinclude/services \
- ${PLAT_INCLUDES} \
- ${SPD_INCLUDES} \
-Iinclude/tools_share
+endif
include common/backtrace/backtrace.mk
diff --git a/bl1/aarch32/bl1_context_mgmt.c b/bl1/aarch32/bl1_context_mgmt.c
index d1fd3ca00..005d046cc 100644
--- a/bl1/aarch32/bl1_context_mgmt.c
+++ b/bl1/aarch32/bl1_context_mgmt.c
@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
+
+#include <arch_helpers.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <platform.h>
+#include <common/debug.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <plat/common/platform.h>
#include <smccc_helpers.h>
+
#include "../bl1_private.h"
/*
diff --git a/bl1/aarch32/bl1_entrypoint.S b/bl1/aarch32/bl1_entrypoint.S
index 16b26b9f2..3f0cbaf4b 100644
--- a/bl1/aarch32/bl1_entrypoint.S
+++ b/bl1/aarch32/bl1_entrypoint.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <context.h>
#include <el3_common_macros.S>
#include <smccc_helpers.h>
diff --git a/bl1/aarch32/bl1_exceptions.S b/bl1/aarch32/bl1_exceptions.S
index 9b001a96f..6728278f8 100644
--- a/bl1/aarch32/bl1_exceptions.S
+++ b/bl1/aarch32/bl1_exceptions.S
@@ -6,12 +6,12 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl1.h>
-#include <bl_common.h>
+#include <bl1/bl1.h>
+#include <common/bl_common.h>
#include <context.h>
+#include <lib/xlat_tables/xlat_tables.h>
#include <smccc_helpers.h>
#include <smccc_macros.S>
-#include <xlat_tables.h>
.globl bl1_aarch32_smc_handler
diff --git a/bl1/aarch64/bl1_context_mgmt.c b/bl1/aarch64/bl1_context_mgmt.c
index 9bfb3094b..032631905 100644
--- a/bl1/aarch64/bl1_context_mgmt.c
+++ b/bl1/aarch64/bl1_context_mgmt.c
@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
+
+#include <arch_helpers.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <platform.h>
+#include <common/debug.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <plat/common/platform.h>
+
#include "../bl1_private.h"
/*
diff --git a/bl1/aarch64/bl1_exceptions.S b/bl1/aarch64/bl1_exceptions.S
index cf8a6a79d..19a0ac27a 100644
--- a/bl1/aarch64/bl1_exceptions.S
+++ b/bl1/aarch64/bl1_exceptions.S
@@ -6,8 +6,8 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl1.h>
-#include <bl_common.h>
+#include <bl1/bl1.h>
+#include <common/bl_common.h>
#include <context.h>
/* -----------------------------------------------------------------------------
diff --git a/bl1/bl1.ld.S b/bl1/bl1.ld.S
index fabe3ef66..c4f6b99fc 100644
--- a/bl1/bl1.ld.S
+++ b/bl1/bl1.ld.S
@@ -5,7 +5,8 @@
*/
#include <platform_def.h>
-#include <xlat_tables_defs.h>
+
+#include <lib/xlat_tables/xlat_tables_defs.h>
OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
OUTPUT_ARCH(PLATFORM_LINKER_ARCH)
diff --git a/bl1/bl1_fwu.c b/bl1/bl1_fwu.c
index 0fbdf515e..57a86aea8 100644
--- a/bl1/bl1_fwu.c
+++ b/bl1/bl1_fwu.c
@@ -4,20 +4,23 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <auth_mod.h>
-#include <bl1.h>
-#include <bl_common.h>
-#include <context.h>
-#include <context_mgmt.h>
-#include <debug.h>
#include <errno.h>
-#include <platform.h>
+#include <string.h>
+
#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <bl1/bl1.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <context.h>
+#include <drivers/auth/auth_mod.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
#include <smccc_helpers.h>
-#include <string.h>
-#include <utils.h>
+
#include "bl1_private.h"
/*
diff --git a/bl1/bl1_main.c b/bl1/bl1_main.c
index ca4369553..d2c2b4173 100644
--- a/bl1/bl1_main.c
+++ b/bl1/bl1_main.c
@@ -4,20 +4,23 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <auth_mod.h>
-#include <bl1.h>
-#include <bl_common.h>
-#include <console.h>
-#include <debug.h>
-#include <errata_report.h>
-#include <platform.h>
+
#include <platform_def.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <bl1/bl1.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/auth/auth_mod.h>
+#include <drivers/console.h>
+#include <lib/cpus/errata_report.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
#include <smccc_helpers.h>
-#include <utils.h>
-#include <uuid.h>
+#include <tools_share/uuid.h>
+
#include "bl1_private.h"
/* BL1 Service UUID */
diff --git a/bl1/bl1_private.h b/bl1/bl1_private.h
index ed815853f..bdbf80f32 100644
--- a/bl1/bl1_private.h
+++ b/bl1/bl1_private.h
@@ -8,7 +8,8 @@
#define BL1_PRIVATE_H
#include <stdint.h>
-#include <utils_def.h>
+
+#include <lib/utils_def.h>
/*******************************************************************************
* Declarations of linker defined symbols which will tell us where BL1 lives
diff --git a/bl1/tbbr/tbbr_img_desc.c b/bl1/tbbr/tbbr_img_desc.c
index 2581d90df..e8df73d47 100644
--- a/bl1/tbbr/tbbr_img_desc.c
+++ b/bl1/tbbr/tbbr_img_desc.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl1.h>
-#include <bl_common.h>
#include <platform_def.h>
-#include <tbbr/tbbr_img_desc.h>
+
+#include <bl1/bl1.h>
+#include <bl1/tbbr/tbbr_img_desc.h>
+#include <common/bl_common.h>
image_desc_t bl1_tbbr_image_descs[] = {
{
diff --git a/bl2/aarch32/bl2_el3_entrypoint.S b/bl2/aarch32/bl2_el3_entrypoint.S
index 0c7b06455..cc846ddf1 100644
--- a/bl2/aarch32/bl2_el3_entrypoint.S
+++ b/bl2/aarch32/bl2_el3_entrypoint.S
@@ -6,10 +6,9 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <el3_common_macros.S>
-
.globl bl2_entrypoint
.globl bl2_run_next_image
diff --git a/bl2/aarch32/bl2_el3_exceptions.S b/bl2/aarch32/bl2_el3_exceptions.S
index 11ddf371f..087b6656d 100644
--- a/bl2/aarch32/bl2_el3_exceptions.S
+++ b/bl2/aarch32/bl2_el3_exceptions.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
.globl bl2_vector_table
diff --git a/bl2/aarch32/bl2_entrypoint.S b/bl2/aarch32/bl2_entrypoint.S
index d215f484b..e7b98af32 100644
--- a/bl2/aarch32/bl2_entrypoint.S
+++ b/bl2/aarch32/bl2_entrypoint.S
@@ -6,8 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
-
+#include <common/bl_common.h>
.globl bl2_vector_table
.globl bl2_entrypoint
diff --git a/bl2/aarch64/bl2_el3_entrypoint.S b/bl2/aarch64/bl2_el3_entrypoint.S
index 2d3efd1fc..16b7c0d5f 100644
--- a/bl2/aarch64/bl2_el3_entrypoint.S
+++ b/bl2/aarch64/bl2_el3_entrypoint.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <el3_common_macros.S>
.globl bl2_entrypoint
diff --git a/bl2/aarch64/bl2_el3_exceptions.S b/bl2/aarch64/bl2_el3_exceptions.S
index 07d104062..3d580513e 100644
--- a/bl2/aarch64/bl2_el3_exceptions.S
+++ b/bl2/aarch64/bl2_el3_exceptions.S
@@ -6,8 +6,8 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl1.h>
-#include <bl_common.h>
+#include <bl1/bl1.h>
+#include <common/bl_common.h>
#include <context.h>
/* -----------------------------------------------------------------------------
diff --git a/bl2/aarch64/bl2_entrypoint.S b/bl2/aarch64/bl2_entrypoint.S
index 30a5c599a..d938947c1 100644
--- a/bl2/aarch64/bl2_entrypoint.S
+++ b/bl2/aarch64/bl2_entrypoint.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
.globl bl2_entrypoint
diff --git a/bl2/bl2.ld.S b/bl2/bl2.ld.S
index 6d26cdb22..30cdf7d78 100644
--- a/bl2/bl2.ld.S
+++ b/bl2/bl2.ld.S
@@ -5,7 +5,8 @@
*/
#include <platform_def.h>
-#include <xlat_tables_defs.h>
+
+#include <lib/xlat_tables/xlat_tables_defs.h>
OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
OUTPUT_ARCH(PLATFORM_LINKER_ARCH)
diff --git a/bl2/bl2_el3.ld.S b/bl2/bl2_el3.ld.S
index 82ab427d1..af93a0ce9 100644
--- a/bl2/bl2_el3.ld.S
+++ b/bl2/bl2_el3.ld.S
@@ -5,7 +5,8 @@
*/
#include <platform_def.h>
-#include <xlat_tables_defs.h>
+
+#include <lib/xlat_tables/xlat_tables_defs.h>
OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
OUTPUT_ARCH(PLATFORM_LINKER_ARCH)
diff --git a/bl2/bl2_image_load_v2.c b/bl2/bl2_image_load_v2.c
index 0f40785d4..dd53e1d2b 100644
--- a/bl2/bl2_image_load_v2.c
+++ b/bl2/bl2_image_load_v2.c
@@ -4,18 +4,20 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <auth_mod.h>
-#include <bl_common.h>
-#include <debug.h>
-#include <desc_image_load.h>
-#include <platform.h>
-#include <platform_def.h>
#include <stdint.h>
-#include "bl2_private.h"
+#include <platform_def.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/desc_image_load.h>
+#include <drivers/auth/auth_mod.h>
+#include <plat/common/platform.h>
+
+#include "bl2_private.h"
/*******************************************************************************
* This function loads SCP_BL2/BL3x images and returns the ep_info for
diff --git a/bl2/bl2_main.c b/bl2/bl2_main.c
index 101eb33d0..019088dc1 100644
--- a/bl2/bl2_main.c
+++ b/bl2/bl2_main.c
@@ -5,13 +5,14 @@
*/
#include <arch_helpers.h>
-#include <auth_mod.h>
-#include <bl1.h>
-#include <bl2.h>
-#include <bl_common.h>
-#include <console.h>
-#include <debug.h>
-#include <platform.h>
+#include <bl1/bl1.h>
+#include <bl2/bl2.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/auth/auth_mod.h>
+#include <drivers/console.h>
+#include <plat/common/platform.h>
+
#include "bl2_private.h"
#ifdef AARCH32
diff --git a/bl2u/aarch32/bl2u_entrypoint.S b/bl2u/aarch32/bl2u_entrypoint.S
index 7fb64f3e4..67566df89 100644
--- a/bl2u/aarch32/bl2u_entrypoint.S
+++ b/bl2u/aarch32/bl2u_entrypoint.S
@@ -6,8 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
-
+#include <common/bl_common.h>
.globl bl2u_vector_table
.globl bl2u_entrypoint
diff --git a/bl2u/aarch64/bl2u_entrypoint.S b/bl2u/aarch64/bl2u_entrypoint.S
index 8b9c2a649..591f5f606 100644
--- a/bl2u/aarch64/bl2u_entrypoint.S
+++ b/bl2u/aarch64/bl2u_entrypoint.S
@@ -6,8 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
-
+#include <common/bl_common.h>
.globl bl2u_entrypoint
diff --git a/bl2u/bl2u.ld.S b/bl2u/bl2u.ld.S
index 3db5f8946..8d4984fbf 100644
--- a/bl2u/bl2u.ld.S
+++ b/bl2u/bl2u.ld.S
@@ -5,7 +5,8 @@
*/
#include <platform_def.h>
-#include <xlat_tables_defs.h>
+
+#include <lib/xlat_tables/xlat_tables_defs.h>
OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
OUTPUT_ARCH(PLATFORM_LINKER_ARCH)
diff --git a/bl2u/bl2u_main.c b/bl2u/bl2u_main.c
index b29d57e9d..d3c83ccc5 100644
--- a/bl2u/bl2u_main.c
+++ b/bl2u/bl2u_main.c
@@ -4,19 +4,20 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <auth_mod.h>
-#include <bl1.h>
-#include <bl2u.h>
-#include <bl_common.h>
-#include <console.h>
-#include <debug.h>
-#include <platform.h>
-#include <platform_def.h>
#include <stdint.h>
+#include <platform_def.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <bl1/bl1.h>
+#include <bl2u/bl2u.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/auth/auth_mod.h>
+#include <drivers/console.h>
+#include <plat/common/platform.h>
/*******************************************************************************
* This function is responsible to:
diff --git a/bl31/aarch64/bl31_entrypoint.S b/bl31/aarch64/bl31_entrypoint.S
index 7c116a2e0..c41773b88 100644
--- a/bl31/aarch64/bl31_entrypoint.S
+++ b/bl31/aarch64/bl31_entrypoint.S
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
#include <arch.h>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <el3_common_macros.S>
-#include <platform_def.h>
-#include <pmf_asm_macros.S>
-#include <runtime_instr.h>
-#include <xlat_mmu_helpers.h>
+#include <lib/pmf/pmf_asm_macros.S>
+#include <lib/runtime_instr.h>
+#include <lib/xlat_tables/xlat_mmu_helpers.h>
.globl bl31_entrypoint
.globl bl31_warm_entrypoint
diff --git a/bl31/aarch64/crash_reporting.S b/bl31/aarch64/crash_reporting.S
index 0986a0a19..b3f59796c 100644
--- a/bl31/aarch64/crash_reporting.S
+++ b/bl31/aarch64/crash_reporting.S
@@ -3,13 +3,15 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
+#include <plat_macros.S>
+#include <platform_def.h>
+
#include <arch.h>
#include <asm_macros.S>
#include <context.h>
-#include <cpu_data.h>
-#include <plat_macros.S>
-#include <platform_def.h>
-#include <utils_def.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/utils_def.h>
.globl report_unhandled_exception
.globl report_unhandled_interrupt
diff --git a/bl31/aarch64/ea_delegate.S b/bl31/aarch64/ea_delegate.S
index 9d7c5e8a9..0c8cfa8f9 100644
--- a/bl31/aarch64/ea_delegate.S
+++ b/bl31/aarch64/ea_delegate.S
@@ -8,9 +8,9 @@
#include <assert_macros.S>
#include <asm_macros.S>
#include <assert_macros.S>
+#include <bl31/ea_handle.h>
#include <context.h>
-#include <ea_handle.h>
-#include <ras_arch.h>
+#include <lib/extensions/ras_arch.h>
.globl handle_lower_el_ea_esb
diff --git a/bl31/aarch64/runtime_exceptions.S b/bl31/aarch64/runtime_exceptions.S
index ab61e8ccf..e7abd5031 100644
--- a/bl31/aarch64/runtime_exceptions.S
+++ b/bl31/aarch64/runtime_exceptions.S
@@ -4,15 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
#include <arch.h>
#include <asm_macros.S>
+#include <bl31/ea_handle.h>
+#include <bl31/interrupt_mgmt.h>
+#include <common/runtime_svc.h>
#include <context.h>
-#include <cpu_data.h>
-#include <ea_handle.h>
-#include <interrupt_mgmt.h>
-#include <platform_def.h>
-#include <runtime_svc.h>
-#include <smccc.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/smccc.h>
.globl runtime_exceptions
diff --git a/bl31/bl31.ld.S b/bl31/bl31.ld.S
index fd53ed82c..5925e0ca0 100644
--- a/bl31/bl31.ld.S
+++ b/bl31/bl31.ld.S
@@ -5,7 +5,8 @@
*/
#include <platform_def.h>
-#include <xlat_tables_defs.h>
+
+#include <lib/xlat_tables/xlat_tables_defs.h>
OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
OUTPUT_ARCH(PLATFORM_LINKER_ARCH)
@@ -77,7 +78,7 @@ SECTIONS
/* Place pubsub sections for events */
. = ALIGN(8);
-#include <pubsub_events.h>
+#include <lib/el3_runtime/pubsub_events.h>
. = ALIGN(PAGE_SIZE);
__RODATA_END__ = .;
@@ -124,7 +125,7 @@ SECTIONS
/* Place pubsub sections for events */
. = ALIGN(8);
-#include <pubsub_events.h>
+#include <lib/el3_runtime/pubsub_events.h>
*(.vectors)
__RO_END_UNALIGNED__ = .;
diff --git a/bl31/bl31_context_mgmt.c b/bl31/bl31_context_mgmt.c
index f868372a6..d41979fa7 100644
--- a/bl31/bl31_context_mgmt.c
+++ b/bl31/bl31_context_mgmt.c
@@ -5,13 +5,13 @@
*/
#include <assert.h>
-#include <bl31.h>
-#include <bl_common.h>
-#include <context.h>
-#include <context_mgmt.h>
-#include <cpu_data.h>
-#include <platform.h>
+#include <bl31/bl31.h>
+#include <common/bl_common.h>
+#include <context.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <plat/common/platform.h>
/*******************************************************************************
* This function returns a pointer to the most recent 'cpu_context' structure
diff --git a/bl31/bl31_main.c b/bl31/bl31_main.c
index 77b59ed6a..927cda2f9 100644
--- a/bl31/bl31_main.c
+++ b/bl31/bl31_main.c
@@ -4,22 +4,23 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl31.h>
-#include <bl_common.h>
-#include <console.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <ehf.h>
-#include <platform.h>
-#include <pmf.h>
-#include <runtime_instr.h>
-#include <runtime_svc.h>
-#include <std_svc.h>
#include <string.h>
+#include <arch.h>
+#include <arch_helpers.h>
+#include <bl31/bl31.h>
+#include <bl31/ehf.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <drivers/console.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/pmf/pmf.h>
+#include <lib/runtime_instr.h>
+#include <plat/common/platform.h>
+#include <services/std_svc.h>
+
#if ENABLE_RUNTIME_INSTRUMENTATION
PMF_REGISTER_SERVICE_SMC(rt_instr_svc, PMF_RT_INSTR_SVC_ID,
RT_INSTR_TOTAL_IDS, PMF_STORE_ENABLE)
diff --git a/bl31/ehf.c b/bl31/ehf.c
index fa036cb1c..1bcebee53 100644
--- a/bl31/ehf.c
+++ b/bl31/ehf.c
@@ -9,17 +9,18 @@
*/
#include <assert.h>
-#include <context.h>
-#include <context_mgmt.h>
-#include <cpu_data.h>
-#include <debug.h>
-#include <ehf.h>
-#include <gic_common.h>
-#include <interrupt_mgmt.h>
-#include <platform.h>
-#include <pubsub_events.h>
#include <stdbool.h>
+#include <bl31/ehf.h>
+#include <bl31/interrupt_mgmt.h>
+#include <context.h>
+#include <common/debug.h>
+#include <drivers/arm/gic_common.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <plat/common/platform.h>
+
/* Output EHF logs as verbose */
#define EHF_LOG(...) VERBOSE("EHF: " __VA_ARGS__)
diff --git a/bl31/interrupt_mgmt.c b/bl31/interrupt_mgmt.c
index 0df50b6d2..e6efad3e0 100644
--- a/bl31/interrupt_mgmt.c
+++ b/bl31/interrupt_mgmt.c
@@ -5,11 +5,12 @@
*/
#include <assert.h>
-#include <bl_common.h>
-#include <context_mgmt.h>
#include <errno.h>
-#include <interrupt_mgmt.h>
-#include <platform.h>
+
+#include <common/bl_common.h>
+#include <bl31/interrupt_mgmt.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <plat/common/platform.h>
/*******************************************************************************
* Local structure and corresponding array to keep track of the state of the
diff --git a/bl32/sp_min/aarch32/entrypoint.S b/bl32/sp_min/aarch32/entrypoint.S
index d6853cc40..2ffef6a2e 100644
--- a/bl32/sp_min/aarch32/entrypoint.S
+++ b/bl32/sp_min/aarch32/entrypoint.S
@@ -6,13 +6,13 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
+#include <common/runtime_svc.h>
#include <context.h>
#include <el3_common_macros.S>
-#include <runtime_svc.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
#include <smccc_helpers.h>
#include <smccc_macros.S>
-#include <xlat_tables_defs.h>
.globl sp_min_vector_table
.globl sp_min_entrypoint
diff --git a/bl32/sp_min/sp_min.ld.S b/bl32/sp_min/sp_min.ld.S
index ce6c954ec..ba9d34212 100644
--- a/bl32/sp_min/sp_min.ld.S
+++ b/bl32/sp_min/sp_min.ld.S
@@ -5,7 +5,8 @@
*/
#include <platform_def.h>
-#include <xlat_tables_defs.h>
+
+#include <lib/xlat_tables/xlat_tables_defs.h>
OUTPUT_FORMAT(elf32-littlearm)
OUTPUT_ARCH(arm)
@@ -62,7 +63,7 @@ SECTIONS
/* Place pubsub sections for events */
. = ALIGN(8);
-#include <pubsub_events.h>
+#include <lib/el3_runtime/pubsub_events.h>
. = ALIGN(PAGE_SIZE);
__RODATA_END__ = .;
@@ -91,7 +92,7 @@ SECTIONS
/* Place pubsub sections for events */
. = ALIGN(8);
-#include <pubsub_events.h>
+#include <lib/el3_runtime/pubsub_events.h>
*(.vectors)
__RO_END_UNALIGNED__ = .;
diff --git a/bl32/sp_min/sp_min_main.c b/bl32/sp_min/sp_min_main.c
index a12a83bcf..3cb19901f 100644
--- a/bl32/sp_min/sp_min_main.c
+++ b/bl32/sp_min/sp_min_main.c
@@ -4,26 +4,28 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <platform_def.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
-#include <console.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <platform.h>
-#include <platform_def.h>
+#include <drivers/console.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/psci/psci.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
#include <platform_sp_min.h>
-#include <psci.h>
-#include <runtime_svc.h>
+#include <services/std_svc.h>
#include <smccc_helpers.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <std_svc.h>
-#include <stdint.h>
-#include <string.h>
-#include <utils.h>
+
#include "sp_min_private.h"
/* Pointers to per-core cpu contexts */
diff --git a/bl32/tsp/aarch64/tsp_entrypoint.S b/bl32/tsp/aarch64/tsp_entrypoint.S
index 5d9da8578..48f6981bb 100644
--- a/bl32/tsp/aarch64/tsp_entrypoint.S
+++ b/bl32/tsp/aarch64/tsp_entrypoint.S
@@ -6,8 +6,9 @@
#include <arch.h>
#include <asm_macros.S>
-#include <tsp.h>
-#include <xlat_tables_defs.h>
+#include <bl32/tsp/tsp.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+
#include "../tsp_private.h"
diff --git a/bl32/tsp/aarch64/tsp_exceptions.S b/bl32/tsp/aarch64/tsp_exceptions.S
index 48e358a3a..ad4b64887 100644
--- a/bl32/tsp/aarch64/tsp_exceptions.S
+++ b/bl32/tsp/aarch64/tsp_exceptions.S
@@ -6,9 +6,8 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
-#include <tsp.h>
-
+#include <bl32/tsp/tsp.h>
+#include <common/bl_common.h>
/* ----------------------------------------------------
* The caller-saved registers x0-x18 and LR are saved
diff --git a/bl32/tsp/aarch64/tsp_request.S b/bl32/tsp/aarch64/tsp_request.S
index 2261f87f9..5ad16da66 100644
--- a/bl32/tsp/aarch64/tsp_request.S
+++ b/bl32/tsp/aarch64/tsp_request.S
@@ -5,7 +5,7 @@
*/
#include <asm_macros.S>
-#include <tsp.h>
+#include <bl32/tsp/tsp.h>
.globl tsp_get_magic
diff --git a/bl32/tsp/tsp.ld.S b/bl32/tsp/tsp.ld.S
index 97b12ce19..e9a1df168 100644
--- a/bl32/tsp/tsp.ld.S
+++ b/bl32/tsp/tsp.ld.S
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <lib/xlat_tables/xlat_tables_defs.h>
#include <platform_def.h>
-#include <xlat_tables_defs.h>
OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
OUTPUT_ARCH(PLATFORM_LINKER_ARCH)
diff --git a/bl32/tsp/tsp_interrupt.c b/bl32/tsp/tsp_interrupt.c
index f50133814..4e500b3ca 100644
--- a/bl32/tsp/tsp_interrupt.c
+++ b/bl32/tsp/tsp_interrupt.c
@@ -4,12 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <platform.h>
+
#include <platform_def.h>
-#include <tsp.h>
+
+#include <arch_helpers.h>
+#include <bl32/tsp/tsp.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
#include "tsp_private.h"
/*******************************************************************************
diff --git a/bl32/tsp/tsp_main.c b/bl32/tsp/tsp_main.c
index e41b51ebc..24efa6189 100644
--- a/bl32/tsp/tsp_main.c
+++ b/bl32/tsp/tsp_main.c
@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <bl_common.h>
-#include <debug.h>
-#include <platform.h>
#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <bl32/tsp/tsp.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <lib/spinlock.h>
+#include <plat/common/platform.h>
#include <platform_tsp.h>
-#include <spinlock.h>
-#include <tsp.h>
+
#include "tsp_private.h"
diff --git a/bl32/tsp/tsp_private.h b/bl32/tsp/tsp_private.h
index b697fa496..e39f29166 100644
--- a/bl32/tsp/tsp_private.h
+++ b/bl32/tsp/tsp_private.h
@@ -22,12 +22,13 @@
#ifndef __ASSEMBLY__
-#include <cassert.h>
-#include <platform_def.h> /* For CACHE_WRITEBACK_GRANULE */
-#include <spinlock.h>
#include <stdint.h>
-#include <tsp.h>
+#include <platform_def.h> /* For CACHE_WRITEBACK_GRANULE */
+
+#include <bl32/tsp/tsp.h>
+#include <lib/cassert.h>
+#include <lib/spinlock.h>
typedef struct work_statistics {
/* Number of s-el1 interrupts on this cpu */
diff --git a/bl32/tsp/tsp_timer.c b/bl32/tsp/tsp_timer.c
index ebe7f0d39..35928634d 100644
--- a/bl32/tsp/tsp_timer.c
+++ b/bl32/tsp/tsp_timer.c
@@ -3,9 +3,12 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
+
#include <assert.h>
-#include <platform.h>
+
+#include <arch_helpers.h>
+#include <plat/common/platform.h>
+
#include "tsp_private.h"
/*******************************************************************************
diff --git a/common/aarch64/debug.S b/common/aarch64/debug.S
index 4478d0d03..da740ef22 100644
--- a/common/aarch64/debug.S
+++ b/common/aarch64/debug.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <debug.h>
+#include <common/debug.h>
.globl asm_print_str
.globl asm_print_hex
diff --git a/common/aarch64/early_exceptions.S b/common/aarch64/early_exceptions.S
index ba94f6cb1..36a872468 100644
--- a/common/aarch64/early_exceptions.S
+++ b/common/aarch64/early_exceptions.S
@@ -5,7 +5,7 @@
*/
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
/* -----------------------------------------------------------------------------
* Very simple stackless exception handlers used by BL2 and BL31 stages.
diff --git a/common/backtrace/backtrace.c b/common/backtrace/backtrace.c
index a91d06573..bf60a08a9 100644
--- a/common/backtrace/backtrace.c
+++ b/common/backtrace/backtrace.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <console.h>
-#include <debug.h>
#include <stdbool.h>
#include <stdint.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+
/* Maximum number of entries in the backtrace to display */
#define UNWIND_LIMIT 20U
diff --git a/common/bl_common.c b/common/bl_common.c
index d12a17cf3..b2d22c19d 100644
--- a/common/bl_common.c
+++ b/common/bl_common.c
@@ -4,18 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <auth_mod.h>
-#include <bl_common.h>
-#include <debug.h>
#include <errno.h>
-#include <io_storage.h>
-#include <platform.h>
#include <string.h>
-#include <utils.h>
-#include <xlat_tables_defs.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/auth/auth_mod.h>
+#include <drivers/io/io_storage.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+#include <plat/common/platform.h>
#if TRUSTED_BOARD_BOOT
# ifdef DYN_DISABLE_AUTH
diff --git a/common/desc_image_load.c b/common/desc_image_load.c
index b07fba334..ada02f8dd 100644
--- a/common/desc_image_load.c
+++ b/common/desc_image_load.c
@@ -4,12 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <desc_image_load.h>
-
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/desc_image_load.h>
static bl_load_info_t bl_load_info;
static bl_params_t next_bl_params;
diff --git a/common/fdt_wrappers.c b/common/fdt_wrappers.c
index 31dafb2eb..e67fdb005 100644
--- a/common/fdt_wrappers.c
+++ b/common/fdt_wrappers.c
@@ -7,11 +7,13 @@
/* Helper functions to offer easier navigation of Device Tree Blob */
#include <assert.h>
-#include <debug.h>
-#include <fdt_wrappers.h>
-#include <libfdt.h>
#include <string.h>
+#include <libfdt.h>
+
+#include <common/debug.h>
+#include <common/fdt_wrappers.h>
+
/*
* Read cells from a given property of the given node. At most 2 cells of the
* property are read, and pointer is updated. Returns 0 on success, and -1 upon
diff --git a/common/image_decompress.c b/common/image_decompress.c
index 7bd02b1da..a4586ae62 100644
--- a/common/image_decompress.c
+++ b/common/image_decompress.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <debug.h>
-#include <image_decompress.h>
#include <stdint.h>
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/image_decompress.h>
+
static uintptr_t decompressor_buf_base;
static uint32_t decompressor_buf_size;
static decompressor_t *decompressor;
diff --git a/common/runtime_svc.c b/common/runtime_svc.c
index c30c0ecb6..09ce787d4 100644
--- a/common/runtime_svc.c
+++ b/common/runtime_svc.c
@@ -5,11 +5,12 @@
*/
#include <assert.h>
-#include <debug.h>
#include <errno.h>
-#include <runtime_svc.h>
#include <string.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+
/*******************************************************************************
* The 'rt_svc_descs' array holds the runtime service descriptors exported by
* services by placing them in the 'rt_svc_descs' linker section.
diff --git a/common/tf_log.c b/common/tf_log.c
index 070218564..3e174dda0 100644
--- a/common/tf_log.c
+++ b/common/tf_log.c
@@ -4,9 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdarg.h>
#include <assert.h>
-#include <debug.h>
-#include <platform.h>
+#include <stdio.h>
+
+#include <common/debug.h>
+#include <plat/common/platform.h>
/* Set the default maximum log level to the `LOG_LEVEL` build flag */
static unsigned int max_log_level = LOG_LEVEL;
diff --git a/docs/exception-handling.rst b/docs/exception-handling.rst
index e7cb09cf2..dbcd4bca8 100644
--- a/docs/exception-handling.rst
+++ b/docs/exception-handling.rst
@@ -308,9 +308,9 @@ assign interrupts to fictitious dispatchers:
.. code:: c
+ #include <common/interrupt_props.h>
+ #include <drivers/arm/gic_common.h>
#include <exception_mgmt.h>
- #include <gic_common.h>
- #include <interrupt_props.h>
...
diff --git a/drivers/allwinner/sunxi_rsb.c b/drivers/allwinner/sunxi_rsb.c
index 7075c674d..67f5b7ec2 100644
--- a/drivers/allwinner/sunxi_rsb.c
+++ b/drivers/allwinner/sunxi_rsb.c
@@ -4,10 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <delay_timer.h>
#include <errno.h>
-#include <mmio.h>
+
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
+
#include <sunxi_mmap.h>
#define RSB_CTRL 0x00
diff --git a/drivers/arm/cci/cci.c b/drivers/arm/cci/cci.c
index 605971cac..a139f6cc7 100644
--- a/drivers/arm/cci/cci.c
+++ b/drivers/arm/cci/cci.c
@@ -4,15 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <cci.h>
-#include <debug.h>
-#include <mmio.h>
#include <stdbool.h>
#include <stdint.h>
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/arm/cci.h>
+#include <lib/mmio.h>
+
#define MAKE_CCI_PART_NUMBER(hi, lo) (((hi) << 8) | (lo))
#define CCI_PART_LO_MASK U(0xff)
#define CCI_PART_HI_MASK U(0xf)
diff --git a/drivers/arm/ccn/ccn.c b/drivers/arm/ccn/ccn.c
index d46e02089..64b162697 100644
--- a/drivers/arm/ccn/ccn.c
+++ b/drivers/arm/ccn/ccn.c
@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
#include <assert.h>
-#include <bakery_lock.h>
-#include <ccn.h>
-#include <debug.h>
#include <errno.h>
-#include <mmio.h>
#include <stdbool.h>
+
+#include <arch.h>
+#include <common/debug.h>
+#include <drivers/arm/ccn.h>
+#include <lib/bakery_lock.h>
+#include <lib/mmio.h>
+
#include "ccn_private.h"
static const ccn_desc_t *ccn_plat_desc;
diff --git a/drivers/arm/gic/common/gic_common.c b/drivers/arm/gic/common/gic_common.c
index 589de5da4..38b2f6719 100644
--- a/drivers/arm/gic/common/gic_common.c
+++ b/drivers/arm/gic/common/gic_common.c
@@ -5,8 +5,10 @@
*/
#include <assert.h>
-#include <gic_common.h>
-#include <mmio.h>
+
+#include <drivers/arm/gic_common.h>
+#include <lib/mmio.h>
+
#include "gic_common_private.h"
/*******************************************************************************
diff --git a/drivers/arm/gic/common/gic_common_private.h b/drivers/arm/gic/common/gic_common_private.h
index 9d9e8c7ba..1ab1bdbef 100644
--- a/drivers/arm/gic/common/gic_common_private.h
+++ b/drivers/arm/gic/common/gic_common_private.h
@@ -7,10 +7,11 @@
#ifndef GIC_COMMON_PRIVATE_H
#define GIC_COMMON_PRIVATE_H
-#include <gic_common.h>
-#include <mmio.h>
#include <stdint.h>
+#include <drivers/arm/gic_common.h>
+#include <lib/mmio.h>
+
/*******************************************************************************
* GIC Distributor interface register accessors that are common to GICv3 & GICv2
******************************************************************************/
diff --git a/drivers/arm/gic/v2/gicv2_helpers.c b/drivers/arm/gic/v2/gicv2_helpers.c
index bc4c1d165..6739a782c 100644
--- a/drivers/arm/gic/v2/gicv2_helpers.c
+++ b/drivers/arm/gic/v2/gicv2_helpers.c
@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <debug.h>
-#include <gic_common.h>
-#include <gicv2.h>
-#include <interrupt_props.h>
+#include <common/debug.h>
+#include <common/interrupt_props.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gicv2.h>
+
#include "../common/gic_common_private.h"
#include "gicv2_private.h"
diff --git a/drivers/arm/gic/v2/gicv2_main.c b/drivers/arm/gic/v2/gicv2_main.c
index b8729056d..c5d4fe1c3 100644
--- a/drivers/arm/gic/v2/gicv2_main.c
+++ b/drivers/arm/gic/v2/gicv2_main.c
@@ -4,16 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <gic_common.h>
-#include <gicv2.h>
-#include <interrupt_props.h>
-#include <spinlock.h>
#include <stdbool.h>
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <common/interrupt_props.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gicv2.h>
+#include <lib/spinlock.h>
+
#include "../common/gic_common_private.h"
#include "gicv2_private.h"
diff --git a/drivers/arm/gic/v2/gicv2_private.h b/drivers/arm/gic/v2/gicv2_private.h
index ccfad78cd..0fbdab0a2 100644
--- a/drivers/arm/gic/v2/gicv2_private.h
+++ b/drivers/arm/gic/v2/gicv2_private.h
@@ -7,10 +7,11 @@
#ifndef GICV2_PRIVATE_H
#define GICV2_PRIVATE_H
-#include <gicv2.h>
-#include <mmio.h>
#include <stdint.h>
+#include <drivers/arm/gicv2.h>
+#include <lib/mmio.h>
+
/*******************************************************************************
* Private function prototypes
******************************************************************************/
diff --git a/drivers/arm/gic/v3/arm_gicv3_common.c b/drivers/arm/gic/v3/arm_gicv3_common.c
index c80973295..448989286 100644
--- a/drivers/arm/gic/v3/arm_gicv3_common.c
+++ b/drivers/arm/gic/v3/arm_gicv3_common.c
@@ -10,12 +10,13 @@
* APIs that are different to those generic ones in GICv3 driver.
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <gicv3.h>
+
+#include <arch_helpers.h>
+#include <drivers/arm/arm_gicv3_common.h>
+#include <drivers/arm/gicv3.h>
#include "gicv3_private.h"
-#include "arm_gicv3_common.h"
/*
* Flush the internal GIC cache of the LPIs pending tables to memory before
diff --git a/drivers/arm/gic/v3/gic600.c b/drivers/arm/gic/v3/gic600.c
index eb4fc548f..9cb2ab25e 100644
--- a/drivers/arm/gic/v3/gic600.c
+++ b/drivers/arm/gic/v3/gic600.c
@@ -11,9 +11,10 @@
* GIC600 supports independently power-gating redistributor interface.
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <gicv3.h>
+
+#include <arch_helpers.h>
+#include <drivers/arm/gicv3.h>
#include "gicv3_private.h"
diff --git a/drivers/arm/gic/v3/gicv3_helpers.c b/drivers/arm/gic/v3/gicv3_helpers.c
index c12a4b651..39ea2a374 100644
--- a/drivers/arm/gic/v3/gicv3_helpers.c
+++ b/drivers/arm/gic/v3/gicv3_helpers.c
@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <debug.h>
-#include <gic_common.h>
-#include <interrupt_props.h>
+#include <common/debug.h>
+#include <common/interrupt_props.h>
+#include <drivers/arm/gic_common.h>
+
#include "../common/gic_common_private.h"
#include "gicv3_private.h"
diff --git a/drivers/arm/gic/v3/gicv3_main.c b/drivers/arm/gic/v3/gicv3_main.c
index 60f2e108a..cf92f10ba 100644
--- a/drivers/arm/gic/v3/gicv3_main.c
+++ b/drivers/arm/gic/v3/gicv3_main.c
@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <debug.h>
-#include <gicv3.h>
-#include <interrupt_props.h>
-#include <spinlock.h>
+#include <common/debug.h>
+#include <common/interrupt_props.h>
+#include <drivers/arm/gicv3.h>
+#include <lib/spinlock.h>
+
#include "gicv3_private.h"
const gicv3_driver_data_t *gicv3_driver_data;
diff --git a/drivers/arm/gic/v3/gicv3_private.h b/drivers/arm/gic/v3/gicv3_private.h
index 188e71168..92066e1f2 100644
--- a/drivers/arm/gic/v3/gicv3_private.h
+++ b/drivers/arm/gic/v3/gicv3_private.h
@@ -8,10 +8,12 @@
#define GICV3_PRIVATE_H
#include <assert.h>
-#include <gic_common.h>
-#include <gicv3.h>
-#include <mmio.h>
#include <stdint.h>
+
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gicv3.h>
+#include <lib/mmio.h>
+
#include "../common/gic_common_private.h"
/*******************************************************************************
diff --git a/drivers/arm/pl011/aarch32/pl011_console.S b/drivers/arm/pl011/aarch32/pl011_console.S
index 5d6b95fe3..ae613b134 100644
--- a/drivers/arm/pl011/aarch32/pl011_console.S
+++ b/drivers/arm/pl011/aarch32/pl011_console.S
@@ -8,7 +8,7 @@
#include <assert_macros.S>
#define USE_FINISH_CONSOLE_REG_2
#include <console_macros.S>
-#include <pl011.h>
+#include <drivers/arm/pl011.h>
#if !MULTI_CONSOLE_API
/*
diff --git a/drivers/arm/pl011/aarch64/pl011_console.S b/drivers/arm/pl011/aarch64/pl011_console.S
index 7fec0904d..aaa39c11c 100644
--- a/drivers/arm/pl011/aarch64/pl011_console.S
+++ b/drivers/arm/pl011/aarch64/pl011_console.S
@@ -8,7 +8,7 @@
#include <assert_macros.S>
#define USE_FINISH_CONSOLE_REG_2
#include <console_macros.S>
-#include <pl011.h>
+#include <drivers/arm/pl011.h>
#if !MULTI_CONSOLE_API
/*
diff --git a/drivers/arm/pl061/pl061_gpio.c b/drivers/arm/pl061/pl061_gpio.c
index af980e5eb..97013e83f 100644
--- a/drivers/arm/pl061/pl061_gpio.c
+++ b/drivers/arm/pl061/pl061_gpio.c
@@ -9,13 +9,14 @@
*/
#include <assert.h>
-#include <cassert.h>
-#include <debug.h>
#include <errno.h>
-#include <gpio.h>
-#include <mmio.h>
-#include <pl061_gpio.h>
-#include <utils.h>
+
+#include <common/debug.h>
+#include <drivers/arm/pl061_gpio.h>
+#include <drivers/gpio.h>
+#include <lib/cassert.h>
+#include <lib/mmio.h>
+#include <lib/utils.h>
#if !PLAT_PL061_MAX_GPIOS
# define PLAT_PL061_MAX_GPIOS 32
diff --git a/drivers/arm/smmu/smmu_v3.c b/drivers/arm/smmu/smmu_v3.c
index 78a9ffa6d..004e81e36 100644
--- a/drivers/arm/smmu/smmu_v3.c
+++ b/drivers/arm/smmu/smmu_v3.c
@@ -5,10 +5,11 @@
*/
#include <cdefs.h>
-#include <mmio.h>
-#include <smmu_v3.h>
#include <stdbool.h>
+#include <drivers/arm/smmu_v3.h>
+#include <lib/mmio.h>
+
static inline uint32_t __init smmuv3_read_s_idr1(uintptr_t base)
{
return mmio_read_32(base + SMMU_S_IDR1);
diff --git a/drivers/arm/sp804/sp804_delay_timer.c b/drivers/arm/sp804/sp804_delay_timer.c
index 8f1c5c51b..5313fbde2 100644
--- a/drivers/arm/sp804/sp804_delay_timer.c
+++ b/drivers/arm/sp804/sp804_delay_timer.c
@@ -5,8 +5,9 @@
*/
#include <assert.h>
-#include <delay_timer.h>
-#include <mmio.h>
+
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
uintptr_t sp804_base_addr;
diff --git a/drivers/arm/sp805/sp805.c b/drivers/arm/sp805/sp805.c
index aee90164a..ffca1ced5 100644
--- a/drivers/arm/sp805/sp805.c
+++ b/drivers/arm/sp805/sp805.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
-#include <sp805.h>
#include <stdint.h>
+#include <drivers/arm/sp805.h>
+#include <lib/mmio.h>
+
/* Inline register access functions */
static inline void sp805_write_wdog_load(uintptr_t base, uint32_t value)
diff --git a/drivers/arm/tzc/tzc380.c b/drivers/arm/tzc/tzc380.c
index 082161fe5..676df8d80 100644
--- a/drivers/arm/tzc/tzc380.c
+++ b/drivers/arm/tzc/tzc380.c
@@ -5,10 +5,11 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <mmio.h>
#include <stddef.h>
-#include <tzc380.h>
+
+#include <common/debug.h>
+#include <drivers/arm/tzc380.h>
+#include <lib/mmio.h>
struct tzc380_instance {
uintptr_t base;
diff --git a/drivers/arm/tzc/tzc400.c b/drivers/arm/tzc/tzc400.c
index d27b01029..50d670139 100644
--- a/drivers/arm/tzc/tzc400.c
+++ b/drivers/arm/tzc/tzc400.c
@@ -5,10 +5,12 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <mmio.h>
#include <stddef.h>
-#include <tzc400.h>
+
+#include <common/debug.h>
+#include <drivers/arm/tzc400.h>
+#include <lib/mmio.h>
+
#include "tzc_common_private.h"
/*
diff --git a/drivers/arm/tzc/tzc_common_private.h b/drivers/arm/tzc/tzc_common_private.h
index efac85071..c800536f3 100644
--- a/drivers/arm/tzc/tzc_common_private.h
+++ b/drivers/arm/tzc/tzc_common_private.h
@@ -9,8 +9,8 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <mmio.h>
-#include <tzc_common.h>
+#include <drivers/arm/tzc_common.h>
+#include <lib/mmio.h>
#define DEFINE_TZC_COMMON_WRITE_ACTION(fn_name, macro_name) \
static inline void _tzc##fn_name##_write_action( \
diff --git a/drivers/arm/tzc/tzc_dmc500.c b/drivers/arm/tzc/tzc_dmc500.c
index f0aba9c19..e45fbf8d8 100644
--- a/drivers/arm/tzc/tzc_dmc500.c
+++ b/drivers/arm/tzc/tzc_dmc500.c
@@ -5,10 +5,12 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <mmio.h>
-#include <tzc_dmc500.h>
-#include "tzc_common.h"
+
+#include <common/debug.h>
+#include <drivers/arm/tzc_dmc500.h>
+#include <drivers/arm/tzc_common.h>
+#include <lib/mmio.h>
+
#include "tzc_common_private.h"
/*
diff --git a/drivers/arm/tzc/tzc_dmc620.c b/drivers/arm/tzc/tzc_dmc620.c
index 4abd0800b..64ec5abee 100644
--- a/drivers/arm/tzc/tzc_dmc620.c
+++ b/drivers/arm/tzc/tzc_dmc620.c
@@ -5,9 +5,10 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <mmio.h>
-#include <tzc_dmc620.h>
+
+#include <common/debug.h>
+#include <drivers/arm/tzc_dmc620.h>
+#include <lib/mmio.h>
/* Mask to extract bit 31 to 16 */
#define MASK_31_16 UINT64_C(0x0000ffff0000)
diff --git a/drivers/auth/auth_mod.c b/drivers/auth/auth_mod.c
index eb537b66a..1b8ff82bc 100644
--- a/drivers/auth/auth_mod.c
+++ b/drivers/auth/auth_mod.c
@@ -5,17 +5,19 @@
*/
#include <assert.h>
-#include <auth_common.h>
-#include <auth_mod.h>
-#include <cot_def.h>
-#include <crypto_mod.h>
-#include <debug.h>
-#include <img_parser_mod.h>
-#include <platform.h>
-#include <platform_def.h>
#include <stdint.h>
#include <string.h>
+#include <platform_def.h>
+
+#include <common/debug.h>
+#include <common/tbbr/cot_def.h>
+#include <drivers/auth/auth_common.h>
+#include <drivers/auth/auth_mod.h>
+#include <drivers/auth/crypto_mod.h>
+#include <drivers/auth/img_parser_mod.h>
+#include <plat/common/platform.h>
+
/* ASN.1 tags */
#define ASN1_INTEGER 0x02
diff --git a/drivers/auth/crypto_mod.c b/drivers/auth/crypto_mod.c
index 4cd05506b..5e5ac2b03 100644
--- a/drivers/auth/crypto_mod.c
+++ b/drivers/auth/crypto_mod.c
@@ -5,8 +5,9 @@
*/
#include <assert.h>
-#include <crypto_mod.h>
-#include <debug.h>
+
+#include <common/debug.h>
+#include <drivers/auth/crypto_mod.h>
/* Variable exported by the crypto library through REGISTER_CRYPTO_LIB() */
diff --git a/drivers/auth/cryptocell/cryptocell_crypto.c b/drivers/auth/cryptocell/cryptocell_crypto.c
index 80c10933e..a507d0a42 100644
--- a/drivers/auth/cryptocell/cryptocell_crypto.c
+++ b/drivers/auth/cryptocell/cryptocell_crypto.c
@@ -4,20 +4,22 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <crypto_driver.h>
-#include <crypto_mod.h>
-#include <debug.h>
-#include <mbedtls_common.h>
-#include <platform_def.h>
-#include <rsa.h>
-#include <sbrom_bsv_api.h>
-#include <secureboot_base_func.h>
-#include <secureboot_gen_defs.h>
#include <stddef.h>
#include <string.h>
-#include <util.h>
-#include <utils.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/arm/cryptocell/crypto_driver.h>
+#include <drivers/arm/cryptocell/rsa.h>
+#include <drivers/arm/cryptocell/sbrom_bsv_api.h>
+#include <drivers/arm/cryptocell/secureboot_base_func.h>
+#include <drivers/arm/cryptocell/secureboot_gen_defs.h>
+#include <drivers/arm/cryptocell/util.h>
+#include <drivers/auth/crypto_mod.h>
+#include <drivers/auth/mbedtls/mbedtls_common.h>
+#include <lib/utils.h>
#include <mbedtls/oid.h>
diff --git a/drivers/auth/cryptocell/cryptocell_crypto.mk b/drivers/auth/cryptocell/cryptocell_crypto.mk
index a88dcfc57..a631829fd 100644
--- a/drivers/auth/cryptocell/cryptocell_crypto.mk
+++ b/drivers/auth/cryptocell/cryptocell_crypto.mk
@@ -20,9 +20,7 @@ endif
TF_LDFLAGS += -L$(CCSBROM_LIB_PATH)
LDLIBS += -lcc_712sbromx509
-INCLUDES += -Iinclude/drivers/arm/cryptocell
-
CRYPTOCELL_SOURCES := drivers/auth/cryptocell/cryptocell_crypto.c
BL1_SOURCES += ${CRYPTOCELL_SOURCES}
-BL2_SOURCES += ${CRYPTOCELL_SOURCES} \ No newline at end of file
+BL2_SOURCES += ${CRYPTOCELL_SOURCES}
diff --git a/drivers/auth/img_parser_mod.c b/drivers/auth/img_parser_mod.c
index 63160141d..c4688f867 100644
--- a/drivers/auth/img_parser_mod.c
+++ b/drivers/auth/img_parser_mod.c
@@ -5,14 +5,15 @@
*/
#include <assert.h>
-#include <auth_common.h>
-#include <debug.h>
#include <errno.h>
-#include <img_parser_mod.h>
#include <limits.h>
#include <stdint.h>
#include <string.h>
-#include <utils_def.h>
+
+#include <common/debug.h>
+#include <drivers/auth/auth_common.h>
+#include <drivers/auth/img_parser_mod.h>
+#include <lib/utils_def.h>
IMPORT_SYM(uintptr_t, __PARSER_LIB_DESCS_START__, PARSER_LIB_DESCS_START);
IMPORT_SYM(uintptr_t, __PARSER_LIB_DESCS_END__, PARSER_LIB_DESCS_END);
diff --git a/drivers/auth/mbedtls/mbedtls_common.c b/drivers/auth/mbedtls/mbedtls_common.c
index dbf45baeb..b6d02fd10 100644
--- a/drivers/auth/mbedtls/mbedtls_common.c
+++ b/drivers/auth/mbedtls/mbedtls_common.c
@@ -5,14 +5,16 @@
*/
#include <assert.h>
-#include <debug.h>
+#include <stddef.h>
+
/* mbed TLS headers */
#include <mbedtls/memory_buffer_alloc.h>
#include <mbedtls/platform.h>
-#include <mbedtls_common.h>
-#include <mbedtls_config.h>
-#include <platform.h>
-#include <stddef.h>
+
+#include <common/debug.h>
+#include <drivers/auth/mbedtls/mbedtls_common.h>
+#include <drivers/auth/mbedtls/mbedtls_config.h>
+#include <plat/common/platform.h>
static void cleanup(void)
{
diff --git a/drivers/auth/mbedtls/mbedtls_common.mk b/drivers/auth/mbedtls/mbedtls_common.mk
index cfbd86ab9..63e65bd47 100644
--- a/drivers/auth/mbedtls/mbedtls_common.mk
+++ b/drivers/auth/mbedtls/mbedtls_common.mk
@@ -14,10 +14,9 @@ ifeq (${MBEDTLS_DIR},)
endif
MBEDTLS_INC = -I${MBEDTLS_DIR}/include
-INCLUDES += -Iinclude/drivers/auth/mbedtls
# Specify mbed TLS configuration file
-MBEDTLS_CONFIG_FILE := "<mbedtls_config.h>"
+MBEDTLS_CONFIG_FILE := "<drivers/auth/mbedtls/mbedtls_config.h>"
$(eval $(call add_define,MBEDTLS_CONFIG_FILE))
MBEDTLS_SOURCES += drivers/auth/mbedtls/mbedtls_common.c
diff --git a/drivers/auth/mbedtls/mbedtls_crypto.c b/drivers/auth/mbedtls/mbedtls_crypto.c
index bc9ed3a85..33420fbbd 100644
--- a/drivers/auth/mbedtls/mbedtls_crypto.c
+++ b/drivers/auth/mbedtls/mbedtls_crypto.c
@@ -4,10 +4,6 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <crypto_mod.h>
-#include <debug.h>
-#include <mbedtls_common.h>
-#include <mbedtls_config.h>
#include <stddef.h>
#include <string.h>
@@ -17,6 +13,11 @@
#include <mbedtls/oid.h>
#include <mbedtls/platform.h>
+#include <common/debug.h>
+#include <drivers/auth/crypto_mod.h>
+#include <drivers/auth/mbedtls/mbedtls_common.h>
+#include <drivers/auth/mbedtls/mbedtls_config.h>
+
#define LIB_NAME "mbed TLS"
/*
diff --git a/drivers/auth/mbedtls/mbedtls_x509_parser.c b/drivers/auth/mbedtls/mbedtls_x509_parser.c
index bda1208af..129566bd6 100644
--- a/drivers/auth/mbedtls/mbedtls_x509_parser.c
+++ b/drivers/auth/mbedtls/mbedtls_x509_parser.c
@@ -12,20 +12,21 @@
* extensions field, such as an image hash or a public key.
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <img_parser_mod.h>
-#include <mbedtls_common.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
-#include <utils.h>
/* mbed TLS headers */
#include <mbedtls/asn1.h>
#include <mbedtls/oid.h>
#include <mbedtls/platform.h>
+#include <arch_helpers.h>
+#include <drivers/auth/img_parser_mod.h>
+#include <drivers/auth/mbedtls/mbedtls_common.h>
+#include <lib/utils.h>
+
/* Maximum OID string length ("a.b.c.d.e.f ...") */
#define MAX_OID_STR_LEN 64
diff --git a/drivers/auth/tbbr/tbbr_cot.c b/drivers/auth/tbbr/tbbr_cot.c
index a950a7a8d..ec14a185d 100644
--- a/drivers/auth/tbbr/tbbr_cot.c
+++ b/drivers/auth/tbbr/tbbr_cot.c
@@ -4,12 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <auth_mod.h>
-#include <platform_def.h>
#include <stddef.h>
+#include <platform_def.h>
+
+#include <drivers/auth/auth_mod.h>
#if USE_TBBR_DEFS
-#include <tbbr_oid.h>
+#include <tools_share/tbbr_oid.h>
#else
#include <platform_oid.h>
#endif
diff --git a/drivers/cadence/uart/aarch64/cdns_console.S b/drivers/cadence/uart/aarch64/cdns_console.S
index 418810e15..43d08f454 100644
--- a/drivers/cadence/uart/aarch64/cdns_console.S
+++ b/drivers/cadence/uart/aarch64/cdns_console.S
@@ -6,9 +6,9 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
-#include <cadence/cdns_uart.h>
#define USE_FINISH_CONSOLE_REG_2
#include <console_macros.S>
+#include <drivers/cadence/cdns_uart.h>
/*
* "core" functions are low-level implementations that don't require
diff --git a/drivers/cfi/v2m/v2m_flash.c b/drivers/cfi/v2m/v2m_flash.c
index 9b80e2f2a..aadafbce2 100644
--- a/drivers/cfi/v2m/v2m_flash.c
+++ b/drivers/cfi/v2m/v2m_flash.c
@@ -5,8 +5,9 @@
*/
#include <errno.h>
-#include <mmio.h>
-#include <v2m_flash.h>
+
+#include <drivers/cfi/v2m_flash.h>
+#include <lib/mmio.h>
/*
* This file supplies a low level interface to the vexpress NOR flash
diff --git a/drivers/console/multi_console.c b/drivers/console/multi_console.c
index c678de098..e94de35c7 100644
--- a/drivers/console/multi_console.c
+++ b/drivers/console/multi_console.c
@@ -7,6 +7,7 @@
#if MULTI_CONSOLE_API
#include <assert.h>
+
#include <drivers/console.h>
console_t *console_list;
diff --git a/drivers/coreboot/cbmem_console/aarch64/cbmem_console.S b/drivers/coreboot/cbmem_console/aarch64/cbmem_console.S
index 89be349c0..4c14b69c5 100644
--- a/drivers/coreboot/cbmem_console/aarch64/cbmem_console.S
+++ b/drivers/coreboot/cbmem_console/aarch64/cbmem_console.S
@@ -5,9 +5,9 @@
*/
#include <asm_macros.S>
-#include <cbmem_console.h>
#define USE_FINISH_CONSOLE_REG_2
#include <console_macros.S>
+#include <drivers/coreboot/cbmem_console.h>
/*
* This driver implements access to coreboot's in-memory console
diff --git a/drivers/delay_timer/delay_timer.c b/drivers/delay_timer/delay_timer.c
index feac3579f..8c2996ec3 100644
--- a/drivers/delay_timer/delay_timer.c
+++ b/drivers/delay_timer/delay_timer.c
@@ -5,9 +5,11 @@
*/
#include <assert.h>
-#include <delay_timer.h>
+
#include <platform_def.h>
-#include <utils_def.h>
+
+#include <drivers/delay_timer.h>
+#include <lib/utils_def.h>
/***********************************************************
* The delay timer implementation
diff --git a/drivers/delay_timer/generic_delay_timer.c b/drivers/delay_timer/generic_delay_timer.c
index 03ca5321a..4b67ed0d1 100644
--- a/drivers/delay_timer/generic_delay_timer.c
+++ b/drivers/delay_timer/generic_delay_timer.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <debug.h>
-#include <delay_timer.h>
-#include <generic_delay_timer.h>
-#include <platform.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/generic_delay_timer.h>
+#include <plat/common/platform.h>
/* Ticks elapsed in one second by a signal of 1 MHz */
#define MHZ_TICKS_PER_SEC 1000000
diff --git a/drivers/gpio/gpio.c b/drivers/gpio/gpio.c
index 62f3dc253..76612b253 100644
--- a/drivers/gpio/gpio.c
+++ b/drivers/gpio/gpio.c
@@ -11,7 +11,8 @@
#include <assert.h>
#include <errno.h>
-#include <gpio.h>
+
+#include <drivers/gpio.h>
/*
* The gpio implementation
diff --git a/drivers/imx/timer/imx_gpt.c b/drivers/imx/timer/imx_gpt.c
index bd364eb30..464efe93f 100644
--- a/drivers/imx/timer/imx_gpt.c
+++ b/drivers/imx/timer/imx_gpt.c
@@ -5,8 +5,10 @@
*/
#include <assert.h>
-#include <delay_timer.h>
-#include <mmio.h>
+
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
+
#include <imx_gpt.h>
#define GPTCR_SWR BIT(15) /* Software reset */
diff --git a/drivers/imx/uart/imx_uart.c b/drivers/imx/uart/imx_uart.c
index 0250a4142..68d31c887 100644
--- a/drivers/imx/uart/imx_uart.c
+++ b/drivers/imx/uart/imx_uart.c
@@ -3,10 +3,14 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
+
#include <stdint.h>
-#include <mmio.h>
+
#include <platform_def.h>
+
+#include <arch.h>
+#include <lib/mmio.h>
+
#include <imx_uart.h>
/* TX/RX FIFO threshold */
diff --git a/drivers/imx/usdhc/imx_usdhc.c b/drivers/imx/usdhc/imx_usdhc.c
index 1f9550e17..07f55b784 100644
--- a/drivers/imx/usdhc/imx_usdhc.c
+++ b/drivers/imx/usdhc/imx_usdhc.c
@@ -4,17 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <delay_timer.h>
-#include <imx_usdhc.h>
-#include <mmc.h>
#include <errno.h>
-#include <mmio.h>
#include <string.h>
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/mmc.h>
+#include <lib/mmio.h>
+
+#include <imx_usdhc.h>
+
static void imx_usdhc_initialize(void);
static int imx_usdhc_send_cmd(struct mmc_cmd *cmd);
static int imx_usdhc_set_ios(unsigned int clk, unsigned int width);
diff --git a/drivers/imx/usdhc/imx_usdhc.h b/drivers/imx/usdhc/imx_usdhc.h
index 9ff3298df..e063316ae 100644
--- a/drivers/imx/usdhc/imx_usdhc.h
+++ b/drivers/imx/usdhc/imx_usdhc.h
@@ -7,7 +7,7 @@
#ifndef IMX_USDHC_H
#define IMX_USDHC_H
-#include <mmc.h>
+#include <drivers/mmc.h>
typedef struct imx_usdhc_params {
uintptr_t reg_base;
diff --git a/drivers/io/io_block.c b/drivers/io/io_block.c
index ff13113af..f190a4307 100644
--- a/drivers/io/io_block.c
+++ b/drivers/io/io_block.c
@@ -5,14 +5,16 @@
*/
#include <assert.h>
-#include <debug.h>
#include <errno.h>
-#include <io_block.h>
-#include <io_driver.h>
-#include <io_storage.h>
-#include <platform_def.h>
#include <string.h>
-#include <utils.h>
+
+#include <platform_def.h>
+
+#include <common/debug.h>
+#include <drivers/io/io_block.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_storage.h>
+#include <lib/utils.h>
typedef struct {
io_block_dev_spec_t *dev_spec;
diff --git a/drivers/io/io_dummy.c b/drivers/io/io_dummy.c
index d4020e3a6..4f0cda6da 100644
--- a/drivers/io/io_dummy.c
+++ b/drivers/io/io_dummy.c
@@ -5,12 +5,13 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <io_driver.h>
-#include <io_dummy.h>
-#include <io_storage.h>
#include <string.h>
+#include <common/debug.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_dummy.h>
+#include <drivers/io/io_storage.h>
+
struct file_state {
int in_use;
size_t size;
diff --git a/drivers/io/io_fip.c b/drivers/io/io_fip.c
index 9d6c763e8..d4771b514 100644
--- a/drivers/io/io_fip.c
+++ b/drivers/io/io_fip.c
@@ -5,19 +5,21 @@
*/
#include <assert.h>
-#include <bl_common.h>
-#include <debug.h>
#include <errno.h>
-#include <firmware_image_package.h>
-#include <io_driver.h>
-#include <io_fip.h>
-#include <io_storage.h>
-#include <platform.h>
-#include <platform_def.h>
#include <stdint.h>
#include <string.h>
-#include <utils.h>
-#include <uuid.h>
+
+#include <platform_def.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_fip.h>
+#include <drivers/io/io_storage.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+#include <tools_share/firmware_image_package.h>
+#include <tools_share/uuid.h>
#ifndef MAX_FIP_DEVICES
#define MAX_FIP_DEVICES 1
diff --git a/drivers/io/io_memmap.c b/drivers/io/io_memmap.c
index 5595e60a4..96590b6c0 100644
--- a/drivers/io/io_memmap.c
+++ b/drivers/io/io_memmap.c
@@ -5,13 +5,15 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <io_driver.h>
-#include <io_memmap.h>
-#include <io_storage.h>
-#include <platform_def.h>
#include <string.h>
-#include <utils.h>
+
+#include <platform_def.h>
+
+#include <common/debug.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_memmap.h>
+#include <drivers/io/io_storage.h>
+#include <lib/utils.h>
/* As we need to be able to keep state for seek, only one file can be open
* at a time. Make this a structure and point to the entity->info. When we
diff --git a/drivers/io/io_semihosting.c b/drivers/io/io_semihosting.c
index 9ca0a9dc9..23d09c118 100644
--- a/drivers/io/io_semihosting.c
+++ b/drivers/io/io_semihosting.c
@@ -5,13 +5,13 @@
*/
#include <assert.h>
-#include <io_driver.h>
-#include <io_semihosting.h>
-#include <io_storage.h>
-#include <platform_def.h>
-#include <semihosting.h>
+#include <platform_def.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_semihosting.h>
+#include <drivers/io/io_storage.h>
+#include <lib/semihosting.h>
/* Identify the device type as semihosting */
static io_type_t device_type_sh(void)
diff --git a/drivers/io/io_storage.c b/drivers/io/io_storage.c
index 948f84813..c9ff31bcc 100644
--- a/drivers/io/io_storage.c
+++ b/drivers/io/io_storage.c
@@ -5,11 +5,12 @@
*/
#include <assert.h>
-#include <io_driver.h>
-#include <io_storage.h>
-#include <platform_def.h>
#include <stddef.h>
+#include <platform_def.h>
+
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_storage.h>
/* Storage for a fixed maximum number of IO entities, definable by platform */
static io_entity_t entity_pool[MAX_IO_HANDLES];
diff --git a/drivers/marvell/amb_adec.c b/drivers/marvell/amb_adec.c
index 16fe772da..1f671058d 100644
--- a/drivers/marvell/amb_adec.c
+++ b/drivers/marvell/amb_adec.c
@@ -7,9 +7,10 @@
/* AXI to M-Bridge decoding unit driver for Marvell Armada 8K and 8K+ SoCs */
+#include <common/debug.h>
+#include <lib/mmio.h>
+
#include <armada_common.h>
-#include <debug.h>
-#include <mmio.h>
#include <mvebu.h>
#include <mvebu_def.h>
diff --git a/drivers/marvell/ap807_clocks_init.c b/drivers/marvell/ap807_clocks_init.c
index 841e6aeb4..04c256b61 100644
--- a/drivers/marvell/ap807_clocks_init.c
+++ b/drivers/marvell/ap807_clocks_init.c
@@ -5,10 +5,11 @@
* https://spdx.org/licenses
*/
+#include <drivers/delay_timer.h>
+#include <drivers/marvell/aro.h>
+#include <lib/mmio.h>
+
#include <a8k_plat_def.h>
-#include <aro.h>
-#include <delay_timer.h>
-#include <mmio.h>
/* Notify bootloader on DRAM setup */
#define AP807_CPU_ARO_CTRL(cluster) \
diff --git a/drivers/marvell/cache_llc.c b/drivers/marvell/cache_llc.c
index e13e6ce2f..3df93a43b 100644
--- a/drivers/marvell/cache_llc.c
+++ b/drivers/marvell/cache_llc.c
@@ -9,11 +9,13 @@
* for Marvell SoCs in AP806, AP807, and AP810
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <cache_llc.h>
-#include <ccu.h>
-#include <mmio.h>
+
+#include <arch_helpers.h>
+#include <drivers/marvell/cache_llc.h>
+#include <drivers/marvell/ccu.h>
+#include <lib/mmio.h>
+
#include <mvebu_def.h>
#define CCU_HTC_CR(ap_index) (MVEBU_CCU_BASE(ap_index) + 0x200)
diff --git a/drivers/marvell/ccu.c b/drivers/marvell/ccu.c
index acb1c00c0..1e4ab44da 100644
--- a/drivers/marvell/ccu.c
+++ b/drivers/marvell/ccu.c
@@ -7,10 +7,11 @@
/* CCU unit device driver for Marvell AP807, AP807 and AP810 SoCs */
+#include <common/debug.h>
+#include <drivers/marvell/ccu.h>
+#include <lib/mmio.h>
+
#include <armada_common.h>
-#include <ccu.h>
-#include <debug.h>
-#include <mmio.h>
#include <mvebu.h>
#include <mvebu_def.h>
diff --git a/drivers/marvell/comphy/phy-comphy-3700.c b/drivers/marvell/comphy/phy-comphy-3700.c
index 53a59b0f5..2e8c4128e 100644
--- a/drivers/marvell/comphy/phy-comphy-3700.c
+++ b/drivers/marvell/comphy/phy-comphy-3700.c
@@ -5,13 +5,16 @@
* https://spdx.org/licenses
*/
-#include <debug.h>
-#include <delay_timer.h>
#include <errno.h>
-#include <mmio.h>
+
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
+#include <lib/spinlock.h>
+
#include <mvebu.h>
#include <mvebu_def.h>
-#include <spinlock.h>
+
#include "phy-comphy-3700.h"
#include "phy-comphy-common.h"
diff --git a/drivers/marvell/comphy/phy-comphy-cp110.c b/drivers/marvell/comphy/phy-comphy-cp110.c
index 86e5f1c68..384dd39f2 100644
--- a/drivers/marvell/comphy/phy-comphy-cp110.c
+++ b/drivers/marvell/comphy/phy-comphy-cp110.c
@@ -7,12 +7,14 @@
/* Marvell CP110 SoC COMPHY unit driver */
-#include <debug.h>
-#include <delay_timer.h>
#include <errno.h>
-#include <mmio.h>
+
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
+#include <lib/spinlock.h>
+
#include <mvebu_def.h>
-#include <spinlock.h>
#include "mvebu.h"
#include "comphy-cp110.h"
#include "phy-comphy-cp110.h"
diff --git a/drivers/marvell/gwin.c b/drivers/marvell/gwin.c
index a4743eb5e..9d9430836 100644
--- a/drivers/marvell/gwin.c
+++ b/drivers/marvell/gwin.c
@@ -7,10 +7,11 @@
/* GWIN unit device driver for Marvell AP810 SoC */
+#include <common/debug.h>
+#include <drivers/marvell/gwin.h>
+#include <lib/mmio.h>
+
#include <armada_common.h>
-#include <debug.h>
-#include <gwin.h>
-#include <mmio.h>
#include <mvebu.h>
#include <mvebu_def.h>
diff --git a/drivers/marvell/io_win.c b/drivers/marvell/io_win.c
index c0424e086..c4257fa7c 100644
--- a/drivers/marvell/io_win.c
+++ b/drivers/marvell/io_win.c
@@ -7,10 +7,11 @@
/* IO Window unit device driver for Marvell AP807, AP807 and AP810 SoCs */
+#include <common/debug.h>
+#include <drivers/marvell/io_win.h>
+#include <lib/mmio.h>
+
#include <armada_common.h>
-#include <debug.h>
-#include <io_win.h>
-#include <mmio.h>
#include <mvebu.h>
#include <mvebu_def.h>
diff --git a/drivers/marvell/iob.c b/drivers/marvell/iob.c
index e88bc1673..87f147aa4 100644
--- a/drivers/marvell/iob.c
+++ b/drivers/marvell/iob.c
@@ -7,11 +7,12 @@
/* IOW unit device driver for Marvell CP110 and CP115 SoCs */
-#include <armada_common.h>
#include <arch_helpers.h>
-#include <debug.h>
-#include <iob.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <drivers/marvell/iob.h>
+#include <lib/mmio.h>
+
+#include <armada_common.h>
#include <mvebu.h>
#include <mvebu_def.h>
diff --git a/drivers/marvell/mc_trustzone/mc_trustzone.c b/drivers/marvell/mc_trustzone/mc_trustzone.c
index 0db3b8d09..52b300676 100644
--- a/drivers/marvell/mc_trustzone/mc_trustzone.c
+++ b/drivers/marvell/mc_trustzone/mc_trustzone.c
@@ -5,10 +5,12 @@
* https://spdx.org/licenses
*/
-#include <addr_map.h>
-#include <debug.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <drivers/marvell/addr_map.h>
+#include <lib/mmio.h>
+
#include <mvebu_def.h>
+
#include "mc_trustzone.h"
#define TZ_SIZE(x) ((x) >> 13)
diff --git a/drivers/marvell/mc_trustzone/mc_trustzone.h b/drivers/marvell/mc_trustzone/mc_trustzone.h
index d36dcb5c0..296dce853 100644
--- a/drivers/marvell/mc_trustzone/mc_trustzone.h
+++ b/drivers/marvell/mc_trustzone/mc_trustzone.h
@@ -8,7 +8,7 @@
#ifndef MC_TRUSTZONE_H
#define MC_TRUSTZONE_H
-#include <addr_map.h>
+#include <drivers/marvell/addr_map.h>
#define MVEBU_TZ_MAX_WINS 16
diff --git a/drivers/marvell/mci.c b/drivers/marvell/mci.c
index 721504e03..3a9859c98 100644
--- a/drivers/marvell/mci.c
+++ b/drivers/marvell/mci.c
@@ -7,10 +7,11 @@
/* MCI bus driver for Marvell ARMADA 8K and 8K+ SoCs */
-#include <debug.h>
-#include <delay_timer.h>
-#include <mmio.h>
-#include <mci.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/marvell/mci.h>
+#include <lib/mmio.h>
+
#include <mvebu.h>
#include <mvebu_def.h>
#include <plat_marvell.h>
diff --git a/drivers/marvell/mochi/ap807_setup.c b/drivers/marvell/mochi/ap807_setup.c
index 075ca31f8..864c9230a 100644
--- a/drivers/marvell/mochi/ap807_setup.c
+++ b/drivers/marvell/mochi/ap807_setup.c
@@ -7,13 +7,14 @@
/* AP807 Marvell SoC driver */
-#include <ap_setup.h>
-#include <cache_llc.h>
-#include <ccu.h>
-#include <debug.h>
-#include <io_win.h>
-#include <mci.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <drivers/marvell/cache_llc.h>
+#include <drivers/marvell/ccu.h>
+#include <drivers/marvell/io_win.h>
+#include <drivers/marvell/mci.h>
+#include <drivers/marvell/mochi/ap_setup.h>
+#include <lib/mmio.h>
+
#include <mvebu_def.h>
#define SMMU_sACR (MVEBU_SMMU_BASE + 0x10)
diff --git a/drivers/marvell/mochi/apn806_setup.c b/drivers/marvell/mochi/apn806_setup.c
index 1d33be93a..1e91c4317 100644
--- a/drivers/marvell/mochi/apn806_setup.c
+++ b/drivers/marvell/mochi/apn806_setup.c
@@ -7,13 +7,14 @@
/* AP806 Marvell SoC driver */
-#include <ap_setup.h>
-#include <ccu.h>
-#include <cache_llc.h>
-#include <debug.h>
-#include <io_win.h>
-#include <mci.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <drivers/marvell/ccu.h>
+#include <drivers/marvell/cache_llc.h>
+#include <drivers/marvell/io_win.h>
+#include <drivers/marvell/mci.h>
+#include <drivers/marvell/mochi/ap_setup.h>
+#include <lib/mmio.h>
+
#include <mvebu_def.h>
#define SMMU_sACR (MVEBU_SMMU_BASE + 0x10)
diff --git a/drivers/marvell/mochi/cp110_setup.c b/drivers/marvell/mochi/cp110_setup.c
index 654bb62b2..d7d737318 100644
--- a/drivers/marvell/mochi/cp110_setup.c
+++ b/drivers/marvell/mochi/cp110_setup.c
@@ -7,11 +7,12 @@
/* CP110 Marvell SoC driver */
-#include <amb_adec.h>
-#include <cp110_setup.h>
-#include <debug.h>
-#include <delay_timer.h>
-#include <iob.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/marvell/amb_adec.h>
+#include <drivers/marvell/iob.h>
+#include <drivers/marvell/mochi/cp110_setup.h>
+
#include <plat_marvell.h>
/*
diff --git a/drivers/marvell/thermal.c b/drivers/marvell/thermal.c
index c7ceb9291..a501ab44e 100644
--- a/drivers/marvell/thermal.c
+++ b/drivers/marvell/thermal.c
@@ -7,8 +7,8 @@
/* Driver for thermal unit located in Marvell ARMADA 8K and compatible SoCs */
-#include <debug.h>
-#include <thermal.h>
+#include <common/debug.h>
+#include <drivers/marvell/thermal.h>
int marvell_thermal_init(struct tsen_config *tsen_cfg)
{
diff --git a/drivers/marvell/uart/a3700_console.S b/drivers/marvell/uart/a3700_console.S
index 25c21cfcd..cc3855dbb 100644
--- a/drivers/marvell/uart/a3700_console.S
+++ b/drivers/marvell/uart/a3700_console.S
@@ -7,9 +7,9 @@
#include <arch.h>
#include <asm_macros.S>
-#include <a3700_console.h>
#define USE_FINISH_CONSOLE_REG_2
#include <console_macros.S>
+#include <drivers/marvell/uart/a3700_console.h>
/*
* "core" functions are low-level implementations that don't require
diff --git a/drivers/mentor/i2c/mi2cv.c b/drivers/mentor/i2c/mi2cv.c
index 8ebd9662b..1cdcf7478 100644
--- a/drivers/mentor/i2c/mi2cv.c
+++ b/drivers/mentor/i2c/mi2cv.c
@@ -11,12 +11,14 @@
* for Marvell and Allwinner SoCs in ATF.
*/
-#include <debug.h>
-#include <delay_timer.h>
#include <errno.h>
-#include <mentor/mi2cv.h>
+
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/mentor/mi2cv.h>
+#include <lib/mmio.h>
+
#include <mentor_i2c_plat.h>
-#include <mmio.h>
#if LOG_LEVEL >= LOG_LEVEL_VERBOSE
#define DEBUG_I2C
diff --git a/drivers/meson/console/aarch64/meson_console.S b/drivers/meson/console/aarch64/meson_console.S
index eaee10ef1..5cf9b8878 100644
--- a/drivers/meson/console/aarch64/meson_console.S
+++ b/drivers/meson/console/aarch64/meson_console.S
@@ -8,7 +8,7 @@
#include <assert_macros.S>
#define USE_FINISH_CONSOLE_REG_2
#include <console_macros.S>
-#include <meson_console.h>
+#include <drivers/meson/meson_console.h>
.globl console_meson_register
.globl console_meson_init
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 4160003c8..50e87c1db 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -6,15 +6,16 @@
/* Define a simple and generic interface to access eMMC and SD-card devices. */
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <delay_timer.h>
#include <errno.h>
-#include <mmc.h>
#include <stdbool.h>
#include <string.h>
-#include <utils.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/mmc.h>
+#include <lib/utils.h>
#define MMC_DEFAULT_MAX_RETRIES 5
#define SEND_OP_COND_MAX_RETRIES 100
diff --git a/drivers/partition/gpt.c b/drivers/partition/gpt.c
index 0c51e62a8..4577f06a2 100644
--- a/drivers/partition/gpt.c
+++ b/drivers/partition/gpt.c
@@ -5,11 +5,12 @@
*/
#include <assert.h>
-#include <debug.h>
#include <errno.h>
-#include <gpt.h>
#include <string.h>
-#include <utils.h>
+
+#include <common/debug.h>
+#include <drivers/partition/gpt.h>
+#include <lib/utils.h>
static int unicode_to_ascii(unsigned short *str_in, unsigned char *str_out)
{
diff --git a/drivers/partition/partition.c b/drivers/partition/partition.c
index 6085b8651..07869acf5 100644
--- a/drivers/partition/partition.c
+++ b/drivers/partition/partition.c
@@ -5,15 +5,16 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <gpt.h>
-#include <io_storage.h>
-#include <mbr.h>
-#include <partition.h>
-#include <platform.h>
#include <stdio.h>
#include <string.h>
+#include <common/debug.h>
+#include <drivers/io/io_storage.h>
+#include <drivers/partition/partition.h>
+#include <drivers/partition/gpt.h>
+#include <drivers/partition/mbr.h>
+#include <plat/common/platform.h>
+
static uint8_t mbr_sector[PARTITION_BLOCK_SIZE];
partition_entry_list_t list;
diff --git a/drivers/renesas/rcar/auth/auth_mod.c b/drivers/renesas/rcar/auth/auth_mod.c
index 04ed27928..d9446d95e 100644
--- a/drivers/renesas/rcar/auth/auth_mod.c
+++ b/drivers/renesas/rcar/auth/auth_mod.c
@@ -5,13 +5,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <debug.h>
-#include <mmio.h>
-#include <platform.h>
-#include <platform_def.h>
#include <stddef.h>
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
#include "rom_api.h"
typedef int32_t(*secure_boot_api_f) (uint32_t a, uint32_t b, void *c);
diff --git a/drivers/renesas/rcar/avs/avs_driver.c b/drivers/renesas/rcar/avs/avs_driver.c
index 80a7c9190..647869ede 100644
--- a/drivers/renesas/rcar/avs/avs_driver.c
+++ b/drivers/renesas/rcar/avs/avs_driver.c
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
-#include <debug.h>
-#include <utils_def.h>
+#include <common/debug.h>
+#include <lib/mmio.h>
+#include <lib/utils_def.h>
+
#include "cpg_registers.h"
#include "avs_driver.h"
#include "rcar_def.h"
diff --git a/drivers/renesas/rcar/board/board.c b/drivers/renesas/rcar/board/board.c
index 147a0b0c3..f15e06bc0 100644
--- a/drivers/renesas/rcar/board/board.c
+++ b/drivers/renesas/rcar/board/board.c
@@ -6,9 +6,12 @@
*/
#include <stdint.h>
+
+#include <lib/utils_def.h>
+
#include <iic_dvfs.h>
+
#include "board.h"
-#include "utils_def.h"
#ifndef BOARD_DEFAULT
#if (RCAR_LSI == RCAR_E3)
diff --git a/drivers/renesas/rcar/common.c b/drivers/renesas/rcar/common.c
index e82e8b521..42bdce579 100644
--- a/drivers/renesas/rcar/common.c
+++ b/drivers/renesas/rcar/common.c
@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
+#include <lib/mmio.h>
+
#include "rcar_private.h"
void
diff --git a/drivers/renesas/rcar/console/rcar_printf.c b/drivers/renesas/rcar/console/rcar_printf.c
index 9321b584a..2a6e2c003 100644
--- a/drivers/renesas/rcar/console/rcar_printf.c
+++ b/drivers/renesas/rcar/console/rcar_printf.c
@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
#include <stdarg.h>
#include <stdint.h>
-#include <arch_helpers.h>
-#include <platform_def.h>
-#include <bakery_lock.h>
-#include "rcar_def.h"
-#include "rcar_private.h"
-#include "rcar_printf.h"
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/bakery_lock.h>
+
+#include "rcar_def.h"
+#include "rcar_private.h"
+#include "rcar_printf.h"
#define INDEX_TIMER_COUNT (4U)
diff --git a/drivers/renesas/rcar/cpld/ulcb_cpld.c b/drivers/renesas/rcar/cpld/ulcb_cpld.c
index 92e438a4f..d7192f48d 100644
--- a/drivers/renesas/rcar/cpld/ulcb_cpld.c
+++ b/drivers/renesas/rcar/cpld/ulcb_cpld.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
+#include <lib/mmio.h>
#define SCLK 8 /* GP_6_8 */
#define SSTBZ 3 /* GP_2_3 */
diff --git a/drivers/renesas/rcar/delay/micro_delay.h b/drivers/renesas/rcar/delay/micro_delay.h
index 458959fd8..4e4b28bab 100644
--- a/drivers/renesas/rcar/delay/micro_delay.h
+++ b/drivers/renesas/rcar/delay/micro_delay.h
@@ -10,7 +10,7 @@
#define TMU3_MEASUREMENT (0)
#ifndef __ASSEMBLY__
-#include "stdint.h"
+#include <stdint.h>
void rcar_micro_delay(uint32_t count_us);
#if (TMU3_MEASUREMENT == 1)
diff --git a/drivers/renesas/rcar/dma/dma_driver.c b/drivers/renesas/rcar/dma/dma_driver.c
index d4fa65d26..fef55c477 100644
--- a/drivers/renesas/rcar/dma/dma_driver.c
+++ b/drivers/renesas/rcar/dma/dma_driver.c
@@ -5,12 +5,14 @@
*/
#include <stdint.h>
-#include <arch_helpers.h>
#include <string.h>
-#include <mmio.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/mmio.h>
+
#include "rcar_def.h"
#include "cpg_registers.h"
-#include "debug.h"
#include "rcar_private.h"
/* DMA CHANNEL setting (0/16/32) */
diff --git a/drivers/renesas/rcar/emmc/emmc_cmd.c b/drivers/renesas/rcar/emmc/emmc_cmd.c
index 0f393490c..a2e25e339 100644
--- a/drivers/renesas/rcar/emmc/emmc_cmd.c
+++ b/drivers/renesas/rcar/emmc/emmc_cmd.c
@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
+#include <common/debug.h>
+
#include "emmc_config.h"
#include "emmc_hal.h"
#include "emmc_std.h"
diff --git a/drivers/renesas/rcar/emmc/emmc_init.c b/drivers/renesas/rcar/emmc/emmc_init.c
index 386fb1e4e..b27e16586 100644
--- a/drivers/renesas/rcar/emmc/emmc_init.c
+++ b/drivers/renesas/rcar/emmc/emmc_init.c
@@ -5,7 +5,9 @@
*/
#include <stddef.h>
-#include <mmio.h>
+
+#include <lib/mmio.h>
+
#include "emmc_config.h"
#include "emmc_hal.h"
#include "emmc_std.h"
diff --git a/drivers/renesas/rcar/emmc/emmc_interrupt.c b/drivers/renesas/rcar/emmc/emmc_interrupt.c
index 3077db4c0..37a3cf9d4 100644
--- a/drivers/renesas/rcar/emmc/emmc_interrupt.c
+++ b/drivers/renesas/rcar/emmc/emmc_interrupt.c
@@ -5,6 +5,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stddef.h>
+
+#include <lib/mmio.h>
#include "emmc_config.h"
#include "emmc_def.h"
@@ -13,9 +16,6 @@
#include "emmc_std.h"
#include "rcar_def.h"
-#include <mmio.h>
-#include <stddef.h>
-
static EMMC_ERROR_CODE emmc_trans_sector(uint32_t *buff_address_virtual);
uint32_t emmc_interrupt(void)
diff --git a/drivers/renesas/rcar/emmc/emmc_mount.c b/drivers/renesas/rcar/emmc/emmc_mount.c
index 9a7d2cad6..dd57b0c24 100644
--- a/drivers/renesas/rcar/emmc/emmc_mount.c
+++ b/drivers/renesas/rcar/emmc/emmc_mount.c
@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <lib/mmio.h>
+
#include "emmc_config.h"
#include "emmc_hal.h"
#include "emmc_std.h"
diff --git a/drivers/renesas/rcar/emmc/emmc_read.c b/drivers/renesas/rcar/emmc/emmc_read.c
index b11c2c43e..390d0caac 100644
--- a/drivers/renesas/rcar/emmc/emmc_read.c
+++ b/drivers/renesas/rcar/emmc/emmc_read.c
@@ -3,7 +3,9 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <arch_helpers.h>
+
#include "emmc_config.h"
#include "emmc_hal.h"
#include "emmc_std.h"
diff --git a/drivers/renesas/rcar/emmc/emmc_utility.c b/drivers/renesas/rcar/emmc/emmc_utility.c
index e64947ddc..39d9ede5a 100644
--- a/drivers/renesas/rcar/emmc/emmc_utility.c
+++ b/drivers/renesas/rcar/emmc/emmc_utility.c
@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
+#include <common/debug.h>
+
#include "emmc_config.h"
#include "emmc_hal.h"
#include "emmc_std.h"
diff --git a/drivers/renesas/rcar/iic_dvfs/iic_dvfs.c b/drivers/renesas/rcar/iic_dvfs/iic_dvfs.c
index 11d52bf76..39b9bb4e3 100644
--- a/drivers/renesas/rcar/iic_dvfs/iic_dvfs.c
+++ b/drivers/renesas/rcar/iic_dvfs/iic_dvfs.c
@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
-#include <debug.h>
+#include <common/debug.h>
+#include <lib/mmio.h>
+
#include "rcar_def.h"
#include "cpg_registers.h"
#include "iic_dvfs.h"
diff --git a/drivers/renesas/rcar/io/io_emmcdrv.c b/drivers/renesas/rcar/io/io_emmcdrv.c
index f74bd5f4e..4b464fb3e 100644
--- a/drivers/renesas/rcar/io/io_emmcdrv.c
+++ b/drivers/renesas/rcar/io/io_emmcdrv.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <io_driver.h>
-#include <io_storage.h>
#include <string.h>
+#include <common/debug.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_storage.h>
+
#include "io_common.h"
#include "io_emmcdrv.h"
#include "io_private.h"
diff --git a/drivers/renesas/rcar/io/io_memdrv.c b/drivers/renesas/rcar/io/io_memdrv.c
index e55fd6466..3f6b4c71b 100644
--- a/drivers/renesas/rcar/io/io_memdrv.c
+++ b/drivers/renesas/rcar/io/io_memdrv.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <io_driver.h>
-#include <io_storage.h>
#include <string.h>
+#include <common/debug.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_storage.h>
+
#include "io_common.h"
#include "io_private.h"
#include "io_memdrv.h"
diff --git a/drivers/renesas/rcar/io/io_rcar.c b/drivers/renesas/rcar/io/io_rcar.c
index 4293c51c5..650931bb4 100644
--- a/drivers/renesas/rcar/io/io_rcar.c
+++ b/drivers/renesas/rcar/io/io_rcar.c
@@ -4,23 +4,27 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <auth_mod.h>
-#include <bl_common.h>
-#include <debug.h>
#include <errno.h>
-#include <firmware_image_package.h>
-#include <io_driver.h>
-#include <io_storage.h>
-#include <platform.h>
-#include <platform_def.h>
#include <stdint.h>
#include <string.h>
-#include <uuid.h>
-#include <mmio.h>
+
+#include <platform_def.h>
+
#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/auth/auth_mod.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_storage.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+#include <tools_share/firmware_image_package.h>
+#include <tools_share/uuid.h>
+
#include "io_rcar.h"
#include "io_common.h"
#include "io_private.h"
+
extern int32_t plat_get_drv_source(uint32_t id, uintptr_t *dev,
uintptr_t *image_spec);
diff --git a/drivers/renesas/rcar/pwrc/pwrc.c b/drivers/renesas/rcar/pwrc/pwrc.c
index 6dfc0b69f..8cdfe75e5 100644
--- a/drivers/renesas/rcar/pwrc/pwrc.c
+++ b/drivers/renesas/rcar/pwrc/pwrc.c
@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <bakery_lock.h>
-#include <debug.h>
-#include <mmio.h>
#include <string.h>
-#include <xlat_tables_v2.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/bakery_lock.h>
+#include <lib/mmio.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
+
#include "iic_dvfs.h"
#include "rcar_def.h"
#include "rcar_private.h"
diff --git a/drivers/renesas/rcar/rom/rom_api.c b/drivers/renesas/rcar/rom/rom_api.c
index c14de55b6..be38fbff3 100644
--- a/drivers/renesas/rcar/rom/rom_api.c
+++ b/drivers/renesas/rcar/rom/rom_api.c
@@ -4,8 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
#include <stdint.h>
+
+#include <lib/mmio.h>
+
#include "rcar_def.h"
#include "rom_api.h"
diff --git a/drivers/renesas/rcar/rpc/rpc_driver.c b/drivers/renesas/rcar/rpc/rpc_driver.c
index bc7424ac6..bea275210 100644
--- a/drivers/renesas/rcar/rpc/rpc_driver.c
+++ b/drivers/renesas/rcar/rpc/rpc_driver.c
@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
#include <stdint.h>
#include <string.h>
+
+#include <common/debug.h>
+#include <lib/mmio.h>
+
#include "cpg_registers.h"
#include "rpc_registers.h"
-#include "debug.h"
#include "rcar_private.h"
#define MSTPSR9_RPC_BIT (0x00020000U)
diff --git a/drivers/renesas/rcar/watchdog/swdt.c b/drivers/renesas/rcar/watchdog/swdt.c
index f9dbf86fe..42f865349 100644
--- a/drivers/renesas/rcar/watchdog/swdt.c
+++ b/drivers/renesas/rcar/watchdog/swdt.c
@@ -5,9 +5,10 @@
*/
#include <arch_helpers.h>
-#include <debug.h>
-#include <gicv2.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <drivers/arm/gicv2.h>
+#include <lib/mmio.h>
+
#include "rcar_def.h"
extern void gicd_set_icenabler(uintptr_t base, unsigned int id);
diff --git a/drivers/st/clk/stm32mp1_clk.c b/drivers/st/clk/stm32mp1_clk.c
index b8457cb37..7a8898672 100644
--- a/drivers/st/clk/stm32mp1_clk.c
+++ b/drivers/st/clk/stm32mp1_clk.c
@@ -4,26 +4,29 @@
* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <delay_timer.h>
-#include <dt-bindings/clock/stm32mp1-clks.h>
-#include <dt-bindings/clock/stm32mp1-clksrc.h>
#include <errno.h>
-#include <generic_delay_timer.h>
-#include <libfdt.h>
-#include <mmio.h>
-#include <platform.h>
#include <stdint.h>
#include <stdio.h>
-#include <stm32mp1_clk.h>
-#include <stm32mp1_clkfunc.h>
+
+#include <libfdt.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/generic_delay_timer.h>
+#include <drivers/st/stm32mp1_clk.h>
+#include <drivers/st/stm32mp1_clkfunc.h>
+#include <drivers/st/stm32mp1_rcc.h>
+#include <dt-bindings/clock/stm32mp1-clks.h>
+#include <dt-bindings/clock/stm32mp1-clksrc.h>
+#include <lib/mmio.h>
+#include <lib/utils_def.h>
+#include <plat/common/platform.h>
+
#include <stm32mp1_dt.h>
#include <stm32mp1_private.h>
-#include <stm32mp1_rcc.h>
-#include <utils_def.h>
#define MAX_HSI_HZ 64000000
diff --git a/drivers/st/clk/stm32mp1_clkfunc.c b/drivers/st/clk/stm32mp1_clkfunc.c
index 078d803e7..179191945 100644
--- a/drivers/st/clk/stm32mp1_clkfunc.c
+++ b/drivers/st/clk/stm32mp1_clkfunc.c
@@ -4,11 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <dt-bindings/clock/stm32mp1-clksrc.h>
#include <errno.h>
+
#include <libfdt.h>
-#include <stm32mp1_clk.h>
-#include <stm32mp1_clkfunc.h>
+
+#include <drivers/st/stm32mp1_clk.h>
+#include <drivers/st/stm32mp1_clkfunc.h>
+#include <dt-bindings/clock/stm32mp1-clksrc.h>
+
#include <stm32mp1_dt.h>
#define DT_RCC_NODE_NAME "rcc@50000000"
diff --git a/drivers/st/ddr/stm32mp1_ddr.c b/drivers/st/ddr/stm32mp1_ddr.c
index eed1d7613..a2b0e9ec0 100644
--- a/drivers/st/ddr/stm32mp1_ddr.c
+++ b/drivers/st/ddr/stm32mp1_ddr.c
@@ -4,22 +4,25 @@
* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
*/
+#include <stddef.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <debug.h>
-#include <delay_timer.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/st/stm32mp1_clk.h>
+#include <drivers/st/stm32mp1_ddr.h>
+#include <drivers/st/stm32mp1_ddr_regs.h>
+#include <drivers/st/stm32mp1_pmic.h>
+#include <drivers/st/stm32mp1_pwr.h>
+#include <drivers/st/stm32mp1_ram.h>
+#include <drivers/st/stm32mp1_rcc.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
-#include <mmio.h>
-#include <platform.h>
-#include <stddef.h>
-#include <stm32mp1_clk.h>
-#include <stm32mp1_ddr.h>
-#include <stm32mp1_ddr_regs.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
+#include <stm32mp1_def.h>
#include <stm32mp1_dt.h>
-#include <stm32mp1_pmic.h>
-#include <stm32mp1_pwr.h>
-#include <stm32mp1_ram.h>
-#include <stm32mp1_rcc.h>
struct reg_desc {
const char *name;
diff --git a/drivers/st/ddr/stm32mp1_ddr_helpers.c b/drivers/st/ddr/stm32mp1_ddr_helpers.c
index 325c0b897..a8c1b7769 100644
--- a/drivers/st/ddr/stm32mp1_ddr_helpers.c
+++ b/drivers/st/ddr/stm32mp1_ddr_helpers.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
#include <platform_def.h>
-#include <stm32mp1_ddr_helpers.h>
-#include <stm32mp1_rcc.h>
+
+#include <drivers/st/stm32mp1_ddr_helpers.h>
+#include <drivers/st/stm32mp1_rcc.h>
+#include <lib/mmio.h>
void ddr_enable_clock(void)
{
diff --git a/drivers/st/ddr/stm32mp1_ram.c b/drivers/st/ddr/stm32mp1_ram.c
index 6d515ec76..1c8217917 100644
--- a/drivers/st/ddr/stm32mp1_ram.c
+++ b/drivers/st/ddr/stm32mp1_ram.c
@@ -4,21 +4,25 @@
* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <boot_api.h>
-#include <debug.h>
-#include <dt-bindings/clock/stm32mp1-clks.h>
#include <errno.h>
+
#include <libfdt.h>
-#include <mmio.h>
+
#include <platform_def.h>
-#include <stm32mp1_clk.h>
-#include <stm32mp1_ddr.h>
-#include <stm32mp1_ddr_helpers.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/st/stm32mp1_clk.h>
+#include <drivers/st/stm32mp1_ddr.h>
+#include <drivers/st/stm32mp1_ddr_helpers.h>
+#include <drivers/st/stm32mp1_ram.h>
+#include <drivers/st/stm32mp1_rcc.h>
+#include <dt-bindings/clock/stm32mp1-clks.h>
+#include <lib/mmio.h>
+
+#include <boot_api.h>
#include <stm32mp1_dt.h>
#include <stm32mp1_private.h>
-#include <stm32mp1_ram.h>
-#include <stm32mp1_rcc.h>
#define DDR_PATTERN 0xAAAAAAAAU
#define DDR_ANTIPATTERN 0x55555555U
diff --git a/drivers/st/gpio/stm32_gpio.c b/drivers/st/gpio/stm32_gpio.c
index 200b47340..9591e3738 100644
--- a/drivers/st/gpio/stm32_gpio.c
+++ b/drivers/st/gpio/stm32_gpio.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
-#include <debug.h>
-#include <mmio.h>
#include <stdbool.h>
-#include <stm32_gpio.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/st/stm32_gpio.h>
+#include <lib/mmio.h>
static bool check_gpio(uint32_t bank, uint32_t pin)
{
diff --git a/drivers/st/io/io_mmc.c b/drivers/st/io/io_mmc.c
index 1ed262057..a239b5f3a 100644
--- a/drivers/st/io/io_mmc.c
+++ b/drivers/st/io/io_mmc.c
@@ -5,15 +5,16 @@
*/
#include <assert.h>
-#include <debug.h>
#include <errno.h>
-#include <io_driver.h>
-#include <io_mmc.h>
-#include <io_storage.h>
-#include <mmc.h>
-#include <stm32_sdmmc2.h>
#include <string.h>
+#include <common/debug.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_storage.h>
+#include <drivers/mmc.h>
+#include <drivers/st/io_mmc.h>
+#include <drivers/st/stm32_sdmmc2.h>
+
/* SDMMC device functions */
static int mmc_dev_open(const uintptr_t init_params, io_dev_info_t **dev_info);
static int mmc_block_open(io_dev_info_t *dev_info, const uintptr_t spec,
diff --git a/drivers/st/io/io_stm32image.c b/drivers/st/io/io_stm32image.c
index e6798e047..ba612e2e9 100644
--- a/drivers/st/io/io_stm32image.c
+++ b/drivers/st/io/io_stm32image.c
@@ -5,17 +5,20 @@
*/
#include <assert.h>
-#include <boot_api.h>
-#include <debug.h>
#include <errno.h>
-#include <io_driver.h>
-#include <io_stm32image.h>
-#include <io_storage.h>
-#include <platform.h>
-#include <platform_def.h>
#include <stdint.h>
#include <string.h>
-#include <utils.h>
+
+#include <platform_def.h>
+
+#include <common/debug.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_storage.h>
+#include <drivers/st/io_stm32image.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+
+#include <boot_api.h>
static uintptr_t backend_dev_handle;
static uintptr_t backend_image_spec;
diff --git a/drivers/st/mmc/stm32_sdmmc2.c b/drivers/st/mmc/stm32_sdmmc2.c
index db5158156..787241d59 100644
--- a/drivers/st/mmc/stm32_sdmmc2.c
+++ b/drivers/st/mmc/stm32_sdmmc2.c
@@ -4,25 +4,27 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+#include <errno.h>
+#include <string.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <debug.h>
-#include <delay_timer.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/mmc.h>
+#include <drivers/st/stm32_sdmmc2.h>
+#include <drivers/st/stm32mp1_clk.h>
+#include <drivers/st/stm32mp1_rcc.h>
+#include <drivers/st/stm32mp1_reset.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <dt-bindings/reset/stm32mp1-resets.h>
-#include <errno.h>
#include <libfdt.h>
-#include <mmc.h>
-#include <mmio.h>
-#include <platform.h>
-#include <stm32_sdmmc2.h>
-#include <stm32mp1_clk.h>
+#include <lib/mmio.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+
#include <stm32mp1_dt.h>
-#include <stm32mp1_rcc.h>
-#include <stm32mp1_reset.h>
-#include <string.h>
-#include <utils.h>
/* Registers offsets */
#define SDMMC_POWER 0x00U
diff --git a/drivers/st/pmic/stm32_i2c.c b/drivers/st/pmic/stm32_i2c.c
index 098013947..f861ba296 100644
--- a/drivers/st/pmic/stm32_i2c.c
+++ b/drivers/st/pmic/stm32_i2c.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <delay_timer.h>
#include <errno.h>
-#include <mmio.h>
#include <stdbool.h>
#include <stdlib.h>
-#include <stm32_i2c.h>
+
+#include <arch_helpers.h>
+#include <drivers/delay_timer.h>
+#include <drivers/st/stm32_i2c.h>
+#include <lib/mmio.h>
/* STM32 I2C registers offsets */
#define I2C_CR1 0x00U
diff --git a/drivers/st/pmic/stm32mp1_pmic.c b/drivers/st/pmic/stm32mp1_pmic.c
index 958de08d9..ee4402762 100644
--- a/drivers/st/pmic/stm32mp1_pmic.c
+++ b/drivers/st/pmic/stm32mp1_pmic.c
@@ -4,20 +4,24 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <delay_timer.h>
#include <errno.h>
+#include <stdbool.h>
+
#include <libfdt.h>
-#include <mmio.h>
-#include <mmio.h>
+
#include <platform_def.h>
-#include <stdbool.h>
-#include <stm32_gpio.h>
-#include <stm32mp1_clk.h>
+
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/st/stm32_gpio.h>
+#include <drivers/st/stm32mp1_clk.h>
+#include <drivers/st/stm32mp1_pmic.h>
+#include <drivers/st/stpmu1.h>
+#include <lib/mmio.h>
+#include <lib/utils_def.h>
+
+#include <stm32mp1_def.h>
#include <stm32mp1_dt.h>
-#include <stm32mp1_pmic.h>
-#include <stpmu1.h>
-#include <utils_def.h>
/* I2C Timing hard-coded value, for I2C clock source is HSI at 64MHz */
#define I2C_TIMING 0x10D07DB5
diff --git a/drivers/st/pmic/stpmu1.c b/drivers/st/pmic/stpmu1.c
index 5951899a1..9c36bf64a 100644
--- a/drivers/st/pmic/stpmu1.c
+++ b/drivers/st/pmic/stpmu1.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <platform.h>
-#include <stpmu1.h>
#include <string.h>
+#include <common/debug.h>
+#include <drivers/st/stpmu1.h>
+#include <plat/common/platform.h>
+
struct regul_struct {
const char *dt_node_name;
const uint16_t *voltage_table;
diff --git a/drivers/st/reset/stm32mp1_reset.c b/drivers/st/reset/stm32mp1_reset.c
index 106bbfe62..f58e10b27 100644
--- a/drivers/st/reset/stm32mp1_reset.c
+++ b/drivers/st/reset/stm32mp1_reset.c
@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
-#include <debug.h>
#include <limits.h>
-#include <mmio.h>
+
#include <platform_def.h>
-#include <stm32mp1_rcc.h>
-#include <stm32mp1_reset.h>
-#include <utils_def.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/st/stm32mp1_rcc.h>
+#include <drivers/st/stm32mp1_reset.h>
+#include <lib/mmio.h>
+#include <lib/utils_def.h>
#define RST_CLR_OFFSET 4U
diff --git a/drivers/st/uart/aarch32/stm32_console.S b/drivers/st/uart/aarch32/stm32_console.S
index 303d6bac7..4d00e68ab 100644
--- a/drivers/st/uart/aarch32/stm32_console.S
+++ b/drivers/st/uart/aarch32/stm32_console.S
@@ -7,8 +7,8 @@
#include <assert_macros.S>
#define USE_FINISH_CONSOLE_REG_2
#include <console_macros.S>
-#include <stm32_console.h>
-#include <stm32_uart_regs.h>
+#include <drivers/st/stm32_console.h>
+#include <drivers/st/stm32_uart_regs.h>
#define USART_TIMEOUT 0x1000
diff --git a/drivers/staging/renesas/rcar/ddr/ddr_a/ddr_init_e3.c b/drivers/staging/renesas/rcar/ddr/ddr_a/ddr_init_e3.c
index 716d15d18..74677f64c 100644
--- a/drivers/staging/renesas/rcar/ddr/ddr_a/ddr_init_e3.c
+++ b/drivers/staging/renesas/rcar/ddr/ddr_a/ddr_init_e3.c
@@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-
#include <stdint.h>
-#include <debug.h>
+
+#include <common/debug.h>
#include "boot_init_dram_regdef_e3.h"
#include "ddr_init_e3.h"
diff --git a/drivers/staging/renesas/rcar/ddr/ddr_b/boot_init_dram.c b/drivers/staging/renesas/rcar/ddr/ddr_b/boot_init_dram.c
index d7291315f..841eeb473 100644
--- a/drivers/staging/renesas/rcar/ddr/ddr_b/boot_init_dram.c
+++ b/drivers/staging/renesas/rcar/ddr/ddr_b/boot_init_dram.c
@@ -7,8 +7,10 @@
#include <stdint.h>
#include <string.h>
#include <stdio.h>
-#include <mmio.h>
-#include <debug.h>
+
+#include <common/debug.h>
+#include <lib/mmio.h>
+
#include "ddr_regdef.h"
#include "init_dram_tbl_h3.h"
#include "init_dram_tbl_m3.h"
diff --git a/drivers/staging/renesas/rcar/ddr/dram_sub_func.c b/drivers/staging/renesas/rcar/ddr/dram_sub_func.c
index 4bf6942e0..82aa7f84d 100644
--- a/drivers/staging/renesas/rcar/ddr/dram_sub_func.c
+++ b/drivers/staging/renesas/rcar/ddr/dram_sub_func.c
@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
-#include <debug.h>
+#include <common/debug.h>
+#include <lib/mmio.h>
+
#include "dram_sub_func.h"
#define PRR (0xFFF00044U)
diff --git a/drivers/staging/renesas/rcar/pfc/E3/pfc_init_e3.c b/drivers/staging/renesas/rcar/pfc/E3/pfc_init_e3.c
index d75aa7c34..47fa837b3 100644
--- a/drivers/staging/renesas/rcar/pfc/E3/pfc_init_e3.c
+++ b/drivers/staging/renesas/rcar/pfc/E3/pfc_init_e3.c
@@ -5,7 +5,9 @@
*/
#include <stdint.h> /* for uint32_t */
-#include <mmio.h>
+
+#include <lib/mmio.h>
+
#include "pfc_init_e3.h"
#include "rcar_def.h"
diff --git a/drivers/staging/renesas/rcar/pfc/H3/pfc_init_h3_v1.c b/drivers/staging/renesas/rcar/pfc/H3/pfc_init_h3_v1.c
index 1c38f0600..f31d99e56 100644
--- a/drivers/staging/renesas/rcar/pfc/H3/pfc_init_h3_v1.c
+++ b/drivers/staging/renesas/rcar/pfc/H3/pfc_init_h3_v1.c
@@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <stdint.h> /* for uint32_t */
-#include <mmio.h>
+#include <stdint.h>
+#include <lib/mmio.h>
/* GPIO base address */
#define GPIO_BASE (0xE6050000U)
diff --git a/drivers/staging/renesas/rcar/pfc/H3/pfc_init_h3_v2.c b/drivers/staging/renesas/rcar/pfc/H3/pfc_init_h3_v2.c
index 3ed0cd3e4..e53235a20 100644
--- a/drivers/staging/renesas/rcar/pfc/H3/pfc_init_h3_v2.c
+++ b/drivers/staging/renesas/rcar/pfc/H3/pfc_init_h3_v2.c
@@ -5,7 +5,9 @@
*/
#include <stdint.h> /* for uint32_t */
-#include <mmio.h>
+
+#include <lib/mmio.h>
+
#include "pfc_init_h3_v2.h"
#include "rcar_def.h"
diff --git a/drivers/staging/renesas/rcar/pfc/M3/pfc_init_m3.c b/drivers/staging/renesas/rcar/pfc/M3/pfc_init_m3.c
index 911ee8cc9..f7e66f245 100644
--- a/drivers/staging/renesas/rcar/pfc/M3/pfc_init_m3.c
+++ b/drivers/staging/renesas/rcar/pfc/M3/pfc_init_m3.c
@@ -5,7 +5,9 @@
*/
#include <stdint.h> /* for uint32_t */
-#include <mmio.h>
+
+#include <lib/mmio.h>
+
#include "pfc_init_m3.h"
#include "rcar_def.h"
#include "rcar_private.h"
diff --git a/drivers/staging/renesas/rcar/pfc/M3N/pfc_init_m3n.c b/drivers/staging/renesas/rcar/pfc/M3N/pfc_init_m3n.c
index a2b6b34a1..e6b8a4f28 100644
--- a/drivers/staging/renesas/rcar/pfc/M3N/pfc_init_m3n.c
+++ b/drivers/staging/renesas/rcar/pfc/M3N/pfc_init_m3n.c
@@ -5,7 +5,9 @@
*/
#include <stdint.h> /* for uint32_t */
-#include <mmio.h>
+
+#include <lib/mmio.h>
+
#include "pfc_init_m3n.h"
#include "rcar_def.h"
diff --git a/drivers/staging/renesas/rcar/pfc/pfc_init.c b/drivers/staging/renesas/rcar/pfc/pfc_init.c
index fceff3ddd..f20e8b0b5 100644
--- a/drivers/staging/renesas/rcar/pfc/pfc_init.c
+++ b/drivers/staging/renesas/rcar/pfc/pfc_init.c
@@ -5,8 +5,10 @@
*/
#include <stdint.h>
-#include <debug.h>
-#include <mmio.h>
+
+#include <common/debug.h>
+#include <lib/mmio.h>
+
#include "rcar_def.h"
#if RCAR_LSI == RCAR_AUTO
#include "H3/pfc_init_h3_v1.h"
diff --git a/drivers/staging/renesas/rcar/qos/E3/qos_init_e3_v10.c b/drivers/staging/renesas/rcar/qos/E3/qos_init_e3_v10.c
index efe0c754d..593fefb62 100644
--- a/drivers/staging/renesas/rcar/qos/E3/qos_init_e3_v10.c
+++ b/drivers/staging/renesas/rcar/qos/E3/qos_init_e3_v10.c
@@ -5,7 +5,9 @@
*/
#include <stdint.h>
-#include <debug.h>
+
+#include <common/debug.h>
+
#include "../qos_common.h"
#include "../qos_reg.h"
#include "qos_init_e3_v10.h"
diff --git a/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v10.c b/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v10.c
index fd81187c8..21aa3df03 100644
--- a/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v10.c
+++ b/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v10.c
@@ -5,7 +5,9 @@
*/
#include <stdint.h>
-#include <debug.h>
+
+#include <common/debug.h>
+
#include "../qos_common.h"
#include "qos_init_h3_v10.h"
diff --git a/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v11.c b/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v11.c
index 1f6560050..5b7348ce0 100644
--- a/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v11.c
+++ b/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v11.c
@@ -5,8 +5,11 @@
*/
#include <stdint.h>
-#include <debug.h>
+
+#include <common/debug.h>
+
#include <rcar_def.h>
+
#include "../qos_common.h"
#include "qos_init_h3_v11.h"
diff --git a/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v20.c b/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v20.c
index 692236065..f27a7dce6 100644
--- a/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v20.c
+++ b/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v20.c
@@ -5,7 +5,9 @@
*/
#include <stdint.h>
-#include <debug.h>
+
+#include <common/debug.h>
+
#include "../qos_common.h"
#include "../qos_reg.h"
#include "qos_init_h3_v20.h"
diff --git a/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v30.c b/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v30.c
index 5986a3948..b3e65df94 100644
--- a/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v30.c
+++ b/drivers/staging/renesas/rcar/qos/H3/qos_init_h3_v30.c
@@ -5,7 +5,9 @@
*/
#include <stdint.h>
-#include <debug.h>
+
+#include <common/debug.h>
+
#include "../qos_common.h"
#include "../qos_reg.h"
#include "qos_init_h3_v30.h"
diff --git a/drivers/staging/renesas/rcar/qos/H3/qos_init_h3n_v30.c b/drivers/staging/renesas/rcar/qos/H3/qos_init_h3n_v30.c
index 58c37160e..e4909b9c1 100644
--- a/drivers/staging/renesas/rcar/qos/H3/qos_init_h3n_v30.c
+++ b/drivers/staging/renesas/rcar/qos/H3/qos_init_h3n_v30.c
@@ -5,7 +5,9 @@
*/
#include <stdint.h>
-#include <debug.h>
+
+#include <common/debug.h>
+
#include "../qos_common.h"
#include "../qos_reg.h"
#include "qos_init_h3n_v30.h"
diff --git a/drivers/staging/renesas/rcar/qos/M3/qos_init_m3_v10.c b/drivers/staging/renesas/rcar/qos/M3/qos_init_m3_v10.c
index a0d1e1473..c0846d2e2 100644
--- a/drivers/staging/renesas/rcar/qos/M3/qos_init_m3_v10.c
+++ b/drivers/staging/renesas/rcar/qos/M3/qos_init_m3_v10.c
@@ -5,7 +5,9 @@
*/
#include <stdint.h>
-#include <debug.h>
+
+#include <common/debug.h>
+
#include "../qos_common.h"
#include "qos_init_m3_v10.h"
diff --git a/drivers/staging/renesas/rcar/qos/M3/qos_init_m3_v11.c b/drivers/staging/renesas/rcar/qos/M3/qos_init_m3_v11.c
index fc0d2cce1..3186cf68f 100644
--- a/drivers/staging/renesas/rcar/qos/M3/qos_init_m3_v11.c
+++ b/drivers/staging/renesas/rcar/qos/M3/qos_init_m3_v11.c
@@ -5,7 +5,9 @@
*/
#include <stdint.h>
-#include <debug.h>
+
+#include <common/debug.h>
+
#include "../qos_common.h"
#include "../qos_reg.h"
#include "qos_init_m3_v11.h"
diff --git a/drivers/staging/renesas/rcar/qos/M3N/qos_init_m3n_v10.c b/drivers/staging/renesas/rcar/qos/M3N/qos_init_m3n_v10.c
index e9d66761e..0be68c3cd 100644
--- a/drivers/staging/renesas/rcar/qos/M3N/qos_init_m3n_v10.c
+++ b/drivers/staging/renesas/rcar/qos/M3N/qos_init_m3n_v10.c
@@ -5,7 +5,9 @@
*/
#include <stdint.h>
-#include <debug.h>
+
+#include <common/debug.h>
+
#include "../qos_common.h"
#include "../qos_reg.h"
#include "qos_init_m3n_v10.h"
diff --git a/drivers/staging/renesas/rcar/qos/qos_init.c b/drivers/staging/renesas/rcar/qos/qos_init.c
index 54c880309..1d1bcd59f 100644
--- a/drivers/staging/renesas/rcar/qos/qos_init.c
+++ b/drivers/staging/renesas/rcar/qos/qos_init.c
@@ -5,8 +5,10 @@
*/
#include <stdint.h>
-#include <debug.h>
-#include <mmio.h>
+
+#include <common/debug.h>
+#include <lib/mmio.h>
+
#include "qos_init.h"
#include "qos_common.h"
#if RCAR_LSI == RCAR_AUTO
diff --git a/drivers/synopsys/emmc/dw_mmc.c b/drivers/synopsys/emmc/dw_mmc.c
index eb428198f..0c5c64570 100644
--- a/drivers/synopsys/emmc/dw_mmc.c
+++ b/drivers/synopsys/emmc/dw_mmc.c
@@ -4,17 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <delay_timer.h>
-#include <dw_mmc.h>
#include <errno.h>
-#include <mmc.h>
-#include <mmio.h>
#include <string.h>
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/mmc.h>
+#include <drivers/synopsys/dw_mmc.h>
+#include <lib/mmio.h>
+
#define DWMMC_CTRL (0x00)
#define CTRL_IDMAC_EN (1 << 25)
#define CTRL_DMA_EN (1 << 5)
diff --git a/drivers/synopsys/ufs/dw_ufs.c b/drivers/synopsys/ufs/dw_ufs.c
index b0ea3e737..c7c8fc22d 100644
--- a/drivers/synopsys/ufs/dw_ufs.c
+++ b/drivers/synopsys/ufs/dw_ufs.c
@@ -5,12 +5,13 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <dw_ufs.h>
-#include <mmio.h>
#include <stdint.h>
#include <string.h>
-#include <ufs.h>
+
+#include <common/debug.h>
+#include <drivers/dw_ufs.h>
+#include <drivers/ufs.h>
+#include <lib/mmio.h>
static int dwufs_phy_init(ufs_params_t *params)
{
diff --git a/drivers/ti/uart/aarch64/16550_console.S b/drivers/ti/uart/aarch64/16550_console.S
index 785b640dd..3180593ad 100644
--- a/drivers/ti/uart/aarch64/16550_console.S
+++ b/drivers/ti/uart/aarch64/16550_console.S
@@ -9,7 +9,7 @@
#include <assert_macros.S>
#define USE_FINISH_CONSOLE_REG_2
#include <console_macros.S>
-#include <uart_16550.h>
+#include <drivers/ti/uart/uart_16550.h>
/*
* "core" functions are low-level implementations that don't require
diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c
index 515fc2785..2351c9b04 100644
--- a/drivers/ufs/ufs.c
+++ b/drivers/ufs/ufs.c
@@ -4,17 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <delay_timer.h>
#include <endian.h>
#include <errno.h>
-#include <mmio.h>
-#include <platform_def.h>
#include <stdint.h>
#include <string.h>
-#include <ufs.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/ufs.h>
+#include <lib/mmio.h>
#define CDB_ADDR_MASK 127
#define ALIGN_CDB(x) (((x) + CDB_ADDR_MASK) & ~CDB_ADDR_MASK)
diff --git a/include/arch/aarch32/arch.h b/include/arch/aarch32/arch.h
index 8260c5491..cbe272c23 100644
--- a/include/arch/aarch32/arch.h
+++ b/include/arch/aarch32/arch.h
@@ -7,7 +7,7 @@
#ifndef ARCH_H
#define ARCH_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/*******************************************************************************
* MIDR bit definitions
diff --git a/include/arch/aarch32/arch_helpers.h b/include/arch/aarch32/arch_helpers.h
index a6fe14fb8..c2773c139 100644
--- a/include/arch/aarch32/arch_helpers.h
+++ b/include/arch/aarch32/arch_helpers.h
@@ -7,11 +7,12 @@
#ifndef ARCH_HELPERS_H
#define ARCH_HELPERS_H
-#include <arch.h>
#include <cdefs.h>
#include <stdint.h>
#include <string.h>
+#include <arch.h>
+
/**********************************************************************
* Macros which create inline functions to read or write CPU system
* registers
diff --git a/include/arch/aarch32/asm_macros.S b/include/arch/aarch32/asm_macros.S
index c54f75c2d..8408804fb 100644
--- a/include/arch/aarch32/asm_macros.S
+++ b/include/arch/aarch32/asm_macros.S
@@ -7,8 +7,8 @@
#define ASM_MACROS_S
#include <arch.h>
-#include <asm_macros_common.S>
-#include <spinlock.h>
+#include <common/asm_macros_common.S>
+#include <lib/spinlock.h>
/*
* TLBI instruction with type specifier that implements the workaround for
diff --git a/include/arch/aarch32/console_macros.S b/include/arch/aarch32/console_macros.S
index ba6e7d050..ed5088d5a 100644
--- a/include/arch/aarch32/console_macros.S
+++ b/include/arch/aarch32/console_macros.S
@@ -6,7 +6,7 @@
#ifndef CONSOLE_MACROS_S
#define CONSOLE_MACROS_S
-#include <console.h>
+#include <drivers/console.h>
/*
* This macro encapsulates the common setup that has to be done at the end of
diff --git a/include/arch/aarch32/smccc_helpers.h b/include/arch/aarch32/smccc_helpers.h
index 67952ec50..d3e5e59c5 100644
--- a/include/arch/aarch32/smccc_helpers.h
+++ b/include/arch/aarch32/smccc_helpers.h
@@ -7,7 +7,7 @@
#ifndef SMCCC_HELPERS_H
#define SMCCC_HELPERS_H
-#include <smccc.h>
+#include <lib/smccc.h>
/* These are offsets to registers in smc_ctx_t */
#define SMC_CTX_GPREG_R0 U(0x0)
@@ -25,9 +25,11 @@
#define SMC_CTX_SIZE U(0x90)
#ifndef __ASSEMBLY__
-#include <cassert.h>
+
#include <stdint.h>
+#include <lib/cassert.h>
+
/*
* The generic structure to save arguments and callee saved registers during
* an SMC. Also this structure is used to store the result return values after
diff --git a/include/arch/aarch64/arch.h b/include/arch/aarch64/arch.h
index 72a14dcfa..8a44d83f0 100644
--- a/include/arch/aarch64/arch.h
+++ b/include/arch/aarch64/arch.h
@@ -7,7 +7,7 @@
#ifndef ARCH_H
#define ARCH_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/*******************************************************************************
* MIDR bit definitions
diff --git a/include/arch/aarch64/arch_helpers.h b/include/arch/aarch64/arch_helpers.h
index 7222b9dc7..b912b4223 100644
--- a/include/arch/aarch64/arch_helpers.h
+++ b/include/arch/aarch64/arch_helpers.h
@@ -7,12 +7,13 @@
#ifndef ARCH_HELPERS_H
#define ARCH_HELPERS_H
-#include <arch.h>
#include <cdefs.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
+#include <arch.h>
+
/**********************************************************************
* Macros which create inline functions to read or write CPU system
* registers
diff --git a/include/arch/aarch64/asm_macros.S b/include/arch/aarch64/asm_macros.S
index dea302137..387be4ca3 100644
--- a/include/arch/aarch64/asm_macros.S
+++ b/include/arch/aarch64/asm_macros.S
@@ -7,8 +7,8 @@
#define ASM_MACROS_S
#include <arch.h>
-#include <asm_macros_common.S>
-#include <spinlock.h>
+#include <common/asm_macros_common.S>
+#include <lib/spinlock.h>
/*
* TLBI instruction with type specifier that implements the workaround for
diff --git a/include/arch/aarch64/console_macros.S b/include/arch/aarch64/console_macros.S
index 5c88d4f22..90ef42048 100644
--- a/include/arch/aarch64/console_macros.S
+++ b/include/arch/aarch64/console_macros.S
@@ -6,7 +6,7 @@
#ifndef CONSOLE_MACROS_S
#define CONSOLE_MACROS_S
-#include <console.h>
+#include <drivers/console.h>
/*
* This macro encapsulates the common setup that has to be done at the end of
diff --git a/include/arch/aarch64/smccc_helpers.h b/include/arch/aarch64/smccc_helpers.h
index efab18b0c..e28697d7e 100644
--- a/include/arch/aarch64/smccc_helpers.h
+++ b/include/arch/aarch64/smccc_helpers.h
@@ -7,12 +7,14 @@
#ifndef SMCCC_HELPERS_H
#define SMCCC_HELPERS_H
-#include <smccc.h>
+#include <lib/smccc.h>
#ifndef __ASSEMBLY__
-#include <context.h>
+
#include <stdbool.h>
+#include <context.h>
+
/* Convenience macros to return from SMC handler */
#define SMC_RET0(_h) { \
return (uint64_t) (_h); \
diff --git a/include/bl1/bl1.h b/include/bl1/bl1.h
index 39b8d1ede..7b5d87572 100644
--- a/include/bl1/bl1.h
+++ b/include/bl1/bl1.h
@@ -7,7 +7,7 @@
#ifndef BL1_H
#define BL1_H
-#include <bl_common.h>
+#include <common/bl_common.h>
/*
* Defines for BL1 SMC function ids.
@@ -62,7 +62,8 @@
((_fid >= FWU_SMC_FID_START) && (_fid <= FWU_SMC_FID_END))
#ifndef __ASSEMBLY__
-#include <cassert.h>
+
+#include <lib/cassert.h>
struct entry_point_info;
diff --git a/include/bl1/tbbr/tbbr_img_desc.h b/include/bl1/tbbr/tbbr_img_desc.h
index bb36eb50c..db15cdbfc 100644
--- a/include/bl1/tbbr/tbbr_img_desc.h
+++ b/include/bl1/tbbr/tbbr_img_desc.h
@@ -7,7 +7,7 @@
#ifndef TBBR_IMG_DESC_H
#define TBBR_IMG_DESC_H
-#include <bl_common.h>
+#include <common/bl_common.h>
extern image_desc_t bl1_tbbr_image_descs[];
diff --git a/include/bl31/ehf.h b/include/bl31/ehf.h
index f35d81002..ee00d0936 100644
--- a/include/bl31/ehf.h
+++ b/include/bl31/ehf.h
@@ -11,7 +11,8 @@
#include <cdefs.h>
#include <stdint.h>
-#include <utils_def.h>
+
+#include <lib/utils_def.h>
/* Valid priorities set bit 0 of the priority handler. */
#define EHF_PRI_VALID_ BIT(0)
diff --git a/include/bl31/interrupt_mgmt.h b/include/bl31/interrupt_mgmt.h
index 6a49fb6dd..b1683cc11 100644
--- a/include/bl31/interrupt_mgmt.h
+++ b/include/bl31/interrupt_mgmt.h
@@ -8,7 +8,7 @@
#define INTERRUPT_MGMT_H
#include <arch.h>
-#include <utils_def.h>
+#include <lib/utils_def.h>
/*******************************************************************************
* Constants for the types of interrupts recognised by the IM framework
diff --git a/include/bl32/payloads/tlk.h b/include/bl32/payloads/tlk.h
index 0234cbe4d..2c12633ea 100644
--- a/include/bl32/payloads/tlk.h
+++ b/include/bl32/payloads/tlk.h
@@ -7,7 +7,7 @@
#ifndef TLK_H
#define TLK_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/*
* Generate function IDs for the Trusted OS/Apps
diff --git a/include/common/bl_common.h b/include/common/bl_common.h
index 56c89fcc4..c12b08bb7 100644
--- a/include/common/bl_common.h
+++ b/include/common/bl_common.h
@@ -7,9 +7,9 @@
#ifndef BL_COMMON_H
#define BL_COMMON_H
-#include <ep_info.h>
-#include <param_header.h>
-#include <utils_def.h>
+#include <common/ep_info.h>
+#include <common/param_header.h>
+#include <lib/utils_def.h>
#define UP U(1)
#define DOWN U(0)
@@ -58,11 +58,11 @@
#define SERROR_AARCH32 U(0xf)
#ifndef __ASSEMBLY__
-#include <cassert.h>
+
#include <stddef.h>
#include <stdint.h>
-#include <utils_def.h> /* To retain compatibility */
+#include <lib/cassert.h>
/*
* Declarations of linker defined symbols to help determine memory layout of
diff --git a/include/common/debug.h b/include/common/debug.h
index a14a66e85..f8faf6835 100644
--- a/include/common/debug.h
+++ b/include/common/debug.h
@@ -7,7 +7,7 @@
#ifndef DEBUG_H
#define DEBUG_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/*
* The log output macros print output to the console. These macros produce
@@ -28,12 +28,14 @@
#define LOG_LEVEL_VERBOSE U(50)
#ifndef __ASSEMBLY__
+
#include <cdefs.h>
-#include <console.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
+#include <drivers/console.h>
+
/*
* Define Log Markers corresponding to each log level which will
* be embedded in the format string and is expected by tf_log() to determine
diff --git a/include/common/desc_image_load.h b/include/common/desc_image_load.h
index 625489519..f2f26ea99 100644
--- a/include/common/desc_image_load.h
+++ b/include/common/desc_image_load.h
@@ -6,7 +6,7 @@
#ifndef DESC_IMAGE_LOAD_H
#define DESC_IMAGE_LOAD_H
-#include <bl_common.h>
+#include <common/bl_common.h>
/* Following structure is used to store BL ep/image info. */
typedef struct bl_mem_params_node {
diff --git a/include/common/ep_info.h b/include/common/ep_info.h
index 0f67687e4..a09d03ba0 100644
--- a/include/common/ep_info.h
+++ b/include/common/ep_info.h
@@ -7,8 +7,8 @@
#ifndef EP_INFO_H
#define EP_INFO_H
-#include <param_header.h>
-#include <utils_def.h>
+#include <common/param_header.h>
+#include <lib/utils_def.h>
#define SECURE U(0x0)
#define NON_SECURE U(0x1)
@@ -64,9 +64,10 @@
#ifndef __ASSEMBLY__
-#include <cassert.h>
#include <stdint.h>
+#include <lib/cassert.h>
+
typedef struct aapcs64_params {
u_register_t arg0;
u_register_t arg1;
diff --git a/include/common/param_header.h b/include/common/param_header.h
index e9717cbca..0c1503f1b 100644
--- a/include/common/param_header.h
+++ b/include/common/param_header.h
@@ -8,7 +8,8 @@
#define PARAM_HEADER_H
#include <stdbool.h>
-#include <utils_def.h>
+
+#include <lib/utils_def.h>
/* Param header types */
#define PARAM_EP U(0x01)
diff --git a/include/common/runtime_svc.h b/include/common/runtime_svc.h
index e32c2870a..59bf158b4 100644
--- a/include/common/runtime_svc.h
+++ b/include/common/runtime_svc.h
@@ -7,10 +7,10 @@
#ifndef RUNTIME_SVC_H
#define RUNTIME_SVC_H
-#include <bl_common.h> /* to include exception types */
-#include <cassert.h>
+#include <common/bl_common.h> /* to include exception types */
+#include <lib/cassert.h>
+#include <lib/utils_def.h>
#include <smccc_helpers.h> /* to include SMCCC definitions */
-#include <utils_def.h>
/*******************************************************************************
* Structure definition, typedefs & constants for the runtime service framework
diff --git a/include/common/tbbr/tbbr_img_def.h b/include/common/tbbr/tbbr_img_def.h
index bd8f5dc58..672886ded 100644
--- a/include/common/tbbr/tbbr_img_def.h
+++ b/include/common/tbbr/tbbr_img_def.h
@@ -7,7 +7,7 @@
#ifndef TBBR_IMG_DEF_H
#define TBBR_IMG_DEF_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/* Firmware Image Package */
#define FIP_IMAGE_ID U(0)
diff --git a/include/drivers/arm/cci.h b/include/drivers/arm/cci.h
index 24b76dab8..c5ddcfd44 100644
--- a/include/drivers/arm/cci.h
+++ b/include/drivers/arm/cci.h
@@ -7,7 +7,7 @@
#ifndef CCI_H
#define CCI_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/* Slave interface offsets from PERIPHBASE */
#define SLAVE_IFACE6_OFFSET UL(0x7000)
diff --git a/include/drivers/arm/gic_common.h b/include/drivers/arm/gic_common.h
index a9ec7b764..3ac1b43ff 100644
--- a/include/drivers/arm/gic_common.h
+++ b/include/drivers/arm/gic_common.h
@@ -7,7 +7,7 @@
#ifndef GIC_COMMON_H
#define GIC_COMMON_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/*******************************************************************************
* GIC Distributor interface general definitions
diff --git a/include/drivers/arm/gicv2.h b/include/drivers/arm/gicv2.h
index 705077ce3..6bc5101d1 100644
--- a/include/drivers/arm/gicv2.h
+++ b/include/drivers/arm/gicv2.h
@@ -7,7 +7,7 @@
#ifndef GICV2_H
#define GICV2_H
-#include <gic_common.h>
+#include <drivers/arm/gic_common.h>
/*******************************************************************************
* GICv2 miscellaneous definitions
@@ -119,9 +119,10 @@
#ifndef __ASSEMBLY__
#include <cdefs.h>
-#include <interrupt_props.h>
#include <stdint.h>
+#include <common/interrupt_props.h>
+
/*******************************************************************************
* This structure describes some of the implementation defined attributes of
* the GICv2 IP. It is used by the platform port to specify these attributes
diff --git a/include/drivers/arm/gicv3.h b/include/drivers/arm/gicv3.h
index c26f2975a..238269774 100644
--- a/include/drivers/arm/gicv3.h
+++ b/include/drivers/arm/gicv3.h
@@ -209,12 +209,13 @@
#ifndef __ASSEMBLY__
-#include <arch_helpers.h>
-#include <gic_common.h>
-#include <interrupt_props.h>
#include <stdbool.h>
#include <stdint.h>
-#include <utils_def.h>
+
+#include <arch_helpers.h>
+#include <common/interrupt_props.h>
+#include <drivers/arm/gic_common.h>
+#include <lib/utils_def.h>
static inline bool gicv3_is_intr_id_special_identifier(unsigned int id)
{
diff --git a/include/drivers/arm/pl011.h b/include/drivers/arm/pl011.h
index 6216a61fc..f201f0048 100644
--- a/include/drivers/arm/pl011.h
+++ b/include/drivers/arm/pl011.h
@@ -7,7 +7,7 @@
#ifndef PL011_H
#define PL011_H
-#include <console.h>
+#include <drivers/console.h>
/* PL011 Registers */
#define UARTDR 0x000
diff --git a/include/drivers/arm/pl061_gpio.h b/include/drivers/arm/pl061_gpio.h
index 6c4a9f5a5..68238c9ab 100644
--- a/include/drivers/arm/pl061_gpio.h
+++ b/include/drivers/arm/pl061_gpio.h
@@ -7,7 +7,7 @@
#ifndef PL061_GPIO_H
#define PL061_GPIO_H
-#include <gpio.h>
+#include <drivers/gpio.h>
void pl061_gpio_register(uintptr_t base_addr, int gpio_dev);
void pl061_gpio_init(void);
diff --git a/include/drivers/arm/smmu_v3.h b/include/drivers/arm/smmu_v3.h
index 1b7ffb8db..33f3d6fcf 100644
--- a/include/drivers/arm/smmu_v3.h
+++ b/include/drivers/arm/smmu_v3.h
@@ -8,7 +8,8 @@
#define SMMU_V3_H
#include <stdint.h>
-#include <utils_def.h>
+
+#include <lib/utils_def.h>
/* SMMUv3 register offsets from device base */
#define SMMU_S_IDR1 U(0x8004)
diff --git a/include/drivers/arm/sp804_delay_timer.h b/include/drivers/arm/sp804_delay_timer.h
index 8eb8715ae..f8769e836 100644
--- a/include/drivers/arm/sp804_delay_timer.h
+++ b/include/drivers/arm/sp804_delay_timer.h
@@ -7,9 +7,9 @@
#ifndef SP804_DELAY_TIMER_H
#define SP804_DELAY_TIMER_H
-#include <delay_timer.h>
#include <stdint.h>
+#include <drivers/delay_timer.h>
uint32_t sp804_get_timer_value(void);
diff --git a/include/drivers/arm/sp805.h b/include/drivers/arm/sp805.h
index e7714a393..551bfe4ba 100644
--- a/include/drivers/arm/sp805.h
+++ b/include/drivers/arm/sp805.h
@@ -7,7 +7,7 @@
#ifndef SP805_H
#define SP805_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/* SP805 register offset */
#define SP805_WDOG_LOAD_OFF UL(0x000)
diff --git a/include/drivers/arm/tzc380.h b/include/drivers/arm/tzc380.h
index 19cf98831..03b9b054e 100644
--- a/include/drivers/arm/tzc380.h
+++ b/include/drivers/arm/tzc380.h
@@ -7,8 +7,8 @@
#ifndef TZC380_H
#define TZC380_H
-#include <tzc_common.h>
-#include <utils_def.h>
+#include <drivers/arm/tzc_common.h>
+#include <lib/utils_def.h>
#define TZC380_CONFIGURATION_OFF U(0x000)
#define ACTION_OFF U(0x004)
diff --git a/include/drivers/arm/tzc400.h b/include/drivers/arm/tzc400.h
index a7bb3f648..98ef0ec1e 100644
--- a/include/drivers/arm/tzc400.h
+++ b/include/drivers/arm/tzc400.h
@@ -7,8 +7,8 @@
#ifndef TZC400_H
#define TZC400_H
-#include <tzc_common.h>
-#include <utils_def.h>
+#include <drivers/arm/tzc_common.h>
+#include <lib/utils_def.h>
#define BUILD_CONFIG_OFF U(0x000)
#define GATE_KEEPER_OFF U(0x008)
diff --git a/include/drivers/arm/tzc_common.h b/include/drivers/arm/tzc_common.h
index 4b8154788..4820baa1a 100644
--- a/include/drivers/arm/tzc_common.h
+++ b/include/drivers/arm/tzc_common.h
@@ -7,7 +7,7 @@
#ifndef TZC_COMMON_H
#define TZC_COMMON_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/*
* Offset of core registers from the start of the base of configuration
diff --git a/include/drivers/arm/tzc_dmc500.h b/include/drivers/arm/tzc_dmc500.h
index df6e7f949..24bfaeb14 100644
--- a/include/drivers/arm/tzc_dmc500.h
+++ b/include/drivers/arm/tzc_dmc500.h
@@ -7,8 +7,8 @@
#ifndef TZC_DMC500_H
#define TZC_DMC500_H
-#include <tzc_common.h>
-#include <utils_def.h>
+#include <drivers/arm/tzc_common.h>
+#include <lib/utils_def.h>
#define SI_STATUS_OFFSET U(0x000)
#define SI_STATE_CTRL_OFFSET U(0x030)
diff --git a/include/drivers/arm/tzc_dmc620.h b/include/drivers/arm/tzc_dmc620.h
index 074bbc122..e0e6760b2 100644
--- a/include/drivers/arm/tzc_dmc620.h
+++ b/include/drivers/arm/tzc_dmc620.h
@@ -7,7 +7,7 @@
#ifndef TZC_DMC620_H
#define TZC_DMC620_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/* DMC-620 memc register offsets */
#define DMC620_MEMC_STATUS U(0x0000)
diff --git a/include/drivers/auth/auth_mod.h b/include/drivers/auth/auth_mod.h
index 19bc2f135..908995391 100644
--- a/include/drivers/auth/auth_mod.h
+++ b/include/drivers/auth/auth_mod.h
@@ -9,10 +9,10 @@
#if TRUSTED_BOARD_BOOT
-#include <auth_common.h>
-#include <cot_def.h>
-#include <img_parser_mod.h>
-#include <tbbr_img_def.h>
+#include <common/tbbr/cot_def.h>
+#include <common/tbbr/tbbr_img_def.h>
+#include <drivers/auth/auth_common.h>
+#include <drivers/auth/img_parser_mod.h>
/*
* Image flags
diff --git a/include/drivers/auth/img_parser_mod.h b/include/drivers/auth/img_parser_mod.h
index 43796935a..b2fb60ed1 100644
--- a/include/drivers/auth/img_parser_mod.h
+++ b/include/drivers/auth/img_parser_mod.h
@@ -7,7 +7,7 @@
#ifndef IMG_PARSER_MOD_H
#define IMG_PARSER_MOD_H
-#include <auth_common.h>
+#include <drivers/auth/auth_common.h>
/*
* Return values
diff --git a/include/drivers/cadence/cdns_uart.h b/include/drivers/cadence/cdns_uart.h
index 490be108e..0a1cf7781 100644
--- a/include/drivers/cadence/cdns_uart.h
+++ b/include/drivers/cadence/cdns_uart.h
@@ -7,7 +7,7 @@
#ifndef CDNS_UART_H
#define CDNS_UART_H
-#include <console.h>
+#include <drivers/console.h>
/* This is very minimalistic and will only work in QEMU. */
diff --git a/include/drivers/console.h b/include/drivers/console.h
index 02f2f8a2d..24887f908 100644
--- a/include/drivers/console.h
+++ b/include/drivers/console.h
@@ -7,7 +7,7 @@
#ifndef CONSOLE_H
#define CONSOLE_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
#define CONSOLE_T_NEXT (U(0) * REGSZ)
#define CONSOLE_T_FLAGS (U(1) * REGSZ)
@@ -44,7 +44,9 @@ typedef struct console {
int (*const flush)(struct console *console);
/* Additional private driver data may follow here. */
} console_t;
-#include <console_assertions.h> /* offset macro assertions for console_t */
+
+/* offset macro assertions for console_t */
+#include <drivers/console_assertions.h>
/*
* NOTE: There is no publicly accessible console_register() function. Consoles
diff --git a/include/drivers/console_assertions.h b/include/drivers/console_assertions.h
index 559bb5096..00caa3141 100644
--- a/include/drivers/console_assertions.h
+++ b/include/drivers/console_assertions.h
@@ -7,7 +7,7 @@
#ifndef CONSOLE_ASSERTIONS_H
#define CONSOLE_ASSERTIONS_H
-#include <cassert.h>
+#include <lib/cassert.h>
/*
* This file contains some separate assertions about console_t, moved here to
diff --git a/include/drivers/coreboot/cbmem_console.h b/include/drivers/coreboot/cbmem_console.h
index 7fe7a72da..40c90e6bb 100644
--- a/include/drivers/coreboot/cbmem_console.h
+++ b/include/drivers/coreboot/cbmem_console.h
@@ -7,7 +7,7 @@
#ifndef CBMEM_CONSOLE_H
#define CBMEM_CONSOLE_H
-#include <console.h>
+#include <drivers/console.h>
#define CONSOLE_T_CBMC_BASE CONSOLE_T_DRVDATA
#define CONSOLE_T_CBMC_SIZE (CONSOLE_T_DRVDATA + REGSZ)
diff --git a/include/drivers/io/io_block.h b/include/drivers/io/io_block.h
index d6d32f9b7..c99e8c7c6 100644
--- a/include/drivers/io/io_block.h
+++ b/include/drivers/io/io_block.h
@@ -7,7 +7,7 @@
#ifndef IO_BLOCK_H
#define IO_BLOCK_H
-#include <io_storage.h>
+#include <drivers/io/io_storage.h>
/* block devices ops */
typedef struct io_block_ops {
diff --git a/include/drivers/io/io_driver.h b/include/drivers/io/io_driver.h
index 587f137c5..2b704f491 100644
--- a/include/drivers/io/io_driver.h
+++ b/include/drivers/io/io_driver.h
@@ -7,9 +7,9 @@
#ifndef IO_DRIVER_H
#define IO_DRIVER_H
-#include <io_storage.h>
#include <stdint.h>
+#include <drivers/io/io_storage.h>
/* Generic IO entity structure,representing an accessible IO construct on the
* device, such as a file */
diff --git a/include/drivers/io/io_storage.h b/include/drivers/io/io_storage.h
index c496d487e..ec6db3f2a 100644
--- a/include/drivers/io/io_storage.h
+++ b/include/drivers/io/io_storage.h
@@ -10,8 +10,8 @@
#include <errno.h>
#include <stdint.h>
#include <stdio.h> /* For ssize_t */
-#include <uuid.h>
+#include <tools_share/uuid.h>
/* Device type which can be used to enable policy decisions about which device
* to access */
diff --git a/include/drivers/marvell/ccu.h b/include/drivers/marvell/ccu.h
index 2757765bc..546d9f13b 100644
--- a/include/drivers/marvell/ccu.h
+++ b/include/drivers/marvell/ccu.h
@@ -11,7 +11,7 @@
#define CCU_H
#ifndef __ASSEMBLY__
-#include <addr_map.h>
+#include <drivers/marvell/addr_map.h>
#endif
/* CCU registers definitions */
diff --git a/include/drivers/marvell/gwin.h b/include/drivers/marvell/gwin.h
index 6b7f1752f..1b874a745 100644
--- a/include/drivers/marvell/gwin.h
+++ b/include/drivers/marvell/gwin.h
@@ -10,7 +10,7 @@
#ifndef GWIN_H
#define GWIN_H
-#include <addr_map.h>
+#include <drivers/marvell/addr_map.h>
int init_gwin(int ap_index);
void gwin_temp_win_insert(int ap_index, struct addr_map_win *win, int size);
diff --git a/include/drivers/marvell/io_win.h b/include/drivers/marvell/io_win.h
index 45e86666a..7438d6b4b 100644
--- a/include/drivers/marvell/io_win.h
+++ b/include/drivers/marvell/io_win.h
@@ -10,7 +10,7 @@
#ifndef IO_WIN_H
#define IO_WIN_H
-#include <addr_map.h>
+#include <drivers/marvell/addr_map.h>
int init_io_win(int ap_index);
void iow_temp_win_insert(int ap_index, struct addr_map_win *win, int size);
diff --git a/include/drivers/marvell/iob.h b/include/drivers/marvell/iob.h
index ccbdf960d..9b5e515a4 100644
--- a/include/drivers/marvell/iob.h
+++ b/include/drivers/marvell/iob.h
@@ -10,7 +10,7 @@
#ifndef IOB_H
#define IOB_H
-#include <addr_map.h>
+#include <drivers/marvell/addr_map.h>
enum target_ids_iob {
INTERNAL_TID = 0x0,
diff --git a/include/drivers/marvell/mochi/cp110_setup.h b/include/drivers/marvell/mochi/cp110_setup.h
index 18d9f1810..3686257d3 100644
--- a/include/drivers/marvell/mochi/cp110_setup.h
+++ b/include/drivers/marvell/mochi/cp110_setup.h
@@ -10,7 +10,8 @@
#ifndef CP110_SETUP_H
#define CP110_SETUP_H
-#include <mmio.h>
+#include <lib/mmio.h>
+
#include <mvebu_def.h>
#define MVEBU_DEVICE_ID_REG (MVEBU_CP_DFX_OFFSET + 0x40)
diff --git a/include/drivers/marvell/uart/a3700_console.h b/include/drivers/marvell/uart/a3700_console.h
index 01335a2a3..5511d96c4 100644
--- a/include/drivers/marvell/uart/a3700_console.h
+++ b/include/drivers/marvell/uart/a3700_console.h
@@ -8,7 +8,7 @@
#ifndef A3700_CONSOLE_H
#define A3700_CONSOLE_H
-#include <console.h>
+#include <drivers/console.h>
/* MVEBU UART Registers */
#define UART_RX_REG 0x00
diff --git a/include/drivers/meson/meson_console.h b/include/drivers/meson/meson_console.h
index 759571dda..5da1e3fd4 100644
--- a/include/drivers/meson/meson_console.h
+++ b/include/drivers/meson/meson_console.h
@@ -7,7 +7,7 @@
#ifndef MESON_CONSOLE_H
#define MESON_CONSOLE_H
-#include <console.h>
+#include <drivers/console.h>
#define CONSOLE_T_MESON_BASE CONSOLE_T_DRVDATA
diff --git a/include/drivers/mmc.h b/include/drivers/mmc.h
index a62928bc6..2aaa28d68 100644
--- a/include/drivers/mmc.h
+++ b/include/drivers/mmc.h
@@ -8,7 +8,8 @@
#define MMC_H
#include <stdint.h>
-#include <utils_def.h>
+
+#include <lib/utils_def.h>
#define MMC_BLOCK_SIZE U(512)
#define MMC_BLOCK_MASK (MMC_BLOCK_SIZE - U(1))
diff --git a/include/drivers/partition/gpt.h b/include/drivers/partition/gpt.h
index 7984e4d80..3ae160fdc 100644
--- a/include/drivers/partition/gpt.h
+++ b/include/drivers/partition/gpt.h
@@ -7,7 +7,7 @@
#ifndef GPT_H
#define GPT_H
-#include <partition.h>
+#include <drivers/partition/partition.h>
#define PARTITION_TYPE_GPT 0xee
#define GPT_HEADER_OFFSET PARTITION_BLOCK_SIZE
diff --git a/include/drivers/partition/partition.h b/include/drivers/partition/partition.h
index 2aeaace9f..d94c7824a 100644
--- a/include/drivers/partition/partition.h
+++ b/include/drivers/partition/partition.h
@@ -7,9 +7,10 @@
#ifndef PARTITION_H
#define PARTITION_H
-#include <cassert.h>
#include <stdint.h>
+#include <lib/cassert.h>
+
#if !PLAT_PARTITION_MAX_ENTRIES
# define PLAT_PARTITION_MAX_ENTRIES 128
#endif /* PLAT_PARTITION_MAX_ENTRIES */
diff --git a/include/drivers/st/io_mmc.h b/include/drivers/st/io_mmc.h
index de71e7d8a..b35b4b5d0 100644
--- a/include/drivers/st/io_mmc.h
+++ b/include/drivers/st/io_mmc.h
@@ -7,7 +7,7 @@
#ifndef IO_MMC_H
#define IO_MMC_H
-#include <io_driver.h>
+#include <drivers/io/io_driver.h>
int register_io_dev_mmc(const io_dev_connector_t **dev_con);
diff --git a/include/drivers/st/io_stm32image.h b/include/drivers/st/io_stm32image.h
index b66821960..68060558b 100644
--- a/include/drivers/st/io_stm32image.h
+++ b/include/drivers/st/io_stm32image.h
@@ -7,8 +7,8 @@
#ifndef IO_STM32IMAGE_H
#define IO_STM32IMAGE_H
-#include <io_driver.h>
-#include <partition.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/partition/partition.h>
#define MAX_LBA_SIZE 512
#define MAX_PART_NAME_SIZE (EFI_NAMELEN + 1)
diff --git a/include/drivers/st/stm32_console.h b/include/drivers/st/stm32_console.h
index 57e6d7409..b30376828 100644
--- a/include/drivers/st/stm32_console.h
+++ b/include/drivers/st/stm32_console.h
@@ -7,7 +7,7 @@
#ifndef STM32_CONSOLE_H
#define STM32_CONSOLE_H
-#include <console.h>
+#include <drivers/console.h>
#define CONSOLE_T_STM32_BASE CONSOLE_T_DRVDATA
diff --git a/include/drivers/st/stm32_gpio.h b/include/drivers/st/stm32_gpio.h
index 938922b48..acd95ecab 100644
--- a/include/drivers/st/stm32_gpio.h
+++ b/include/drivers/st/stm32_gpio.h
@@ -7,7 +7,7 @@
#ifndef STM32_GPIO_H
#define STM32_GPIO_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
#define STM32_GPIOA_BANK U(0x50002000)
#define STM32_GPIOZ_BANK U(0x54004000)
diff --git a/include/drivers/st/stm32_i2c.h b/include/drivers/st/stm32_i2c.h
index 4760c00fe..de2ca59c8 100644
--- a/include/drivers/st/stm32_i2c.h
+++ b/include/drivers/st/stm32_i2c.h
@@ -8,7 +8,8 @@
#define STM32_I2C_H
#include <stdint.h>
-#include <utils_def.h>
+
+#include <lib/utils_def.h>
/* Bit definition for I2C_CR1 register */
#define I2C_CR1_PE BIT(0)
diff --git a/include/drivers/st/stm32_sdmmc2.h b/include/drivers/st/stm32_sdmmc2.h
index b17265926..aa9472c83 100644
--- a/include/drivers/st/stm32_sdmmc2.h
+++ b/include/drivers/st/stm32_sdmmc2.h
@@ -7,9 +7,10 @@
#ifndef STM32_SDMMC2_H
#define STM32_SDMMC2_H
-#include <mmc.h>
#include <stdbool.h>
+#include <drivers/mmc.h>
+
struct stm32_sdmmc2_params {
uintptr_t reg_base;
unsigned int clk_rate;
diff --git a/include/drivers/st/stm32_uart_regs.h b/include/drivers/st/stm32_uart_regs.h
index e78d3d481..14b296c4b 100644
--- a/include/drivers/st/stm32_uart_regs.h
+++ b/include/drivers/st/stm32_uart_regs.h
@@ -7,7 +7,7 @@
#ifndef STM32_UART_REGS_H
#define STM32_UART_REGS_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
#define USART_CR1 U(0x00)
#define USART_CR2 U(0x04)
diff --git a/include/drivers/st/stm32mp1_clk.h b/include/drivers/st/stm32mp1_clk.h
index c89551725..5594e2327 100644
--- a/include/drivers/st/stm32mp1_clk.h
+++ b/include/drivers/st/stm32mp1_clk.h
@@ -7,9 +7,10 @@
#ifndef STM32MP1_CLK_H
#define STM32MP1_CLK_H
-#include <arch_helpers.h>
#include <stdbool.h>
+#include <arch_helpers.h>
+
int stm32mp1_clk_probe(void);
int stm32mp1_clk_init(void);
bool stm32mp1_clk_is_enabled(unsigned long id);
diff --git a/include/drivers/st/stm32mp1_clkfunc.h b/include/drivers/st/stm32mp1_clkfunc.h
index 2467af9bb..106dcae01 100644
--- a/include/drivers/st/stm32mp1_clkfunc.h
+++ b/include/drivers/st/stm32mp1_clkfunc.h
@@ -7,9 +7,10 @@
#ifndef STM32MP1_CLKFUNC_H
#define STM32MP1_CLKFUNC_H
-#include <libfdt.h>
#include <stdbool.h>
+#include <libfdt.h>
+
enum stm32mp_osc_id {
_HSI,
_HSE,
diff --git a/include/drivers/st/stm32mp1_ddr_regs.h b/include/drivers/st/stm32mp1_ddr_regs.h
index 288e072d2..bfcd5e210 100644
--- a/include/drivers/st/stm32mp1_ddr_regs.h
+++ b/include/drivers/st/stm32mp1_ddr_regs.h
@@ -7,7 +7,7 @@
#ifndef STM32MP1_DDR_REGS_H
#define STM32MP1_DDR_REGS_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/* DDR3/LPDDR2/LPDDR3 Controller (DDRCTRL) registers */
struct stm32mp1_ddrctl {
diff --git a/include/drivers/st/stm32mp1_pmic.h b/include/drivers/st/stm32mp1_pmic.h
index cc80b25ab..256e340be 100644
--- a/include/drivers/st/stm32mp1_pmic.h
+++ b/include/drivers/st/stm32mp1_pmic.h
@@ -9,6 +9,8 @@
#include <stdbool.h>
+#include <stm32mp1_def.h>
+
bool dt_check_pmic(void);
int dt_pmic_enable_boot_on_regulators(void);
void initialize_pmic_i2c(void);
diff --git a/include/drivers/st/stm32mp1_pwr.h b/include/drivers/st/stm32mp1_pwr.h
index b34536eae..e17df44fb 100644
--- a/include/drivers/st/stm32mp1_pwr.h
+++ b/include/drivers/st/stm32mp1_pwr.h
@@ -7,7 +7,7 @@
#ifndef STM32MP1_PWR_H
#define STM32MP1_PWR_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
#define PWR_CR1 U(0x00)
#define PWR_CR2 U(0x08)
diff --git a/include/drivers/st/stm32mp1_rcc.h b/include/drivers/st/stm32mp1_rcc.h
index 87f4d7f73..fd406c57e 100644
--- a/include/drivers/st/stm32mp1_rcc.h
+++ b/include/drivers/st/stm32mp1_rcc.h
@@ -7,7 +7,7 @@
#ifndef STM32MP1_RCC_H
#define STM32MP1_RCC_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
#define RCC_TZCR U(0x00)
#define RCC_OCENSETR U(0x0C)
diff --git a/include/drivers/st/stpmu1.h b/include/drivers/st/stpmu1.h
index 4bbcebbec..e75d9a66b 100644
--- a/include/drivers/st/stpmu1.h
+++ b/include/drivers/st/stpmu1.h
@@ -7,8 +7,8 @@
#ifndef STPMU1_H
#define STPMU1_H
-#include <stm32_i2c.h>
-#include <utils_def.h>
+#include <drivers/st/stm32_i2c.h>
+#include <lib/utils_def.h>
#define TURN_ON_REG 0x1U
#define TURN_OFF_REG 0x2U
diff --git a/include/drivers/synopsys/dw_mmc.h b/include/drivers/synopsys/dw_mmc.h
index 533a876fc..7031e0f46 100644
--- a/include/drivers/synopsys/dw_mmc.h
+++ b/include/drivers/synopsys/dw_mmc.h
@@ -7,7 +7,7 @@
#ifndef DW_MMC_H
#define DW_MMC_H
-#include <mmc.h>
+#include <drivers/mmc.h>
typedef struct dw_mmc_params {
uintptr_t reg_base;
diff --git a/include/drivers/ti/uart/uart_16550.h b/include/drivers/ti/uart/uart_16550.h
index ad80c5772..92b1ea8c3 100644
--- a/include/drivers/ti/uart/uart_16550.h
+++ b/include/drivers/ti/uart/uart_16550.h
@@ -7,7 +7,7 @@
#ifndef UART_16550_H
#define UART_16550_H
-#include <console.h>
+#include <drivers/console.h>
/* UART16550 Registers */
#define UARTTX 0x0
diff --git a/include/drivers/ufs.h b/include/drivers/ufs.h
index 414649bd4..a10cd8034 100644
--- a/include/drivers/ufs.h
+++ b/include/drivers/ufs.h
@@ -7,7 +7,7 @@
#ifndef UFS_H
#define UFS_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/* register map of UFSHCI */
/* Controller Capabilities */
diff --git a/include/lib/bakery_lock.h b/include/lib/bakery_lock.h
index 2d1612e17..a2f540c62 100644
--- a/include/lib/bakery_lock.h
+++ b/include/lib/bakery_lock.h
@@ -15,7 +15,8 @@
#include <cdefs.h>
#include <stdbool.h>
#include <stdint.h>
-#include <utils_def.h>
+
+#include <lib/utils_def.h>
/*****************************************************************************
* Internal helpers used by the bakery lock implementation.
diff --git a/include/lib/cpus/aarch32/cortex_a57.h b/include/lib/cpus/aarch32/cortex_a57.h
index 6f60c1146..2ac1e17d8 100644
--- a/include/lib/cpus/aarch32/cortex_a57.h
+++ b/include/lib/cpus/aarch32/cortex_a57.h
@@ -7,7 +7,7 @@
#ifndef CORTEX_A57_H
#define CORTEX_A57_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/* Cortex-A57 midr for revision 0 */
#define CORTEX_A57_MIDR 0x410FD070
diff --git a/include/lib/cpus/aarch32/cortex_a72.h b/include/lib/cpus/aarch32/cortex_a72.h
index f45865a39..95402d0a7 100644
--- a/include/lib/cpus/aarch32/cortex_a72.h
+++ b/include/lib/cpus/aarch32/cortex_a72.h
@@ -6,7 +6,8 @@
#ifndef CORTEX_A72_H
#define CORTEX_A72_H
-#include <utils_def.h>
+
+#include <lib/utils_def.h>
/* Cortex-A72 midr for revision 0 */
#define CORTEX_A72_MIDR 0x410FD080
diff --git a/include/lib/cpus/aarch32/cpu_macros.S b/include/lib/cpus/aarch32/cpu_macros.S
index 1c0da0f2b..a5ae6a486 100644
--- a/include/lib/cpus/aarch32/cpu_macros.S
+++ b/include/lib/cpus/aarch32/cpu_macros.S
@@ -7,7 +7,7 @@
#define CPU_MACROS_S
#include <arch.h>
-#include <errata_report.h>
+#include <lib/cpus/errata_report.h>
#if defined(IMAGE_BL1) || defined(IMAGE_BL32) || (defined(IMAGE_BL2) && BL2_AT_EL3)
#define IMAGE_AT_EL3
diff --git a/include/lib/cpus/aarch64/cortex_a57.h b/include/lib/cpus/aarch64/cortex_a57.h
index 71d07db5f..5b6c9dd29 100644
--- a/include/lib/cpus/aarch64/cortex_a57.h
+++ b/include/lib/cpus/aarch64/cortex_a57.h
@@ -6,7 +6,8 @@
#ifndef CORTEX_A57_H
#define CORTEX_A57_H
-#include <utils_def.h>
+
+#include <lib/utils_def.h>
/* Cortex-A57 midr for revision 0 */
#define CORTEX_A57_MIDR U(0x410FD070)
diff --git a/include/lib/cpus/aarch64/cortex_a72.h b/include/lib/cpus/aarch64/cortex_a72.h
index 4eafc11e1..60b6c6190 100644
--- a/include/lib/cpus/aarch64/cortex_a72.h
+++ b/include/lib/cpus/aarch64/cortex_a72.h
@@ -6,7 +6,8 @@
#ifndef CORTEX_A72_H
#define CORTEX_A72_H
-#include <utils_def.h>
+
+#include <lib/utils_def.h>
/* Cortex-A72 midr for revision 0 */
#define CORTEX_A72_MIDR 0x410FD080
diff --git a/include/lib/cpus/aarch64/cortex_a75.h b/include/lib/cpus/aarch64/cortex_a75.h
index f68f98f63..fabc1afdc 100644
--- a/include/lib/cpus/aarch64/cortex_a75.h
+++ b/include/lib/cpus/aarch64/cortex_a75.h
@@ -7,7 +7,7 @@
#ifndef CORTEX_A75_H
#define CORTEX_A75_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/* Cortex-A75 MIDR */
#define CORTEX_A75_MIDR U(0x410fd0a0)
diff --git a/include/lib/cpus/aarch64/cortex_ares.h b/include/lib/cpus/aarch64/cortex_ares.h
index 4f3e81296..cfc36e473 100644
--- a/include/lib/cpus/aarch64/cortex_ares.h
+++ b/include/lib/cpus/aarch64/cortex_ares.h
@@ -7,7 +7,7 @@
#ifndef CORTEX_ARES_H
#define CORTEX_ARES_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/* Cortex-ARES MIDR for revision 0 */
#define CORTEX_ARES_MIDR U(0x410fd0c0)
diff --git a/include/lib/cpus/aarch64/cpu_macros.S b/include/lib/cpus/aarch64/cpu_macros.S
index 287570054..b907668b3 100644
--- a/include/lib/cpus/aarch64/cpu_macros.S
+++ b/include/lib/cpus/aarch64/cpu_macros.S
@@ -7,7 +7,7 @@
#define CPU_MACROS_S
#include <arch.h>
-#include <errata_report.h>
+#include <lib/cpus/errata_report.h>
#define CPU_IMPL_PN_MASK (MIDR_IMPL_MASK << MIDR_IMPL_SHIFT) | \
(MIDR_PN_MASK << MIDR_PN_SHIFT)
diff --git a/include/lib/cpus/aarch64/dsu_def.h b/include/lib/cpus/aarch64/dsu_def.h
index 0e2d93a8c..aa8b1b1ab 100644
--- a/include/lib/cpus/aarch64/dsu_def.h
+++ b/include/lib/cpus/aarch64/dsu_def.h
@@ -7,7 +7,7 @@
#ifndef DSU_DEF_H
#define DSU_DEF_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/********************************************************************
* DSU control registers definitions *
diff --git a/include/lib/cpus/errata_report.h b/include/lib/cpus/errata_report.h
index c97d4c247..17b2c30f8 100644
--- a/include/lib/cpus/errata_report.h
+++ b/include/lib/cpus/errata_report.h
@@ -11,8 +11,8 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <spinlock.h>
-#include <utils_def.h>
+#include <lib/spinlock.h>
+#include <lib/utils_def.h>
#if DEBUG
void print_errata_status(void);
diff --git a/include/lib/el3_runtime/aarch32/context.h b/include/lib/el3_runtime/aarch32/context.h
index 1ea19ca7c..86ff53a67 100644
--- a/include/lib/el3_runtime/aarch32/context.h
+++ b/include/lib/el3_runtime/aarch32/context.h
@@ -7,7 +7,7 @@
#ifndef CONTEXT_H
#define CONTEXT_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/*******************************************************************************
* Constants that allow assembler code to access members of and the 'regs'
@@ -26,9 +26,10 @@
#ifndef __ASSEMBLY__
-#include <cassert.h>
#include <stdint.h>
+#include <lib/cassert.h>
+
/*
* Common constants to help define the 'cpu_context' structure and its
* members below.
diff --git a/include/lib/el3_runtime/aarch64/context.h b/include/lib/el3_runtime/aarch64/context.h
index 8c5f4c68d..70c50aae2 100644
--- a/include/lib/el3_runtime/aarch64/context.h
+++ b/include/lib/el3_runtime/aarch64/context.h
@@ -7,7 +7,7 @@
#ifndef CONTEXT_H
#define CONTEXT_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/*******************************************************************************
* Constants that allow assembler code to access members of and the 'gp_regs'
@@ -180,10 +180,12 @@
#ifndef __ASSEMBLY__
-#include <cassert.h>
-#include <platform_def.h> /* for CACHE_WRITEBACK_GRANULE */
#include <stdint.h>
+#include <platform_def.h> /* for CACHE_WRITEBACK_GRANULE */
+
+#include <lib/cassert.h>
+
/*
* Common constants to help define the 'cpu_context' structure and its
* members below.
diff --git a/include/lib/el3_runtime/context_mgmt.h b/include/lib/el3_runtime/context_mgmt.h
index 149ac3ffd..f23f9cd44 100644
--- a/include/lib/el3_runtime/context_mgmt.h
+++ b/include/lib/el3_runtime/context_mgmt.h
@@ -7,11 +7,12 @@
#ifndef CONTEXT_MGMT_H
#define CONTEXT_MGMT_H
-#include <arch.h>
#include <assert.h>
#include <context.h>
#include <stdint.h>
+#include <arch.h>
+
/*******************************************************************************
* Forward declarations
******************************************************************************/
diff --git a/include/lib/el3_runtime/cpu_data.h b/include/lib/el3_runtime/cpu_data.h
index 561f8beed..9e1d7f16c 100644
--- a/include/lib/el3_runtime/cpu_data.h
+++ b/include/lib/el3_runtime/cpu_data.h
@@ -7,9 +7,10 @@
#ifndef CPU_DATA_H
#define CPU_DATA_H
-#include <ehf.h>
#include <platform_def.h> /* CACHE_WRITEBACK_GRANULE required */
+#include <bl31/ehf.h>
+
#ifdef AARCH32
#if CRASH_REPORTING
@@ -51,9 +52,9 @@
#ifndef __ASSEMBLY__
#include <arch_helpers.h>
-#include <cassert.h>
+#include <lib/cassert.h>
+#include <lib/psci/psci.h>
#include <platform_def.h>
-#include <psci.h>
#include <stdint.h>
/* Offsets for the cpu_data structure */
diff --git a/include/lib/el3_runtime/pubsub.h b/include/lib/el3_runtime/pubsub.h
index 930952ff8..eb9128656 100644
--- a/include/lib/el3_runtime/pubsub.h
+++ b/include/lib/el3_runtime/pubsub.h
@@ -30,11 +30,12 @@
/* For the compiler ... */
-#include <arch_helpers.h>
#include <assert.h>
#include <cdefs.h>
#include <stddef.h>
+#include <arch_helpers.h>
+
#define __pubsub_section(event) __section("__pubsub_" #event)
/*
diff --git a/include/lib/el3_runtime/pubsub_events.h b/include/lib/el3_runtime/pubsub_events.h
index 64b3f630c..8e4a87afd 100644
--- a/include/lib/el3_runtime/pubsub_events.h
+++ b/include/lib/el3_runtime/pubsub_events.h
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <pubsub.h>
+#include <lib/el3_runtime/pubsub.h>
/*
* This file defines a list of pubsub events, declared using
diff --git a/include/lib/extensions/amu.h b/include/lib/extensions/amu.h
index 1836fe5ae..99ecfccbb 100644
--- a/include/lib/extensions/amu.h
+++ b/include/lib/extensions/amu.h
@@ -7,11 +7,13 @@
#ifndef AMU_H
#define AMU_H
-#include <cassert.h>
-#include <platform_def.h>
#include <stdbool.h>
#include <stdint.h>
-#include <utils_def.h>
+
+#include <platform_def.h>
+
+#include <lib/cassert.h>
+#include <lib/utils_def.h>
/* All group 0 counters */
#define AMU_GROUP0_COUNTERS_MASK U(0xf)
diff --git a/include/lib/extensions/ras.h b/include/lib/extensions/ras.h
index 62fd63f93..9f6b2905f 100644
--- a/include/lib/extensions/ras.h
+++ b/include/lib/extensions/ras.h
@@ -71,7 +71,8 @@
#ifndef __ASSEMBLY__
#include <assert.h>
-#include <ras_arch.h>
+
+#include <lib/extensions/ras_arch.h>
struct err_record_info;
diff --git a/include/lib/extensions/ras_arch.h b/include/lib/extensions/ras_arch.h
index e6cd736ae..e9375a356 100644
--- a/include/lib/extensions/ras_arch.h
+++ b/include/lib/extensions/ras_arch.h
@@ -184,7 +184,7 @@
#include <arch_helpers.h>
#include <assert.h>
#include <context.h>
-#include <mmio.h>
+#include <lib/mmio.h>
#include <stdint.h>
/*
diff --git a/include/lib/libc/assert.h b/include/lib/libc/assert.h
index 2cca6a0b2..d04f9dc04 100644
--- a/include/lib/libc/assert.h
+++ b/include/lib/libc/assert.h
@@ -8,9 +8,11 @@
#define ASSERT_H
#include <cdefs.h>
-#include <debug.h>
+
#include <platform_def.h>
+#include <common/debug.h>
+
#ifndef PLAT_LOG_LEVEL_ASSERT
#define PLAT_LOG_LEVEL_ASSERT LOG_LEVEL
#endif
diff --git a/include/lib/object_pool.h b/include/lib/object_pool.h
index 7d40b41d8..0f85331a8 100644
--- a/include/lib/object_pool.h
+++ b/include/lib/object_pool.h
@@ -7,9 +7,10 @@
#ifndef OBJECT_POOL_H
#define OBJECT_POOL_H
-#include <debug.h>
#include <stdlib.h>
-#include <utils_def.h>
+
+#include <common/debug.h>
+#include <lib/utils_def.h>
/*
* Pool of statically allocated objects.
diff --git a/include/lib/optee_utils.h b/include/lib/optee_utils.h
index b13c4504f..6067caff4 100644
--- a/include/lib/optee_utils.h
+++ b/include/lib/optee_utils.h
@@ -3,10 +3,11 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#ifndef OPTEE_UTILS_H
#define OPTEE_UTILS_H
-#include <bl_common.h>
+#include <common/bl_common.h>
int parse_optee_header(entry_point_info_t *header_ep,
image_info_t *pager_image_info,
diff --git a/include/lib/pmf/pmf.h b/include/lib/pmf/pmf.h
index 18ef0a559..df7c9ff31 100644
--- a/include/lib/pmf/pmf.h
+++ b/include/lib/pmf/pmf.h
@@ -7,9 +7,9 @@
#ifndef PMF_H
#define PMF_H
-#include <cassert.h>
-#include <pmf_helpers.h>
-#include <utils_def.h>
+#include <lib/cassert.h>
+#include <lib/pmf/pmf_helpers.h>
+#include <lib/utils_def.h>
/*
* Constants used for/by PMF services.
diff --git a/include/lib/pmf/pmf_helpers.h b/include/lib/pmf/pmf_helpers.h
index c535b222d..e6798a7ce 100644
--- a/include/lib/pmf/pmf_helpers.h
+++ b/include/lib/pmf/pmf_helpers.h
@@ -7,13 +7,14 @@
#ifndef PMF_HELPERS_H
#define PMF_HELPERS_H
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <platform.h>
#include <stddef.h>
#include <stdint.h>
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <plat/common/platform.h>
+
/*
* Prototype for PMF service functions.
*/
diff --git a/include/lib/psci/psci.h b/include/lib/psci/psci.h
index b7febc38f..fe279d4f2 100644
--- a/include/lib/psci/psci.h
+++ b/include/lib/psci/psci.h
@@ -7,11 +7,12 @@
#ifndef PSCI_H
#define PSCI_H
-#include <bakery_lock.h>
-#include <bl_common.h>
#include <platform_def.h> /* for PLAT_NUM_PWR_DOMAINS */
-#include <psci_lib.h> /* To maintain compatibility for SPDs */
-#include <utils_def.h>
+
+#include <common/bl_common.h>
+#include <lib/bakery_lock.h>
+#include <lib/psci/psci_lib.h> /* To maintain compatibility for SPDs */
+#include <lib/utils_def.h>
/*******************************************************************************
* Number of power domains whose state this PSCI implementation can track
diff --git a/include/lib/psci/psci_lib.h b/include/lib/psci/psci_lib.h
index 134cad9e0..53d7711b1 100644
--- a/include/lib/psci/psci_lib.h
+++ b/include/lib/psci/psci_lib.h
@@ -7,9 +7,10 @@
#ifndef PSCI_LIB_H
#define PSCI_LIB_H
-#include <ep_info.h>
+#include <common/ep_info.h>
#ifndef __ASSEMBLY__
+
#include <cdefs.h>
#include <stdint.h>
diff --git a/include/lib/runtime_instr.h b/include/lib/runtime_instr.h
index cb648391e..f5a3f1386 100644
--- a/include/lib/runtime_instr.h
+++ b/include/lib/runtime_instr.h
@@ -7,7 +7,7 @@
#ifndef RUNTIME_INSTR_H
#define RUNTIME_INSTR_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
#define RT_INSTR_ENTER_PSCI U(0)
#define RT_INSTR_EXIT_PSCI U(1)
diff --git a/include/lib/smccc.h b/include/lib/smccc.h
index 6ee8aa07d..b10c52ce9 100644
--- a/include/lib/smccc.h
+++ b/include/lib/smccc.h
@@ -7,7 +7,7 @@
#ifndef SMCCC_H
#define SMCCC_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
#define SMCCC_VERSION_MAJOR_SHIFT U(16)
#define SMCCC_VERSION_MAJOR_MASK U(0x7FFF)
@@ -21,10 +21,10 @@
#if SMCCC_MAJOR_VERSION == 1
# define SMCCC_MINOR_VERSION U(1)
-# include <smccc_v1.h>
+# include <lib/smccc_v1.h>
#elif SMCCC_MAJOR_VERSION == 2
# define SMCCC_MINOR_VERSION U(0)
-# include <smccc_v2.h>
+# include <lib/smccc_v2.h>
#else
# error "Unsupported version of SMCCC."
#endif
@@ -35,9 +35,10 @@
#ifndef __ASSEMBLY__
-#include <cassert.h>
#include <stdint.h>
+#include <lib/cassert.h>
+
#define is_caller_non_secure(_f) (((_f) & SMC_FROM_NON_SECURE) != U(0))
#define is_caller_secure(_f) (!is_caller_non_secure(_f))
diff --git a/include/lib/utils.h b/include/lib/utils.h
index b6ab26ec7..674845404 100644
--- a/include/lib/utils.h
+++ b/include/lib/utils.h
@@ -13,6 +13,7 @@
*/
#if !(defined(__LINKER__) || defined(__ASSEMBLY__))
+#include <stddef.h>
#include <stdint.h>
typedef struct mem_region {
diff --git a/include/lib/xlat_tables/aarch32/xlat_tables_aarch32.h b/include/lib/xlat_tables/aarch32/xlat_tables_aarch32.h
index 37f3b53b7..a333d1e4e 100644
--- a/include/lib/xlat_tables/aarch32/xlat_tables_aarch32.h
+++ b/include/lib/xlat_tables/aarch32/xlat_tables_aarch32.h
@@ -8,8 +8,8 @@
#define XLAT_TABLES_AARCH32_H
#include <arch.h>
-#include <utils_def.h>
-#include <xlat_tables_defs.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
#if !defined(PAGE_SIZE)
#error "PAGE_SIZE is not defined."
diff --git a/include/lib/xlat_tables/aarch64/xlat_tables_aarch64.h b/include/lib/xlat_tables/aarch64/xlat_tables_aarch64.h
index 91ca8e477..cc5624c91 100644
--- a/include/lib/xlat_tables/aarch64/xlat_tables_aarch64.h
+++ b/include/lib/xlat_tables/aarch64/xlat_tables_aarch64.h
@@ -8,8 +8,8 @@
#define XLAT_TABLES_AARCH64_H
#include <arch.h>
-#include <utils_def.h>
-#include <xlat_tables_defs.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
#if !defined(PAGE_SIZE)
#error "PAGE_SIZE is not defined."
diff --git a/include/lib/xlat_tables/xlat_tables.h b/include/lib/xlat_tables/xlat_tables.h
index 050679d94..9e2543fbb 100644
--- a/include/lib/xlat_tables/xlat_tables.h
+++ b/include/lib/xlat_tables/xlat_tables.h
@@ -7,12 +7,13 @@
#ifndef XLAT_TABLES_H
#define XLAT_TABLES_H
-#include <xlat_tables_defs.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
#ifndef __ASSEMBLY__
#include <stddef.h>
#include <stdint.h>
-#include <xlat_mmu_helpers.h>
+
+#include <lib/xlat_tables/xlat_mmu_helpers.h>
/* Helper macro to define entries for mmap_region_t. It creates
* identity mappings for each region.
diff --git a/include/lib/xlat_tables/xlat_tables_compat.h b/include/lib/xlat_tables/xlat_tables_compat.h
index 4650a8c6f..90768db5d 100644
--- a/include/lib/xlat_tables/xlat_tables_compat.h
+++ b/include/lib/xlat_tables/xlat_tables_compat.h
@@ -5,7 +5,7 @@
*/
#if XLAT_TABLES_LIB_V2
-#include <xlat_tables_v2.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
#else
-#include <xlat_tables.h>
+#include <lib/xlat_tables/xlat_tables.h>
#endif
diff --git a/include/lib/xlat_tables/xlat_tables_defs.h b/include/lib/xlat_tables/xlat_tables_defs.h
index 09baae9bf..6d0fb7896 100644
--- a/include/lib/xlat_tables/xlat_tables_defs.h
+++ b/include/lib/xlat_tables/xlat_tables_defs.h
@@ -8,8 +8,8 @@
#define XLAT_TABLES_DEFS_H
#include <arch.h>
-#include <utils_def.h>
-#include <xlat_mmu_helpers.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_mmu_helpers.h>
/* Miscellaneous MMU related constants */
#define NUM_2MB_IN_GB (U(1) << 9)
diff --git a/include/lib/xlat_tables/xlat_tables_v2.h b/include/lib/xlat_tables/xlat_tables_v2.h
index 5c4edc31a..555142683 100644
--- a/include/lib/xlat_tables/xlat_tables_v2.h
+++ b/include/lib/xlat_tables/xlat_tables_v2.h
@@ -7,13 +7,14 @@
#ifndef XLAT_TABLES_V2_H
#define XLAT_TABLES_V2_H
-#include <xlat_tables_defs.h>
-#include <xlat_tables_v2_helpers.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+#include <lib/xlat_tables/xlat_tables_v2_helpers.h>
#ifndef __ASSEMBLY__
#include <stddef.h>
#include <stdint.h>
-#include <xlat_mmu_helpers.h>
+
+#include <lib/xlat_tables/xlat_mmu_helpers.h>
/*
* Default granularity size for an mmap_region_t.
diff --git a/include/lib/xlat_tables/xlat_tables_v2_helpers.h b/include/lib/xlat_tables/xlat_tables_v2_helpers.h
index fa8995886..ce5cf820a 100644
--- a/include/lib/xlat_tables/xlat_tables_v2_helpers.h
+++ b/include/lib/xlat_tables/xlat_tables_v2_helpers.h
@@ -18,12 +18,14 @@
#ifndef __ASSEMBLY__
-#include <cassert.h>
-#include <platform_def.h>
#include <stdbool.h>
#include <stddef.h>
-#include <xlat_tables_arch.h>
-#include <xlat_tables_defs.h>
+
+#include <platform_def.h>
+
+#include <lib/cassert.h>
+#include <lib/xlat_tables/xlat_tables_arch.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
/* Forward declaration */
struct mmap_region;
diff --git a/include/plat/arm/board/common/board_css_def.h b/include/plat/arm/board/common/board_css_def.h
index 29211be2a..6cca38909 100644
--- a/include/plat/arm/board/common/board_css_def.h
+++ b/include/plat/arm/board/common/board_css_def.h
@@ -7,9 +7,10 @@
#ifndef BOARD_CSS_DEF_H
#define BOARD_CSS_DEF_H
-#include <common_def.h>
+#include <lib/utils_def.h>
+#include <plat/common/common_def.h>
+
#include <soc_css_def.h>
-#include <utils_def.h>
#include <v2m_def.h>
/*
@@ -31,7 +32,7 @@
#ifndef __ASSEMBLY__
-#include <mmio.h>
+#include <lib/mmio.h>
#define BOARD_CSS_GET_PLAT_TYPE(addr) \
((mmio_read_32(addr) & BOARD_CSS_PLAT_ID_REG_ID_MASK) \
diff --git a/include/plat/arm/board/common/v2m_def.h b/include/plat/arm/board/common/v2m_def.h
index ed57fc9a0..c5de407af 100644
--- a/include/plat/arm/board/common/v2m_def.h
+++ b/include/plat/arm/board/common/v2m_def.h
@@ -6,7 +6,7 @@
#ifndef V2M_DEF_H
#define V2M_DEF_H
-#include <xlat_tables_compat.h>
+#include <lib/xlat_tables/xlat_tables_compat.h>
/* V2M motherboard system registers & offsets */
#define V2M_SYSREGS_BASE UL(0x1c010000)
diff --git a/include/plat/arm/common/aarch64/arm_macros.S b/include/plat/arm/common/aarch64/arm_macros.S
index c2ba7db9f..0bd0daf53 100644
--- a/include/plat/arm/common/aarch64/arm_macros.S
+++ b/include/plat/arm/common/aarch64/arm_macros.S
@@ -6,9 +6,9 @@
#ifndef ARM_MACROS_S
#define ARM_MACROS_S
-#include <gic_common.h>
-#include <gicv2.h>
-#include <gicv3.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/include/plat/arm/common/aarch64/cci_macros.S b/include/plat/arm/common/aarch64/cci_macros.S
index 069dc854f..07f7cd39a 100644
--- a/include/plat/arm/common/aarch64/cci_macros.S
+++ b/include/plat/arm/common/aarch64/cci_macros.S
@@ -6,7 +6,7 @@
#ifndef CCI_MACROS_S
#define CCI_MACROS_S
-#include <cci.h>
+#include <drivers/arm/cci.h>
#include <platform_def.h>
.section .rodata.cci_reg_name, "aS"
diff --git a/include/plat/arm/common/arm_config.h b/include/plat/arm/common/arm_config.h
index 4dda35060..c2b28df5b 100644
--- a/include/plat/arm/common/arm_config.h
+++ b/include/plat/arm/common/arm_config.h
@@ -7,7 +7,8 @@
#define ARM_CONFIG_H
#include <stdint.h>
-#include <utils_def.h>
+
+#include <lib/utils_def.h>
/* Whether Base memory map is in use */
#define ARM_CONFIG_BASE_MMAP BIT(1)
diff --git a/include/plat/arm/common/arm_def.h b/include/plat/arm/common/arm_def.h
index 4ab3a8086..c63fddb3f 100644
--- a/include/plat/arm/common/arm_def.h
+++ b/include/plat/arm/common/arm_def.h
@@ -6,15 +6,15 @@
#ifndef ARM_DEF_H
#define ARM_DEF_H
-#include <arch.h>
-#include <common_def.h>
-#include <gic_common.h>
-#include <interrupt_props.h>
#include <platform_def.h>
-#include <tbbr_img_def.h>
-#include <utils_def.h>
-#include <xlat_tables_defs.h>
+#include <arch.h>
+#include <common/interrupt_props.h>
+#include <common/tbbr/tbbr_img_def.h>
+#include <drivers/arm/gic_common.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+#include <plat/common/common_def.h>
/******************************************************************************
* Definitions common to all ARM standard platforms
diff --git a/include/plat/arm/common/arm_sip_svc.h b/include/plat/arm/common/arm_sip_svc.h
index 3e25cbc6a..16573ce6a 100644
--- a/include/plat/arm/common/arm_sip_svc.h
+++ b/include/plat/arm/common/arm_sip_svc.h
@@ -7,7 +7,7 @@
#ifndef ARM_SIP_SVC_H
#define ARM_SIP_SVC_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/* SMC function IDs for SiP Service queries */
diff --git a/include/plat/arm/common/arm_spm_def.h b/include/plat/arm/common/arm_spm_def.h
index bf3cb8fa0..bdcbc96af 100644
--- a/include/plat/arm/common/arm_spm_def.h
+++ b/include/plat/arm/common/arm_spm_def.h
@@ -6,9 +6,10 @@
#ifndef ARM_SPM_DEF_H
#define ARM_SPM_DEF_H
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+
#include <arm_def.h>
-#include <utils_def.h>
-#include <xlat_tables_defs.h>
/*
* Reserve 4 MiB for binaries of Secure Partitions and Resource Description
diff --git a/include/plat/arm/common/arm_tzc_dram.ld.S b/include/plat/arm/common/arm_tzc_dram.ld.S
index df951e117..6dcea0b6e 100644
--- a/include/plat/arm/common/arm_tzc_dram.ld.S
+++ b/include/plat/arm/common/arm_tzc_dram.ld.S
@@ -3,10 +3,10 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef ARM_TZC_DRAM_LD_S__
-#define ARM_TZC_DRAM_LD_S__
+#ifndef ARM_TZC_DRAM_LD_S
+#define ARM_TZC_DRAM_LD_S
-#include <xlat_tables_defs.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
MEMORY {
EL3_SEC_DRAM (rw): ORIGIN = ARM_EL3_TZC_DRAM1_BASE, LENGTH = ARM_EL3_TZC_DRAM1_SIZE
@@ -27,4 +27,4 @@ SECTIONS
} >EL3_SEC_DRAM
}
-#endif /* ARM_TZC_DRAM_LD_S__ */
+#endif /* ARM_TZC_DRAM_LD_S */
diff --git a/include/plat/arm/common/plat_arm.h b/include/plat/arm/common/plat_arm.h
index 9b459841c..628160824 100644
--- a/include/plat/arm/common/plat_arm.h
+++ b/include/plat/arm/common/plat_arm.h
@@ -6,14 +6,15 @@
#ifndef PLAT_ARM_H
#define PLAT_ARM_H
-#include <bakery_lock.h>
-#include <cassert.h>
-#include <cpu_data.h>
#include <stdint.h>
-#include <spinlock.h>
-#include <tzc_common.h>
-#include <utils_def.h>
-#include <xlat_tables_compat.h>
+
+#include <drivers/arm/tzc_common.h>
+#include <lib/bakery_lock.h>
+#include <lib/cassert.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/spinlock.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_compat.h>
/*******************************************************************************
* Forward declarations
diff --git a/include/plat/arm/css/common/css_def.h b/include/plat/arm/css/common/css_def.h
index 4a7d314c9..6b355a4e9 100644
--- a/include/plat/arm/css/common/css_def.h
+++ b/include/plat/arm/css/common/css_def.h
@@ -7,10 +7,11 @@
#ifndef CSS_DEF_H
#define CSS_DEF_H
+#include <common/interrupt_props.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/tzc400.h>
+
#include <arm_def.h>
-#include <gic_common.h>
-#include <interrupt_props.h>
-#include <tzc400.h>
/*************************************************************************
* Definitions common to all ARM Compute SubSystems (CSS)
diff --git a/include/plat/arm/css/common/css_pm.h b/include/plat/arm/css/common/css_pm.h
index ff75c6916..b82ff47e7 100644
--- a/include/plat/arm/css/common/css_pm.h
+++ b/include/plat/arm/css/common/css_pm.h
@@ -8,9 +8,10 @@
#define CSS_PM_H
#include <cdefs.h>
-#include <psci.h>
#include <stdint.h>
+#include <lib/psci/psci.h>
+
/* Macros to read the CSS power domain state */
#define CSS_CORE_PWR_STATE(state) (state)->pwr_domain_state[ARM_PWR_LVL0]
#define CSS_CLUSTER_PWR_STATE(state) (state)->pwr_domain_state[ARM_PWR_LVL1]
diff --git a/include/plat/arm/soc/common/soc_css_def.h b/include/plat/arm/soc/common/soc_css_def.h
index 263313a9a..b4b6ba8e4 100644
--- a/include/plat/arm/soc/common/soc_css_def.h
+++ b/include/plat/arm/soc/common/soc_css_def.h
@@ -7,9 +7,8 @@
#ifndef SOC_CSS_DEF_H
#define SOC_CSS_DEF_H
-#include <common_def.h>
-#include <utils_def.h>
-
+#include <lib/utils_def.h>
+#include <plat/common/common_def.h>
/*
* Definitions common to all ARM CSS SoCs
diff --git a/include/plat/common/common_def.h b/include/plat/common/common_def.h
index 66074ac17..66c88ba8c 100644
--- a/include/plat/common/common_def.h
+++ b/include/plat/common/common_def.h
@@ -6,10 +6,11 @@
#ifndef COMMON_DEF_H
#define COMMON_DEF_H
-#include <bl_common.h>
#include <platform_def.h>
-#include <utils_def.h>
-#include <xlat_tables_defs.h>
+
+#include <common/bl_common.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
/******************************************************************************
* Required platform porting definitions that are expected to be common to
diff --git a/include/plat/common/platform.h b/include/plat/common/platform.h
index 04272b1b5..13767ff0a 100644
--- a/include/plat/common/platform.h
+++ b/include/plat/common/platform.h
@@ -7,9 +7,10 @@
#ifndef PLATFORM_H
#define PLATFORM_H
-#include <psci.h>
#include <stdint.h>
+#include <lib/psci/psci.h>
+
/*******************************************************************************
* Forward declarations
******************************************************************************/
diff --git a/include/plat/marvell/a3700/common/armada_common.h b/include/plat/marvell/a3700/common/armada_common.h
index fdcc02a66..c6953fb71 100644
--- a/include/plat/marvell/a3700/common/armada_common.h
+++ b/include/plat/marvell/a3700/common/armada_common.h
@@ -8,9 +8,10 @@
#ifndef ARMADA_COMMON_H
#define ARMADA_COMMON_H
-#include <io_addr_dec.h>
#include <stdint.h>
+#include <io_addr_dec.h>
+
int marvell_get_io_dec_win_conf(struct dec_win_config **win, uint32_t *size);
#endif /* ARMADA_COMMON_H */
diff --git a/include/plat/marvell/a3700/common/marvell_def.h b/include/plat/marvell/a3700/common/marvell_def.h
index 3c105fca7..229b8b029 100644
--- a/include/plat/marvell/a3700/common/marvell_def.h
+++ b/include/plat/marvell/a3700/common/marvell_def.h
@@ -8,12 +8,12 @@
#ifndef MARVELL_DEF_H
#define MARVELL_DEF_H
-#include <arch.h>
-#include <common_def.h>
#include <platform_def.h>
-#include <tbbr_img_def.h>
-#include <xlat_tables.h>
+#include <arch.h>
+#include <common/tbbr/tbbr_img_def.h>
+#include <lib/xlat_tables/xlat_tables.h>
+#include <plat/common/common_def.h>
/****************************************************************************
* Definitions common to all MARVELL standard platforms
diff --git a/include/plat/marvell/a3700/common/plat_marvell.h b/include/plat/marvell/a3700/common/plat_marvell.h
index 01e42c545..8b8b53ffe 100644
--- a/include/plat/marvell/a3700/common/plat_marvell.h
+++ b/include/plat/marvell/a3700/common/plat_marvell.h
@@ -8,11 +8,12 @@
#ifndef PLAT_MARVELL_H
#define PLAT_MARVELL_H
-#include <bl_common.h>
-#include <cassert.h>
-#include <cpu_data.h>
#include <stdint.h>
-#include <xlat_tables.h>
+
+#include <common/bl_common.h>
+#include <lib/cassert.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/xlat_tables/xlat_tables.h>
/*
* Extern declarations common to Marvell standard platforms
diff --git a/include/plat/marvell/a8k/common/armada_common.h b/include/plat/marvell/a8k/common/armada_common.h
index 64d9adf96..dd2a24abc 100644
--- a/include/plat/marvell/a8k/common/armada_common.h
+++ b/include/plat/marvell/a8k/common/armada_common.h
@@ -8,10 +8,10 @@
#ifndef ARMADA_COMMON_H
#define ARMADA_COMMON_H
-#include <amb_adec.h>
-#include <io_win.h>
-#include <iob.h>
-#include <ccu.h>
+#include <drivers/marvell/amb_adec.h>
+#include <drivers/marvell/ccu.h>
+#include <drivers/marvell/io_win.h>
+#include <drivers/marvell/iob.h>
/*
* This struct supports skip image request
diff --git a/include/plat/marvell/a8k/common/marvell_def.h b/include/plat/marvell/a8k/common/marvell_def.h
index c67b3cd87..5ba90f711 100644
--- a/include/plat/marvell/a8k/common/marvell_def.h
+++ b/include/plat/marvell/a8k/common/marvell_def.h
@@ -8,12 +8,12 @@
#ifndef MARVELL_DEF_H
#define MARVELL_DEF_H
-#include <arch.h>
-#include <common_def.h>
#include <platform_def.h>
-#include <tbbr_img_def.h>
-#include <xlat_tables.h>
+#include <arch.h>
+#include <common/tbbr/tbbr_img_def.h>
+#include <lib/xlat_tables/xlat_tables.h>
+#include <plat/common/common_def.h>
/******************************************************************************
* Definitions common to all MARVELL standard platforms
diff --git a/include/plat/marvell/a8k/common/plat_marvell.h b/include/plat/marvell/a8k/common/plat_marvell.h
index 037548da0..65d4de8a6 100644
--- a/include/plat/marvell/a8k/common/plat_marvell.h
+++ b/include/plat/marvell/a8k/common/plat_marvell.h
@@ -8,11 +8,12 @@
#ifndef PLAT_MARVELL_H
#define PLAT_MARVELL_H
-#include <cassert.h>
-#include <cpu_data.h>
#include <stdint.h>
-#include <utils.h>
-#include <xlat_tables.h>
+
+#include <lib/cassert.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables.h>
/*
* Extern declarations common to Marvell standard platforms
diff --git a/include/plat/marvell/common/aarch64/cci_macros.S b/include/plat/marvell/common/aarch64/cci_macros.S
index 96b364eeb..b0a909bb6 100644
--- a/include/plat/marvell/common/aarch64/cci_macros.S
+++ b/include/plat/marvell/common/aarch64/cci_macros.S
@@ -8,7 +8,7 @@
#ifndef CCI_MACROS_S
#define CCI_MACROS_S
-#include <cci.h>
+#include <drivers/arm/cci.h>
#include <platform_def.h>
.section .rodata.cci_reg_name, "aS"
diff --git a/include/plat/marvell/common/aarch64/marvell_macros.S b/include/plat/marvell/common/aarch64/marvell_macros.S
index c2a8bd055..bfe2d4127 100644
--- a/include/plat/marvell/common/aarch64/marvell_macros.S
+++ b/include/plat/marvell/common/aarch64/marvell_macros.S
@@ -8,10 +8,10 @@
#ifndef MARVELL_MACROS_S
#define MARVELL_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>
/*
diff --git a/include/plat/marvell/common/marvell_plat_priv.h b/include/plat/marvell/common/marvell_plat_priv.h
index 6f0b588a7..78b5331e4 100644
--- a/include/plat/marvell/common/marvell_plat_priv.h
+++ b/include/plat/marvell/common/marvell_plat_priv.h
@@ -8,7 +8,7 @@
#ifndef MARVELL_PLAT_PRIV_H
#define MARVELL_PLAT_PRIV_H
-#include <utils.h>
+#include <lib/utils.h>
/*****************************************************************************
* Function and variable prototypes
diff --git a/include/services/mm_svc.h b/include/services/mm_svc.h
index e2ce90fda..c81e90481 100644
--- a/include/services/mm_svc.h
+++ b/include/services/mm_svc.h
@@ -9,7 +9,7 @@
#if SPM_DEPRECATED
-#include <utils_def.h>
+#include <lib/utils_def.h>
#define MM_VERSION_MAJOR U(1)
#define MM_VERSION_MAJOR_SHIFT 16
diff --git a/include/services/sdei.h b/include/services/sdei.h
index 4d0fd3fd3..ae8c7e42f 100644
--- a/include/services/sdei.h
+++ b/include/services/sdei.h
@@ -7,8 +7,8 @@
#ifndef SDEI_H
#define SDEI_H
-#include <spinlock.h>
-#include <utils_def.h>
+#include <lib/spinlock.h>
+#include <lib/utils_def.h>
/* Range 0xC4000020 - 0xC400003F reserved for SDE 64bit smc calls */
#define SDEI_VERSION 0xC4000020U
diff --git a/include/services/secure_partition.h b/include/services/secure_partition.h
index 0ae6cf991..47f63684f 100644
--- a/include/services/secure_partition.h
+++ b/include/services/secure_partition.h
@@ -10,7 +10,8 @@
#if SPM_DEPRECATED
#include <stdint.h>
-#include <utils_def.h>
+
+#include <lib/utils_def.h>
/*
* Flags used by the secure_partition_mp_info structure to describe the
diff --git a/include/services/sp_res_desc.h b/include/services/sp_res_desc.h
index dc0022128..b8be72eeb 100644
--- a/include/services/sp_res_desc.h
+++ b/include/services/sp_res_desc.h
@@ -8,7 +8,8 @@
#define SPM_RES_DESC_H
#include <stdint.h>
-#include <sp_res_desc_def.h>
+
+#include <services/sp_res_desc_def.h>
/*******************************************************************************
* Attribute Section
diff --git a/include/services/sp_res_desc_def.h b/include/services/sp_res_desc_def.h
index 68df297a8..5a3c50d7f 100644
--- a/include/services/sp_res_desc_def.h
+++ b/include/services/sp_res_desc_def.h
@@ -7,7 +7,7 @@
#ifndef SPM_RES_DESC_DEFS_H
#define SPM_RES_DESC_DEFS_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/*******************************************************************************
* Attribute Section
diff --git a/include/services/spci_svc.h b/include/services/spci_svc.h
index eae4fb7fe..b82cf1e30 100644
--- a/include/services/spci_svc.h
+++ b/include/services/spci_svc.h
@@ -7,8 +7,8 @@
#ifndef SPCI_SVC_H
#define SPCI_SVC_H
-#include <smccc.h>
-#include <utils_def.h>
+#include <lib/smccc.h>
+#include <lib/utils_def.h>
/* SPCI_VERSION helpers */
diff --git a/include/services/spm_svc.h b/include/services/spm_svc.h
index 763b24eac..fcb409b29 100644
--- a/include/services/spm_svc.h
+++ b/include/services/spm_svc.h
@@ -9,7 +9,7 @@
#if SPM_DEPRECATED
-#include <utils_def.h>
+#include <lib/utils_def.h>
#define SPM_VERSION_MAJOR U(0)
#define SPM_VERSION_MAJOR_SHIFT 16
diff --git a/include/services/sprt_svc.h b/include/services/sprt_svc.h
index b6b51dd43..bd695e58a 100644
--- a/include/services/sprt_svc.h
+++ b/include/services/sprt_svc.h
@@ -7,8 +7,8 @@
#ifndef SPRT_SVC_H
#define SPRT_SVC_H
-#include <smccc.h>
-#include <utils_def.h>
+#include <lib/smccc.h>
+#include <lib/utils_def.h>
/* SPRT_VERSION helpers */
diff --git a/include/tools_share/firmware_image_package.h b/include/tools_share/firmware_image_package.h
index 9f586b0aa..598d5c258 100644
--- a/include/tools_share/firmware_image_package.h
+++ b/include/tools_share/firmware_image_package.h
@@ -8,7 +8,8 @@
#define FIRMWARE_IMAGE_PACKAGE_H
#include <stdint.h>
-#include <uuid.h>
+
+#include "uuid.h"
/* This is used as a signature to validate the blob header */
#define TOC_HEADER_NAME 0xAA640001
diff --git a/lib/aarch64/misc_helpers.S b/lib/aarch64/misc_helpers.S
index 8920f7297..9aac8cfb9 100644
--- a/lib/aarch64/misc_helpers.S
+++ b/lib/aarch64/misc_helpers.S
@@ -7,7 +7,7 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
-#include <xlat_tables_defs.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
#if !ERROR_DEPRECATED
.globl get_afflvl_shift
diff --git a/lib/coreboot/coreboot.mk b/lib/coreboot/coreboot.mk
index bbaa33294..420182350 100644
--- a/lib/coreboot/coreboot.mk
+++ b/lib/coreboot/coreboot.mk
@@ -19,6 +19,4 @@ BL31_SOURCES += $(addprefix lib/coreboot/, \
BL31_SOURCES += drivers/coreboot/cbmem_console/${ARCH}/cbmem_console.S
-INCLUDES += -Iinclude/drivers/coreboot
-
endif # COREBOOT
diff --git a/lib/coreboot/coreboot_table.c b/lib/coreboot/coreboot_table.c
index 64f8879e4..63bdc6359 100644
--- a/lib/coreboot/coreboot_table.c
+++ b/lib/coreboot/coreboot_table.c
@@ -5,12 +5,13 @@
*/
#include <assert.h>
-#include <cbmem_console.h>
-#include <coreboot.h>
-#include <debug.h>
-#include <mmio.h>
#include <string.h>
-#include <xlat_tables_v2.h>
+
+#include <drivers/coreboot/cbmem_console.h>
+#include <common/debug.h>
+#include <lib/coreboot.h>
+#include <lib/mmio.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
/*
* Structures describing coreboot's in-memory descriptor tables. See
diff --git a/lib/cpus/aarch32/cortex_a53.S b/lib/cpus/aarch32/cortex_a53.S
index 1647e169f..4975ec60d 100644
--- a/lib/cpus/aarch32/cortex_a53.S
+++ b/lib/cpus/aarch32/cortex_a53.S
@@ -3,12 +3,13 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
+#include <common/debug.h>
#include <cortex_a53.h>
#include <cpu_macros.S>
-#include <debug.h>
#if A53_DISABLE_NON_TEMPORAL_HINT
#undef ERRATA_A53_836870
diff --git a/lib/cpus/aarch32/cortex_a57.S b/lib/cpus/aarch32/cortex_a57.S
index dff86be76..04942d309 100644
--- a/lib/cpus/aarch32/cortex_a57.S
+++ b/lib/cpus/aarch32/cortex_a57.S
@@ -6,9 +6,9 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
+#include <common/debug.h>
#include <cortex_a57.h>
#include <cpu_macros.S>
-#include <debug.h>
/* ---------------------------------------------
* Disable intra-cluster coherency
diff --git a/lib/cpus/aarch32/cortex_a72.S b/lib/cpus/aarch32/cortex_a72.S
index 3bc3388bc..ff2b0e66e 100644
--- a/lib/cpus/aarch32/cortex_a72.S
+++ b/lib/cpus/aarch32/cortex_a72.S
@@ -6,9 +6,9 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
+#include <common/debug.h>
#include <cortex_a72.h>
#include <cpu_macros.S>
-#include <debug.h>
/* ---------------------------------------------
* Disable all types of L2 prefetches.
diff --git a/lib/cpus/aarch32/cpu_helpers.S b/lib/cpus/aarch32/cpu_helpers.S
index ddc080842..f84cd0dfa 100644
--- a/lib/cpus/aarch32/cpu_helpers.S
+++ b/lib/cpus/aarch32/cpu_helpers.S
@@ -7,8 +7,8 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
-#include <cpu_data.h>
#include <cpu_macros.S>
+#include <lib/el3_runtime/cpu_data.h>
#if defined(IMAGE_BL1) || defined(IMAGE_BL32) || (defined(IMAGE_BL2) && BL2_AT_EL3)
/*
diff --git a/lib/cpus/aarch64/cortex_a35.S b/lib/cpus/aarch64/cortex_a35.S
index 2e0d63161..96e5dd383 100644
--- a/lib/cpus/aarch64/cortex_a35.S
+++ b/lib/cpus/aarch64/cortex_a35.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <cortex_a35.h>
#include <cpu_macros.S>
#include <plat_macros.S>
diff --git a/lib/cpus/aarch64/cortex_a53.S b/lib/cpus/aarch64/cortex_a53.S
index 108509f1f..332bad75f 100644
--- a/lib/cpus/aarch64/cortex_a53.S
+++ b/lib/cpus/aarch64/cortex_a53.S
@@ -5,11 +5,11 @@
*/
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
#include <cortex_a53.h>
#include <cpu_macros.S>
-#include <debug.h>
-#include <errata_report.h>
+#include <lib/cpus/errata_report.h>
#include <plat_macros.S>
#if A53_DISABLE_NON_TEMPORAL_HINT
diff --git a/lib/cpus/aarch64/cortex_a55.S b/lib/cpus/aarch64/cortex_a55.S
index 4e9bd9f6f..b347e299c 100644
--- a/lib/cpus/aarch64/cortex_a55.S
+++ b/lib/cpus/aarch64/cortex_a55.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <cortex_a55.h>
#include <cpu_macros.S>
#include <plat_macros.S>
diff --git a/lib/cpus/aarch64/cortex_a57.S b/lib/cpus/aarch64/cortex_a57.S
index 8e6044551..a86267166 100644
--- a/lib/cpus/aarch64/cortex_a57.S
+++ b/lib/cpus/aarch64/cortex_a57.S
@@ -6,10 +6,10 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
#include <cortex_a57.h>
#include <cpu_macros.S>
-#include <debug.h>
#include <plat_macros.S>
/* ---------------------------------------------
diff --git a/lib/cpus/aarch64/cortex_a73.S b/lib/cpus/aarch64/cortex_a73.S
index b79656135..772b0be79 100644
--- a/lib/cpus/aarch64/cortex_a73.S
+++ b/lib/cpus/aarch64/cortex_a73.S
@@ -5,7 +5,7 @@
*/
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <cortex_a73.h>
#include <cpu_macros.S>
#include <plat_macros.S>
diff --git a/lib/cpus/aarch64/cortex_a75_pubsub.c b/lib/cpus/aarch64/cortex_a75_pubsub.c
index f4ca48606..bd2c6974e 100644
--- a/lib/cpus/aarch64/cortex_a75_pubsub.c
+++ b/lib/cpus/aarch64/cortex_a75_pubsub.c
@@ -6,7 +6,7 @@
#include <cortex_a75.h>
#include <cpuamu.h>
-#include <pubsub_events.h>
+#include <lib/el3_runtime/pubsub_events.h>
static void *cortex_a75_context_save(const void *arg)
{
diff --git a/lib/cpus/aarch64/cortex_a76.S b/lib/cpus/aarch64/cortex_a76.S
index 4def14373..27db74e41 100644
--- a/lib/cpus/aarch64/cortex_a76.S
+++ b/lib/cpus/aarch64/cortex_a76.S
@@ -5,13 +5,13 @@
*/
#include <arch.h>
-#include <arm_arch_svc.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <context.h>
#include <cortex_a76.h>
#include <cpu_macros.S>
#include <plat_macros.S>
+#include <services/arm_arch_svc.h>
#if !DYNAMIC_WORKAROUND_CVE_2018_3639
#error Cortex A76 requires DYNAMIC_WORKAROUND_CVE_2018_3639=1
diff --git a/lib/cpus/aarch64/cortex_ares_pubsub.c b/lib/cpus/aarch64/cortex_ares_pubsub.c
index 9566223f2..4a4f33386 100644
--- a/lib/cpus/aarch64/cortex_ares_pubsub.c
+++ b/lib/cpus/aarch64/cortex_ares_pubsub.c
@@ -6,7 +6,7 @@
#include <cortex_ares.h>
#include <cpuamu.h>
-#include <pubsub_events.h>
+#include <lib/el3_runtime/pubsub_events.h>
static void *cortex_ares_context_save(const void *arg)
{
diff --git a/lib/cpus/aarch64/cortex_deimos.S b/lib/cpus/aarch64/cortex_deimos.S
index cad906f65..0e72fba5a 100644
--- a/lib/cpus/aarch64/cortex_deimos.S
+++ b/lib/cpus/aarch64/cortex_deimos.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <cortex_deimos.h>
#include <cpu_macros.S>
#include <plat_macros.S>
diff --git a/lib/cpus/aarch64/cortex_helios.S b/lib/cpus/aarch64/cortex_helios.S
index 4812ac47c..7d3d7e45c 100644
--- a/lib/cpus/aarch64/cortex_helios.S
+++ b/lib/cpus/aarch64/cortex_helios.S
@@ -5,10 +5,10 @@
*/
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
#include <cortex_helios.h>
#include <cpu_macros.S>
-#include <debug.h>
#include <plat_macros.S>
func cortex_helios_cpu_pwr_dwn
diff --git a/lib/cpus/aarch64/cpu_helpers.S b/lib/cpus/aarch64/cpu_helpers.S
index 69ece8fff..74d7bb240 100644
--- a/lib/cpus/aarch64/cpu_helpers.S
+++ b/lib/cpus/aarch64/cpu_helpers.S
@@ -7,10 +7,10 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
-#include <cpu_data.h>
+#include <common/debug.h>
#include <cpu_macros.S>
-#include <debug.h>
-#include <errata_report.h>
+#include <lib/cpus/errata_report.h>
+#include <lib/el3_runtime/cpu_data.h>
/* Reset fn is needed in BL at reset vector */
#if defined(IMAGE_BL1) || defined(IMAGE_BL31) || (defined(IMAGE_BL2) && BL2_AT_EL3)
diff --git a/lib/cpus/aarch64/cpuamu.c b/lib/cpus/aarch64/cpuamu.c
index 5ad5bf839..3a2fa819f 100644
--- a/lib/cpus/aarch64/cpuamu.c
+++ b/lib/cpus/aarch64/cpuamu.c
@@ -5,8 +5,8 @@
*/
#include <cpuamu.h>
-#include <platform.h>
-#include <pubsub_events.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <plat/common/platform.h>
#define CPUAMU_NR_COUNTERS 5U
diff --git a/lib/cpus/aarch64/dsu_helpers.S b/lib/cpus/aarch64/dsu_helpers.S
index 152a3da26..eb84daacf 100644
--- a/lib/cpus/aarch64/dsu_helpers.S
+++ b/lib/cpus/aarch64/dsu_helpers.S
@@ -6,7 +6,7 @@
#include <asm_macros.S>
#include <dsu_def.h>
-#include <errata_report.h>
+#include <lib/cpus/errata_report.h>
/* -----------------------------------------------------------------------
* DSU erratum 936184 check function
diff --git a/lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S b/lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S
index c613ebdf6..c9a954496 100644
--- a/lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S
+++ b/lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S
@@ -5,9 +5,9 @@
*/
#include <arch.h>
-#include <arm_arch_svc.h>
#include <asm_macros.S>
#include <context.h>
+#include <services/arm_arch_svc.h>
.globl wa_cve_2017_5715_bpiall_vbar
diff --git a/lib/cpus/aarch64/wa_cve_2017_5715_mmu.S b/lib/cpus/aarch64/wa_cve_2017_5715_mmu.S
index d7b6e26e4..9277cc624 100644
--- a/lib/cpus/aarch64/wa_cve_2017_5715_mmu.S
+++ b/lib/cpus/aarch64/wa_cve_2017_5715_mmu.S
@@ -5,9 +5,9 @@
*/
#include <arch.h>
-#include <arm_arch_svc.h>
#include <asm_macros.S>
#include <context.h>
+#include <services/arm_arch_svc.h>
.globl wa_cve_2017_5715_mmu_vbar
diff --git a/lib/cpus/errata_report.c b/lib/cpus/errata_report.c
index 42603cb6d..aeb356005 100644
--- a/lib/cpus/errata_report.c
+++ b/lib/cpus/errata_report.c
@@ -6,14 +6,15 @@
/* Runtime firmware routines to report errata status for the current CPU. */
-#include <arch_helpers.h>
#include <assert.h>
-#include <cpu_data.h>
-#include <debug.h>
-#include <errata_report.h>
-#include <spinlock.h>
#include <stdbool.h>
-#include <utils.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/cpus/errata_report.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/spinlock.h>
+#include <lib/utils.h>
#ifdef IMAGE_BL1
# define BL_STRING "BL1"
diff --git a/lib/el3_runtime/aarch32/context_mgmt.c b/lib/el3_runtime/aarch32/context_mgmt.c
index ad0a1206d..a4702fcc6 100644
--- a/lib/el3_runtime/aarch32/context_mgmt.c
+++ b/lib/el3_runtime/aarch32/context_mgmt.c
@@ -4,19 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <amu.h>
+#include <assert.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <platform_def.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <platform.h>
-#include <platform_def.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/extensions/amu.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
#include <smccc_helpers.h>
-#include <stdbool.h>
-#include <string.h>
-#include <utils.h>
/*******************************************************************************
* Context management library initialisation routine. This library is used by
diff --git a/lib/el3_runtime/aarch32/cpu_data.S b/lib/el3_runtime/aarch32/cpu_data.S
index 68d64151f..bdad2c145 100644
--- a/lib/el3_runtime/aarch32/cpu_data.S
+++ b/lib/el3_runtime/aarch32/cpu_data.S
@@ -5,7 +5,7 @@
*/
#include <asm_macros.S>
-#include <cpu_data.h>
+#include <lib/el3_runtime/cpu_data.h>
.globl _cpu_data
.globl _cpu_data_by_index
diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c
index 39c27d0ec..8a5764ce2 100644
--- a/lib/el3_runtime/aarch64/context_mgmt.c
+++ b/lib/el3_runtime/aarch64/context_mgmt.c
@@ -4,24 +4,26 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <amu.h>
+#include <assert.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <platform_def.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
+#include <bl31/interrupt_mgmt.h>
+#include <common/bl_common.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <interrupt_mgmt.h>
-#include <mpam.h>
-#include <platform.h>
-#include <platform_def.h>
-#include <pubsub_events.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <lib/extensions/amu.h>
+#include <lib/extensions/mpam.h>
+#include <lib/extensions/spe.h>
+#include <lib/extensions/sve.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
#include <smccc_helpers.h>
-#include <spe.h>
-#include <stdbool.h>
-#include <string.h>
-#include <sve.h>
-#include <utils.h>
/*******************************************************************************
diff --git a/lib/el3_runtime/aarch64/cpu_data.S b/lib/el3_runtime/aarch64/cpu_data.S
index 96be0813c..2edf22559 100644
--- a/lib/el3_runtime/aarch64/cpu_data.S
+++ b/lib/el3_runtime/aarch64/cpu_data.S
@@ -5,7 +5,7 @@
*/
#include <asm_macros.S>
-#include <cpu_data.h>
+#include <lib/el3_runtime/cpu_data.h>
.globl init_cpu_data_ptr
.globl _cpu_data_by_index
diff --git a/lib/el3_runtime/cpu_data_array.c b/lib/el3_runtime/cpu_data_array.c
index 10b1a7c5b..13d464c97 100644
--- a/lib/el3_runtime/cpu_data_array.c
+++ b/lib/el3_runtime/cpu_data_array.c
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <cassert.h>
-#include <cpu_data.h>
#include <platform_def.h>
+#include <lib/cassert.h>
+#include <lib/el3_runtime/cpu_data.h>
+
/* The per_cpu_ptr_cache_t space allocation */
cpu_data_t percpu_data[PLATFORM_CORE_COUNT];
diff --git a/lib/extensions/amu/aarch32/amu.c b/lib/extensions/amu/aarch32/amu.c
index 585d908f7..82d2e1864 100644
--- a/lib/extensions/amu/aarch32/amu.c
+++ b/lib/extensions/amu/aarch32/amu.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <amu.h>
-#include <amu_private.h>
+#include <stdbool.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <platform.h>
-#include <pubsub_events.h>
-#include <stdbool.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <lib/extensions/amu.h>
+#include <lib/extensions/amu_private.h>
+#include <plat/common/platform.h>
#define AMU_GROUP0_NR_COUNTERS 4
diff --git a/lib/extensions/amu/aarch64/amu.c b/lib/extensions/amu/aarch64/amu.c
index 1564e8402..85f7007aa 100644
--- a/lib/extensions/amu/aarch64/amu.c
+++ b/lib/extensions/amu/aarch64/amu.c
@@ -4,15 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <amu.h>
-#include <amu_private.h>
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <platform.h>
-#include <pubsub_events.h>
#include <stdbool.h>
+#include <arch.h>
+#include <arch_helpers.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <lib/extensions/amu.h>
+#include <lib/extensions/amu_private.h>
+#include <plat/common/platform.h>
+
#define AMU_GROUP0_NR_COUNTERS 4
struct amu_ctx {
diff --git a/lib/extensions/mpam/mpam.c b/lib/extensions/mpam/mpam.c
index d57bb470b..016670790 100644
--- a/lib/extensions/mpam/mpam.c
+++ b/lib/extensions/mpam/mpam.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdbool.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <mpam.h>
-#include <stdbool.h>
+#include <lib/extensions/mpam.h>
bool mpam_supported(void)
{
diff --git a/lib/extensions/ras/ras_common.c b/lib/extensions/ras/ras_common.c
index f39e5f5f1..be8beceeb 100644
--- a/lib/extensions/ras/ras_common.c
+++ b/lib/extensions/ras/ras_common.c
@@ -4,15 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <debug.h>
-#include <ea_handle.h>
-#include <ehf.h>
-#include <platform.h>
-#include <ras.h>
-#include <ras_arch.h>
#include <stdbool.h>
+#include <arch_helpers.h>
+#include <bl31/ea_handle.h>
+#include <bl31/ehf.h>
+#include <common/debug.h>
+#include <lib/extensions/ras.h>
+#include <lib/extensions/ras_arch.h>
+#include <plat/common/platform.h>
+
#ifndef PLAT_RAS_PRI
# error Platform must define RAS priority value
#endif
diff --git a/lib/extensions/ras/std_err_record.c b/lib/extensions/ras/std_err_record.c
index 9fdfd6b60..c03fbbe43 100644
--- a/lib/extensions/ras/std_err_record.c
+++ b/lib/extensions/ras/std_err_record.c
@@ -3,8 +3,9 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <ras_arch.h>
-#include <utils_def.h>
+
+#include <lib/extensions/ras_arch.h>
+#include <lib/utils_def.h>
/*
* Probe for error in memory-mapped registers containing error records
diff --git a/lib/extensions/spe/spe.c b/lib/extensions/spe/spe.c
index e5df015b0..78876c66b 100644
--- a/lib/extensions/spe/spe.c
+++ b/lib/extensions/spe/spe.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdbool.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <pubsub.h>
-#include <spe.h>
-#include <stdbool.h>
+#include <lib/el3_runtime/pubsub.h>
+#include <lib/extensions/spe.h>
static inline void psb_csync(void)
{
diff --git a/lib/extensions/sve/sve.c b/lib/extensions/sve/sve.c
index e031bf61b..fa4ac7758 100644
--- a/lib/extensions/sve/sve.c
+++ b/lib/extensions/sve/sve.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdbool.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <pubsub.h>
-#include <stdbool.h>
-#include <sve.h>
+#include <lib/el3_runtime/pubsub.h>
+#include <lib/extensions/sve.h>
bool sve_supported(void)
{
diff --git a/lib/libc/abort.c b/lib/libc/abort.c
index c9d16cccc..432b1d075 100644
--- a/lib/libc/abort.c
+++ b/lib/libc/abort.c
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
#include <stdlib.h>
+#include <common/debug.h>
+
void abort(void)
{
ERROR("ABORT\n");
diff --git a/lib/libc/assert.c b/lib/libc/assert.c
index 8fa8f7212..60f1a8660 100644
--- a/lib/libc/assert.c
+++ b/lib/libc/assert.c
@@ -6,11 +6,12 @@
#include <assert.h>
#include <cdefs.h>
-#include <console.h>
-#include <debug.h>
-#include <platform.h>
#include <stdio.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <plat/common/platform.h>
+
/*
* Only print the output if PLAT_LOG_LEVEL_ASSERT is higher or equal to
* LOG_LEVEL_INFO, which is the default value for builds with DEBUG=1.
diff --git a/lib/libc/printf.c b/lib/libc/printf.c
index d50876d75..2715a72d4 100644
--- a/lib/libc/printf.c
+++ b/lib/libc/printf.c
@@ -3,12 +3,14 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <assert.h>
-#include <debug.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
+#include <common/debug.h>
+
#define get_num_va_args(_args, _lcount) \
(((_lcount) > 1) ? va_arg(_args, long long int) : \
(((_lcount) == 1) ? va_arg(_args, long int) : \
diff --git a/lib/libc/putchar.c b/lib/libc/putchar.c
index 0beb625b2..037e28ac4 100644
--- a/lib/libc/putchar.c
+++ b/lib/libc/putchar.c
@@ -5,7 +5,8 @@
*/
#include <stdio.h>
-#include <console.h>
+
+#include <drivers/console.h>
int putchar(int c)
{
diff --git a/lib/libc/snprintf.c b/lib/libc/snprintf.c
index 66a2fa2f5..38ad1c71a 100644
--- a/lib/libc/snprintf.c
+++ b/lib/libc/snprintf.c
@@ -5,10 +5,11 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <platform.h>
#include <stdarg.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
static void string_print(char **s, size_t n, size_t *chars_printed,
const char *str)
{
diff --git a/lib/locks/bakery/bakery_lock_coherent.c b/lib/locks/bakery/bakery_lock_coherent.c
index 8e86790ab..1634e3af6 100644
--- a/lib/locks/bakery/bakery_lock_coherent.c
+++ b/lib/locks/bakery/bakery_lock_coherent.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bakery_lock.h>
-#include <cpu_data.h>
-#include <platform.h>
#include <string.h>
+#include <arch_helpers.h>
+#include <lib/bakery_lock.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <plat/common/platform.h>
+
/*
* Functions in this file implement Bakery Algorithm for mutual exclusion with the
* bakery lock data structures in coherent memory.
diff --git a/lib/locks/bakery/bakery_lock_normal.c b/lib/locks/bakery/bakery_lock_normal.c
index beae63c72..867da929a 100644
--- a/lib/locks/bakery/bakery_lock_normal.c
+++ b/lib/locks/bakery/bakery_lock_normal.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bakery_lock.h>
-#include <cpu_data.h>
-#include <platform.h>
#include <string.h>
-#include <utils_def.h>
+
+#include <arch_helpers.h>
+#include <lib/bakery_lock.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/utils_def.h>
+#include <plat/common/platform.h>
/*
* Functions in this file implement Bakery Algorithm for mutual exclusion with the
diff --git a/lib/optee/optee_utils.c b/lib/optee/optee_utils.c
index 34d095b0d..f7392fda8 100644
--- a/lib/optee/optee_utils.c
+++ b/lib/optee/optee_utils.c
@@ -4,12 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <desc_image_load.h>
#include <errno.h>
-#include <optee_utils.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <common/desc_image_load.h>
+#include <lib/optee_utils.h>
/*
* load_addr_hi and load_addr_lo: image load address.
diff --git a/lib/pmf/pmf_main.c b/lib/pmf/pmf_main.c
index fe7bb7423..131a05578 100644
--- a/lib/pmf/pmf_main.c
+++ b/lib/pmf/pmf_main.c
@@ -3,15 +3,17 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
+
#include <assert.h>
-#include <debug.h>
#include <errno.h>
-#include <platform.h>
-#include <pmf.h>
#include <string.h>
-#include <utils_def.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/pmf/pmf.h>
+#include <lib/utils_def.h>
+#include <plat/common/platform.h>
/*******************************************************************************
* The 'pmf_svc_descs' array holds the PMF service descriptors exported by
diff --git a/lib/pmf/pmf_smc.c b/lib/pmf/pmf_smc.c
index 4c5b14f93..6d7950299 100644
--- a/lib/pmf/pmf_smc.c
+++ b/lib/pmf/pmf_smc.c
@@ -3,10 +3,12 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <assert.h>
-#include <debug.h>
-#include <platform.h>
-#include <pmf.h>
+
+#include <common/debug.h>
+#include <lib/pmf/pmf.h>
+#include <plat/common/platform.h>
#include <smccc_helpers.h>
/*
diff --git a/lib/psci/aarch32/psci_helpers.S b/lib/psci/aarch32/psci_helpers.S
index 63d7e7088..5cc192e66 100644
--- a/lib/psci/aarch32/psci_helpers.S
+++ b/lib/psci/aarch32/psci_helpers.S
@@ -5,8 +5,8 @@
*/
#include <asm_macros.S>
+#include <lib/psci/psci.h>
#include <platform_def.h>
-#include <psci.h>
.globl psci_do_pwrdown_cache_maintenance
.globl psci_do_pwrup_cache_maintenance
diff --git a/lib/psci/aarch64/psci_helpers.S b/lib/psci/aarch64/psci_helpers.S
index 88db1c968..add968a7b 100644
--- a/lib/psci/aarch64/psci_helpers.S
+++ b/lib/psci/aarch64/psci_helpers.S
@@ -6,8 +6,8 @@
#include <asm_macros.S>
#include <assert_macros.S>
+#include <lib/psci/psci.h>
#include <platform_def.h>
-#include <psci.h>
.globl psci_do_pwrdown_cache_maintenance
.globl psci_do_pwrup_cache_maintenance
diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c
index 97aeb8323..2928c33e5 100644
--- a/lib/psci/psci_common.c
+++ b/lib/psci/psci_common.c
@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+#include <string.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <platform.h>
-#include <string.h>
-#include <utils.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+
#include "psci_private.h"
/*
diff --git a/lib/psci/psci_main.c b/lib/psci/psci_main.c
index b4a25fb0a..5c0e952a9 100644
--- a/lib/psci/psci_main.c
+++ b/lib/psci/psci_main.c
@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
-#include <arm_arch_svc.h>
#include <assert.h>
-#include <debug.h>
-#include <platform.h>
-#include <pmf.h>
-#include <runtime_instr.h>
-#include <smccc.h>
#include <string.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/pmf/pmf.h>
+#include <lib/runtime_instr.h>
+#include <lib/smccc.h>
+#include <plat/common/platform.h>
+#include <services/arm_arch_svc.h>
+
#include "psci_private.h"
/*******************************************************************************
diff --git a/lib/psci/psci_mem_protect.c b/lib/psci/psci_mem_protect.c
index 857146b67..481051f95 100644
--- a/lib/psci/psci_mem_protect.c
+++ b/lib/psci/psci_mem_protect.c
@@ -6,7 +6,9 @@
#include <assert.h>
#include <limits.h>
-#include <utils.h>
+
+#include <lib/utils.h>
+
#include "psci_private.h"
u_register_t psci_mem_protect(unsigned int enable)
diff --git a/lib/psci/psci_off.c b/lib/psci/psci_off.c
index 944f8bff9..ac03e0596 100644
--- a/lib/psci/psci_off.c
+++ b/lib/psci/psci_off.c
@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <platform.h>
-#include <pmf.h>
-#include <runtime_instr.h>
#include <string.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/pmf/pmf.h>
+#include <lib/runtime_instr.h>
+#include <plat/common/platform.h>
+
#include "psci_private.h"
/******************************************************************************
diff --git a/lib/psci/psci_on.c b/lib/psci/psci_on.c
index f38900cf5..aa6b324ed 100644
--- a/lib/psci/psci_on.c
+++ b/lib/psci/psci_on.c
@@ -4,15 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <platform.h>
-#include <pubsub_events.h>
#include <stddef.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <plat/common/platform.h>
+
#include "psci_private.h"
/*
diff --git a/lib/psci/psci_private.h b/lib/psci/psci_private.h
index 82b951db6..68ec7fb66 100644
--- a/lib/psci/psci_private.h
+++ b/lib/psci/psci_private.h
@@ -7,14 +7,15 @@
#ifndef PSCI_PRIVATE_H
#define PSCI_PRIVATE_H
+#include <stdbool.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <bakery_lock.h>
-#include <bl_common.h>
-#include <cpu_data.h>
-#include <psci.h>
-#include <spinlock.h>
-#include <stdbool.h>
+#include <common/bl_common.h>
+#include <lib/bakery_lock.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/psci/psci.h>
+#include <lib/spinlock.h>
/*
* The PSCI capability which are provided by the generic code but does not
diff --git a/lib/psci/psci_setup.c b/lib/psci/psci_setup.c
index 6b3081eb5..b9467d3e0 100644
--- a/lib/psci/psci_setup.c
+++ b/lib/psci/psci_setup.c
@@ -4,15 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+#include <stddef.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <errata_report.h>
-#include <platform.h>
-#include <stddef.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/cpus/errata_report.h>
+#include <plat/common/platform.h>
+
#include "psci_private.h"
/*******************************************************************************
diff --git a/lib/psci/psci_stat.c b/lib/psci/psci_stat.c
index 6f6a7d4f8..772a1840a 100644
--- a/lib/psci/psci_stat.c
+++ b/lib/psci/psci_stat.c
@@ -5,9 +5,12 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <platform.h>
+
#include <platform_def.h>
+
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
#include "psci_private.h"
#ifndef PLAT_MAX_PWR_LVL_STATES
diff --git a/lib/psci/psci_suspend.c b/lib/psci/psci_suspend.c
index e00819de7..8a752c1a1 100644
--- a/lib/psci/psci_suspend.c
+++ b/lib/psci/psci_suspend.c
@@ -4,19 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+#include <stddef.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <cpu_data.h>
-#include <debug.h>
-#include <platform.h>
-#include <pmf.h>
-#include <pubsub_events.h>
-#include <runtime_instr.h>
-#include <stddef.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <lib/pmf/pmf.h>
+#include <lib/runtime_instr.h>
+#include <plat/common/platform.h>
+
#include "psci_private.h"
/*******************************************************************************
diff --git a/lib/psci/psci_system_off.c b/lib/psci/psci_system_off.c
index 7cac4e937..141d69ef2 100644
--- a/lib/psci/psci_system_off.c
+++ b/lib/psci/psci_system_off.c
@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <console.h>
-#include <debug.h>
-#include <platform.h>
#include <stddef.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <plat/common/platform.h>
+
#include "psci_private.h"
void __dead2 psci_system_off(void)
diff --git a/lib/romlib/romlib.ld.S b/lib/romlib/romlib.ld.S
index 8f0bc62bc..2aac4adf6 100644
--- a/lib/romlib/romlib.ld.S
+++ b/lib/romlib/romlib.ld.S
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <lib/xlat_tables/xlat_tables_defs.h>
#include <platform_def.h>
-#include <xlat_tables_defs.h>
MEMORY {
ROM (rx): ORIGIN = ROMLIB_RO_BASE, LENGTH = ROMLIB_RO_LIMIT - ROMLIB_RO_BASE
diff --git a/lib/semihosting/semihosting.c b/lib/semihosting/semihosting.c
index 2ba43f343..ee48dbc1f 100644
--- a/lib/semihosting/semihosting.c
+++ b/lib/semihosting/semihosting.c
@@ -6,9 +6,10 @@
#include <assert.h>
#include <errno.h>
-#include <semihosting.h>
#include <string.h>
+#include <lib/semihosting.h>
+
#ifndef SEMIHOSTING_SUPPORTED
#define SEMIHOSTING_SUPPORTED 1
#endif
diff --git a/lib/stack_protector/stack_protector.c b/lib/stack_protector/stack_protector.c
index fba5e1ffa..3ff74fc8a 100644
--- a/lib/stack_protector/stack_protector.c
+++ b/lib/stack_protector/stack_protector.c
@@ -3,10 +3,12 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <platform.h>
+
#include <stdint.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
/*
* Canary value used by the compiler runtime checks to detect stack corruption.
*
diff --git a/lib/utils/mem_region.c b/lib/utils/mem_region.c
index a5c3c6170..662f6a05a 100644
--- a/lib/utils/mem_region.c
+++ b/lib/utils/mem_region.c
@@ -5,7 +5,8 @@
*/
#include <assert.h>
-#include <utils.h>
+
+#include <lib/utils.h>
/*
* All the regions defined in mem_region_t must have the following properties
diff --git a/lib/xlat_tables/aarch32/xlat_tables.c b/lib/xlat_tables/aarch32/xlat_tables.c
index 55957031f..468a9e7dd 100644
--- a/lib/xlat_tables/aarch32/xlat_tables.c
+++ b/lib/xlat_tables/aarch32/xlat_tables.c
@@ -4,13 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
+
#include <platform_def.h>
-#include <utils.h>
-#include <xlat_tables_arch.h>
-#include <xlat_tables.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables_arch.h>
+#include <lib/xlat_tables/xlat_tables.h>
+
#include "../xlat_tables_private.h"
#if (ARM_ARCH_MAJOR == 7) && !defined(ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING)
diff --git a/lib/xlat_tables/aarch64/xlat_tables.c b/lib/xlat_tables/aarch64/xlat_tables.c
index 4afdeed06..71f491a21 100644
--- a/lib/xlat_tables/aarch64/xlat_tables.c
+++ b/lib/xlat_tables/aarch64/xlat_tables.c
@@ -4,16 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <common_def.h>
-#include <platform_def.h>
#include <stdint.h>
-#include <utils.h>
-#include <xlat_tables.h>
-#include <xlat_tables_arch.h>
+
+#include <platform_def.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables.h>
+#include <lib/xlat_tables/xlat_tables_arch.h>
+#include <plat/common/common_def.h>
+
#include "../xlat_tables_private.h"
#define XLAT_TABLE_LEVEL_BASE \
diff --git a/lib/xlat_tables/xlat_tables_common.c b/lib/xlat_tables/xlat_tables_common.c
index 2ee77c7ae..23fe3f0b4 100644
--- a/lib/xlat_tables/xlat_tables_common.c
+++ b/lib/xlat_tables/xlat_tables_common.c
@@ -4,18 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <cassert.h>
-#include <common_def.h>
-#include <debug.h>
-#include <platform_def.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
-#include <utils.h>
-#include <xlat_tables.h>
+
+#include <platform_def.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/cassert.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables.h>
+#include <plat/common/common_def.h>
+
#include "xlat_tables_private.h"
#if LOG_LEVEL >= LOG_LEVEL_VERBOSE
diff --git a/lib/xlat_tables/xlat_tables_private.h b/lib/xlat_tables/xlat_tables_private.h
index fad967ebf..4390f34ea 100644
--- a/lib/xlat_tables/xlat_tables_private.h
+++ b/lib/xlat_tables/xlat_tables_private.h
@@ -7,9 +7,10 @@
#ifndef XLAT_TABLES_PRIVATE_H
#define XLAT_TABLES_PRIVATE_H
-#include <cassert.h>
#include <platform_def.h>
-#include <xlat_tables_arch.h>
+
+#include <lib/cassert.h>
+#include <lib/xlat_tables/xlat_tables_arch.h>
#if HW_ASSISTED_COHERENCY
#error xlat tables v2 must be used with HW_ASSISTED_COHERENCY
diff --git a/lib/xlat_tables_v2/aarch32/enable_mmu.S b/lib/xlat_tables_v2/aarch32/enable_mmu.S
index 4a4ac30f5..f2fff36c2 100644
--- a/lib/xlat_tables_v2/aarch32/enable_mmu.S
+++ b/lib/xlat_tables_v2/aarch32/enable_mmu.S
@@ -6,7 +6,7 @@
#include <asm_macros.S>
#include <assert_macros.S>
-#include <xlat_tables_v2.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
.global enable_mmu_direct_svc_mon
.global enable_mmu_direct_hyp
diff --git a/lib/xlat_tables_v2/aarch32/xlat_tables_arch.c b/lib/xlat_tables_v2/aarch32/xlat_tables_arch.c
index 66938e5f1..349b6c4d5 100644
--- a/lib/xlat_tables_v2/aarch32/xlat_tables_arch.c
+++ b/lib/xlat_tables_v2/aarch32/xlat_tables_arch.c
@@ -4,14 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <cassert.h>
-#include <platform_def.h>
#include <stdbool.h>
-#include <utils_def.h>
-#include <xlat_tables_v2.h>
+
+#include <platform_def.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <lib/cassert.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
+
#include "../xlat_tables_private.h"
#if (ARM_ARCH_MAJOR == 7) && !defined(ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING)
diff --git a/lib/xlat_tables_v2/aarch64/enable_mmu.S b/lib/xlat_tables_v2/aarch64/enable_mmu.S
index 504c03c15..07e7be1ec 100644
--- a/lib/xlat_tables_v2/aarch64/enable_mmu.S
+++ b/lib/xlat_tables_v2/aarch64/enable_mmu.S
@@ -6,7 +6,7 @@
#include <asm_macros.S>
#include <assert_macros.S>
-#include <xlat_tables_v2.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
.global enable_mmu_direct_el1
.global enable_mmu_direct_el2
diff --git a/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c b/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
index 269adc7ef..a803d8357 100644
--- a/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
+++ b/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <cassert.h>
#include <stdbool.h>
#include <stdint.h>
-#include <utils_def.h>
-#include <xlat_tables_v2.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <lib/cassert.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
+
#include "../xlat_tables_private.h"
/*
diff --git a/lib/xlat_tables_v2/xlat_tables_context.c b/lib/xlat_tables_v2/xlat_tables_context.c
index b887427a2..bf3ae1e7d 100644
--- a/lib/xlat_tables_v2/xlat_tables_context.c
+++ b/lib/xlat_tables_v2/xlat_tables_context.c
@@ -5,10 +5,12 @@
*/
#include <assert.h>
-#include <debug.h>
+
#include <platform_def.h>
-#include <xlat_tables_defs.h>
-#include <xlat_tables_v2.h>
+
+#include <common/debug.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
#include "xlat_tables_private.h"
diff --git a/lib/xlat_tables_v2/xlat_tables_core.c b/lib/xlat_tables_v2/xlat_tables_core.c
index 53fc874d8..c49554f1f 100644
--- a/lib/xlat_tables_v2/xlat_tables_core.c
+++ b/lib/xlat_tables_v2/xlat_tables_core.c
@@ -4,17 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
#include <errno.h>
-#include <platform_def.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
-#include <utils_def.h>
-#include <xlat_tables_defs.h>
-#include <xlat_tables_v2.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
#include "xlat_tables_private.h"
diff --git a/lib/xlat_tables_v2/xlat_tables_private.h b/lib/xlat_tables_v2/xlat_tables_private.h
index 528996a29..fc709554b 100644
--- a/lib/xlat_tables_v2/xlat_tables_private.h
+++ b/lib/xlat_tables_v2/xlat_tables_private.h
@@ -7,9 +7,11 @@
#ifndef XLAT_TABLES_PRIVATE_H
#define XLAT_TABLES_PRIVATE_H
-#include <platform_def.h>
#include <stdbool.h>
-#include <xlat_tables_defs.h>
+
+#include <platform_def.h>
+
+#include <lib/xlat_tables/xlat_tables_defs.h>
#if PLAT_XLAT_TABLES_DYNAMIC
/*
diff --git a/lib/xlat_tables_v2/xlat_tables_utils.c b/lib/xlat_tables_v2/xlat_tables_utils.c
index 41c01aee7..f5848a255 100644
--- a/lib/xlat_tables_v2/xlat_tables_utils.c
+++ b/lib/xlat_tables_v2/xlat_tables_utils.c
@@ -4,17 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
#include <errno.h>
-#include <platform_def.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
-#include <utils_def.h>
-#include <xlat_tables_defs.h>
-#include <xlat_tables_v2.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
#include "xlat_tables_private.h"
diff --git a/lib/zlib/tf_gunzip.c b/lib/zlib/tf_gunzip.c
index 574d871b0..fd56dfc7c 100644
--- a/lib/zlib/tf_gunzip.c
+++ b/lib/zlib/tf_gunzip.c
@@ -5,11 +5,12 @@
*/
#include <assert.h>
-#include <debug.h>
#include <errno.h>
#include <string.h>
+
+#include <common/debug.h>
+#include <lib/utils.h>
#include <tf_gunzip.h>
-#include <utils.h>
#include "zutil.h"
diff --git a/plat/allwinner/common/include/platform_def.h b/plat/allwinner/common/include/platform_def.h
index 08eb5cf2b..ede3881a7 100644
--- a/plat/allwinner/common/include/platform_def.h
+++ b/plat/allwinner/common/include/platform_def.h
@@ -7,10 +7,11 @@
#ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H
-#include <common_def.h>
+#include <common/tbbr/tbbr_img_def.h>
+#include <lib/utils_def.h>
+#include <plat/common/common_def.h>
+
#include <sunxi_mmap.h>
-#include <tbbr/tbbr_img_def.h>
-#include <utils_def.h>
#define BL31_BASE SUNXI_SRAM_A2_BASE
#define BL31_LIMIT (SUNXI_SRAM_A2_BASE + SUNXI_SRAM_A2_SIZE)
diff --git a/plat/allwinner/common/sunxi_bl31_setup.c b/plat/allwinner/common/sunxi_bl31_setup.c
index 2c6632912..7ffa65821 100644
--- a/plat/allwinner/common/sunxi_bl31_setup.c
+++ b/plat/allwinner/common/sunxi_bl31_setup.c
@@ -4,20 +4,24 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
#include <assert.h>
-#include <console.h>
-#include <debug.h>
-#include <generic_delay_timer.h>
-#include <gicv2.h>
+
#include <libfdt.h>
-#include <mmio.h>
-#include <platform.h>
+
#include <platform_def.h>
+
+#include <arch.h>
+#include <common/debug.h>
+#include <drivers/arm/gicv2.h>
+#include <drivers/console.h>
+#include <drivers/generic_delay_timer.h>
+#include <drivers/ti/uart/uart_16550.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
#include <sunxi_def.h>
#include <sunxi_mmap.h>
#include <sunxi_private.h>
-#include <uart_16550.h>
static entry_point_info_t bl32_image_ep_info;
diff --git a/plat/allwinner/common/sunxi_common.c b/plat/allwinner/common/sunxi_common.c
index 2eb26a91b..6bb8968ce 100644
--- a/plat/allwinner/common/sunxi_common.c
+++ b/plat/allwinner/common/sunxi_common.c
@@ -4,16 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <debug.h>
#include <errno.h>
-#include <mmio.h>
-#include <platform.h>
+
#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/mmio.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
+#include <plat/common/platform.h>
+
#include <sunxi_def.h>
#include <sunxi_mmap.h>
#include <sunxi_private.h>
-#include <xlat_tables_v2.h>
static mmap_region_t sunxi_mmap[PLATFORM_MMAP_REGIONS + 1] = {
MAP_REGION_FLAT(SUNXI_SRAM_BASE, SUNXI_SRAM_SIZE,
diff --git a/plat/allwinner/common/sunxi_cpu_ops.c b/plat/allwinner/common/sunxi_cpu_ops.c
index 3b732b5d1..8c086030a 100644
--- a/plat/allwinner/common/sunxi_cpu_ops.c
+++ b/plat/allwinner/common/sunxi_cpu_ops.c
@@ -4,18 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <core_off_arisc.h>
-#include <debug.h>
-#include <delay_timer.h>
-#include <mmio.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 <lib/utils_def.h>
+#include <plat/common/platform.h>
+
+#include <core_off_arisc.h>
#include <sunxi_cpucfg.h>
#include <sunxi_mmap.h>
#include <sunxi_private.h>
-#include <utils_def.h>
static void sunxi_cpu_disable_power(unsigned int cluster, unsigned int core)
{
diff --git a/plat/allwinner/common/sunxi_pm.c b/plat/allwinner/common/sunxi_pm.c
index 7d13cdad1..8cc715c27 100644
--- a/plat/allwinner/common/sunxi_pm.c
+++ b/plat/allwinner/common/sunxi_pm.c
@@ -4,15 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <delay_timer.h>
-#include <gicv2.h>
-#include <mmio.h>
-#include <platform.h>
+
#include <platform_def.h>
-#include <psci.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/arm/gicv2.h>
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
+#include <lib/psci/psci.h>
+#include <plat/common/platform.h>
+
#include <sunxi_cpucfg.h>
#include <sunxi_mmap.h>
#include <sunxi_private.h>
diff --git a/plat/allwinner/common/sunxi_security.c b/plat/allwinner/common/sunxi_security.c
index 905372887..1f16a0b72 100644
--- a/plat/allwinner/common/sunxi_security.c
+++ b/plat/allwinner/common/sunxi_security.c
@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <lib/mmio.h>
+
#include <sunxi_mmap.h>
#include <sunxi_private.h>
diff --git a/plat/allwinner/common/sunxi_topology.c b/plat/allwinner/common/sunxi_topology.c
index 98cf63c8c..7acc77a9a 100644
--- a/plat/allwinner/common/sunxi_topology.c
+++ b/plat/allwinner/common/sunxi_topology.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <platform.h>
#include <platform_def.h>
+#include <arch.h>
+#include <plat/common/platform.h>
+
static unsigned char plat_power_domain_tree_desc[PLAT_MAX_PWR_LVL + 1] = {
/* One root node for the SoC */
1,
diff --git a/plat/allwinner/sun50i_a64/sunxi_power.c b/plat/allwinner/sun50i_a64/sunxi_power.c
index 59feed789..706bfcecb 100644
--- a/plat/allwinner/sun50i_a64/sunxi_power.c
+++ b/plat/allwinner/sun50i_a64/sunxi_power.c
@@ -5,14 +5,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <allwinner/sunxi_rsb.h>
-#include <arch_helpers.h>
-#include <debug.h>
-#include <delay_timer.h>
#include <errno.h>
+
#include <libfdt.h>
-#include <mmio.h>
+
#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/allwinner/sunxi_rsb.h>
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
+
#include <sunxi_def.h>
#include <sunxi_mmap.h>
#include <sunxi_private.h>
diff --git a/plat/allwinner/sun50i_h6/sunxi_power.c b/plat/allwinner/sun50i_h6/sunxi_power.c
index 7bdac8ab0..5b5bad177 100644
--- a/plat/allwinner/sun50i_h6/sunxi_power.c
+++ b/plat/allwinner/sun50i_h6/sunxi_power.c
@@ -5,13 +5,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <debug.h>
-#include <delay_timer.h>
#include <errno.h>
-#include <mmio.h>
-#include <mentor/mi2cv.h>
#include <string.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/mentor/mi2cv.h>
+#include <lib/mmio.h>
+
#include <sunxi_def.h>
#include <sunxi_mmap.h>
#include <sunxi_private.h>
diff --git a/plat/arm/board/common/aarch32/board_arm_helpers.S b/plat/arm/board/common/aarch32/board_arm_helpers.S
index d64da292a..320bfb3c3 100644
--- a/plat/arm/board/common/aarch32/board_arm_helpers.S
+++ b/plat/arm/board/common/aarch32/board_arm_helpers.S
@@ -3,8 +3,9 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <v2m_def.h>
.globl plat_report_exception
diff --git a/plat/arm/board/common/aarch64/board_arm_helpers.S b/plat/arm/board/common/aarch64/board_arm_helpers.S
index 4385e62ba..5a905244f 100644
--- a/plat/arm/board/common/aarch64/board_arm_helpers.S
+++ b/plat/arm/board/common/aarch64/board_arm_helpers.S
@@ -3,8 +3,9 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <v2m_def.h>
.globl plat_report_exception
diff --git a/plat/arm/board/common/board_arm_trusted_boot.c b/plat/arm/board/common/board_arm_trusted_boot.c
index 6c03c91b5..64ca3c36d 100644
--- a/plat/arm/board/common/board_arm_trusted_boot.c
+++ b/plat/arm/board/common/board_arm_trusted_boot.c
@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_def.h>
#include <assert.h>
-#include <cassert.h>
-#include <platform.h>
#include <stdint.h>
#include <string.h>
-#include <tbbr_oid.h>
+
+#include <lib/cassert.h>
+#include <plat/common/platform.h>
+#include <tools_share/tbbr_oid.h>
+
+#include <arm_def.h>
/* SHA256 algorithm */
#define SHA256_BYTES 32
@@ -180,9 +182,9 @@ int plat_set_nv_ctr(void *cookie, unsigned int nv_ctr)
}
#else /* ARM_CRYPTOCELL_INTEG */
-#include <nvm.h>
-#include <nvm_otp.h>
-#include <sbrom_bsv_api.h>
+#include <drivers/arm/cryptocell/nvm.h>
+#include <drivers/arm/cryptocell/nvm_otp.h>
+#include <drivers/arm/cryptocell/sbrom_bsv_api.h>
CASSERT(HASH_RESULT_SIZE_IN_BYTES == SHA256_BYTES,
assert_mismatch_in_hash_result_size);
diff --git a/plat/arm/board/common/board_common.mk b/plat/arm/board/common/board_common.mk
index 2556fc04a..487aad739 100644
--- a/plat/arm/board/common/board_common.mk
+++ b/plat/arm/board/common/board_common.mk
@@ -4,8 +4,7 @@
# SPDX-License-Identifier: BSD-3-Clause
#
-PLAT_INCLUDES += -Iinclude/drivers/cfi/ \
- -Iinclude/plat/arm/board/common/
+PLAT_INCLUDES += -Iinclude/plat/arm/board/common/
PLAT_BL_COMMON_SOURCES += drivers/arm/pl011/${ARCH}/pl011_console.S \
plat/arm/board/common/${ARCH}/board_arm_helpers.S
diff --git a/plat/arm/board/fvp/aarch64/fvp_helpers.S b/plat/arm/board/fvp/aarch64/fvp_helpers.S
index abc3ceb00..0f905151b 100644
--- a/plat/arm/board/fvp/aarch64/fvp_helpers.S
+++ b/plat/arm/board/fvp/aarch64/fvp_helpers.S
@@ -6,8 +6,8 @@
#include <arch.h>
#include <asm_macros.S>
-#include <gicv2.h>
-#include <gicv3.h>
+#include <drivers/arm/gicv2.h>
+#include <drivers/arm/gicv3.h>
#include <platform_def.h>
#include <v2m_def.h>
#include "../drivers/pwrc/fvp_pwrc.h"
diff --git a/plat/arm/board/fvp/aarch64/fvp_ras.c b/plat/arm/board/fvp/aarch64/fvp_ras.c
index fb80a8a0b..759f6d0d8 100644
--- a/plat/arm/board/fvp/aarch64/fvp_ras.c
+++ b/plat/arm/board/fvp/aarch64/fvp_ras.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <ras.h>
+#include <lib/extensions/ras.h>
struct ras_interrupt fvp_ras_interrupts[] = {
};
diff --git a/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c b/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c
index b17446c10..c48bb07a3 100644
--- a/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c
+++ b/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c
@@ -4,9 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bakery_lock.h>
-#include <mmio.h>
+#include <lib/bakery_lock.h>
+#include <lib/mmio.h>
+
#include <plat_arm.h>
+
#include "../../fvp_def.h"
#include "../../fvp_private.h"
#include "fvp_pwrc.h"
diff --git a/plat/arm/board/fvp/fvp_bl1_setup.c b/plat/arm/board/fvp/fvp_bl1_setup.c
index 4b2a340b0..d6e82f50d 100644
--- a/plat/arm/board/fvp/fvp_bl1_setup.c
+++ b/plat/arm/board/fvp/fvp_bl1_setup.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <common/tbbr/tbbr_img_def.h>
+#include <plat/common/platform.h>
+
#include <plat_arm.h>
-#include <platform.h>
-#include <tbbr_img_def.h>
-#include "fvp_private.h"
+#include "fvp_private.h"
/*******************************************************************************
* Perform any BL1 specific platform actions.
diff --git a/plat/arm/board/fvp/fvp_bl2_setup.c b/plat/arm/board/fvp/fvp_bl2_setup.c
index 0a3b67d39..13e74fd9a 100644
--- a/plat/arm/board/fvp/fvp_bl2_setup.c
+++ b/plat/arm/board/fvp/fvp_bl2_setup.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <generic_delay_timer.h>
-#include <mmio.h>
+#include <drivers/arm/sp804_delay_timer.h>
+#include <drivers/generic_delay_timer.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
#include <plat_arm.h>
-#include <platform.h>
-#include <sp804_delay_timer.h>
#include <v2m_def.h>
#include "fvp_def.h"
#include "fvp_private.h"
diff --git a/plat/arm/board/fvp/fvp_bl2u_setup.c b/plat/arm/board/fvp/fvp_bl2u_setup.c
index b9ab3f36e..c51e287f6 100644
--- a/plat/arm/board/fvp/fvp_bl2u_setup.c
+++ b/plat/arm/board/fvp/fvp_bl2u_setup.c
@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <plat/common/platform.h>
+
#include <plat_arm.h>
-#include <platform.h>
#include "fvp_def.h"
#include "fvp_private.h"
diff --git a/plat/arm/board/fvp/fvp_bl31_setup.c b/plat/arm/board/fvp/fvp_bl31_setup.c
index 1c8804f10..5f2121c52 100644
--- a/plat/arm/board/fvp/fvp_bl31_setup.c
+++ b/plat/arm/board/fvp/fvp_bl31_setup.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <drivers/arm/smmu_v3.h>
+#include <plat/common/platform.h>
+
#include <arm_config.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <smmu_v3.h>
#include "fvp_private.h"
void __init bl31_early_platform_setup2(u_register_t arg0,
diff --git a/plat/arm/board/fvp/fvp_common.c b/plat/arm/board/fvp/fvp_common.c
index f36b637ef..31a61de4e 100644
--- a/plat/arm/board/fvp/fvp_common.c
+++ b/plat/arm/board/fvp/fvp_common.c
@@ -4,20 +4,22 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+
+#include <common/debug.h>
+#include <drivers/arm/cci.h>
+#include <drivers/arm/ccn.h>
+#include <drivers/arm/gicv2.h>
+#include <lib/mmio.h>
+#include <lib/xlat_tables/xlat_tables_compat.h>
+#include <plat/common/platform.h>
+#include <services/secure_partition.h>
+
#include <arm_config.h>
#include <arm_def.h>
#include <arm_spm_def.h>
-#include <assert.h>
-#include <cci.h>
-#include <ccn.h>
-#include <debug.h>
-#include <gicv2.h>
-#include <mmio.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <secure_partition.h>
#include <v2m_def.h>
-#include <xlat_tables_compat.h>
#include "../fvp_def.h"
#include "fvp_private.h"
diff --git a/plat/arm/board/fvp/fvp_def.h b/plat/arm/board/fvp/fvp_def.h
index a8ed9d324..1b9f84b00 100644
--- a/plat/arm/board/fvp/fvp_def.h
+++ b/plat/arm/board/fvp/fvp_def.h
@@ -7,7 +7,7 @@
#ifndef FVP_DEF_H
#define FVP_DEF_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
#ifndef FVP_CLUSTER_COUNT
#define FVP_CLUSTER_COUNT 2
diff --git a/plat/arm/board/fvp/fvp_io_storage.c b/plat/arm/board/fvp/fvp_io_storage.c
index 11c7c3bcd..e186b3083 100644
--- a/plat/arm/board/fvp/fvp_io_storage.c
+++ b/plat/arm/board/fvp/fvp_io_storage.c
@@ -5,13 +5,15 @@
*/
#include <assert.h>
-#include <common_def.h>
-#include <debug.h>
-#include <io_driver.h>
-#include <io_semihosting.h>
-#include <io_storage.h>
+
+#include <common/debug.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_semihosting.h>
+#include <drivers/io/io_storage.h>
+#include <lib/semihosting.h>
+#include <plat/common/common_def.h>
+
#include <plat_arm.h>
-#include <semihosting.h> /* For FOPEN_MODE_... */
/* Semihosting filenames */
#define BL2_IMAGE_NAME "bl2.bin"
diff --git a/plat/arm/board/fvp/fvp_pm.c b/plat/arm/board/fvp/fvp_pm.c
index 78d302555..7da246bd6 100644
--- a/plat/arm/board/fvp/fvp_pm.c
+++ b/plat/arm/board/fvp/fvp_pm.c
@@ -4,18 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <arm_config.h>
#include <assert.h>
-#include <debug.h>
#include <errno.h>
-#include <gicv3.h>
-#include <mmio.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/arm/gicv3.h>
+#include <lib/extensions/spe.h>
+#include <lib/mmio.h>
+#include <lib/psci/psci.h>
+#include <plat/common/platform.h>
+
+#include <arm_config.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <psci.h>
-#include <spe.h>
#include <v2m_def.h>
+
#include "../../../../drivers/arm/gic/v3/gicv3_private.h"
#include "drivers/pwrc/fvp_pwrc.h"
#include "fvp_def.h"
diff --git a/plat/arm/board/fvp/fvp_stack_protector.c b/plat/arm/board/fvp/fvp_stack_protector.c
index 1e8e3010f..e940a1291 100644
--- a/plat/arm/board/fvp/fvp_stack_protector.c
+++ b/plat/arm/board/fvp/fvp_stack_protector.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <platform.h>
#include <stdint.h>
+#include <arch_helpers.h>
+#include <plat/common/platform.h>
+
#define RANDOM_CANARY_VALUE ((u_register_t) 3288484550995823360ULL)
u_register_t plat_get_stack_protector_canary(void)
diff --git a/plat/arm/board/fvp/fvp_topology.c b/plat/arm/board/fvp/fvp_topology.c
index e21b9d28c..3384a2f70 100644
--- a/plat/arm/board/fvp/fvp_topology.c
+++ b/plat/arm/board/fvp/fvp_topology.c
@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
#include <arch.h>
-#include <arm_config.h>
-#include <cassert.h>
+#include <lib/cassert.h>
+#include <plat/common/platform.h>
+
#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
+#include <arm_config.h>
#include "drivers/pwrc/fvp_pwrc.h"
/* The FVP power domain tree descriptor */
diff --git a/plat/arm/board/fvp/fvp_trusted_boot.c b/plat/arm/board/fvp/fvp_trusted_boot.c
index 39be4a6e7..c18bfb213 100644
--- a/plat/arm/board/fvp/fvp_trusted_boot.c
+++ b/plat/arm/board/fvp/fvp_trusted_boot.c
@@ -7,8 +7,9 @@
#include <assert.h>
#include <stdint.h>
#include <string.h>
-#include <platform.h>
-#include <tbbr_oid.h>
+
+#include <plat/common/platform.h>
+#include <tools_share/tbbr_oid.h>
#include "fvp_def.h"
diff --git a/plat/arm/board/fvp/include/platform_def.h b/plat/arm/board/fvp/include/platform_def.h
index 3097f909b..ca4bd5399 100644
--- a/plat/arm/board/fvp/include/platform_def.h
+++ b/plat/arm/board/fvp/include/platform_def.h
@@ -18,12 +18,14 @@
# endif
#endif /* AARCH32 */
+#include <drivers/arm/tzc400.h>
+#include <lib/utils_def.h>
+#include <plat/common/common_def.h>
+
#include <arm_def.h>
#include <arm_spm_def.h>
-#include <common_def.h>
-#include <tzc400.h>
-#include <utils_def.h>
#include <v2m_def.h>
+
#include "../fvp_def.h"
/* Required platform porting definitions */
diff --git a/plat/arm/board/juno/aarch32/juno_helpers.S b/plat/arm/board/juno/aarch32/juno_helpers.S
index 1bc4e309a..080a8ddcc 100644
--- a/plat/arm/board/juno/aarch32/juno_helpers.S
+++ b/plat/arm/board/juno/aarch32/juno_helpers.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <cortex_a53.h>
#include <cortex_a57.h>
#include <cortex_a72.h>
diff --git a/plat/arm/board/juno/aarch64/juno_helpers.S b/plat/arm/board/juno/aarch64/juno_helpers.S
index edcfc7449..373f2fc89 100644
--- a/plat/arm/board/juno/aarch64/juno_helpers.S
+++ b/plat/arm/board/juno/aarch64/juno_helpers.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <cortex_a53.h>
#include <cortex_a57.h>
#include <cortex_a72.h>
diff --git a/plat/arm/board/juno/include/platform_def.h b/plat/arm/board/juno/include/platform_def.h
index 8098bc3fe..ed82879af 100644
--- a/plat/arm/board/juno/include/platform_def.h
+++ b/plat/arm/board/juno/include/platform_def.h
@@ -19,15 +19,16 @@
#endif /* AARCH32 */
+#include <drivers/arm/tzc400.h>
+#if TRUSTED_BOARD_BOOT
+#include <drivers/auth/mbedtls/mbedtls_config.h>
+#endif
+#include <plat/common/common_def.h>
+
#include <arm_def.h>
#include <board_css_def.h>
-#include <common_def.h>
#include <css_def.h>
-#if TRUSTED_BOARD_BOOT
-#include <mbedtls_config.h>
-#endif
#include <soc_css_def.h>
-#include <tzc400.h>
#include <v2m_def.h>
#include "../juno_def.h"
diff --git a/plat/arm/board/juno/juno_bl1_setup.c b/plat/arm/board/juno/juno_bl1_setup.c
index 3dd2a227c..e751ab69c 100644
--- a/plat/arm/board/juno/juno_bl1_setup.c
+++ b/plat/arm/board/juno/juno_bl1_setup.c
@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
-#include <debug.h>
#include <errno.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/tbbr/tbbr_img_def.h>
+#include <drivers/arm/sp805.h>
+#include <plat/common/platform.h>
+
#include <plat_arm.h>
-#include <platform.h>
#include <sds.h>
-#include <sp805.h>
-#include <tbbr_img_def.h>
#include <v2m_def.h>
void juno_reset_to_aarch32_state(void);
diff --git a/plat/arm/board/juno/juno_bl2_setup.c b/plat/arm/board/juno/juno_bl2_setup.c
index 1f483d63d..56f05eb18 100644
--- a/plat/arm/board/juno/juno_bl2_setup.c
+++ b/plat/arm/board/juno/juno_bl2_setup.c
@@ -5,8 +5,10 @@
*/
#include <assert.h>
-#include <bl_common.h>
-#include <desc_image_load.h>
+
+#include <common/bl_common.h>
+#include <common/desc_image_load.h>
+
#include <plat_arm.h>
#if JUNO_AARCH32_EL3_RUNTIME
diff --git a/plat/arm/board/juno/juno_def.h b/plat/arm/board/juno/juno_def.h
index 5301886fb..7a8bedf5a 100644
--- a/plat/arm/board/juno/juno_def.h
+++ b/plat/arm/board/juno/juno_def.h
@@ -7,7 +7,7 @@
#ifndef JUNO_DEF_H
#define JUNO_DEF_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/*******************************************************************************
* Juno memory map related constants
diff --git a/plat/arm/board/juno/juno_err.c b/plat/arm/board/juno/juno_err.c
index dd8e27881..69daa1ae0 100644
--- a/plat/arm/board/juno/juno_err.c
+++ b/plat/arm/board/juno/juno_err.c
@@ -4,9 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <errno.h>
-#include <platform.h>
+
+#include <arch_helpers.h>
+#include <plat/common/platform.h>
+
#include <v2m_def.h>
/*
diff --git a/plat/arm/board/juno/juno_security.c b/plat/arm/board/juno/juno_security.c
index b6cfe7817..b0df83791 100644
--- a/plat/arm/board/juno/juno_security.c
+++ b/plat/arm/board/juno/juno_security.c
@@ -4,12 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <mmio.h>
-#include <nic_400.h>
+#include <common/debug.h>
+#include <drivers/arm/nic_400.h>
+#include <lib/mmio.h>
+
#include <plat_arm.h>
#include <soc_css.h>
-
#include "juno_def.h"
#include "juno_tzmp1_def.h"
diff --git a/plat/arm/board/juno/juno_stack_protector.c b/plat/arm/board/juno/juno_stack_protector.c
index ec0b1fbee..ff05b5d46 100644
--- a/plat/arm/board/juno/juno_stack_protector.c
+++ b/plat/arm/board/juno/juno_stack_protector.c
@@ -5,8 +5,9 @@
*/
#include <arch_helpers.h>
-#include <debug.h>
-#include <utils.h>
+#include <common/debug.h>
+#include <lib/utils.h>
+
#include "juno_decl.h"
#include "juno_def.h"
diff --git a/plat/arm/board/juno/juno_topology.c b/plat/arm/board/juno/juno_topology.c
index c8a759824..51b99aca7 100644
--- a/plat/arm/board/juno/juno_topology.c
+++ b/plat/arm/board/juno/juno_topology.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <plat/common/platform.h>
+
#include <arm_def.h>
#include <css_pm.h>
#include <plat_arm.h>
-#include <platform.h>
#include "juno_def.h"
#include "../../css/drivers/scmi/scmi.h"
#include "../../css/drivers/mhu/css_mhu_doorbell.h"
diff --git a/plat/arm/board/juno/juno_trng.c b/plat/arm/board/juno/juno_trng.c
index d9ad1d4eb..505fb0266 100644
--- a/plat/arm/board/juno/juno_trng.c
+++ b/plat/arm/board/juno/juno_trng.c
@@ -5,9 +5,11 @@
*/
#include <assert.h>
-#include <mmio.h>
#include <string.h>
-#include <utils_def.h>
+
+#include <lib/mmio.h>
+#include <lib/utils_def.h>
+
#include "juno_decl.h"
#include "juno_def.h"
diff --git a/plat/arm/board/n1sdp/n1sdp_bl31_setup.c b/plat/arm/board/n1sdp/n1sdp_bl31_setup.c
index cdd0b63da..d044b7ccf 100644
--- a/plat/arm/board/n1sdp/n1sdp_bl31_setup.c
+++ b/plat/arm/board/n1sdp/n1sdp_bl31_setup.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
#include "../../css/drivers/scmi/scmi.h"
#include "../../css/drivers/mhu/css_mhu_doorbell.h"
#include <plat_arm.h>
-#include <platform_def.h>
static scmi_channel_plat_info_t n1sdp_scmi_plat_info = {
.scmi_mbx_mem = N1SDP_SCMI_PAYLOAD_BASE,
diff --git a/plat/arm/board/n1sdp/n1sdp_plat.c b/plat/arm/board/n1sdp/n1sdp_plat.c
index 8c057c55e..5aaa7376a 100644
--- a/plat/arm/board/n1sdp/n1sdp_plat.c
+++ b/plat/arm/board/n1sdp/n1sdp_plat.c
@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
#include <arm_def.h>
-#include <bl_common.h>
-#include <debug.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
/*
* Table of regions to map using the MMU.
diff --git a/plat/arm/board/sgi575/include/platform_def.h b/plat/arm/board/sgi575/include/platform_def.h
index 16e2898de..6aea522f0 100644
--- a/plat/arm/board/sgi575/include/platform_def.h
+++ b/plat/arm/board/sgi575/include/platform_def.h
@@ -7,8 +7,9 @@
#ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H
+#include <lib/utils_def.h>
+
#include <sgi_base_platform_def.h>
-#include <utils_def.h>
#define PLAT_ARM_CLUSTER_COUNT 2
#define CSS_SGI_MAX_CPUS_PER_CLUSTER 4
diff --git a/plat/arm/board/sgi575/sgi575_plat.c b/plat/arm/board/sgi575/sgi575_plat.c
index a8ca916d9..d1a1fbf46 100644
--- a/plat/arm/board/sgi575/sgi575_plat.c
+++ b/plat/arm/board/sgi575/sgi575_plat.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <platform.h>
+#include <plat/common/platform.h>
unsigned int plat_arm_sgi_get_platform_id(void)
{
diff --git a/plat/arm/board/sgi575/sgi575_security.c b/plat/arm/board/sgi575/sgi575_security.c
index 7ccc59a7b..8417e1008 100644
--- a/plat/arm/board/sgi575/sgi575_security.c
+++ b/plat/arm/board/sgi575/sgi575_security.c
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
#include <platform_def.h>
-#include <tzc_dmc620.h>
+
+#include <common/debug.h>
+#include <drivers/arm/tzc_dmc620.h>
uintptr_t sgi575_dmc_base[] = {
SGI575_DMC620_BASE0,
diff --git a/plat/arm/board/sgiclarka/include/platform_def.h b/plat/arm/board/sgiclarka/include/platform_def.h
index 39907e8bc..d2cdb4974 100644
--- a/plat/arm/board/sgiclarka/include/platform_def.h
+++ b/plat/arm/board/sgiclarka/include/platform_def.h
@@ -7,8 +7,9 @@
#ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H
+#include <lib/utils_def.h>
+
#include <sgi_base_platform_def.h>
-#include <utils_def.h>
#define PLAT_ARM_CLUSTER_COUNT 2
#define CSS_SGI_MAX_CPUS_PER_CLUSTER 4
diff --git a/plat/arm/board/sgiclarka/sgiclarka_plat.c b/plat/arm/board/sgiclarka/sgiclarka_plat.c
index 3df2da666..3b7e5ee4e 100644
--- a/plat/arm/board/sgiclarka/sgiclarka_plat.c
+++ b/plat/arm/board/sgiclarka/sgiclarka_plat.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <platform.h>
+#include <plat/common/platform.h>
unsigned int plat_arm_sgi_get_platform_id(void)
{
diff --git a/plat/arm/board/sgiclarka/sgiclarka_security.c b/plat/arm/board/sgiclarka/sgiclarka_security.c
index 29cd75474..c455111d1 100644
--- a/plat/arm/board/sgiclarka/sgiclarka_security.c
+++ b/plat/arm/board/sgiclarka/sgiclarka_security.c
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
#include <platform_def.h>
-#include <tzc_dmc620.h>
+
+#include <common/debug.h>
+#include <drivers/arm/tzc_dmc620.h>
uintptr_t sgiclarka_dmc_base[] = {
SGICLARKA_DMC620_BASE0,
diff --git a/plat/arm/board/sgiclarkh/include/platform_def.h b/plat/arm/board/sgiclarkh/include/platform_def.h
index 544ad90f3..fe8907bee 100644
--- a/plat/arm/board/sgiclarkh/include/platform_def.h
+++ b/plat/arm/board/sgiclarkh/include/platform_def.h
@@ -7,8 +7,9 @@
#ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H
+#include <lib/utils_def.h>
+
#include <sgi_base_platform_def.h>
-#include <utils_def.h>
#define PLAT_ARM_CLUSTER_COUNT 2
#define CSS_SGI_MAX_CPUS_PER_CLUSTER 8
diff --git a/plat/arm/board/sgiclarkh/sgiclarkh_plat.c b/plat/arm/board/sgiclarkh/sgiclarkh_plat.c
index 437592dbd..a1b8d621d 100644
--- a/plat/arm/board/sgiclarkh/sgiclarkh_plat.c
+++ b/plat/arm/board/sgiclarkh/sgiclarkh_plat.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <platform.h>
+#include <plat/common/platform.h>
unsigned int plat_arm_sgi_get_platform_id(void)
{
diff --git a/plat/arm/board/sgiclarkh/sgiclarkh_security.c b/plat/arm/board/sgiclarkh/sgiclarkh_security.c
index 5ae0b8284..aaf9691ce 100644
--- a/plat/arm/board/sgiclarkh/sgiclarkh_security.c
+++ b/plat/arm/board/sgiclarkh/sgiclarkh_security.c
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
#include <platform_def.h>
-#include <tzc_dmc620.h>
+
+#include <common/debug.h>
+#include <drivers/arm/tzc_dmc620.h>
uintptr_t sgiclarkh_dmc_base[] = {
SGICLARKH_DMC620_BASE0,
diff --git a/plat/arm/common/aarch32/arm_bl2_mem_params_desc.c b/plat/arm/common/aarch32/arm_bl2_mem_params_desc.c
index 890f2c960..e23dd258b 100644
--- a/plat/arm/common/aarch32/arm_bl2_mem_params_desc.c
+++ b/plat/arm/common/aarch32/arm_bl2_mem_params_desc.c
@@ -4,11 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
-#include <desc_image_load.h>
-#include <platform.h>
#include <platform_def.h>
+#include <common/bl_common.h>
+#include <common/desc_image_load.h>
+#include <plat/common/platform.h>
/*******************************************************************************
* Following descriptor provides BL image/ep information that gets used
diff --git a/plat/arm/common/aarch64/arm_bl2_mem_params_desc.c b/plat/arm/common/aarch64/arm_bl2_mem_params_desc.c
index 8e6d00d05..c0f42f310 100644
--- a/plat/arm/common/aarch64/arm_bl2_mem_params_desc.c
+++ b/plat/arm/common/aarch64/arm_bl2_mem_params_desc.c
@@ -4,11 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
-#include <desc_image_load.h>
-#include <platform.h>
#include <platform_def.h>
+#include <common/bl_common.h>
+#include <common/desc_image_load.h>
+#include <plat/common/platform.h>
/*******************************************************************************
* Following descriptor provides BL image/ep information that gets used
diff --git a/plat/arm/common/aarch64/arm_ehf.c b/plat/arm/common/aarch64/arm_ehf.c
index f31385185..4ae992c95 100644
--- a/plat/arm/common/aarch64/arm_ehf.c
+++ b/plat/arm/common/aarch64/arm_ehf.c
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <ehf.h>
#include <platform_def.h>
+#include <bl31/ehf.h>
+
/*
* Enumeration of priority levels on ARM platforms.
*/
diff --git a/plat/arm/common/aarch64/arm_sdei.c b/plat/arm/common/aarch64/arm_sdei.c
index 687b21d43..493134b6a 100644
--- a/plat/arm/common/aarch64/arm_sdei.c
+++ b/plat/arm/common/aarch64/arm_sdei.c
@@ -6,9 +6,10 @@
/* SDEI configuration for ARM platforms */
-#include <ehf.h>
#include <platform_def.h>
-#include <sdei.h>
+
+#include <bl31/ehf.h>
+#include <services/sdei.h>
/* Private event mappings */
static sdei_ev_map_t arm_sdei_private[] = {
diff --git a/plat/arm/common/arm_bl1_fwu.c b/plat/arm/common/arm_bl1_fwu.c
index f2be47792..cd92aa8ed 100644
--- a/plat/arm/common/arm_bl1_fwu.c
+++ b/plat/arm/common/arm_bl1_fwu.c
@@ -5,14 +5,17 @@
*/
#include <assert.h>
-#include <bl_common.h>
-#include <debug.h>
#include <errno.h>
-#include <plat_arm.h>
-#include <platform.h>
+
#include <platform_def.h>
-#include <tbbr_img_desc.h>
-#include <utils.h>
+
+#include <bl1/tbbr/tbbr_img_desc.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+
+#include <plat_arm.h>
/* Struct to keep track of usable memory */
typedef struct bl1_mem_info {
diff --git a/plat/arm/common/arm_bl1_setup.c b/plat/arm/common/arm_bl1_setup.c
index f760e18dc..e28211cfa 100644
--- a/plat/arm/common/arm_bl1_setup.c
+++ b/plat/arm/common/arm_bl1_setup.c
@@ -4,17 +4,20 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+
+#include <platform_def.h>
+
#include <arch.h>
+#include <bl1/bl1.h>
+#include <common/bl_common.h>
+#include <drivers/arm/sp805.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables_compat.h>
+#include <plat/common/platform.h>
+
#include <arm_def.h>
-#include <assert.h>
-#include <bl1.h>
-#include <bl_common.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
-#include <sp805.h>
-#include <utils.h>
-#include <xlat_tables_compat.h>
#include "../../../bl1/bl1_private.h"
diff --git a/plat/arm/common/arm_bl2_el3_setup.c b/plat/arm/common/arm_bl2_el3_setup.c
index 4f5e6a9e6..0c1f63ed4 100644
--- a/plat/arm/common/arm_bl2_el3_setup.c
+++ b/plat/arm/common/arm_bl2_el3_setup.c
@@ -3,11 +3,14 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_def.h>
+
#include <assert.h>
-#include <generic_delay_timer.h>
+
+#include <drivers/generic_delay_timer.h>
+#include <plat/common/platform.h>
+
+#include <arm_def.h>
#include <plat_arm.h>
-#include <platform.h>
#pragma weak bl2_el3_early_platform_setup
#pragma weak bl2_el3_plat_arch_setup
diff --git a/plat/arm/common/arm_bl2_setup.c b/plat/arm/common/arm_bl2_setup.c
index 628a50def..9319004ea 100644
--- a/plat/arm/common/arm_bl2_setup.c
+++ b/plat/arm/common/arm_bl2_setup.c
@@ -4,21 +4,24 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <arm_def.h>
#include <assert.h>
-#include <bl_common.h>
-#include <debug.h>
-#include <desc_image_load.h>
-#include <generic_delay_timer.h>
+#include <string.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/desc_image_load.h>
+#include <drivers/generic_delay_timer.h>
#ifdef SPD_opteed
-#include <optee_utils.h>
+#include <lib/optee_utils.h>
#endif
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+
+#include <arm_def.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
-#include <string.h>
-#include <utils.h>
/* Data structure which holds the extents of the trusted SRAM for BL2 */
static meminfo_t bl2_tzram_layout __aligned(CACHE_WRITEBACK_GRANULE);
diff --git a/plat/arm/common/arm_bl2u_setup.c b/plat/arm/common/arm_bl2u_setup.c
index 3848aa065..0dc66e647 100644
--- a/plat/arm/common/arm_bl2u_setup.c
+++ b/plat/arm/common/arm_bl2u_setup.c
@@ -4,15 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+#include <string.h>
+
+#include <platform_def.h>
+
#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <drivers/generic_delay_timer.h>
+#include <plat/common/platform.h>
+
#include <arm_def.h>
-#include <assert.h>
-#include <bl_common.h>
-#include <generic_delay_timer.h>
#include <plat_arm.h>
-#include <platform_def.h>
-#include <platform.h>
-#include <string.h>
/* Weak definitions may be overridden in specific ARM standard platform */
#pragma weak bl2u_platform_setup
diff --git a/plat/arm/common/arm_bl31_setup.c b/plat/arm/common/arm_bl31_setup.c
index 1b05f46e9..41151c2c8 100644
--- a/plat/arm/common/arm_bl31_setup.c
+++ b/plat/arm/common/arm_bl31_setup.c
@@ -4,19 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+
#include <arch.h>
#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <lib/extensions/ras.h>
+#include <lib/mmio.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables_compat.h>
+#include <plat/common/platform.h>
+
#include <arm_def.h>
-#include <assert.h>
-#include <bl_common.h>
-#include <console.h>
-#include <debug.h>
-#include <mmio.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <ras.h>
-#include <utils.h>
-#include <xlat_tables_compat.h>
/*
* Placeholder variables for copying the arguments that have been passed to
diff --git a/plat/arm/common/arm_cci.c b/plat/arm/common/arm_cci.c
index 6505b9174..7ee997e29 100644
--- a/plat/arm/common/arm_cci.c
+++ b/plat/arm/common/arm_cci.c
@@ -4,11 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
#include <arch.h>
-#include <cci.h>
+#include <drivers/arm/cci.h>
+#include <lib/utils.h>
+
#include <plat_arm.h>
-#include <platform_def.h>
-#include <utils.h>
static const int cci_map[] = {
PLAT_ARM_CCI_CLUSTER0_SL_IFACE_IX,
diff --git a/plat/arm/common/arm_ccn.c b/plat/arm/common/arm_ccn.c
index ddf3286d7..6aa56f217 100644
--- a/plat/arm/common/arm_ccn.c
+++ b/plat/arm/common/arm_ccn.c
@@ -4,10 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
#include <arch.h>
-#include <ccn.h>
+#include <drivers/arm/ccn.h>
+
#include <plat_arm.h>
-#include <platform_def.h>
static const unsigned char master_to_rn_id_map[] = {
PLAT_ARM_CLUSTER_TO_CCN_ID_MAP
diff --git a/plat/arm/common/arm_common.c b/plat/arm/common/arm_common.c
index 56ad8aeeb..4cd2ce3d6 100644
--- a/plat/arm/common/arm_common.c
+++ b/plat/arm/common/arm_common.c
@@ -3,17 +3,21 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
+#include <assert.h>
+
+#include <platform_def.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <debug.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <common/romlib.h>
+#include <lib/mmio.h>
+#include <lib/xlat_tables/xlat_tables_compat.h>
+#include <plat/common/platform.h>
+#include <services/secure_partition.h>
+
#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
-#include <romlib.h>
-#include <secure_partition.h>
-#include <xlat_tables_compat.h>
/* Weak definitions may be overridden in specific ARM standard platform */
#pragma weak plat_get_ns_image_entrypoint
diff --git a/plat/arm/common/arm_console.c b/plat/arm/common/arm_console.c
index bd3dca17f..29cb37827 100644
--- a/plat/arm/common/arm_console.c
+++ b/plat/arm/common/arm_console.c
@@ -3,13 +3,17 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <assert.h>
-#include <console.h>
-#include <debug.h>
-#include <pl011.h>
-#include <plat_arm.h>
+
#include <platform_def.h>
+#include <common/debug.h>
+#include <drivers/arm/pl011.h>
+#include <drivers/console.h>
+
+#include <plat_arm.h>
+
/*******************************************************************************
* Functions that set up the console
******************************************************************************/
diff --git a/plat/arm/common/arm_dyn_cfg.c b/plat/arm/common/arm_dyn_cfg.c
index c2a4bb1e6..6c6dc568c 100644
--- a/plat/arm/common/arm_dyn_cfg.c
+++ b/plat/arm/common/arm_dyn_cfg.c
@@ -4,19 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_dyn_cfg_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <desc_image_load.h>
+#include <string.h>
+
+#include <platform_def.h>
+
+#include <common/debug.h>
+#include <common/desc_image_load.h>
+#include <common/tbbr/tbbr_img_def.h>
#if TRUSTED_BOARD_BOOT
-#include <mbedtls_config.h>
+#include <drivers/auth/mbedtls/mbedtls_config.h>
#endif
-#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
-#include <string.h>
-#include <tbbr_img_def.h>
+#include <plat/common/platform.h>
+#include <arm_dyn_cfg_helpers.h>
+#include <plat_arm.h>
/* Variable to store the address to TB_FW_CONFIG passed from BL1 */
static void *tb_fw_cfg_dtb;
diff --git a/plat/arm/common/arm_dyn_cfg_helpers.c b/plat/arm/common/arm_dyn_cfg_helpers.c
index d12d09c7f..bf2f15643 100644
--- a/plat/arm/common/arm_dyn_cfg_helpers.c
+++ b/plat/arm/common/arm_dyn_cfg_helpers.c
@@ -4,11 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_dyn_cfg_helpers.h>
#include <assert.h>
-#include <desc_image_load.h>
-#include <fdt_wrappers.h>
+
#include <libfdt.h>
+
+#include <common/desc_image_load.h>
+#include <common/fdt_wrappers.h>
+
+#include <arm_dyn_cfg_helpers.h>
#include <plat_arm.h>
#define DTB_PROP_MBEDTLS_HEAP_ADDR "mbedtls_heap_addr"
diff --git a/plat/arm/common/arm_err.c b/plat/arm/common/arm_err.c
index aa65f4f33..8650d48a7 100644
--- a/plat/arm/common/arm_err.c
+++ b/plat/arm/common/arm_err.c
@@ -4,15 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <console.h>
-#include <debug.h>
#include <errno.h>
-#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
#include <stdint.h>
-#include <v2m_flash.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/cfi/v2m_flash.h>
+#include <drivers/console.h>
+#include <plat/common/platform.h>
+
+#include <plat_arm.h>
#pragma weak plat_arm_error_handler
diff --git a/plat/arm/common/arm_gicv2.c b/plat/arm/common/arm_gicv2.c
index 5644c6040..fc848c198 100644
--- a/plat/arm/common/arm_gicv2.c
+++ b/plat/arm/common/arm_gicv2.c
@@ -4,11 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <gicv2.h>
-#include <plat_arm.h>
-#include <platform.h>
#include <platform_def.h>
+#include <drivers/arm/gicv2.h>
+#include <plat/common/platform.h>
+
+#include <plat_arm.h>
+
/******************************************************************************
* The following functions are defined as weak to allow a platform to override
* the way the GICv2 driver is initialised and used.
diff --git a/plat/arm/common/arm_gicv3.c b/plat/arm/common/arm_gicv3.c
index a43bff3d4..0f6690a0b 100644
--- a/plat/arm/common/arm_gicv3.c
+++ b/plat/arm/common/arm_gicv3.c
@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
+#include <common/interrupt_props.h>
+#include <drivers/arm/gicv3.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+
#include <arm_def.h>
-#include <gicv3.h>
-#include <interrupt_props.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
-#include <utils.h>
/******************************************************************************
* The following functions are defined as weak to allow a platform to override
diff --git a/plat/arm/common/arm_image_load.c b/plat/arm/common/arm_image_load.c
index 4f86efdf9..791f05ed7 100644
--- a/plat/arm/common/arm_image_load.c
+++ b/plat/arm/common/arm_image_load.c
@@ -4,12 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <common/bl_common.h>
+#include <common/desc_image_load.h>
+#include <plat/common/platform.h>
+
#include <arm_def.h>
-#include <bl_common.h>
-#include <desc_image_load.h>
#include <plat_arm.h>
-#include <platform.h>
-
#pragma weak plat_flush_next_bl_params
#pragma weak plat_get_bl_image_load_info
diff --git a/plat/arm/common/arm_io_storage.c b/plat/arm/common/arm_io_storage.c
index cd58e4564..d7c5cac24 100644
--- a/plat/arm/common/arm_io_storage.c
+++ b/plat/arm/common/arm_io_storage.c
@@ -3,18 +3,22 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <assert.h>
-#include <debug.h>
-#include <firmware_image_package.h>
-#include <io_driver.h>
-#include <io_fip.h>
-#include <io_memmap.h>
-#include <io_storage.h>
-#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
#include <string.h>
-#include <utils.h>
+
+#include <platform_def.h>
+
+#include <common/debug.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_fip.h>
+#include <drivers/io/io_memmap.h>
+#include <drivers/io/io_storage.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+#include <tools_share/firmware_image_package.h>
+
+#include <plat_arm.h>
/* IO devices */
static const io_dev_connector_t *fip_dev_con;
diff --git a/plat/arm/common/arm_nor_psci_mem_protect.c b/plat/arm/common/arm_nor_psci_mem_protect.c
index 2a46b95d6..4ae57e534 100644
--- a/plat/arm/common/arm_nor_psci_mem_protect.c
+++ b/plat/arm/common/arm_nor_psci_mem_protect.c
@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <mmio.h>
-#include <plat_arm.h>
#include <platform_def.h>
-#include <psci.h>
-#include <utils.h>
-#include <v2m_flash.h>
+
+#include <common/debug.h>
+#include <drivers/cfi/v2m_flash.h>
+#include <lib/psci/psci.h>
+#include <lib/mmio.h>
+#include <lib/utils.h>
+
+#include <plat_arm.h>
/*
* DRAM1 is used also to load the NS boot loader. For this reason we
diff --git a/plat/arm/common/arm_pm.c b/plat/arm/common/arm_pm.c
index 3be1b5d39..acfd90899 100644
--- a/plat/arm/common/arm_pm.c
+++ b/plat/arm/common/arm_pm.c
@@ -4,14 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <arm_def.h>
#include <assert.h>
#include <errno.h>
-#include <plat_arm.h>
-#include <platform.h>
+
#include <platform_def.h>
-#include <psci.h>
+
+#include <arch_helpers.h>
+#include <lib/psci/psci.h>
+#include <plat/common/platform.h>
+
+#include <arm_def.h>
+#include <plat_arm.h>
/* Allow ARM Standard platforms to override these functions */
#pragma weak plat_arm_program_trusted_mailbox
diff --git a/plat/arm/common/arm_sip_svc.c b/plat/arm/common/arm_sip_svc.c
index e482a8945..6b0f7e7be 100644
--- a/plat/arm/common/arm_sip_svc.c
+++ b/plat/arm/common/arm_sip_svc.c
@@ -4,14 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_sip_svc.h>
-#include <debug.h>
-#include <plat_arm.h>
-#include <pmf.h>
-#include <runtime_svc.h>
#include <stdint.h>
-#include <uuid.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <lib/pmf/pmf.h>
+#include <tools_share/uuid.h>
+
+#include <arm_sip_svc.h>
+#include <plat_arm.h>
/* ARM SiP Service UUID */
DEFINE_SVC_UUID2(arm_sip_svc_uid,
diff --git a/plat/arm/common/arm_topology.c b/plat/arm/common/arm_topology.c
index b0ad4d1c6..6986e52b0 100644
--- a/plat/arm/common/arm_topology.c
+++ b/plat/arm/common/arm_topology.c
@@ -4,9 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
#include <arch.h>
+
#include <plat_arm.h>
-#include <platform_def.h>
/*******************************************************************************
* This function validates an MPIDR by checking whether it falls within the
diff --git a/plat/arm/common/arm_tzc400.c b/plat/arm/common/arm_tzc400.c
index 2ae084c7b..0346fa184 100644
--- a/plat/arm/common/arm_tzc400.c
+++ b/plat/arm/common/arm_tzc400.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
+#include <common/debug.h>
+#include <drivers/arm/tzc400.h>
+
#include <arm_def.h>
#include <arm_spm_def.h>
-#include <debug.h>
#include <plat_arm.h>
-#include <platform_def.h>
-#include <tzc400.h>
-
/* Weak definitions may be overridden in specific ARM standard platform */
#pragma weak plat_arm_security_setup
diff --git a/plat/arm/common/arm_tzc_dmc500.c b/plat/arm/common/arm_tzc_dmc500.c
index 6bd771b0e..bea3867d3 100644
--- a/plat/arm/common/arm_tzc_dmc500.c
+++ b/plat/arm/common/arm_tzc_dmc500.c
@@ -4,12 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_def.h>
#include <assert.h>
-#include <debug.h>
-#include <plat_arm.h>
+
#include <platform_def.h>
-#include <tzc_dmc500.h>
+
+#include <common/debug.h>
+#include <drivers/arm/tzc_dmc500.h>
+
+#include <arm_def.h>
+#include <plat_arm.h>
/*******************************************************************************
* Initialize the DMC500-TrustZone Controller for ARM standard platforms.
diff --git a/plat/arm/common/execution_state_switch.c b/plat/arm/common/execution_state_switch.c
index 8fa864d66..e3134102d 100644
--- a/plat/arm/common/execution_state_switch.c
+++ b/plat/arm/common/execution_state_switch.c
@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdbool.h>
+#include <string.h>
+
#include <arch_helpers.h>
-#include <arm_sip_svc.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <plat_arm.h>
-#include <psci.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/psci/psci.h>
+#include <lib/utils.h>
#include <smccc_helpers.h>
-#include <stdbool.h>
-#include <string.h>
-#include <utils.h>
+
+#include <arm_sip_svc.h>
+#include <plat_arm.h>
/*
* Handle SMC from a lower exception level to switch its execution state
diff --git a/plat/arm/common/sp_min/arm_sp_min_setup.c b/plat/arm/common/sp_min/arm_sp_min_setup.c
index ca427d58a..967b551e4 100644
--- a/plat/arm/common/sp_min/arm_sp_min_setup.c
+++ b/plat/arm/common/sp_min/arm_sp_min_setup.c
@@ -5,15 +5,18 @@
*/
#include <assert.h>
-#include <bl_common.h>
-#include <console.h>
-#include <debug.h>
-#include <mmio.h>
-#include <pl011.h>
-#include <plat_arm.h>
-#include <platform.h>
+
#include <platform_def.h>
-#include <platform_sp_min.h>
+
+#include <bl32/sp_min/platform_sp_min.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/arm/pl011.h>
+#include <drivers/console.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
+#include <plat_arm.h>
static entry_point_info_t bl33_image_ep_info;
diff --git a/plat/arm/common/tsp/arm_tsp_setup.c b/plat/arm/common/tsp/arm_tsp_setup.c
index 3cf88251f..a3d2f7157 100644
--- a/plat/arm/common/tsp/arm_tsp_setup.c
+++ b/plat/arm/common/tsp/arm_tsp_setup.c
@@ -4,15 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_def.h>
#include <assert.h>
-#include <bl_common.h>
-#include <console.h>
-#include <debug.h>
-#include <pl011.h>
-#include <plat_arm.h>
+
#include <platform_def.h>
-#include <platform_tsp.h>
+
+#include <bl32/tsp/platform_tsp.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/arm/pl011.h>
+#include <drivers/console.h>
+
+#include <arm_def.h>
+#include <plat_arm.h>
#define BL32_END (unsigned long)(&__BL32_END__)
diff --git a/plat/arm/css/common/css_bl1_setup.c b/plat/arm/css/common/css_bl1_setup.c
index b1b275c6e..ae0f01133 100644
--- a/plat/arm/css/common/css_bl1_setup.c
+++ b/plat/arm/css/common/css_bl1_setup.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
-#include <debug.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
#include <plat_arm.h>
-#include <platform.h>
#include <soc_css.h>
void bl1_platform_setup(void)
diff --git a/plat/arm/css/common/css_bl2_setup.c b/plat/arm/css/common/css_bl2_setup.c
index e41b1ca0a..c1c7868b8 100644
--- a/plat/arm/css/common/css_bl2_setup.c
+++ b/plat/arm/css/common/css_bl2_setup.c
@@ -4,13 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
+#include <string.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <lib/mmio.h>
+#include <lib/utils.h>
+
#include <css_def.h>
-#include <debug.h>
-#include <mmio.h>
#include <plat_arm.h>
-#include <string.h>
-#include <utils.h>
+
#include "../drivers/scp/css_scp.h"
/* Weak definition may be overridden in specific CSS based platform */
diff --git a/plat/arm/css/common/css_bl2u_setup.c b/plat/arm/css/common/css_bl2u_setup.c
index 4ceb5cda7..564e98f70 100644
--- a/plat/arm/css/common/css_bl2u_setup.c
+++ b/plat/arm/css/common/css_bl2u_setup.c
@@ -4,10 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
-#include <debug.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
#include <plat_arm.h>
-#include <platform.h>
+
#include "../drivers/scp/css_scp.h"
/* Weak definition may be overridden in specific CSS based platform */
diff --git a/plat/arm/css/common/css_pm.c b/plat/arm/css/common/css_pm.c
index 4735a9dcc..8a156e675 100644
--- a/plat/arm/css/common/css_pm.c
+++ b/plat/arm/css/common/css_pm.c
@@ -4,15 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <cassert.h>
-#include <css_pm.h>
-#include <debug.h>
#include <errno.h>
-#include <plat_arm.h>
-#include <platform.h>
+
#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/cassert.h>