mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
SAMA5: Initial WDT timer (untested)
This commit is contained in:
@@ -5825,4 +5825,6 @@
|
||||
* arch/arm/src/sama5/sam_rtc.h and other files: Hook the SAMA5 RTC
|
||||
driver into the build system; Verify the correct operation of the
|
||||
SAMA5 RTC driver (2013-10-19).
|
||||
* arch/arm/src/sama5/sam_wdt.c and .h: Add a SAMA5 watchdog timer
|
||||
drvier. Untested on initial check-in (2013-10-19).
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ config SAMA5_PIT
|
||||
config SAMA5_WDT
|
||||
bool "Watchdog timer Interrupt (WDT)"
|
||||
default n
|
||||
select WDT
|
||||
select WATCHDOG
|
||||
|
||||
config SAMA5_RTC
|
||||
bool "Real time clock calendar (RTC)"
|
||||
@@ -2019,6 +2019,41 @@ endif # SAMA5_TSD
|
||||
endmenu # Touchscreen Configuration
|
||||
endif # SAMA5_ADC
|
||||
|
||||
if SAMA5_WDT
|
||||
|
||||
menu "Watchdog Configuration"
|
||||
|
||||
config SAMA5_WDT_INTERRUPT
|
||||
bool "Interrupt on timeout"
|
||||
default n
|
||||
---help---
|
||||
The normal behavior is to reset everything when a watchdog timeout
|
||||
occurs. An alternative behavior is to simply interrupt when the
|
||||
timeout occurs. This setting enables that alternative behavior.
|
||||
|
||||
config SAMA5_WDT_DEBUGHALT
|
||||
bool "Halt on DEBUG"
|
||||
default y if DEBUG
|
||||
default n if !DEBUG
|
||||
---help---
|
||||
Halt the watchdog timer in the debug state
|
||||
|
||||
config SAMA5_WDT_IDLEHALT
|
||||
bool "Halt in IDLE"
|
||||
default y
|
||||
---help---
|
||||
Halt the watchdog timer in the IDLE state
|
||||
|
||||
config SAMA5_WDT_REGDEBUG
|
||||
bool "Register level debug"
|
||||
default n
|
||||
depends on DEBUG
|
||||
---help---
|
||||
Enable low-level register debug output
|
||||
|
||||
endmenu # Watchdog configuration
|
||||
endif # SAMA5_WDT
|
||||
|
||||
menu "External Memory Configuration"
|
||||
|
||||
config SAMA5_DDRCS
|
||||
|
||||
@@ -114,6 +114,10 @@ ifeq ($(CONFIG_SAMA5_RTC),y)
|
||||
CHIP_CSRCS += sam_rtc.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SAMA5_WDT),y)
|
||||
CHIP_CSRCS += sam_wdt.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SAMA5_SPI0),y)
|
||||
CHIP_CSRCS += sam_spi.c
|
||||
else
|
||||
|
||||
@@ -182,7 +182,7 @@ int sam_emac_initialize(void);
|
||||
* Some boards require specialized initialization of the PHY before it can be used.
|
||||
* This may include such things as configuring GPIOs, resetting the PHY, etc. If
|
||||
* CONFIG_SAMA5_PHYINIT is defined in the configuration then the board specific
|
||||
* logic must provide sam_phyinitialize(); The STM32 Ethernet driver will call
|
||||
* logic must provide sam_phyinitialize(); The SAMA5 Ethernet driver will call
|
||||
* this function one time before it first uses the PHY.
|
||||
*
|
||||
* Parameters:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/************************************************************************************
|
||||
* arch/arm/src/sama5/stm_rtc.h
|
||||
* arch/arm/src/sama5/sam_rtc.h
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,96 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/sama5/sam_wdt.h
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_SAMA5_SAM_WDT_H
|
||||
#define __ARCH_ARM_SRC_SAMA5_SAM_WDT_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "chip/sam_wdt.h"
|
||||
|
||||
#ifdef CONFIG_WATCHDOG
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sam_wdtinitialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the WDT watchdog timer. The watchdog timer is intialized and
|
||||
* registered as 'devpath. The initial state of the watchdog time is
|
||||
* disabled.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The full path to the watchdog. This should be of the form
|
||||
* /dev/watchdog0
|
||||
*
|
||||
* Returned Values:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SAMA5_WDT
|
||||
void sam_wdtinitialize(FAR const char *devpath);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* CONFIG_WATCHDOG */
|
||||
#endif /* __ARCH_ARM_SRC_SAMA5_SAM_WDT_H */
|
||||
Reference in New Issue
Block a user