From 4ec1a2399cf6e182ba2828a40795912d20eca1ab Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Sun, 14 Oct 2018 12:02:02 +0100 Subject: [PATCH] allwinner: Export sunxi_private.h So far we have a sunxi_private.h header file in the common code directory. This holds the prototypes of various functions we share in *common* code. However we will need some of those in the platform specific code parts as well, and want to introduce new functions shared across the whole platform port. So move the sunxi_private.h file into the common/include directory, so that it becomes visible to all parts of the platform code. Fix up the existing #includes and add missing ones, also add the sunxi_read_soc_id() prototype here. This will be used in follow up patches. Signed-off-by: Andre Przywara --- .../common/{ => include}/sunxi_private.h | 16 ++++++++-------- plat/allwinner/common/sunxi_bl31_setup.c | 2 +- plat/allwinner/common/sunxi_common.c | 3 +-- plat/allwinner/common/sunxi_cpu_ops.c | 3 +-- plat/allwinner/common/sunxi_pm.c | 5 ++--- plat/allwinner/common/sunxi_security.c | 1 + plat/allwinner/sun50i_a64/sunxi_power.c | 1 + plat/allwinner/sun50i_h6/sunxi_power.c | 1 + 8 files changed, 16 insertions(+), 16 deletions(-) rename plat/allwinner/common/{ => include}/sunxi_private.h (78%) diff --git a/plat/allwinner/common/sunxi_private.h b/plat/allwinner/common/include/sunxi_private.h similarity index 78% rename from plat/allwinner/common/sunxi_private.h rename to plat/allwinner/common/include/sunxi_private.h index d4c60f9fc..9d20f607e 100644 --- a/plat/allwinner/common/sunxi_private.h +++ b/plat/allwinner/common/include/sunxi_private.h @@ -4,19 +4,19 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __SUNXI_PRIVATE_H__ -#define __SUNXI_PRIVATE_H__ +#ifndef SUNXI_PRIVATE_H +#define SUNXI_PRIVATE_H void sunxi_configure_mmu_el3(int flags); -void sunxi_cpu_off(unsigned int cluster, unsigned int core); + void sunxi_cpu_on(unsigned int cluster, unsigned int core); +void sunxi_cpu_off(unsigned int cluster, unsigned int core); void sunxi_disable_secondary_cpus(unsigned int primary_cpu); +void __dead2 sunxi_power_down(void); -uint16_t sunxi_read_soc_id(void); - -void sunxi_pmic_setup(uint16_t socid); +int sunxi_pmic_setup(uint16_t socid); void sunxi_security_setup(void); -void __dead2 sunxi_power_down(void); +uint16_t sunxi_read_soc_id(void); -#endif /* __SUNXI_PRIVATE_H__ */ +#endif /* SUNXI_PRIVATE_H */ diff --git a/plat/allwinner/common/sunxi_bl31_setup.c b/plat/allwinner/common/sunxi_bl31_setup.c index 220f26334..6c47e89fc 100644 --- a/plat/allwinner/common/sunxi_bl31_setup.c +++ b/plat/allwinner/common/sunxi_bl31_setup.c @@ -14,9 +14,9 @@ #include #include #include +#include #include -#include "sunxi_private.h" static entry_point_info_t bl32_image_ep_info; static entry_point_info_t bl33_image_ep_info; diff --git a/plat/allwinner/common/sunxi_common.c b/plat/allwinner/common/sunxi_common.c index 37cbf98ad..ea77afb56 100644 --- a/plat/allwinner/common/sunxi_common.c +++ b/plat/allwinner/common/sunxi_common.c @@ -8,10 +8,9 @@ #include #include #include +#include #include -#include "sunxi_private.h" - static mmap_region_t sunxi_mmap[PLATFORM_MMAP_REGIONS + 1] = { MAP_REGION_FLAT(SUNXI_SRAM_BASE, SUNXI_SRAM_SIZE, MT_MEMORY | MT_RW | MT_SECURE), diff --git a/plat/allwinner/common/sunxi_cpu_ops.c b/plat/allwinner/common/sunxi_cpu_ops.c index aaee65c66..2db26977d 100644 --- a/plat/allwinner/common/sunxi_cpu_ops.c +++ b/plat/allwinner/common/sunxi_cpu_ops.c @@ -9,10 +9,9 @@ #include #include #include +#include #include -#include "sunxi_private.h" - static void sunxi_cpu_disable_power(unsigned int cluster, unsigned int core) { if (mmio_read_32(SUNXI_CPU_POWER_CLAMP_REG(cluster, core)) == 0xff) diff --git a/plat/allwinner/common/sunxi_pm.c b/plat/allwinner/common/sunxi_pm.c index e4bb58229..86336f017 100644 --- a/plat/allwinner/common/sunxi_pm.c +++ b/plat/allwinner/common/sunxi_pm.c @@ -13,15 +13,14 @@ #include #include #include -#include #include +#include +#include #define SUNXI_WDOG0_CTRL_REG (SUNXI_WDOG_BASE + 0x0010) #define SUNXI_WDOG0_CFG_REG (SUNXI_WDOG_BASE + 0x0014) #define SUNXI_WDOG0_MODE_REG (SUNXI_WDOG_BASE + 0x0018) -#include "sunxi_private.h" - #define mpidr_is_valid(mpidr) ( \ MPIDR_AFFLVL3_VAL(mpidr) == 0 && \ MPIDR_AFFLVL2_VAL(mpidr) == 0 && \ diff --git a/plat/allwinner/common/sunxi_security.c b/plat/allwinner/common/sunxi_security.c index 80fed6ad0..905372887 100644 --- a/plat/allwinner/common/sunxi_security.c +++ b/plat/allwinner/common/sunxi_security.c @@ -7,6 +7,7 @@ #include #include #include +#include #ifdef SUNXI_SPC_BASE #define SPC_DECPORT_STA_REG(p) (SUNXI_SPC_BASE + ((p) * 0x0c) + 0x4) diff --git a/plat/allwinner/sun50i_a64/sunxi_power.c b/plat/allwinner/sun50i_a64/sunxi_power.c index 452450d5f..b5625231d 100644 --- a/plat/allwinner/sun50i_a64/sunxi_power.c +++ b/plat/allwinner/sun50i_a64/sunxi_power.c @@ -13,6 +13,7 @@ #include #include #include +#include static enum pmic_type { GENERIC_H5, diff --git a/plat/allwinner/sun50i_h6/sunxi_power.c b/plat/allwinner/sun50i_h6/sunxi_power.c index f1ad72b97..8e2931073 100644 --- a/plat/allwinner/sun50i_h6/sunxi_power.c +++ b/plat/allwinner/sun50i_h6/sunxi_power.c @@ -13,6 +13,7 @@ #include #include #include +#include #define AXP805_ADDR 0x36 #define AXP805_ID 0x03 -- GitLab