2010-12-29 23:53:52 +00:00
|
|
|
/*
|
2010-12-30 12:19:25 +00:00
|
|
|
* This file is part of the libopencm3 project.
|
2010-12-29 23:53:52 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
|
|
|
|
*
|
2012-03-02 10:23:11 +00:00
|
|
|
* This library is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
2010-12-29 23:53:52 +00:00
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2012-03-02 10:23:11 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2010-12-29 23:53:52 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2012-03-02 10:23:11 +00:00
|
|
|
* GNU Lesser General Public License for more details.
|
2010-12-29 23:53:52 +00:00
|
|
|
*
|
2012-03-02 10:23:11 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2010-12-29 23:53:52 +00:00
|
|
|
*/
|
|
|
|
|
2011-02-09 00:33:00 +00:00
|
|
|
#ifndef LIBOPENCM3_CM3_MEMORYMAP_H
|
|
|
|
#define LIBOPENCM3_CM3_MEMORYMAP_H
|
2010-12-29 23:53:52 +00:00
|
|
|
|
2013-07-22 16:43:16 +00:00
|
|
|
/* --- ARM Cortex-M0, M3 and M4 specific definitions ----------------------- */
|
2010-12-29 23:53:52 +00:00
|
|
|
|
|
|
|
/* Private peripheral bus - Internal */
|
2014-01-19 23:51:14 +00:00
|
|
|
#define PPBI_BASE (0xE0000000U)
|
2013-07-22 16:43:16 +00:00
|
|
|
|
|
|
|
/* Those defined only on ARMv7 and above */
|
|
|
|
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
|
|
|
|
/* ITM: Instrumentation Trace Macrocell */
|
2010-12-29 23:53:52 +00:00
|
|
|
#define ITM_BASE (PPBI_BASE + 0x0000)
|
2013-07-22 16:43:16 +00:00
|
|
|
|
|
|
|
/* DWT: Data Watchpoint and Trace unit */
|
2010-12-29 23:53:52 +00:00
|
|
|
#define DWT_BASE (PPBI_BASE + 0x1000)
|
2013-07-22 16:43:16 +00:00
|
|
|
|
|
|
|
/* FPB: Flash Patch and Breakpoint unit */
|
2010-12-29 23:53:52 +00:00
|
|
|
#define FPB_BASE (PPBI_BASE + 0x2000)
|
2013-07-22 16:43:16 +00:00
|
|
|
#endif
|
|
|
|
|
2010-12-29 23:53:52 +00:00
|
|
|
/* PPBI_BASE + 0x3000 (0xE000 3000 - 0xE000 DFFF): Reserved */
|
2013-07-22 16:43:16 +00:00
|
|
|
|
2010-12-29 23:53:52 +00:00
|
|
|
#define SCS_BASE (PPBI_BASE + 0xE000)
|
2013-07-22 16:43:16 +00:00
|
|
|
|
2010-12-29 23:53:52 +00:00
|
|
|
/* PPBI_BASE + 0xF000 (0xE000 F000 - 0xE003 FFFF): Reserved */
|
2013-07-22 16:43:16 +00:00
|
|
|
|
|
|
|
/* Those defined only on ARMv7 and above */
|
|
|
|
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
|
2011-02-17 08:38:38 +00:00
|
|
|
#define TPIU_BASE (PPBI_BASE + 0x40000)
|
2013-07-22 16:43:16 +00:00
|
|
|
#endif
|
2010-12-29 23:53:52 +00:00
|
|
|
|
|
|
|
/* --- SCS: System Control Space --- */
|
|
|
|
|
2013-07-22 16:43:16 +00:00
|
|
|
/* Those defined only on ARMv7 and above */
|
|
|
|
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
|
2010-12-29 23:53:52 +00:00
|
|
|
/* ITR: Interrupt Type Register */
|
|
|
|
#define ITR_BASE (SCS_BASE + 0x0000)
|
2013-07-22 16:43:16 +00:00
|
|
|
#endif
|
|
|
|
|
2010-12-29 23:53:52 +00:00
|
|
|
/* SYS_TICK: System Timer */
|
|
|
|
#define SYS_TICK_BASE (SCS_BASE + 0x0010)
|
2013-07-22 16:43:16 +00:00
|
|
|
|
2010-12-29 23:53:52 +00:00
|
|
|
/* NVIC: Nested Vector Interrupt Controller */
|
|
|
|
#define NVIC_BASE (SCS_BASE + 0x0100)
|
2013-07-22 16:43:16 +00:00
|
|
|
|
2010-12-29 23:53:52 +00:00
|
|
|
/* SCB: System Control Block */
|
|
|
|
#define SCB_BASE (SCS_BASE + 0x0D00)
|
2013-07-22 16:43:16 +00:00
|
|
|
|
|
|
|
/* MPU: Memory protection unit */
|
|
|
|
#define MPU_BASE (SCS_BASE + 0x0D90)
|
|
|
|
|
|
|
|
/* Those defined only on CM0*/
|
|
|
|
#if defined(__ARM_ARCH_6M__)
|
|
|
|
/* DEBUG: Debug control and configuration */
|
|
|
|
#define DEBUG_BASE (SCS_BASE + 0x0DF0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Those defined only on ARMv7 and above */
|
|
|
|
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
|
2010-12-29 23:53:52 +00:00
|
|
|
/* STE: Software Trigger Interrupt Register */
|
|
|
|
#define STIR_BASE (SCS_BASE + 0x0F00)
|
|
|
|
/* ID: ID space */
|
|
|
|
#define ID_BASE (SCS_BASE + 0x0FD0)
|
2013-07-22 16:43:16 +00:00
|
|
|
#endif
|
2010-12-29 23:53:52 +00:00
|
|
|
|
2019-10-18 22:29:13 +00:00
|
|
|
/**
|
|
|
|
* @defgroup coresight_registers Coresight Registers
|
|
|
|
* @{
|
|
|
|
* CoreSight Lock Status Registers and Lock Access Registers are
|
|
|
|
* documented for the DWT, ITM, FPB and TPIU peripherals
|
|
|
|
*/
|
|
|
|
#define CORESIGHT_LSR_OFFSET 0xfb4
|
|
|
|
#define CORESIGHT_LAR_OFFSET 0xfb0
|
|
|
|
|
|
|
|
/** CoreSight Lock Status Register lock status bit */
|
|
|
|
#define CORESIGHT_LSR_SLK (1<<1)
|
|
|
|
/** CoreSight Lock Status Register lock availability bit */
|
|
|
|
#define CORESIGHT_LSR_SLI (1<<0)
|
|
|
|
/** CoreSight Lock Access key, common for all */
|
|
|
|
#define CORESIGHT_LAR_KEY 0xC5ACCE55
|
|
|
|
|
|
|
|
/**@}*/
|
|
|
|
|
2010-12-29 23:53:52 +00:00
|
|
|
#endif
|