Commit 4ec1a239 authored by Andre Przywara's avatar Andre Przywara
Browse files

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: default avatarAndre Przywara <andre.przywara@arm.com>
parent f953c30f
...@@ -4,19 +4,19 @@ ...@@ -4,19 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#ifndef __SUNXI_PRIVATE_H__ #ifndef SUNXI_PRIVATE_H
#define __SUNXI_PRIVATE_H__ #define SUNXI_PRIVATE_H
void sunxi_configure_mmu_el3(int flags); 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_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 sunxi_disable_secondary_cpus(unsigned int primary_cpu);
void __dead2 sunxi_power_down(void);
uint16_t sunxi_read_soc_id(void); int sunxi_pmic_setup(uint16_t socid);
void sunxi_pmic_setup(uint16_t socid);
void sunxi_security_setup(void); 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 */
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
#include <platform_def.h> #include <platform_def.h>
#include <sunxi_def.h> #include <sunxi_def.h>
#include <sunxi_mmap.h> #include <sunxi_mmap.h>
#include <sunxi_private.h>
#include <uart_16550.h> #include <uart_16550.h>
#include "sunxi_private.h"
static entry_point_info_t bl32_image_ep_info; static entry_point_info_t bl32_image_ep_info;
static entry_point_info_t bl33_image_ep_info; static entry_point_info_t bl33_image_ep_info;
......
...@@ -8,10 +8,9 @@ ...@@ -8,10 +8,9 @@
#include <platform.h> #include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <sunxi_def.h> #include <sunxi_def.h>
#include <sunxi_private.h>
#include <xlat_tables_v2.h> #include <xlat_tables_v2.h>
#include "sunxi_private.h"
static mmap_region_t sunxi_mmap[PLATFORM_MMAP_REGIONS + 1] = { static mmap_region_t sunxi_mmap[PLATFORM_MMAP_REGIONS + 1] = {
MAP_REGION_FLAT(SUNXI_SRAM_BASE, SUNXI_SRAM_SIZE, MAP_REGION_FLAT(SUNXI_SRAM_BASE, SUNXI_SRAM_SIZE,
MT_MEMORY | MT_RW | MT_SECURE), MT_MEMORY | MT_RW | MT_SECURE),
......
...@@ -9,10 +9,9 @@ ...@@ -9,10 +9,9 @@
#include <platform_def.h> #include <platform_def.h>
#include <sunxi_mmap.h> #include <sunxi_mmap.h>
#include <sunxi_cpucfg.h> #include <sunxi_cpucfg.h>
#include <sunxi_private.h>
#include <utils_def.h> #include <utils_def.h>
#include "sunxi_private.h"
static void sunxi_cpu_disable_power(unsigned int cluster, unsigned int core) static void sunxi_cpu_disable_power(unsigned int cluster, unsigned int core)
{ {
if (mmio_read_32(SUNXI_CPU_POWER_CLAMP_REG(cluster, core)) == 0xff) if (mmio_read_32(SUNXI_CPU_POWER_CLAMP_REG(cluster, core)) == 0xff)
......
...@@ -13,15 +13,14 @@ ...@@ -13,15 +13,14 @@
#include <platform.h> #include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <psci.h> #include <psci.h>
#include <sunxi_mmap.h>
#include <sunxi_cpucfg.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_CTRL_REG (SUNXI_WDOG_BASE + 0x0010)
#define SUNXI_WDOG0_CFG_REG (SUNXI_WDOG_BASE + 0x0014) #define SUNXI_WDOG0_CFG_REG (SUNXI_WDOG_BASE + 0x0014)
#define SUNXI_WDOG0_MODE_REG (SUNXI_WDOG_BASE + 0x0018) #define SUNXI_WDOG0_MODE_REG (SUNXI_WDOG_BASE + 0x0018)
#include "sunxi_private.h"
#define mpidr_is_valid(mpidr) ( \ #define mpidr_is_valid(mpidr) ( \
MPIDR_AFFLVL3_VAL(mpidr) == 0 && \ MPIDR_AFFLVL3_VAL(mpidr) == 0 && \
MPIDR_AFFLVL2_VAL(mpidr) == 0 && \ MPIDR_AFFLVL2_VAL(mpidr) == 0 && \
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <debug.h> #include <debug.h>
#include <mmio.h> #include <mmio.h>
#include <sunxi_mmap.h> #include <sunxi_mmap.h>
#include <sunxi_private.h>
#ifdef SUNXI_SPC_BASE #ifdef SUNXI_SPC_BASE
#define SPC_DECPORT_STA_REG(p) (SUNXI_SPC_BASE + ((p) * 0x0c) + 0x4) #define SPC_DECPORT_STA_REG(p) (SUNXI_SPC_BASE + ((p) * 0x0c) + 0x4)
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <platform_def.h> #include <platform_def.h>
#include <sunxi_def.h> #include <sunxi_def.h>
#include <sunxi_mmap.h> #include <sunxi_mmap.h>
#include <sunxi_private.h>
static enum pmic_type { static enum pmic_type {
GENERIC_H5, GENERIC_H5,
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <mentor/mi2cv.h> #include <mentor/mi2cv.h>
#include <string.h> #include <string.h>
#include <sunxi_mmap.h> #include <sunxi_mmap.h>
#include <sunxi_private.h>
#define AXP805_ADDR 0x36 #define AXP805_ADDR 0x36
#define AXP805_ID 0x03 #define AXP805_ID 0x03
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment