forked from Imagelibrary/rtems
bsps/arm: Use common ARMv7-M bsp_reset()
This commit is contained in:
@@ -74,9 +74,9 @@ libbsp_a_SOURCES += ../../shared/src/stackalloc.c
|
||||
|
||||
# Startup
|
||||
libbsp_a_SOURCES += ../shared/startup/bsp-start-memcpy.S
|
||||
libbsp_a_SOURCES += ../shared/armv7m/startup/bspreset.c
|
||||
libbsp_a_SOURCES += startup/bspstart.c
|
||||
libbsp_a_SOURCES += startup/bspstarthook.c
|
||||
libbsp_a_SOURCES += startup/bspreset.c
|
||||
libbsp_a_SOURCES += startup/io.c
|
||||
libbsp_a_SOURCES += startup/syscon.c
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ libbsp_a_SOURCES += ../../shared/src/uart-output-char.c
|
||||
|
||||
# Startup
|
||||
libbsp_a_SOURCES += ../shared/startup/bsp-start-memcpy.S
|
||||
libbsp_a_SOURCES += startup/bspreset.c
|
||||
libbsp_a_SOURCES += ../shared/armv7m/startup/bspreset.c
|
||||
libbsp_a_SOURCES += startup/bspstart.c
|
||||
|
||||
# IRQ
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup lpc176x
|
||||
*
|
||||
* @brief Reset code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2013 embedded brains GmbH. All rights reserved.
|
||||
*
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
* 82178 Puchheim
|
||||
* Germany
|
||||
* <rtems@embedded-brains.de>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.org/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/score/armv7m.h>
|
||||
|
||||
#include <bsp/bootcard.h>
|
||||
#include <bsp/lpc176x.h>
|
||||
#include <bsp/start.h>
|
||||
|
||||
BSP_START_TEXT_SECTION __attribute__( ( flatten ) ) void bsp_reset( void )
|
||||
{
|
||||
rtems_interrupt_level level;
|
||||
|
||||
(void) level;
|
||||
rtems_interrupt_disable( level );
|
||||
|
||||
_ARMV7M_SCB->aircr = ARMV7M_SCB_AIRCR_VECTKEY |
|
||||
ARMV7M_SCB_AIRCR_SYSRESETREQ;
|
||||
|
||||
while ( true ) {
|
||||
/* Do nothing */
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,8 @@ libbsp_a_SOURCES += ../../shared/cpucounterdiff.c
|
||||
|
||||
# Startup
|
||||
libbsp_a_SOURCES += ../shared/startup/bsp-start-memcpy.S
|
||||
libbsp_a_SOURCES += startup/bspreset.c
|
||||
libbsp_a_SOURCES += ../shared/armv7m/startup/bspreset.c
|
||||
libbsp_a_SOURCES += startup/bspreset-armv4.c
|
||||
libbsp_a_SOURCES += startup/bspstart.c
|
||||
|
||||
# IRQ
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include <bsp/lpc24xx.h>
|
||||
#include <bsp/start.h>
|
||||
|
||||
#ifdef ARM_MULTILIB_ARCH_V4
|
||||
|
||||
BSP_START_TEXT_SECTION __attribute__((flatten)) void bsp_reset(void)
|
||||
{
|
||||
rtems_interrupt_level level;
|
||||
@@ -34,19 +36,16 @@ BSP_START_TEXT_SECTION __attribute__((flatten)) void bsp_reset(void)
|
||||
(void) level;
|
||||
rtems_interrupt_disable(level);
|
||||
|
||||
#if defined(ARM_MULTILIB_ARCH_V4)
|
||||
/* Trigger watchdog reset */
|
||||
WDCLKSEL = 0;
|
||||
WDTC = 0xff;
|
||||
WDMOD = 0x3;
|
||||
WDFEED = 0xaa;
|
||||
WDFEED = 0x55;
|
||||
#elif defined(ARM_MULTILIB_ARCH_V7M)
|
||||
_ARMV7M_SCB->aircr = ARMV7M_SCB_AIRCR_VECTKEY
|
||||
| ARMV7M_SCB_AIRCR_SYSRESETREQ;
|
||||
#endif
|
||||
/* Trigger watchdog reset */
|
||||
WDCLKSEL = 0;
|
||||
WDTC = 0xff;
|
||||
WDMOD = 0x3;
|
||||
WDFEED = 0xaa;
|
||||
WDFEED = 0x55;
|
||||
|
||||
while (true) {
|
||||
/* Do nothing */
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ARM_MULTILIB_ARCH_V4 */
|
||||
@@ -1,10 +1,8 @@
|
||||
/*
|
||||
* Copyright © 2013 Eugeniy Meshcheryakov <eugen@debian.org>
|
||||
*
|
||||
* Copyright (c) 2011 Sebastian Huber. All rights reserved.
|
||||
* Copyright (c) 2015 embedded brains GmbH. All rights reserved.
|
||||
*
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
* Dornierstr. 4
|
||||
* 82178 Puchheim
|
||||
* Germany
|
||||
* <rtems@embedded-brains.de>
|
||||
@@ -14,22 +12,27 @@
|
||||
* http://www.rtems.org/license/LICENSE.
|
||||
*/
|
||||
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/score/armv7m.h>
|
||||
|
||||
#include <bsp/bootcard.h>
|
||||
#include <bsp/start.h>
|
||||
|
||||
void bsp_reset(void)
|
||||
#ifdef ARM_MULTILIB_ARCH_V7M
|
||||
|
||||
BSP_START_TEXT_SECTION __attribute__((flatten)) void bsp_reset(void)
|
||||
{
|
||||
rtems_interrupt_level level;
|
||||
|
||||
rtems_interrupt_local_disable(level);
|
||||
(void) level;
|
||||
rtems_interrupt_disable(level);
|
||||
|
||||
_ARMV7M_SCB->aircr = ARMV7M_SCB_AIRCR_VECTKEY
|
||||
| ARMV7M_SCB_AIRCR_SYSRESETREQ;
|
||||
|
||||
while (true)
|
||||
/* Do nothing */;
|
||||
while (true) {
|
||||
/* Do nothing */
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ARM_MULTILIB_ARCH_V7M */
|
||||
Reference in New Issue
Block a user