allwinner: Export sunxi_private.h
authorAndre Przywara <andre.przywara@arm.com>
Sun, 14 Oct 2018 11:02:02 +0000 (12:02 +0100)
committerAndre Przywara <andre.przywara@arm.com>
Sat, 20 Oct 2018 15:23:59 +0000 (16:23 +0100)
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 <andre.przywara@arm.com>
plat/allwinner/common/include/sunxi_private.h [new file with mode: 0644]
plat/allwinner/common/sunxi_bl31_setup.c
plat/allwinner/common/sunxi_common.c
plat/allwinner/common/sunxi_cpu_ops.c
plat/allwinner/common/sunxi_pm.c
plat/allwinner/common/sunxi_private.h [deleted file]
plat/allwinner/common/sunxi_security.c
plat/allwinner/sun50i_a64/sunxi_power.c
plat/allwinner/sun50i_h6/sunxi_power.c

diff --git a/plat/allwinner/common/include/sunxi_private.h b/plat/allwinner/common/include/sunxi_private.h
new file mode 100644 (file)
index 0000000..9d20f60
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef SUNXI_PRIVATE_H
+#define SUNXI_PRIVATE_H
+
+void sunxi_configure_mmu_el3(int flags);
+
+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);
+
+int sunxi_pmic_setup(uint16_t socid);
+void sunxi_security_setup(void);
+
+uint16_t sunxi_read_soc_id(void);
+
+#endif /* SUNXI_PRIVATE_H */
index 220f263345bf10d50bf541dcf611ac5722fad65d..6c47e89fc9a2f08d0ffa57d42c7e3212f4ff8667 100644 (file)
@@ -14,9 +14,9 @@
 #include <platform_def.h>
 #include <sunxi_def.h>
 #include <sunxi_mmap.h>
+#include <sunxi_private.h>
 #include <uart_16550.h>
 
-#include "sunxi_private.h"
 
 static entry_point_info_t bl32_image_ep_info;
 static entry_point_info_t bl33_image_ep_info;
index 37cbf98adaaf1fb6523b02bc08644aa1c002789d..ea77afb564e63a6dea79fd3fd340902ede4ffa6c 100644 (file)
@@ -8,10 +8,9 @@
 #include <platform.h>
 #include <platform_def.h>
 #include <sunxi_def.h>
+#include <sunxi_private.h>
 #include <xlat_tables_v2.h>
 
-#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),
index aaee65c665cda038a864fa5b9c4a880a5f482d44..2db26977d29f745f158cec0002b49b880bc0a838 100644 (file)
@@ -9,10 +9,9 @@
 #include <platform_def.h>
 #include <sunxi_mmap.h>
 #include <sunxi_cpucfg.h>
+#include <sunxi_private.h>
 #include <utils_def.h>
 
-#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)
index e4bb58229fd50aa640c4c4c2948767c36b79b884..86336f017d80a9392fe83f327be3ecb8de90974b 100644 (file)
 #include <platform.h>
 #include <platform_def.h>
 #include <psci.h>
-#include <sunxi_mmap.h>
 #include <sunxi_cpucfg.h>
+#include <sunxi_mmap.h>
+#include <sunxi_private.h>
 
 #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_private.h b/plat/allwinner/common/sunxi_private.h
deleted file mode 100644 (file)
index d4c60f9..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#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_disable_secondary_cpus(unsigned int primary_cpu);
-
-uint16_t sunxi_read_soc_id(void);
-
-void sunxi_pmic_setup(uint16_t socid);
-void sunxi_security_setup(void);
-
-void __dead2 sunxi_power_down(void);
-
-#endif /* __SUNXI_PRIVATE_H__ */
index 80fed6ad0de77427b0290f8405329df7d0fb3510..9053728872f18fc6f6baf86bbc2f14173ec71c14 100644 (file)
@@ -7,6 +7,7 @@
 #include <debug.h>
 #include <mmio.h>
 #include <sunxi_mmap.h>
+#include <sunxi_private.h>
 
 #ifdef SUNXI_SPC_BASE
 #define SPC_DECPORT_STA_REG(p) (SUNXI_SPC_BASE + ((p) * 0x0c) + 0x4)
index 452450d5fabb41f609a39075d27ebdc699499748..b5625231d0b575eebd6617b4c6298bf3bfc1fee4 100644 (file)
@@ -13,6 +13,7 @@
 #include <platform_def.h>
 #include <sunxi_def.h>
 #include <sunxi_mmap.h>
+#include <sunxi_private.h>
 
 static enum pmic_type {
        GENERIC_H5,
index f1ad72b971fe3430b307cff21df8f8df3a0aa8af..8e29310739a9ab828568e2781d640d6fc3f1e0bd 100644 (file)
@@ -13,6 +13,7 @@
 #include <mentor/mi2cv.h>
 #include <string.h>
 #include <sunxi_mmap.h>
+#include <sunxi_private.h>
 
 #define AXP805_ADDR    0x36
 #define AXP805_ID      0x03