You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2020/04/15 13:07:40 UTC

[incubator-nuttx] branch master updated: risc-v: add pm initialization functions.

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 648a76b  risc-v: add pm initialization functions.
648a76b is described below

commit 648a76b3c117e867d35ba292765652cf340f6c94
Author: zhongan <zh...@xiaomi.com>
AuthorDate: Wed Apr 15 18:13:30 2020 +0800

    risc-v: add pm initialization functions.
    
    Signed-off-by: zhongan <zh...@xiaomi.com>
---
 arch/risc-v/src/common/up_initialize.c | 10 ++++++++++
 arch/risc-v/src/common/up_internal.h   |  8 ++++++++
 2 files changed, 18 insertions(+)

diff --git a/arch/risc-v/src/common/up_initialize.c b/arch/risc-v/src/common/up_initialize.c
index c6c0066..2aed49b 100644
--- a/arch/risc-v/src/common/up_initialize.c
+++ b/arch/risc-v/src/common/up_initialize.c
@@ -124,6 +124,16 @@ void up_initialize(void)
   idle->adj_stack_ptr   = (FAR void *)g_idle_topstack;
   idle->adj_stack_size  = CONFIG_IDLETHREAD_STACKSIZE;
 
+#ifdef CONFIG_PM
+  /* Initialize the power management subsystem.  This MCU-specific function
+   * must be called *very* early in the initialization sequence *before* any
+   * other device drivers are initialized (since they may attempt to register
+   * with the power management subsystem).
+   */
+
+  up_pminitialize();
+#endif
+
   /* Register devices */
 
 #if defined(CONFIG_DEV_NULL)
diff --git a/arch/risc-v/src/common/up_internal.h b/arch/risc-v/src/common/up_internal.h
index 4a19946..29dc0c0 100644
--- a/arch/risc-v/src/common/up_internal.h
+++ b/arch/risc-v/src/common/up_internal.h
@@ -201,6 +201,14 @@ void up_restorefpu(const uint32_t *regs);
 #  define up_restorefpu(regs)
 #endif
 
+/* Power management *********************************************************/
+
+#ifdef CONFIG_PM
+void up_pminitialize(void);
+#else
+#  define up_pminitialize()
+#endif
+
 /* Low level serial output **************************************************/
 
 void up_lowputc(char ch);