Beruflich Dokumente
Kultur Dokumente
Version 1.0
Document History
Your access to the information in this document is conditional upon your acceptance that you will not use or permit others to use
the information for the purposes of determining whether implementations infringe any third party patents.
THIS DOCUMENT IS PROVIDED “AS IS”. ARM PROVIDES NO REPRESENTATIONS AND NO WARRANTIES,
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, SATISFACTORY QUALITY, NON-INFRINGEMENT OR FITNESS FOR A PARTICULAR PURPOSE
WITH RESPECT TO THE DOCUMENT. For the avoidance of doubt, ARM makes no representation with respect to, and has
undertaken no analysis to identify or understand the scope and content of, third party patents, copyrights, trade secrets, or other
rights.
TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL ARM BE LIABLE FOR ANY DAMAGES,
INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR
CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING
OUT OF ANY USE OF THIS DOCUMENT, EVEN IF ARM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
This document consists solely of commercial items. You shall be responsible for ensuring that any use, duplication or disclosure of
this document complies fully with any relevant export laws and regulations to assure that this document or any portion thereof is
not exported, directly or indirectly, in violation of such export laws. Use of the word “partner” in reference to ARM’s customers is
not intended to create or refer to any partnership relationship with any other company. ARM may make changes to this document at
any time and without notice.
If any of the provisions contained in these terms conflict with any of the provisions of any signed written agreement covering this
document with ARM, then the signed written agreement prevails over and supersedes the conflicting provisions of these terms.
This document may be translated into other languages for convenience, and you agree that if there is any conflict between the
English version of this document and any translation, the terms of the English version of the Agreement shall prevail.
Words and logos marked with ® or ™ are registered trademarks or trademarks of ARM Limited or its affiliates in the EU and/or
elsewhere. All rights reserved. Other brands and names mentioned in this document may be the trademarks of their respective
owners. Please follow ARM’s trademark usage guidelines at http://www.arm.com/about/trademark-usage-guidelines.php
LES-PRE-20349
Confidentiality Status
This document is Non-Confidential. The right to use, copy and disclose this document may be subject to license restrictions in
accordance with the terms of the agreement entered into by ARM and the party that ARM delivered this document to.
Product Status
The information in this document is Final, that is for a developed product.
Web Address
http://www.arm.com
Preface
About this book ...................................................... ...................................................... 9
Feedback .................................................................................................................... 11
Chapter 1 Introduction
1.1 About the MPU ........................................................................................................ 1-13
1.2 Key features of the MPU ............................................ ............................................ 1-14
1.3 MPU programmers' model changes for the ARM®v8-M architecture ........... ........... 1-15
Intended audience
Glossary
The ARM Glossary is a list of terms used in ARM documentation, together with definitions for those
terms. The ARM Glossary does not contain terms that are industry standard unless the ARM meaning
differs from the generally accepted meaning.
See the ARM Glossary for more information.
Typographic conventions
italic
Introduces special terminology, denotes cross-references, and citations.
bold
Highlights interface elements, such as menu names. Denotes signal names. Also used for terms
in descriptive lists, where appropriate.
monospace
Denotes text that you can enter at the keyboard, such as commands, file and program names,
and source code.
monospace
Denotes a permitted abbreviation for a command or option. You can enter the underlined text
instead of the full command or option name.
monospace italic
Denotes arguments to monospace text where the argument is to be replaced by a specific value.
monospace bold
Denotes language keywords when used outside example code.
<and>
Encloses replaceable terms for assembler syntax where they appear in code or code fragments.
For example:
MRC p15, 0, <Rd>, <CRn>, <CRm>, <Opcode_2>
SMALL CAPITALS
Used in body text for a few terms that have specific technical meanings, that are defined in the
ARM glossary. For example, IMPLEMENTATION DEFINED, IMPLEMENTATION SPECIFIC, UNKNOWN, and
UNPREDICTABLE.
Timing diagrams
The following figure explains the components used in timing diagrams. Variations, when they occur,
have clear labels. You must not assume any timing information that is not explicit in the diagrams.
Shaded bus and signal areas are undefined, so the bus or signal can assume any value within the shaded
area at that time. The actual level is unimportant and does not affect normal operation.
Clock
HIGH to LOW
Transient
HIGH/LOW to HIGH
Bus stable
Bus change
Signals
The signal conventions are:
Signal level
The level of an asserted signal depends on whether the signal is active-HIGH or active-LOW.
Asserted means:
• HIGH for active-HIGH signals.
• LOW for active-LOW signals.
Lowercase n
At the start or end of a signal name denotes an active-LOW signal.
Feedback
Feedback on content
If you have comments on content then send an e-mail to errata@arm.com. Give:
• The title Memory Protection Unit (MPU) .
• The number ARM 100699_0100_00_en.
• If applicable, the page number(s) to which your comments refer.
• A concise explanation of your comments.
ARM also welcomes general suggestions for additions and improvements.
Note
ARM tests the PDF only in Adobe Acrobat and Acrobat Reader, and cannot guarantee the quality of the
represented document when used with any other PDF reader.
The Memory Protection Unit (MPU) is a programmable unit that allows privileged software to define
memory access permissions for up to 16 separate memory regions. This chapter provides an overview of
the MPU programmers' model and summarizes its key features.
It contains the following sections:
• 1.1 About the MPU on page 1-13.
• 1.2 Key features of the MPU on page 1-14.
• 1.3 MPU programmers' model changes for the ARM®v8-M architecture on page 1-15.
In the ARMv8-M architecture, memory types are divided into Normal Memory and Device Memory. If
the ARMv8-M architecture with Security Extension is implemented, the memory space is partitioned
into Secure and Non-secure memory regions.
It contains the following sections:
• 2.1 Memory type definitions in the ARM®v8-M architecture on page 2-17.
• 2.2 Memory system and memory partitioning on page 2-21.
Note
The Strongly Ordered (SO) device memory type in the ARMv6-M and ARMv7-M architectures is a
subset of the Device memory type in ARMv8-M architecture.
Normal memory can have several attributes that can be applied to it. The following memory attributes
are available:
Cacheability
Memories can be cacheable or non-cacheable.
Shareability
Normal memory can be shareable or Non-shareable.
eXecute Never
Memories can be marked as executable or eXecute Never (XN).
Cacheability
The cacheability can be further divided into cache policy, allocation, and transient hint.
Cache policy
Write-Through or Write-Back
Allocation
Cache line allocation hintas, for read and write access.
Transient hint
A hint to the cache that the data might only be needed in the cache temporarily.
The architecture supports two levels of cache attributes. These are the inner cache and outer cache
attributes.
Typically, the inner cache attribute is used by any integrated caches and the outer cache attributes are
exported using the bus system sideband signals. Depending on the processor implementation, the inner
cache attributes can also be exported to the memory system using extra sideband signals.
For example, in the AMBA® 5 AHB5 specification, the HPROT signal is used to propagate cache
attributes:
0 0 0 0 0 Device-nE
0 0 0 0 1 Device-E
0 0 0 1 0 Normal Non-
cacheable, Non-
shareable
0 0 or 1 1 1 0 Write-Through,
Non-shareable
0 0 or 1 1 1 1 Write-Back, Non-
shareable
1 0 0 1 0 Normal Non-
cacheable, shareable
1 0 or 1 1 1 0 Write-Through,
shareable
1 0 or 1 1 1 1 Write-Back,
shareable
Note
The transient attribute is included in the architecture to be consistent with ARMv8-A processors. It
indicates that the benefit of caching is for a relatively short period. Therefore it might be better to restrict
allocation of transient entries, to avoid possibly casting-out other, less transient, entries.
Configuring an MPU region with a cacheable memory type does not mean that the data must be cached
but only indicates to the hardware that it might be cached. If a region is defined as cacheable software
takes responsibility for performing any necessary cache maintenance operations.
Shareability
Many systems have multiple bus masters, either multiple processors, or a mixture of processors and other
masters such as Direct Memory Access (DMA) engines. The shareability attribute allows software to
advertise to the hardware which of these devices must be able to see any updates to a particular area of
memory.
To manage shareability, the ARM architecture groups all masters into one of three domains of memory
shareability:
• Non-shareable memory.
• Inner shareable memory.
• Outer Shareable memory.
The following figure shows how masters are divided into shareability groups.
Non-shareable memory
Non-shareable represents memory accessible only by a single processor or other agent, so memory
accesses never have to be synchronized with other processors. Only the processor itself must see the
information, though it can be made visible to other agents.
Note
Device-nGnRnE is equivalent to ARMv7-M Strongly Ordered memory type and Device-nGnRE is
equivalent to ARMv7-M Device memory.
Device-nGRE and Device-GRE are new to ARMv8-M architecture.
The MPU is configured by a series of memory mapped registers in the System Control Space (SCS). This
chapter lists the MPU registers, and describes the attribute indirect mechanism that allows multiple MPU
regions to share a set of memory attributes.
It contains the following sections:
• 3.1 MPU registers on page 3-23.
• 3.2 Attribute indirection on page 3-25.
Note
In the ARMv8-M architecture the MPU_TYPE, MPU_CTRL and MPU_RNR registers are identical to
those same registers in the ARMv6-M or ARMv7-M architectures.
This chapter shows the bit assignments for each of the MPU registers.
4.1 MPU_TYPE
The MPU Type register indicates how many regions the MPU supports for the selected security state.
This register is read only.
4.2 MPU_CTRL
The MPU Control register provides various programmable bit fields for MPU enable and features.
4.3 MPU_RNR
The MPU Region Number Register selects the region that is accessed by the MPU_RBAR and
MPU_RLAR.
4.4 MPU_RBAR
The MPU Region Base Address Register defines the starting address of an MPU region and access
permission.
4.5 MPU_RLAR
The MPU Region Limit Address Register defines the ending address of an MPU region, region enable,
and an indirection index to memory attribute array.
4 Reserved 0 Reserved.
0 EN 0 Region enable.
MPU_RBAR_A1 / MPU_RLAR_A1 1
MPU_RBAR_A2 / MPU_RLAR_A2 2
MPU_RBAR_A3 / MPU_RLAR_A3 3
MPU_RBAR_A1 / MPU_RLAR_A1 5
MPU_RBAR_A2 / MPU_RLAR_A2 6
MPU_RBAR_A3 / MPU_RLAR_A3 7
ARMv8-M processors provide software support with an initiative called the Cortex Microcontroller
Software Interface Standard (CMSIS). This chapter lists the standardized names for MPU registers, and
provides configuration settings to initialize CMSIS MPU.
It contains the following sections:
• 5.1 CMSIS-CORE on page 5-39.
5.1 CMSIS-CORE
One of the projects within CMSIS is CMSIS-CORE, a standardized Hardware Abstraction Layer (HAL)
for accessing processor features. CMSIS-CORE is integrated in device driver code that is provided by
microcontroller vendors, and being integrated into various software development suites.
Inside the processor-specific header files in CMSIS-CORE, the MPU registers are defined with a data
structure (typedef) which provides standardized names for MPU registers.
/* Disable MPU */
MPU->CTRL = 0;