You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/02/10 14:57:41 UTC
[incubator-nuttx] 03/05: xarch/sim: Call pm_initialize from
up_initialize directly
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 7fd3a3bccacfbbca85e4e1ba3b8ae586a086504f
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Feb 10 12:57:25 2020 +0800
xarch/sim: Call pm_initialize from up_initialize directly
We don't need the additional flexibility since sim just has one chip.
---
arch/sim/Kconfig | 2 +-
arch/sim/src/Makefile | 4 --
arch/sim/src/sim/up_initialize.c | 2 +-
arch/sim/src/sim/up_internal.h | 6 ---
arch/sim/src/sim/up_pminitialize.c | 77 --------------------------------------
5 files changed, 2 insertions(+), 89 deletions(-)
diff --git a/arch/sim/Kconfig b/arch/sim/Kconfig
index 7ceeb90..62c977a 100644
--- a/arch/sim/Kconfig
+++ b/arch/sim/Kconfig
@@ -26,7 +26,7 @@ endchoice # Host CPU Type
config ARCH_CHIP
string
- default "sim" if ARCH_SIM
+ default "sim"
config SIM_M32
bool "Build 32-bit simulation on 64-bit machine"
diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile
index 8cc91ff..2841b35 100644
--- a/arch/sim/src/Makefile
+++ b/arch/sim/src/Makefile
@@ -113,10 +113,6 @@ ifeq ($(CONFIG_ONESHOT),y)
CSRCS += up_oneshot.c
endif
-ifeq ($(CONFIG_PM),y)
- CSRCS += up_pminitialize.c
-endif
-
ifeq ($(CONFIG_SCHED_CRITMONITOR),y)
HOSTSRCS += up_critmon.c
endif
diff --git a/arch/sim/src/sim/up_initialize.c b/arch/sim/src/sim/up_initialize.c
index 6a52c2a..681bedc 100644
--- a/arch/sim/src/sim/up_initialize.c
+++ b/arch/sim/src/sim/up_initialize.c
@@ -189,7 +189,7 @@ void up_initialize(void)
* with the power management subsystem).
*/
- up_pminitialize();
+ pm_initialize();
#endif
#ifdef CONFIG_MM_IOB
diff --git a/arch/sim/src/sim/up_internal.h b/arch/sim/src/sim/up_internal.h
index 6f90e2d..67b906a 100644
--- a/arch/sim/src/sim/up_internal.h
+++ b/arch/sim/src/sim/up_internal.h
@@ -303,12 +303,6 @@ int up_x11cmap(unsigned short first, unsigned short len,
int sim_tsc_initialize(int minor);
void sim_tsc_uninitialize(void);
-/* up_pminitialize.c ********************************************************/
-
-#ifdef CONFIG_PM
-void up_pminitialize(void);
-#endif
-
/* up_eventloop.c ***********************************************************/
#if defined(CONFIG_SIM_X11FB) && \
diff --git a/arch/sim/src/sim/up_pminitialize.c b/arch/sim/src/sim/up_pminitialize.c
deleted file mode 100644
index 4b44d81..0000000
--- a/arch/sim/src/sim/up_pminitialize.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
- * arch/arm/src/stm32l4/stm32l4_pminitialize.c
- *
- * Copyright (C) 2019 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@nuttx.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <nuttx/power/pm.h>
-
-#include "up_internal.h"
-
-#ifdef CONFIG_PM
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: up_pminitialize
- *
- * Description:
- * This function is called by MCU-specific logic at power-on reset in
- * order to provide one-time initialization the power management subsystem.
- * This 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).
- *
- * Input Parameters:
- * None.
- *
- * Returned Value:
- * None.
- *
- ****************************************************************************/
-
-void up_pminitialize(void)
-{
- /* Then initialize the NuttX power management subsystem proper */
-
- pm_initialize();
-}
-
-#endif /* CONFIG_PM */