From: Icenowy Zheng Date: Sat, 21 Jul 2018 12:41:12 +0000 (+0800) Subject: allwinner: call PMIC setup code X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7c26b6ecea26be4811d040b8c3052b6f5ef1bfb4;p=project%2Fbcm63xx%2Fatf.git 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 --- diff --git a/plat/allwinner/common/sunxi_bl31_setup.c b/plat/allwinner/common/sunxi_bl31_setup.c index 8ecf4908..7e11cecf 100644 --- a/plat/allwinner/common/sunxi_bl31_setup.c +++ b/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"); } diff --git a/plat/allwinner/common/sunxi_private.h b/plat/allwinner/common/sunxi_private.h index e45f494e..49a5c50d 100644 --- a/plat/allwinner/common/sunxi_private.h +++ b/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__ */ diff --git a/plat/allwinner/sun50i_a64/platform.mk b/plat/allwinner/sun50i_a64/platform.mk index 236464fe..e2868afd 100644 --- a/plat/allwinner/sun50i_a64/platform.mk +++ b/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 diff --git a/plat/allwinner/sun50i_a64/sunxi_power.c b/plat/allwinner/sun50i_a64/sunxi_power.c new file mode 100644 index 00000000..50eaa6b9 --- /dev/null +++ b/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 + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include + +int sunxi_pmic_setup(void) +{ + /* STUB */ + NOTICE("BL31: STUB PMIC setup code called\n"); + + return 0; +} diff --git a/plat/allwinner/sun50i_h6/platform.mk b/plat/allwinner/sun50i_h6/platform.mk index c1b26fae..e9ee23d0 100644 --- a/plat/allwinner/sun50i_h6/platform.mk +++ b/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 diff --git a/plat/allwinner/sun50i_h6/sunxi_power.c b/plat/allwinner/sun50i_h6/sunxi_power.c new file mode 100644 index 00000000..50eaa6b9 --- /dev/null +++ b/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 + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include + +int sunxi_pmic_setup(void) +{ + /* STUB */ + NOTICE("BL31: STUB PMIC setup code called\n"); + + return 0; +}