Browse Source

allwinner: call PMIC setup code

As the ATF may need to do some power initialization on Allwinner
platform with AXP PMICs, call the PMIC setup code in BL31.

Stub of PMIC setup code is added, to prevent undefined reference.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
pull/1534/head
Icenowy Zheng 6 years ago
parent
commit
7c26b6ecea
  1. 2
      plat/allwinner/common/sunxi_bl31_setup.c
  2. 2
      plat/allwinner/common/sunxi_private.h
  3. 1
      plat/allwinner/sun50i_a64/platform.mk
  4. 16
      plat/allwinner/sun50i_a64/sunxi_power.c
  5. 1
      plat/allwinner/sun50i_h6/platform.mk
  6. 16
      plat/allwinner/sun50i_h6/sunxi_power.c

2
plat/allwinner/common/sunxi_bl31_setup.c

@ -93,6 +93,8 @@ void bl31_platform_setup(void)
sunxi_security_setup();
sunxi_pmic_setup();
INFO("BL31: Platform setup done\n");
}

2
plat/allwinner/common/sunxi_private.h

@ -13,6 +13,8 @@ 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(void);
void sunxi_security_setup(void);
#endif /* __SUNXI_PRIVATE_H__ */

1
plat/allwinner/sun50i_a64/platform.mk

@ -30,6 +30,7 @@ BL31_SOURCES += drivers/arm/gic/common/gic_common.c \
${AW_PLAT}/common/sunxi_bl31_setup.c \
${AW_PLAT}/common/sunxi_cpu_ops.c \
${AW_PLAT}/common/sunxi_pm.c \
${AW_PLAT}/sun50i_a64/sunxi_power.c \
${AW_PLAT}/common/sunxi_security.c \
${AW_PLAT}/common/sunxi_topology.c

16
plat/allwinner/sun50i_a64/sunxi_power.c

@ -0,0 +1,16 @@
/*
* Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2018, Icenowy Zheng <icenowy@aosc.io>
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <debug.h>
int sunxi_pmic_setup(void)
{
/* STUB */
NOTICE("BL31: STUB PMIC setup code called\n");
return 0;
}

1
plat/allwinner/sun50i_h6/platform.mk

@ -30,6 +30,7 @@ BL31_SOURCES += drivers/arm/gic/common/gic_common.c \
${AW_PLAT}/common/sunxi_bl31_setup.c \
${AW_PLAT}/common/sunxi_cpu_ops.c \
${AW_PLAT}/common/sunxi_pm.c \
${AW_PLAT}/sun50i_h6/sunxi_power.c \
${AW_PLAT}/common/sunxi_security.c \
${AW_PLAT}/common/sunxi_topology.c

16
plat/allwinner/sun50i_h6/sunxi_power.c

@ -0,0 +1,16 @@
/*
* Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2018, Icenowy Zheng <icenowy@aosc.io>
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <debug.h>
int sunxi_pmic_setup(void)
{
/* STUB */
NOTICE("BL31: STUB PMIC setup code called\n");
return 0;
}
Loading…
Cancel
Save