allwinner: call PMIC setup code
authorIcenowy Zheng <icenowy@aosc.io>
Sat, 21 Jul 2018 12:41:12 +0000 (20:41 +0800)
committerIcenowy Zheng <icenowy@aosc.io>
Fri, 7 Sep 2018 14:09:45 +0000 (22:09 +0800)
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>
plat/allwinner/common/sunxi_bl31_setup.c
plat/allwinner/common/sunxi_private.h
plat/allwinner/sun50i_a64/platform.mk
plat/allwinner/sun50i_a64/sunxi_power.c [new file with mode: 0644]
plat/allwinner/sun50i_h6/platform.mk
plat/allwinner/sun50i_h6/sunxi_power.c [new file with mode: 0644]

index 8ecf49083b6ab1b879b8d952d4f20ab658db5c63..7e11cecf5283f2cacf01fc25c5d8eb5f32149c0d 100644 (file)
@@ -93,6 +93,8 @@ void bl31_platform_setup(void)
 
        sunxi_security_setup();
 
+       sunxi_pmic_setup();
+
        INFO("BL31: Platform setup done\n");
 }
 
index e45f494ed289be00b5f22a0fbae05e23b5c0da15..49a5c50da8f69acd494a57a452aa1c3922f6d8bf 100644 (file)
@@ -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__ */
index 236464fe8cf9615ff8abf36f878129dacde6b528..e2868afd2fca2aad45c087566e6199221b3c9deb 100644 (file)
@@ -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 (file)
index 0000000..50eaa6b
--- /dev/null
@@ -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;
+}
index c1b26fae613349b0190ab353af69831ba8fed9ec..e9ee23d03c79865197ab7f4a14ac3756c8fb2135 100644 (file)
@@ -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 (file)
index 0000000..50eaa6b
--- /dev/null
@@ -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;
+}