Browse Source

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 <andre.przywara@arm.com>
pull/1646/head
Andre Przywara 6 years ago
parent
commit
4ec1a2399c
  1. 16
      plat/allwinner/common/include/sunxi_private.h
  2. 2
      plat/allwinner/common/sunxi_bl31_setup.c
  3. 3
      plat/allwinner/common/sunxi_common.c
  4. 3
      plat/allwinner/common/sunxi_cpu_ops.c
  5. 5
      plat/allwinner/common/sunxi_pm.c
  6. 1
      plat/allwinner/common/sunxi_security.c
  7. 1
      plat/allwinner/sun50i_a64/sunxi_power.c
  8. 1
      plat/allwinner/sun50i_h6/sunxi_power.c

16
plat/allwinner/common/sunxi_private.h → 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 */

2
plat/allwinner/common/sunxi_bl31_setup.c

@ -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;

3
plat/allwinner/common/sunxi_common.c

@ -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),

3
plat/allwinner/common/sunxi_cpu_ops.c

@ -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)

5
plat/allwinner/common/sunxi_pm.c

@ -13,15 +13,14 @@
#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 && \

1
plat/allwinner/common/sunxi_security.c

@ -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)

1
plat/allwinner/sun50i_a64/sunxi_power.c

@ -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,

1
plat/allwinner/sun50i_h6/sunxi_power.c

@ -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

Loading…
Cancel
Save