aboutsummaryrefslogtreecommitdiff
path: root/plat/hisilicon/hikey
diff options
context:
space:
mode:
Diffstat (limited to 'plat/hisilicon/hikey')
-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
23 files changed, 157 insertions, 125 deletions
diff --git a/plat/hisilicon/hikey/aarch64/hikey_common.c b/plat/hisilicon/hikey/aarch64/hikey_common.c
index 60e4d867f..702fc2d86 100644
--- a/plat/hisilicon/hikey/aarch64/hikey_common.c
+++ b/plat/hisilicon/hikey/aarch64/hikey_common.c
@@ -4,15 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <debug.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <lib/mmio.h>
+#include <lib/xlat_tables/xlat_tables.h>
+#include <plat/common/platform.h>
+
#include <hikey_def.h>
#include <hikey_layout.h>
-#include <mmio.h>
-#include <platform.h>
-#include <xlat_tables.h>
#define MAP_DDR MAP_REGION_FLAT(DDR_BASE, \
DDR_SIZE - DDR_SEC_SIZE, \
diff --git a/plat/hisilicon/hikey/hikey_bl1_setup.c b/plat/hisilicon/hikey/hikey_bl1_setup.c
index 6fcb59732..a08bdfa72 100644
--- a/plat/hisilicon/hikey/hikey_bl1_setup.c
+++ b/plat/hisilicon/hikey/hikey_bl1_setup.c
@@ -4,23 +4,25 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <debug.h>
-#include <dw_mmc.h>
#include <errno.h>
+#include <string.h>
+
+#include <arch_helpers.h>
+#include <bl1/tbbr/tbbr_img_desc.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/arm/pl011.h>
+#include <drivers/mmc.h>
+#include <drivers/synopsys/dw_mmc.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
#include <hi6220.h>
#include <hikey_def.h>
#include <hikey_layout.h>
-#include <mmc.h>
-#include <mmio.h>
-#include <pl011.h>
-#include <platform.h>
-#include <string.h>
-#include <tbbr/tbbr_img_desc.h>
-#include "../../bl1/bl1_private.h"
+#include "../../../bl1/bl1_private.h"
#include "hikey_private.h"
/* Data structure which holds the extents of the trusted RAM for BL1 */
diff --git a/plat/hisilicon/hikey/hikey_bl2_mem_params_desc.c b/plat/hisilicon/hikey/hikey_bl2_mem_params_desc.c
index 23c16ed99..4e013a0f3 100644
--- a/plat/hisilicon/hikey/hikey_bl2_mem_params_desc.c
+++ b/plat/hisilicon/hikey/hikey_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> /* also includes hikey_def.h and hikey_layout.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/hisilicon/hikey/hikey_bl2_setup.c b/plat/hisilicon/hikey/hikey_bl2_setup.c
index 125d6654c..b87237373 100644
--- a/plat/hisilicon/hikey/hikey_bl2_setup.c
+++ b/plat/hisilicon/hikey/hikey_bl2_setup.c
@@ -4,27 +4,29 @@
* 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 <desc_image_load.h>
-#include <dw_mmc.h>
#include <errno.h>
-#include <hi6220.h>
-#include <hisi_mcu.h>
-#include <hisi_sram_map.h>
-#include <mmc.h>
-#include <mmio.h>
+#include <string.h>
+
+#include <platform_def.h> /* also includes hikey_def.h and hikey_layout.h*/
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/desc_image_load.h>
+#include <drivers/arm/pl011.h>
+#include <drivers/delay_timer.h>
+#include <drivers/mmc.h>
+#include <drivers/synopsys/dw_mmc.h>
+#include <lib/mmio.h>
#ifdef SPD_opteed
-#include <optee_utils.h>
+#include <lib/optee_utils.h>
#endif
-#include <pl011.h>
-#include <platform.h>
-#include <platform_def.h> /* also includes hikey_def.h and hikey_layout.h*/
-#include <string.h>
+#include <plat/common/platform.h>
+#include <hi6220.h>
+#include <hisi_mcu.h>
+#include <hisi_sram_map.h>
#include "hikey_private.h"
/*
diff --git a/plat/hisilicon/hikey/hikey_bl31_setup.c b/plat/hisilicon/hikey/hikey_bl31_setup.c
index 0e061e927..b2dcb6196 100644
--- a/plat/hisilicon/hikey/hikey_bl31_setup.c
+++ b/plat/hisilicon/hikey/hikey_bl31_setup.c
@@ -4,21 +4,24 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <cci.h>
-#include <debug.h>
#include <errno.h>
-#include <gicv2.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/interrupt_props.h>
+#include <drivers/arm/cci.h>
+#include <drivers/arm/gicv2.h>
+#include <drivers/arm/pl011.h>
+#include <lib/mmio.h>
+
#include <hi6220.h>
#include <hikey_def.h>
#include <hisi_ipc.h>
#include <hisi_pwrc.h>
-#include <interrupt_props.h>
-#include <mmio.h>
-#include <pl011.h>
-#include <platform_def.h>
#include "hikey_private.h"
diff --git a/plat/hisilicon/hikey/hikey_bl_common.c b/plat/hisilicon/hikey/hikey_bl_common.c
index b254a900d..d062de455 100644
--- a/plat/hisilicon/hikey/hikey_bl_common.c
+++ b/plat/hisilicon/hikey/hikey_bl_common.c
@@ -5,13 +5,13 @@
*/
#include <arch_helpers.h>
-#include <gpio.h>
+#include <drivers/arm/pl061_gpio.h>
+#include <drivers/arm/sp804_delay_timer.h>
+#include <drivers/gpio.h>
+#include <lib/mmio.h>
+
#include <hi6220.h>
#include <hi6553.h>
-#include <mmio.h>
-#include <pl061_gpio.h>
-#include <sp804_delay_timer.h>
-
#include "hikey_private.h"
void hikey_sp804_init(void)
diff --git a/plat/hisilicon/hikey/hikey_ddr.c b/plat/hisilicon/hikey/hikey_ddr.c
index 43cece001..e688c157b 100644
--- a/plat/hisilicon/hikey/hikey_ddr.c
+++ b/plat/hisilicon/hikey/hikey_ddr.c
@@ -4,16 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
#include <errno.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/arm/sp804_delay_timer.h>
+#include <lib/mmio.h>
+
#include <hi6220.h>
#include <hi6553.h>
#include <hisi_sram_map.h>
-#include <mmio.h>
-#include <sp804_delay_timer.h>
-
#include "hikey_private.h"
static void init_pll(void)
diff --git a/plat/hisilicon/hikey/hikey_image_load.c b/plat/hisilicon/hikey/hikey_image_load.c
index 32ca36db0..0ab1ca496 100644
--- a/plat/hisilicon/hikey/hikey_image_load.c
+++ b/plat/hisilicon/hikey/hikey_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>
/*******************************************************************************
* This function flushes the data structures so that they are visible
diff --git a/plat/hisilicon/hikey/hikey_io_storage.c b/plat/hisilicon/hikey/hikey_io_storage.c
index 3efbefe8c..11dd97334 100644
--- a/plat/hisilicon/hikey/hikey_io_storage.c
+++ b/plat/hisilicon/hikey/hikey_io_storage.c
@@ -4,21 +4,24 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
#include <errno.h>
-#include <firmware_image_package.h>
-#include <io_block.h>
-#include <io_driver.h>
-#include <io_fip.h>
-#include <io_memmap.h>
-#include <io_storage.h>
-#include <mmc.h>
-#include <mmio.h>
-#include <platform_def.h>
-#include <semihosting.h> /* For FOPEN_MODE_... */
#include <string.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.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/io/io_storage.h>
+#include <drivers/mmc.h>
+#include <lib/mmio.h>
+#include <lib/semihosting.h>
+#include <tools_share/firmware_image_package.h>
+
#include "hikey_private.h"
#define EMMC_BLOCK_SHIFT 9
diff --git a/plat/hisilicon/hikey/hikey_pm.c b/plat/hisilicon/hikey/hikey_pm.c
index 3128a3d12..05c1e7f22 100644
--- a/plat/hisilicon/hikey/hikey_pm.c
+++ b/plat/hisilicon/hikey/hikey_pm.c
@@ -4,19 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <cci.h>
-#include <debug.h>
-#include <gicv2.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/arm/cci.h>
+#include <drivers/arm/gicv2.h>
+#include <drivers/arm/sp804_delay_timer.h>
+#include <lib/mmio.h>
+#include <lib/psci/psci.h>
+
#include <hi6220.h>
#include <hikey_def.h>
#include <hisi_ipc.h>
#include <hisi_pwrc.h>
#include <hisi_sram_map.h>
-#include <mmio.h>
-#include <psci.h>
-#include <sp804_delay_timer.h>
#define CORE_PWR_STATE(state) \
((state)->pwr_domain_state[MPIDR_AFFLVL0])
diff --git a/plat/hisilicon/hikey/hikey_private.h b/plat/hisilicon/hikey/hikey_private.h
index ca1baa3f5..d82a0794a 100644
--- a/plat/hisilicon/hikey/hikey_private.h
+++ b/plat/hisilicon/hikey/hikey_private.h
@@ -7,7 +7,7 @@
#ifndef HIKEY_PRIVATE_H
#define HIKEY_PRIVATE_H
-#include <bl_common.h>
+#include <common/bl_common.h>
#define RANDOM_MAX 0x7fffffffffffffff
#define RANDOM_MAGIC 0x9a4dbeaf
diff --git a/plat/hisilicon/hikey/hikey_security.c b/plat/hisilicon/hikey/hikey_security.c
index 43d7b7ad7..4b9593941 100644
--- a/plat/hisilicon/hikey/hikey_security.c
+++ b/plat/hisilicon/hikey/hikey_security.c
@@ -5,11 +5,14 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <platform_def.h>
#include <stdint.h>
#include <string.h>
-#include <utils_def.h>
+
+#include <platform_def.h>
+
+#include <common/debug.h>
+#include <lib/utils_def.h>
+
#include "hikey_private.h"
#define PORTNUM_MAX 5
diff --git a/plat/hisilicon/hikey/hikey_tbbr.c b/plat/hisilicon/hikey/hikey_tbbr.c
index 20eda3619..1f05d18ea 100644
--- a/plat/hisilicon/hikey/hikey_tbbr.c
+++ b/plat/hisilicon/hikey/hikey_tbbr.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <platform.h>
+#include <plat/common/platform.h>
extern char hikey_rotpk_hash[], hikey_rotpk_hash_end[];
diff --git a/plat/hisilicon/hikey/hikey_topology.c b/plat/hisilicon/hikey/hikey_topology.c
index 95948b8d2..7890eb7ed 100644
--- a/plat/hisilicon/hikey/hikey_topology.c
+++ b/plat/hisilicon/hikey/hikey_topology.c
@@ -3,9 +3,11 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
+
#include <platform_def.h>
-#include <psci.h>
+
+#include <arch.h>
+#include <lib/psci/psci.h>
/*
* The HiKey power domain tree descriptor. The cluster power domains
diff --git a/plat/hisilicon/hikey/hisi_dvfs.c b/plat/hisilicon/hikey/hisi_dvfs.c
index 0d4f893b9..22a67fdca 100644
--- a/plat/hisilicon/hikey/hisi_dvfs.c
+++ b/plat/hisilicon/hikey/hisi_dvfs.c
@@ -4,18 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <console.h>
-#include <debug.h>
+#include <string.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
#include <hi6220.h>
#include <hi6553.h>
#include <hisi_sram_map.h>
-#include <mmio.h>
-#include <platform.h>
-#include <platform_def.h>
-#include <string.h>
#define ACPU_FREQ_MAX_NUM 5
#define ACPU_OPP_NUM 7
diff --git a/plat/hisilicon/hikey/hisi_ipc.c b/plat/hisilicon/hikey/hisi_ipc.c
index 7e02f3ae1..43ee0b2ab 100644
--- a/plat/hisilicon/hikey/hisi_ipc.c
+++ b/plat/hisilicon/hikey/hisi_ipc.c
@@ -4,16 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <debug.h>
-#include <hisi_ipc.h>
-#include <hisi_sram_map.h>
-#include <mmio.h>
-#include <platform_def.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/mmio.h>
+
+#include <hisi_ipc.h>
+#include <hisi_sram_map.h>
+
static int ipc_init;
static unsigned int cpu_ipc_num[PLATFORM_CLUSTER_COUNT][PLATFORM_CORE_COUNT_PER_CLUSTER] = {
diff --git a/plat/hisilicon/hikey/hisi_mcu.c b/plat/hisilicon/hikey/hisi_mcu.c
index 359b94d7b..ac83bd854 100644
--- a/plat/hisilicon/hikey/hisi_mcu.c
+++ b/plat/hisilicon/hikey/hisi_mcu.c
@@ -4,17 +4,20 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <console.h>
-#include <debug.h>
-#include <hi6220.h>
-#include <mmio.h>
-#include <platform.h>
-#include <platform_def.h>
#include <string.h>
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
+#include <hi6220.h>
+
#define MCU_SECTION_MAX 30
enum MCU_IMAGE_SEC_TYPE_ENUM {
diff --git a/plat/hisilicon/hikey/hisi_pwrc.c b/plat/hisilicon/hikey/hisi_pwrc.c
index b635fb16f..e2e3db752 100644
--- a/plat/hisilicon/hikey/hisi_pwrc.c
+++ b/plat/hisilicon/hikey/hisi_pwrc.c
@@ -4,8 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <mmio.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <platform_def.h>
+
+#include <common/debug.h>
+#include <lib/mmio.h>
#include <hi6220_regs_acpu.h>
#include <hi6220_regs_ao.h>
@@ -13,11 +19,6 @@
#include <hisi_pwrc.h>
#include <hisi_sram_map.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-#include <platform_def.h>
-
#define CLUSTER_CORE_COUNT (4)
#define CLUSTER_CORE_MASK ((1 << CLUSTER_CORE_COUNT) - 1)
diff --git a/plat/hisilicon/hikey/hisi_sip_svc.c b/plat/hisilicon/hikey/hisi_sip_svc.c
index ffa490376..3cd1bd092 100644
--- a/plat/hisilicon/hikey/hisi_sip_svc.c
+++ b/plat/hisilicon/hikey/hisi_sip_svc.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <hisi_sip_svc.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 <hisi_sip_svc.h>
/* Hisi SiP Service UUID */
DEFINE_SVC_UUID2(hisi_sip_svc_uid,
diff --git a/plat/hisilicon/hikey/include/hi6553.h b/plat/hisilicon/hikey/include/hi6553.h
index 55ce91caf..fc991f842 100644
--- a/plat/hisilicon/hikey/include/hi6553.h
+++ b/plat/hisilicon/hikey/include/hi6553.h
@@ -7,8 +7,9 @@
#ifndef HI6553_H
#define HI6553_H
+#include <lib/mmio.h>
+
#include <hi6220.h>
-#include <mmio.h>
#define HI6553_DISABLE6_XO_CLK (PMUSSI_BASE + (0x036 << 2))
diff --git a/plat/hisilicon/hikey/include/plat_macros.S b/plat/hisilicon/hikey/include/plat_macros.S
index de38bd50b..9cd276a3e 100644
--- a/plat/hisilicon/hikey/include/plat_macros.S
+++ b/plat/hisilicon/hikey/include/plat_macros.S
@@ -7,8 +7,8 @@
#ifndef PLAT_MACROS_S
#define PLAT_MACROS_S
-#include <cci.h>
-#include <gicv2.h>
+#include <drivers/arm/cci.h>
+#include <drivers/arm/gicv2.h>
#include <hi6220.h>
#include <platform_def.h>
diff --git a/plat/hisilicon/hikey/include/platform_def.h b/plat/hisilicon/hikey/include/platform_def.h
index 485eb3800..2537ac66b 100644
--- a/plat/hisilicon/hikey/include/platform_def.h
+++ b/plat/hisilicon/hikey/include/platform_def.h
@@ -8,11 +8,12 @@
#define PLATFORM_DEF_H
#include <arch.h>
-#include <common_def.h>
+#include <common/tbbr/tbbr_img_def.h>
+#include <lib/utils_def.h>
+#include <plat/common/common_def.h>
+
#include <hikey_def.h>
#include <hikey_layout.h> /* BL memory region sizes, etc */
-#include <tbbr_img_def.h>
-#include <utils_def.h>
/* Special value used to verify platform parameters from BL2 to BL3-1 */
#define HIKEY_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL
diff --git a/plat/hisilicon/hikey/platform.mk b/plat/hisilicon/hikey/platform.mk
index 398b224cf..6d077f746 100644
--- a/plat/hisilicon/hikey/platform.mk
+++ b/plat/hisilicon/hikey/platform.mk
@@ -46,7 +46,6 @@ endif
USE_COHERENT_MEM := 1
PLAT_INCLUDES := -Iinclude/common/tbbr \
- -Iinclude/drivers/synopsys \
-Iplat/hisilicon/hikey/include
PLAT_BL_COMMON_SOURCES := drivers/arm/pl011/aarch64/pl011_console.S \