Refresh/fix more broken board configurations

This commit is contained in:
Gregory Nutt
2015-07-02 16:24:32 -06:00
parent fe8e4ac747
commit 56e8457d4d
12 changed files with 524 additions and 436 deletions
-6
View File
@@ -1,6 +0,0 @@
/************************************************************************
* configs/nsh_highram/power.h
*
* Supposed to be empty
*
************************************************************************/
+25 -16
View File
@@ -1,8 +1,8 @@
############################################################################
# configs/compal_e86/src/Makefile
#
# Copyright (C) 2007, 2008, 2013 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
# Copyright (C) 2007, 2008, 2013, 2015 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Copyright (C) 2011 Stefan Richter. All rights reserved.
# Author: Stefan Richter <ichgeh@l--putt.de>
@@ -38,18 +38,26 @@
-include $(TOPDIR)/Make.defs
CFLAGS += -I$(TOPDIR)/sched
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = dummy.c ssd1783.c
COBJS = $(CSRCS:.c=$(OBJEXT))
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = dummy.c
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/arm
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
CFLAGS += -I$(ARCH_SRCDIR)\chip -I$(ARCH_SRCDIR)\common -I$(ARCH_SRCDIR)\arm
else
ifeq ($(WINTOOL),y)
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
-I "${shell cygpath -w $(ARCH_SRCDIR)/arm}"
else
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/arm
endif
endif
all: libboard$(LIBEXT)
@@ -63,16 +71,17 @@ libboard$(LIBEXT): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
$(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@
depend: .depend
clean:
@rm -f libboard$(LIBEXT) *~ .*.swp
$(call DELFILE, libboard$(LIBEXT))
$(call CLEAN)
distclean: clean
@rm -f Make.dep .depend
$(call DELFILE, Make.dep)
$(call DELFILE, .depend)
-include Make.dep
-6
View File
@@ -1,6 +0,0 @@
/************************************************************************
* arch/power.h
*
* Supposed to be empty
*
************************************************************************/
File diff suppressed because it is too large Load Diff
+19 -11
View File
@@ -1,7 +1,7 @@
############################################################################
# configs/compal_e88/src/Makefile
#
# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
# Copyright (C) 2007, 2008, 2015 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Copyright (C) 2011 Stefan Richter. All rights reserved.
@@ -38,18 +38,26 @@
-include $(TOPDIR)/Make.defs
CFLAGS += -I$(TOPDIR)/sched
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = dummy.c
COBJS = $(CSRCS:.c=$(OBJEXT))
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = dummy.c
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/arm
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
CFLAGS += -I$(ARCH_SRCDIR)\chip -I$(ARCH_SRCDIR)\common -I$(ARCH_SRCDIR)\arm
else
ifeq ($(WINTOOL),y)
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
-I "${shell cygpath -w $(ARCH_SRCDIR)/arm}"
else
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/arm
endif
endif
all: libboard$(LIBEXT)
-6
View File
@@ -1,6 +0,0 @@
/************************************************************************
* arch/power.h
*
* Supposed to be empty
*
************************************************************************/
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -186,8 +186,8 @@ CONFIG_ARCH_INTERRUPTSTACK=1024
# Boot options
#
# CONFIG_BOOT_RUNFROMEXTSRAM is not set
CONFIG_BOOT_RUNFROMFLASH=y
# CONFIG_BOOT_RUNFROMISRAM is not set
# CONFIG_BOOT_RUNFROMFLASH is not set
CONFIG_BOOT_RUNFROMISRAM=y
# CONFIG_BOOT_RUNFROMSDRAM is not set
# CONFIG_BOOT_COPYTORAM is not set
+19 -11
View File
@@ -1,7 +1,7 @@
############################################################################
# configs/compal_e99/src/Makefile
#
# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
# Copyright (C) 2007, 2008, 2015 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Copyright (C) 2011 Stefan Richter. All rights reserved.
@@ -38,18 +38,26 @@
-include $(TOPDIR)/Make.defs
CFLAGS += -I$(TOPDIR)/sched
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = dummy.c ssd1783.c
COBJS = $(CSRCS:.c=$(OBJEXT))
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = dummy.c ssd1783.c
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/arm
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
CFLAGS += -I$(ARCH_SRCDIR)\chip -I$(ARCH_SRCDIR)\common -I$(ARCH_SRCDIR)\arm
else
ifeq ($(WINTOOL),y)
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
-I "${shell cygpath -w $(ARCH_SRCDIR)/arm}"
else
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/arm
endif
endif
all: libboard$(LIBEXT)
-6
View File
@@ -1,6 +0,0 @@
/************************************************************************
* configs/pirelli_dpl10/include/power.h
*
* Supposed to be empty
*
************************************************************************/
+5 -13
View File
@@ -1,6 +1,5 @@
/************************************************************************************
* configs/vsn/include/power.h
* include/arch/board/power.h
*
* Copyright (C) 2011 Uros Platise. All rights reserved
*
@@ -35,14 +34,15 @@
*
************************************************************************************/
#ifndef __ARCH_BOARD_POWER_H
#ifndef __CONFIGS_VSN_INCLUDE_POWER_H
#define __ARCH_BOARD_POWER_H
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@@ -51,17 +51,9 @@ extern "C" {
* Public Functions
************************************************************************************/
/** Perform system reset on board level
*/
void board_power_reboot(void);
/* Perform system reset on board level */
/** Power off the board
*
* If it returns, then it was not possible to power-off the board due to some
* other constraints. In the case of VSN due to external power supply, press
* of a push-button or RTC alarm.
*/
void board_power_off(void);
void board_power_reboot(void);
#undef EXTERN
#if defined(__cplusplus)
+47 -34
View File
@@ -35,27 +35,23 @@
*
****************************************************************************/
/** \file
* \author Uros Platise
* \brief VSN Power
*/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <arch/board/board.h>
#include <arch/stm32/irq.h>
#include <stdint.h>
#include <stdbool.h>
#include <debug.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
#include <arch/stm32/irq.h>
#include "vsn.h"
/****************************************************************************
* Declarations and Structures
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@@ -64,45 +60,62 @@ void board_power_register(void);
void board_power_adjust(void);
void board_power_status(void);
/****************************************************************************
* Public Functions
****************************************************************************/
void board_power_init(void)
{
stm32_configgpio(GPIO_PVS);
stm32_configgpio(GPIO_PST);
stm32_configgpio(GPIO_XPWR);
stm32_configgpio(GPIO_SCTC);
stm32_configgpio(GPIO_PCLR);
stm32_configgpio(GPIO_PVS);
stm32_configgpio(GPIO_PST);
stm32_configgpio(GPIO_XPWR);
stm32_configgpio(GPIO_SCTC);
stm32_configgpio(GPIO_PCLR);
}
void board_power_reboot(void)
{
// low-level board reset (not just MCU reset)
// if external power is present, stimulate power-off as board
// will wake-up immediatelly, if power is not present, set an alarm
// before power off the board.
/* low-level board reset (not just MCU reset)
* if external power is present, stimulate power-off as board
* will wake-up immediately, if power is not present, set an alarm
* before power off the board.
*/
}
/****************************************************************************
* Name: board_power_off
*
* Description:
* Power off the board.
*
* If this function returns, then it was not possible to power-off the
* board due to some other constraints.
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void board_power_off(void)
{
// Check if external supply is not present, otherwise return
// notifying that it is not possible to power-off the board
/* Check if external supply is not present, otherwise return */
* notifying that it is not possible to power-off the board
* REVISIT
*/
// \todo
/* stop background processes */
// stop background processes
irqsave();
irqsave();
// switch to internal HSI and get the PD0 and PD1 as GPIO
sysclock_select_hsi();
/* switch to internal HSI and get the PD0 and PD1 as GPIO */
// trigger shutdown with pull-up resistor (not push-pull!) and wait.
stm32_gpiowrite(GPIO_PCLR, true);
for (;;);
sysclock_select_hsi();
/* trigger shutdown with pull-up resistor (not push-pull!) and wait. */
stm32_gpiowrite(GPIO_PCLR, true);
for (;;);
}