aboutsummaryrefslogtreecommitdiff
path: root/plat/imx
diff options
context:
space:
mode:
Diffstat (limited to 'plat/imx')
-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
35 files changed, 164 insertions, 112 deletions
diff --git a/plat/imx/common/imx8_psci.c b/plat/imx/common/imx8_psci.c
index 22a531bf8..588d8b4e2 100644
--- a/plat/imx/common/imx8_psci.c
+++ b/plat/imx/common/imx8_psci.c
@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdbool.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <debug.h>
+#include <common/debug.h>
+
#include <plat_imx8.h>
#include <sci/sci.h>
-#include <stdbool.h>
void __dead2 imx_system_off(void)
{
diff --git a/plat/imx/common/imx8_topology.c b/plat/imx/common/imx8_topology.c
index 64145c4ca..5e14d17fa 100644
--- a/plat/imx/common/imx8_topology.c
+++ b/plat/imx/common/imx8_topology.c
@@ -6,7 +6,7 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <platform.h>
+#include <plat/common/platform.h>
const unsigned char imx_power_domain_tree_desc[] = {
PWR_DOMAIN_AT_MAX_LVL,
diff --git a/plat/imx/common/imx_aips.c b/plat/imx/common/imx_aips.c
index 991c262bc..532d9c0eb 100644
--- a/plat/imx/common/imx_aips.c
+++ b/plat/imx/common/imx_aips.c
@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
-#include <utils_def.h>
+#include <lib/mmio.h>
+#include <lib/utils_def.h>
+
#include <imx_aips.h>
#include <imx_regs.h>
diff --git a/plat/imx/common/imx_caam.c b/plat/imx/common/imx_caam.c
index 335e1ed8e..d9c141f56 100644
--- a/plat/imx/common/imx_caam.c
+++ b/plat/imx/common/imx_caam.c
@@ -3,8 +3,11 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <stdint.h>
-#include <mmio.h>
+
+#include <lib/mmio.h>
+
#include <imx_caam.h>
void imx_caam_init(void)
diff --git a/plat/imx/common/imx_clock.c b/plat/imx/common/imx_clock.c
index ccf2aeb13..743de553a 100644
--- a/plat/imx/common/imx_clock.c
+++ b/plat/imx/common/imx_clock.c
@@ -3,10 +3,13 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <mmio.h>
+
#include <stdint.h>
#include <stdbool.h>
+
+#include <arch.h>
+#include <lib/mmio.h>
+
#include <imx_regs.h>
#include <imx_clock.h>
diff --git a/plat/imx/common/imx_csu.c b/plat/imx/common/imx_csu.c
index 7c6a63e8a..7e165d928 100644
--- a/plat/imx/common/imx_csu.c
+++ b/plat/imx/common/imx_csu.c
@@ -3,7 +3,9 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
+
+#include <lib/mmio.h>
+
#include <imx_csu.h>
#include <imx_regs.h>
diff --git a/plat/imx/common/imx_io_mux.c b/plat/imx/common/imx_io_mux.c
index 723064716..75de5d14e 100644
--- a/plat/imx/common/imx_io_mux.c
+++ b/plat/imx/common/imx_io_mux.c
@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
+#include <lib/mmio.h>
+
#include <imx_regs.h>
#include <imx_io_mux.h>
diff --git a/plat/imx/common/imx_snvs.c b/plat/imx/common/imx_snvs.c
index 4a2a7d725..9b3a73776 100644
--- a/plat/imx/common/imx_snvs.c
+++ b/plat/imx/common/imx_snvs.c
@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
+#include <lib/mmio.h>
+
#include <imx_regs.h>
#include <imx_snvs.h>
diff --git a/plat/imx/common/imx_wdog.c b/plat/imx/common/imx_wdog.c
index 86813dd01..af6d7678e 100644
--- a/plat/imx/common/imx_wdog.c
+++ b/plat/imx/common/imx_wdog.c
@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
+#include <lib/mmio.h>
+
#include <imx_regs.h>
#include <imx_wdog.h>
diff --git a/plat/imx/common/include/imx8_lpuart.h b/plat/imx/common/include/imx8_lpuart.h
index 8e1184f95..63449e7de 100644
--- a/plat/imx/common/include/imx8_lpuart.h
+++ b/plat/imx/common/include/imx8_lpuart.h
@@ -7,7 +7,7 @@
#ifndef IMX8_LPUART_H
#define IMX8_LPUART_H
-#include <console.h>
+#include <drivers/console.h>
#define VERID 0x0
#define PARAM 0x4
diff --git a/plat/imx/common/include/imx_snvs.h b/plat/imx/common/include/imx_snvs.h
index 0aed1e142..0b3d1085f 100644
--- a/plat/imx/common/include/imx_snvs.h
+++ b/plat/imx/common/include/imx_snvs.h
@@ -7,6 +7,7 @@
#define IMX_SNVS_H
#include <stdint.h>
+
#include <arch.h>
struct snvs {
diff --git a/plat/imx/common/include/imx_uart.h b/plat/imx/common/include/imx_uart.h
index d2c396888..a251024f1 100644
--- a/plat/imx/common/include/imx_uart.h
+++ b/plat/imx/common/include/imx_uart.h
@@ -7,7 +7,7 @@
#ifndef IMX_UART_H
#define IMX_UART_H
-#include <console.h>
+#include <drivers/console.h>
#ifndef __ASSEMBLY__
diff --git a/plat/imx/common/include/imx_wdog.h b/plat/imx/common/include/imx_wdog.h
index 7b3037dfe..75a729a99 100644
--- a/plat/imx/common/include/imx_wdog.h
+++ b/plat/imx/common/include/imx_wdog.h
@@ -7,9 +7,10 @@
#ifndef IMX_WDOG_H
#define IMX_WDOG_H
-#include <arch.h>
#include <stdint.h>
+#include <arch.h>
+
struct wdog_regs {
uint16_t wcr;
uint16_t wsr;
diff --git a/plat/imx/common/include/plat_imx8.h b/plat/imx/common/include/plat_imx8.h
index 03799c459..8d83173fd 100644
--- a/plat/imx/common/include/plat_imx8.h
+++ b/plat/imx/common/include/plat_imx8.h
@@ -7,8 +7,8 @@
#ifndef PLAT_IMX8_H
#define PLAT_IMX8_H
-#include <gicv3.h>
-#include <psci.h>
+#include <drivers/arm/gicv3.h>
+#include <lib/psci/psci.h>
unsigned int plat_calc_core_pos(uint64_t mpidr);
void imx_mailbox_init(uintptr_t base_addr);
diff --git a/plat/imx/common/include/sci/sci_rpc.h b/plat/imx/common/include/sci/sci_rpc.h
index 1771baed3..60dbc27b6 100644
--- a/plat/imx/common/include/sci/sci_rpc.h
+++ b/plat/imx/common/include/sci/sci_rpc.h
@@ -13,9 +13,10 @@
/* Includes */
+#include <stdbool.h>
+
#include <sci/sci_types.h>
#include <sci/sci_ipc.h>
-#include <stdbool.h>
/* Defines */
diff --git a/plat/imx/common/plat_imx8_gic.c b/plat/imx/common/plat_imx8_gic.c
index 2da9cc0d9..aec0b6c9b 100644
--- a/plat/imx/common/plat_imx8_gic.c
+++ b/plat/imx/common/plat_imx8_gic.c
@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
-#include <gicv3.h>
-#include <interrupt_props.h>
-#include <plat_imx8.h>
-#include <platform.h>
#include <platform_def.h>
-#include <utils.h>
+
+#include <common/bl_common.h>
+#include <common/interrupt_props.h>
+#include <drivers/arm/gicv3.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+
+#include <plat_imx8.h>
/* the GICv3 driver only needs to be initialized in EL3 */
uintptr_t rdistif_base_addrs[PLATFORM_CORE_COUNT];
diff --git a/plat/imx/common/sci/imx8_mu.c b/plat/imx/common/sci/imx8_mu.c
index 8028c76d6..26d9bdfef 100644
--- a/plat/imx/common/sci/imx8_mu.c
+++ b/plat/imx/common/sci/imx8_mu.c
@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <mmio.h>
+#include <lib/mmio.h>
+
#include "imx8_mu.h"
void MU_EnableRxFullInt(uint32_t base, uint32_t index)
diff --git a/plat/imx/common/sci/ipc.c b/plat/imx/common/sci/ipc.c
index 2af256782..6491ca575 100644
--- a/plat/imx/common/sci/ipc.c
+++ b/plat/imx/common/sci/ipc.c
@@ -4,11 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bakery_lock.h>
+#include <stdlib.h>
+
+#include <lib/bakery_lock.h>
+
#include <sci/sci_scfw.h>
#include <sci/sci_ipc.h>
#include <sci/sci_rpc.h>
-#include <stdlib.h>
#include "imx8_mu.h"
DEFINE_BAKERY_LOCK(sc_ipc_bakery_lock);
diff --git a/plat/imx/common/sci/svc/pad/pad_rpc_clnt.c b/plat/imx/common/sci/svc/pad/pad_rpc_clnt.c
index 555e7047a..319d4696d 100644
--- a/plat/imx/common/sci/svc/pad/pad_rpc_clnt.c
+++ b/plat/imx/common/sci/svc/pad/pad_rpc_clnt.c
@@ -14,11 +14,12 @@
/* Includes */
+#include <stdlib.h>
+
#include <sci/sci_types.h>
#include <sci/svc/rm/sci_rm_api.h>
#include <sci/svc/pad/sci_pad_api.h>
#include <sci/sci_rpc.h>
-#include <stdlib.h>
#include "sci_pad_rpc.h"
/* Local Defines */
diff --git a/plat/imx/common/sci/svc/pm/pm_rpc_clnt.c b/plat/imx/common/sci/svc/pm/pm_rpc_clnt.c
index b108c499b..66a57a13d 100644
--- a/plat/imx/common/sci/svc/pm/pm_rpc_clnt.c
+++ b/plat/imx/common/sci/svc/pm/pm_rpc_clnt.c
@@ -14,11 +14,13 @@
/* Includes */
+#include <stdlib.h>
+
#include <sci/sci_types.h>
#include <sci/svc/rm/sci_rm_api.h>
#include <sci/svc/pm/sci_pm_api.h>
#include <sci/sci_rpc.h>
-#include <stdlib.h>
+
#include "sci_pm_rpc.h"
/* Local Defines */
diff --git a/plat/imx/common/sci/svc/rm/rm_rpc_clnt.c b/plat/imx/common/sci/svc/rm/rm_rpc_clnt.c
index 230956c7c..16771a583 100644
--- a/plat/imx/common/sci/svc/rm/rm_rpc_clnt.c
+++ b/plat/imx/common/sci/svc/rm/rm_rpc_clnt.c
@@ -14,10 +14,12 @@
/* Includes */
+#include <stdlib.h>
+
#include <sci/sci_types.h>
#include <sci/svc/rm/sci_rm_api.h>
#include <sci/sci_rpc.h>
-#include <stdlib.h>
+
#include "sci_rm_rpc.h"
/* Local Defines */
diff --git a/plat/imx/imx7/warp7/include/platform_def.h b/plat/imx/imx7/warp7/include/platform_def.h
index 4ee6fd37d..a931c8062 100644
--- a/plat/imx/imx7/warp7/include/platform_def.h
+++ b/plat/imx/imx7/warp7/include/platform_def.h
@@ -8,8 +8,8 @@
#define PLATFORM_DEF_H
#include <arch.h>
-#include <common_def.h>
-#include <tbbr_img_def.h>
+#include <common/tbbr/tbbr_img_def.h>
+#include <plat/common/common_def.h>
#define PLATFORM_STACK_SIZE 0x1000
diff --git a/plat/imx/imx7/warp7/warp7_bl2_el3_setup.c b/plat/imx/imx7/warp7/warp7_bl2_el3_setup.c
index 10c4160cf..032ed7b19 100644
--- a/plat/imx/imx7/warp7/warp7_bl2_el3_setup.c
+++ b/plat/imx/imx7/warp7/warp7_bl2_el3_setup.c
@@ -4,19 +4,22 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <console.h>
-#include <debug.h>
-#include <desc_image_load.h>
-#include <mmc.h>
-#include <mmio.h>
-#include <optee_utils.h>
+
#include <platform_def.h>
-#include <utils.h>
-#include <xlat_mmu_helpers.h>
-#include <xlat_tables_defs.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/desc_image_load.h>
+#include <drivers/console.h>
+#include <drivers/mmc.h>
+#include <lib/xlat_tables/xlat_mmu_helpers.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+#include <lib/mmio.h>
+#include <lib/optee_utils.h>
+#include <lib/utils.h>
+
#include <imx_aips.h>
#include <imx_caam.h>
#include <imx_clock.h>
@@ -27,6 +30,7 @@
#include <imx_snvs.h>
#include <imx_usdhc.h>
#include <imx_wdog.h>
+
#include "warp7_private.h"
#define UART1_CLK_SELECT (CCM_TARGET_ROOT_ENABLE |\
diff --git a/plat/imx/imx7/warp7/warp7_bl2_mem_params_desc.c b/plat/imx/imx7/warp7/warp7_bl2_mem_params_desc.c
index 12254d46c..a29e14198 100644
--- a/plat/imx/imx7/warp7/warp7_bl2_mem_params_desc.c
+++ b/plat/imx/imx7/warp7/warp7_bl2_mem_params_desc.c
@@ -4,11 +4,12 @@
* 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>
+
static bl_mem_params_node_t bl2_mem_params_descs[] = {
{
.image_id = BL32_IMAGE_ID,
diff --git a/plat/imx/imx7/warp7/warp7_image_load.c b/plat/imx/imx7/warp7/warp7_image_load.c
index 1e3a2b0b5..c3e47b9d7 100644
--- a/plat/imx/imx7/warp7/warp7_image_load.c
+++ b/plat/imx/imx7/warp7/warp7_image_load.c
@@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
-#include <desc_image_load.h>
-#include <platform.h>
+#include <common/bl_common.h>
+#include <common/desc_image_load.h>
+#include <plat/common/platform.h>
void plat_flush_next_bl_params(void)
{
diff --git a/plat/imx/imx7/warp7/warp7_io_storage.c b/plat/imx/imx7/warp7/warp7_io_storage.c
index 8354766ae..b9cace090 100644
--- a/plat/imx/imx7/warp7/warp7_io_storage.c
+++ b/plat/imx/imx7/warp7/warp7_io_storage.c
@@ -3,16 +3,19 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <assert.h>
-#include <debug.h>
-#include <mmc.h>
-#include <firmware_image_package.h>
-#include <io_block.h>
-#include <io_driver.h>
-#include <io_fip.h>
-#include <io_memmap.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_fip.h>
+#include <drivers/io/io_memmap.h>
+#include <drivers/mmc.h>
+#include <tools_share/firmware_image_package.h>
+
static const io_dev_connector_t *fip_dev_con;
static uintptr_t fip_dev_handle;
diff --git a/plat/imx/imx8m/imx8mq/gpc.c b/plat/imx/imx8m/imx8mq/gpc.c
index 187a4ad1f..7fa5a3d1b 100644
--- a/plat/imx/imx8m/imx8mq/gpc.c
+++ b/plat/imx/imx8m/imx8mq/gpc.c
@@ -4,15 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <gpc.h>
-#include <mmio.h>
-#include <platform_def.h>
-#include <psci.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
-#include <std_svc.h>
+
+#include <common/debug.h>
+#include <lib/mmio.h>
+#include <lib/psci/psci.h>
+#include <platform_def.h>
+#include <services/std_svc.h>
+
+#include <gpc.h>
void imx_set_cpu_secure_entry(unsigned int core_id, uintptr_t sec_entrypoint)
{
diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
index 45d2a40f6..f4e6ee746 100644
--- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
+++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
@@ -4,22 +4,25 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <console.h>
+#include <stdbool.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <debug.h>
+#include <drivers/arm/tzc380.h>
+#include <drivers/console.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/mmio.h>
+#include <lib/xlat_tables/xlat_tables.h>
+#include <plat/common/platform.h>
+
#include <gpc.h>
#include <imx_uart.h>
-#include <stdbool.h>
-#include <mmio.h>
-#include <platform.h>
-#include <platform_def.h>
#include <plat_imx8.h>
-#include <xlat_tables.h>
-#include <tzc380.h>
IMPORT_SYM(uintptr_t, __COHERENT_RAM_START__, BL31_COHERENT_RAM_START);
IMPORT_SYM(uintptr_t, __COHERENT_RAM_END__, BL31_COHERENT_RAM_END);
diff --git a/plat/imx/imx8m/imx8mq/imx8mq_psci.c b/plat/imx/imx8m/imx8mq/imx8mq_psci.c
index 7afe52d3d..ee588656e 100644
--- a/plat/imx/imx8m/imx8mq/imx8mq_psci.c
+++ b/plat/imx/imx8m/imx8mq/imx8mq_psci.c
@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdbool.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <debug.h>
+#include <common/debug.h>
+#include <lib/mmio.h>
+#include <lib/psci/psci.h>
+
#include <gpc.h>
-#include <stdbool.h>
#include <plat_imx8.h>
-#include <psci.h>
-#include <mmio.h>
#define CORE_PWR_STATE(state) ((state)->pwr_domain_state[MPIDR_AFFLVL0])
#define CLUSTER_PWR_STATE(state) ((state)->pwr_domain_state[MPIDR_AFFLVL1])
diff --git a/plat/imx/imx8qm/imx8qm_bl31_setup.c b/plat/imx/imx8qm/imx8qm_bl31_setup.c
index 7410ac136..a00695cc3 100644
--- a/plat/imx/imx8qm/imx8qm_bl31_setup.c
+++ b/plat/imx/imx8qm/imx8qm_bl31_setup.c
@@ -4,25 +4,28 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <cci.h>
-#include <console.h>
+#include <stdbool.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <debug.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/arm/cci.h>
+#include <drivers/console.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/mmio.h>
+#include <lib/xlat_tables/xlat_tables.h>
+#include <plat/common/platform.h>
+
#include <imx8qm_pads.h>
#include <imx8_iomux.h>
#include <imx8_lpuart.h>
-#include <mmio.h>
-#include <platform.h>
-#include <platform_def.h>
#include <plat_imx8.h>
#include <sci/sci.h>
#include <sec_rsrc.h>
-#include <stdbool.h>
-#include <xlat_tables.h>
IMPORT_SYM(unsigned long, __COHERENT_RAM_START__, BL31_COHERENT_RAM_START);
IMPORT_SYM(unsigned long, __COHERENT_RAM_END__, BL31_COHERENT_RAM_END);
diff --git a/plat/imx/imx8qm/imx8qm_psci.c b/plat/imx/imx8qm/imx8qm_psci.c
index 8166546d4..833048dcf 100644
--- a/plat/imx/imx8qm/imx8qm_psci.c
+++ b/plat/imx/imx8qm/imx8qm_psci.c
@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdbool.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <cci.h>
-#include <debug.h>
-#include <gicv3.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <drivers/arm/cci.h>
+#include <drivers/arm/gicv3.h>
+#include <lib/mmio.h>
+#include <lib/psci/psci.h>
+
#include <plat_imx8.h>
-#include <psci.h>
#include <sci/sci.h>
-#include <stdbool.h>
#define CORE_PWR_STATE(state) \
((state)->pwr_domain_state[MPIDR_AFFLVL0])
diff --git a/plat/imx/imx8qm/include/platform_def.h b/plat/imx/imx8qm/include/platform_def.h
index 1cf7511a8..1d0bdf9a7 100644
--- a/plat/imx/imx8qm/include/platform_def.h
+++ b/plat/imx/imx8qm/include/platform_def.h
@@ -7,7 +7,7 @@
#ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
#define PLATFORM_LINKER_FORMAT "elf64-littleaarch64"
#define PLATFORM_LINKER_ARCH aarch64
diff --git a/plat/imx/imx8qx/imx8qx_bl31_setup.c b/plat/imx/imx8qx/imx8qx_bl31_setup.c
index 6384a8566..c90794a89 100644
--- a/plat/imx/imx8qx/imx8qx_bl31_setup.c
+++ b/plat/imx/imx8qx/imx8qx_bl31_setup.c
@@ -4,25 +4,28 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <cci.h>
-#include <console.h>
+#include <stdbool.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <debug.h>
+#include <drivers/arm/cci.h>
+#include <drivers/console.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/mmio.h>
+#include <lib/xlat_tables/xlat_tables.h>
+#include <plat/common/platform.h>
+
#include <imx8qx_pads.h>
#include <imx8_iomux.h>
#include <imx8_lpuart.h>
-#include <mmio.h>
-#include <platform.h>
-#include <platform_def.h>
#include <plat_imx8.h>
#include <sci/sci.h>
#include <sec_rsrc.h>
-#include <stdbool.h>
-#include <xlat_tables.h>
IMPORT_SYM(unsigned long, __COHERENT_RAM_START__, BL31_COHERENT_RAM_START);
IMPORT_SYM(unsigned long, __COHERENT_RAM_END__, BL31_COHERENT_RAM_END);
diff --git a/plat/imx/imx8qx/imx8qx_psci.c b/plat/imx/imx8qx/imx8qx_psci.c
index 46ea72486..94c2e2b1e 100644
--- a/plat/imx/imx8qx/imx8qx_psci.c
+++ b/plat/imx/imx8qx/imx8qx_psci.c
@@ -4,15 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdbool.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <debug.h>
-#include <gicv3.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <drivers/arm/gicv3.h>
+#include <lib/mmio.h>
+#include <lib/psci/psci.h>
+
#include <plat_imx8.h>
-#include <psci.h>
#include <sci/sci.h>
-#include <stdbool.h>
const static int ap_core_index[PLATFORM_CORE_COUNT] = {
SC_R_A35_0, SC_R_A35_1, SC_R_A35_2, SC_R_A35_3
diff --git a/plat/imx/imx8qx/include/platform_def.h b/plat/imx/imx8qx/include/platform_def.h
index b9fd96c0c..1239340d0 100644
--- a/plat/imx/imx8qx/include/platform_def.h
+++ b/plat/imx/imx8qx/include/platform_def.h
@@ -7,7 +7,7 @@
#ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
#define PLATFORM_LINKER_FORMAT "elf64-littleaarch64"
#define PLATFORM_LINKER_ARCH aarch64