SlideShare a Scribd company logo
1 of 22
Memory Protection Unit
(MPU)
Talluri naresh
● The Memory Protection Unit (MPU) is a programmable
unit that allows privileged software to define memory
access permission
● It monitors transactions
● which can trigger a fault exception when an access
violation is detected.
● The MPU programmers’ model allows the privileged
software to define memory regions and assign memory
access permission and memory attributes to each of
them.
● It supports upto 16 regions
● The memory attributes define ordering and merging
behaviour of the region
● In MPU mem manage fault address register(MMFAR) is
there which provide information about the cause of the
fault and address being accessed in the case of data faults
● If MMFAR is disabled or cannot be triggered because
execution priority is high
● In MPU some regions are associate with secure and non-
security state
● MPU configuration do not define access permissions and
attributes for debug access
Key features of the MPU:-
● The smallest size that can be programmed for an MPU region is 32 bytes.
● The maximum size of any MPU region is 4GB, but must be a multiple of 32
bytes.
● All regions must begin on a 32 byte aligned address.
● Regions have independent read/write access permissions for privileged
and unprivileged code.
● The eXecure Never (XN) attribute enables separation of code and data
regions
Secure software can access a Non-secure MPU using an alias address (address
0xE002ED90)
● The regions are numbered 0 to 15
● In addition, there is a region called the default region with an id of -1.
All the 0-15 memory regions take priority over the default region.
4 Gbytes -> example of
overlapping regions
Region 0
Region 1
Region 4
Region 2
Region 3
Region 5
● the region 4 overlapping the regions
● 0 and 1. The region 5 is enclosed completely within the region 3
● Since the priority is in an ascending order
● overlap regions (in orange) have the priority.
● So if the region 0 is writeable and the region 4 is not, an address
falling in the overlap between 0 and 4 is not writeable.
Memory model:-
● the processor has a fixed default memory map that provides up to 4 Gbytes of
addressable memory
● The memory map and the programming of the MPU split the memory map
into regions
● Each region has a defined memory type and memory attributs
● The memory type and attributes determine the behavior of accesses to the
region.
Vendor -specific memory
(511Mbytes)
Private peripheral bus
(1.0Mbytes)
External device
(1.0Gbytes)
External RAM
(1.0Gbytes)
Peripheral
(0.5Gbytes)
SRAM
(0.5Gbytes)
Code
(0.5Gbytes)
Memory type:-
● Memory types are divided into Normal Memory and Device Memory.
1) Normal memory:-
● It is used to access general instruction
● It allows to perform some memory access optimization such as
access reordering and merging
● Normal memory can have several attributes that can be applied to it
a) cacheability:- memory can be cacheable or non-cacheable
b) Shareability:- normal memory can Shareable or non-shareable
c) eXecute never:- memory can be marked as executable or execute
never
● The cacheability 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
Shareability:-
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.
Device Memory:-
● Device memory must be used for memory regions that cover
peripherals control registers
The Device memory type has several attributes:-
• G or nG – Gathering or non-Gathering. Multiple accesses to a
device can be merged into a single transaction except for
operations with memory ordering semantics, for example,
memory barrier instructions, load acquire/store release.
• R or nR – Reordering or Non-reordering.
• E or nE – Early Write Acknowledge (similar to bufferable).
MPU registers :-
● The MPU registers are banked between Secure and Non-secure states
● The programmers’ model for Secure MPU and Non-secure MPU are the same,
but the number of MPU regions for the two MPUs can be different.
● MPU registers are privileged access only (unprivileged accesses generate a
fault exception)
● By default the MPU is disabled after reset.
● The memory type is encoded as an 8-bit field that is stored in one of the
Memory Attribute Indirection Registers (MAIR).
● Each MAIR register has four 8-bit fields, allowing eight memory types to be
defined at any one time.
Register address NS address description
MPU_TYPE 0xE000ED90 0xE002ED90 MPU Type Register
MPU_CTRL 0xE000ED94 0xE002ED94 MPU control register
MPU_RNR 0XE000ED98 0xE002ED98 MPU region number
Register
MPU_RBAR 0xE000ED9C 0xE002ED9C MPU Region Base
Address register
MPU_RLAR 0xE000EDA0 0xE002EDA0 MPU Region Base
Limit register
MPU_RBAR_A1 0xE000EDA4 0xE002EDA4 MPU Region Base
Address register alias 1
register Address NS Address Alias Description
MPU_RBAR_A2 0xE000EDAC 0xE002EDAC MPU Region Base
Address register alias 2
MPU_RBAR_A3 0xE000EDB4 0xE002EDB4 MPU Region Base
Address Register Alias 3
MPU_RLAR_A1 0xE000EDA8 0xE002EDA8 MPU Region Limit
Address Register Alias 1
MPU_RLAR_A2 0xE000EDB0 0xE002EDB0 MPU Region Limit Address
Register Alias 2
MPU_RLAR_A3 0xE000EDA8 0xE002EDB8 MPU Region Limit Address
Register Alias 3
MPU_MAIR0 0xE000EDC0 0xE002EDC0 MPU Memory Attribute
Indirection Register 0
MPU_MAIR1 0xE000EDC4 0xE002EDC4 MPU Memory Attribute
Indirection Register 1
MPU_TYPE:-
The MPU Type register indicates how many regions the MPU supports for the
selected security state. This register is read only.
[31:16]-> reserved
[15:8] -> region
[7:1] ->reserved
[0] -> separate
MPU_CTRL:-
The MPU Control register provides various programmable bit fields for MPU enable and features.
[31:3] -> reserved
[2] ->Privileged background region enable
[1] ->MPU Enable for HardFault and NMI(non-maskable)
[0] ->MPU enable/disable
MPU_RNR:
The MPU Region Number Register selects the region that is accessed by the
MPU_RBAR and MPU_RLAR
[31:8] -> reserved
[7:0] -> Region number. Selects and indicates the region that is accessed by
the
MPU_RBAR and MPU_RLAR.
MPU_RBAR:
The MPU Region Base Address Register defines the starting address of an MPU
region and access permission
[31:5] ->Starting address of MPU region address
[4:3] ->Shareability for Normal memory
[2:1] ->Access permissions
[0] ->eXecute never attribute
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
[31:5] -> ending address of MPU region address.
[4] -> reserved
[3:1] ->Attribute Index. Select memory attributes from attribute sets
in
MPU_MAIR0 and MPU_MAIR
[0] -> enable /disable the region
MPU_RBAR_A1/2/3 and MPU_RLAR_A1/2/3:-
An alias of MPU_RBAR register to allow faster programming of different MPU regions. The region
number that is selected when using MPU_RBARn and MPU_RLARn is equal to (MPU_RNR[7:2]<<2)
Condition When Accessing MPU Region accessed
MPU_RNR=0 MPU_RBAR / MPU_RLAR 0
MPU_PNR=1 MPU_RBAR_A1 / MPU_RLAR_A1 1
MPU_PNR=4 MPU_RBAR / MPU_RLAR 4
MPU_PNR=5 MPU_RBAR_A1 / MPU_RLAR_A1 5
MPU_PNR=6 MPU_RBAR_A2 / MPU_RLAR_A2 6
MPU_MAIR0, MPU_MAIR1:-
The MPU Attribute Indirection Register 0 and 1 provide eight sets of 8-bit memory
attributes, which can
be referenced by AttrIndx in MPU_RLAR to determine the memory attribute for an
MPU region.
Thank you

More Related Content

What's hot

Embedded system architecture.pptx
Embedded system architecture.pptxEmbedded system architecture.pptx
Embedded system architecture.pptxAltafKaroshi
 
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC 02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC IEEE SSCS AlexSC
 
Introduction to Processor Design and ARM Processor
Introduction to Processor Design and ARM ProcessorIntroduction to Processor Design and ARM Processor
Introduction to Processor Design and ARM ProcessorDarling Jemima
 
ARM architcture
ARM architcture ARM architcture
ARM architcture Hossam Adel
 
ARM Microcontroller and Embedded Systems (17EC62) – ARM – 32 bit Microcontrol...
ARM Microcontroller and Embedded Systems (17EC62) – ARM – 32 bit Microcontrol...ARM Microcontroller and Embedded Systems (17EC62) – ARM – 32 bit Microcontrol...
ARM Microcontroller and Embedded Systems (17EC62) – ARM – 32 bit Microcontrol...Shrishail Bhat
 
Introduction to arm architecture
Introduction to arm architectureIntroduction to arm architecture
Introduction to arm architectureZakaria Gomaa
 
Introduction to arm processor
Introduction to arm processorIntroduction to arm processor
Introduction to arm processorRAMPRAKASHT1
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OSC.U
 
Introduction on STM32 Platform and Presentation of a Water-Level & Temperatur...
Introduction on STM32 Platform and Presentation of a Water-Level & Temperatur...Introduction on STM32 Platform and Presentation of a Water-Level & Temperatur...
Introduction on STM32 Platform and Presentation of a Water-Level & Temperatur...Julio César Carrasquel
 
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWERMastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWERFastBit Embedded Brain Academy
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architectureDr.YNM
 

What's hot (20)

Embedded system architecture.pptx
Embedded system architecture.pptxEmbedded system architecture.pptx
Embedded system architecture.pptx
 
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC 02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
 
Introduction to ARM Architecture
Introduction to ARM ArchitectureIntroduction to ARM Architecture
Introduction to ARM Architecture
 
Introduction to Processor Design and ARM Processor
Introduction to Processor Design and ARM ProcessorIntroduction to Processor Design and ARM Processor
Introduction to Processor Design and ARM Processor
 
ARM architcture
ARM architcture ARM architcture
ARM architcture
 
ARM Microcontroller and Embedded Systems (17EC62) – ARM – 32 bit Microcontrol...
ARM Microcontroller and Embedded Systems (17EC62) – ARM – 32 bit Microcontrol...ARM Microcontroller and Embedded Systems (17EC62) – ARM – 32 bit Microcontrol...
ARM Microcontroller and Embedded Systems (17EC62) – ARM – 32 bit Microcontrol...
 
FreeRTOS
FreeRTOSFreeRTOS
FreeRTOS
 
Introduction to arm architecture
Introduction to arm architectureIntroduction to arm architecture
Introduction to arm architecture
 
Introduction to arm processor
Introduction to arm processorIntroduction to arm processor
Introduction to arm processor
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 
Cache memory
Cache memory Cache memory
Cache memory
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
 
Arm
ArmArm
Arm
 
Embedded systems basics
Embedded systems basicsEmbedded systems basics
Embedded systems basics
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
486 or 80486 DX Architecture
486 or 80486 DX Architecture486 or 80486 DX Architecture
486 or 80486 DX Architecture
 
Introduction on STM32 Platform and Presentation of a Water-Level & Temperatur...
Introduction on STM32 Platform and Presentation of a Water-Level & Temperatur...Introduction on STM32 Platform and Presentation of a Water-Level & Temperatur...
Introduction on STM32 Platform and Presentation of a Water-Level & Temperatur...
 
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWERMastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architecture
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 

Similar to Memory Protection Unit (MPU) Registers and Configuration

F9 microkernel code reading part 4 memory management
F9 microkernel code reading part 4 memory managementF9 microkernel code reading part 4 memory management
F9 microkernel code reading part 4 memory managementBenux Wei
 
Arm cm3 architecture_and_programmer_model
Arm cm3 architecture_and_programmer_modelArm cm3 architecture_and_programmer_model
Arm cm3 architecture_and_programmer_modelGanesh Naik
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architectureDominicHendry
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architectureDominicHendry
 
32- bit Microprocessor-Indtel 80386.pptx
32- bit Microprocessor-Indtel 80386.pptx32- bit Microprocessor-Indtel 80386.pptx
32- bit Microprocessor-Indtel 80386.pptxYuvraj994432
 
eMMC Embedded Multimedia Card overview
eMMC Embedded Multimedia Card overvieweMMC Embedded Multimedia Card overview
eMMC Embedded Multimedia Card overviewVijayGESYS
 
I. Introduction to Microprocessor System.ppt
I. Introduction to Microprocessor System.pptI. Introduction to Microprocessor System.ppt
I. Introduction to Microprocessor System.pptHAriesOa1
 
PDT DC015 Chapter 2 Computer System 2017/2018 (i)
PDT DC015 Chapter 2 Computer System 2017/2018 (i)PDT DC015 Chapter 2 Computer System 2017/2018 (i)
PDT DC015 Chapter 2 Computer System 2017/2018 (i)Fizaril Amzari Omar
 
8085 interfacing with memory chips
8085 interfacing with memory chips8085 interfacing with memory chips
8085 interfacing with memory chipsSrikrishna Thota
 
Microcontrollers by anax projects
Microcontrollers by anax projectsMicrocontrollers by anax projects
Microcontrollers by anax projectsAnaxProject
 
introduction of microprocessor
introduction of microprocessorintroduction of microprocessor
introduction of microprocessorReetika Singh
 
Memory segmentations
Memory  segmentations Memory  segmentations
Memory segmentations maamir farooq
 
Ec 1303 microprocessor_its_applications
Ec 1303 microprocessor_its_applicationsEc 1303 microprocessor_its_applications
Ec 1303 microprocessor_its_applicationsMerin Jesuraj
 

Similar to Memory Protection Unit (MPU) Registers and Configuration (20)

F9 microkernel code reading part 4 memory management
F9 microkernel code reading part 4 memory managementF9 microkernel code reading part 4 memory management
F9 microkernel code reading part 4 memory management
 
Arm cm3 architecture_and_programmer_model
Arm cm3 architecture_and_programmer_modelArm cm3 architecture_and_programmer_model
Arm cm3 architecture_and_programmer_model
 
002079
002079002079
002079
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
 
ARM
ARM ARM
ARM
 
32- bit Microprocessor-Indtel 80386.pptx
32- bit Microprocessor-Indtel 80386.pptx32- bit Microprocessor-Indtel 80386.pptx
32- bit Microprocessor-Indtel 80386.pptx
 
Microcontroller1
Microcontroller1Microcontroller1
Microcontroller1
 
eMMC Embedded Multimedia Card overview
eMMC Embedded Multimedia Card overvieweMMC Embedded Multimedia Card overview
eMMC Embedded Multimedia Card overview
 
Protected mode memory addressing 8086
Protected mode memory addressing 8086Protected mode memory addressing 8086
Protected mode memory addressing 8086
 
I. Introduction to Microprocessor System.ppt
I. Introduction to Microprocessor System.pptI. Introduction to Microprocessor System.ppt
I. Introduction to Microprocessor System.ppt
 
PDT DC015 Chapter 2 Computer System 2017/2018 (i)
PDT DC015 Chapter 2 Computer System 2017/2018 (i)PDT DC015 Chapter 2 Computer System 2017/2018 (i)
PDT DC015 Chapter 2 Computer System 2017/2018 (i)
 
8085 interfacing with memory chips
8085 interfacing with memory chips8085 interfacing with memory chips
8085 interfacing with memory chips
 
E.s unit 4 and 5
E.s unit 4 and 5E.s unit 4 and 5
E.s unit 4 and 5
 
Microcontrollers by anax projects
Microcontrollers by anax projectsMicrocontrollers by anax projects
Microcontrollers by anax projects
 
introduction of microprocessor
introduction of microprocessorintroduction of microprocessor
introduction of microprocessor
 
Memory segmentations
Memory  segmentations Memory  segmentations
Memory segmentations
 
lb.pptx
lb.pptxlb.pptx
lb.pptx
 
05 basic io_operation_part01
05 basic io_operation_part0105 basic io_operation_part01
05 basic io_operation_part01
 
Ec 1303 microprocessor_its_applications
Ec 1303 microprocessor_its_applicationsEc 1303 microprocessor_its_applications
Ec 1303 microprocessor_its_applications
 

Recently uploaded

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 

Recently uploaded (20)

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 

Memory Protection Unit (MPU) Registers and Configuration

  • 2. ● The Memory Protection Unit (MPU) is a programmable unit that allows privileged software to define memory access permission ● It monitors transactions ● which can trigger a fault exception when an access violation is detected. ● The MPU programmers’ model allows the privileged software to define memory regions and assign memory access permission and memory attributes to each of them. ● It supports upto 16 regions
  • 3. ● The memory attributes define ordering and merging behaviour of the region ● In MPU mem manage fault address register(MMFAR) is there which provide information about the cause of the fault and address being accessed in the case of data faults ● If MMFAR is disabled or cannot be triggered because execution priority is high ● In MPU some regions are associate with secure and non- security state ● MPU configuration do not define access permissions and attributes for debug access
  • 4. Key features of the MPU:- ● The smallest size that can be programmed for an MPU region is 32 bytes. ● The maximum size of any MPU region is 4GB, but must be a multiple of 32 bytes. ● All regions must begin on a 32 byte aligned address. ● Regions have independent read/write access permissions for privileged and unprivileged code. ● The eXecure Never (XN) attribute enables separation of code and data regions Secure software can access a Non-secure MPU using an alias address (address 0xE002ED90)
  • 5. ● The regions are numbered 0 to 15 ● In addition, there is a region called the default region with an id of -1. All the 0-15 memory regions take priority over the default region. 4 Gbytes -> example of overlapping regions Region 0 Region 1 Region 4 Region 2 Region 3 Region 5
  • 6. ● the region 4 overlapping the regions ● 0 and 1. The region 5 is enclosed completely within the region 3 ● Since the priority is in an ascending order ● overlap regions (in orange) have the priority. ● So if the region 0 is writeable and the region 4 is not, an address falling in the overlap between 0 and 4 is not writeable.
  • 7. Memory model:- ● the processor has a fixed default memory map that provides up to 4 Gbytes of addressable memory ● The memory map and the programming of the MPU split the memory map into regions ● Each region has a defined memory type and memory attributs ● The memory type and attributes determine the behavior of accesses to the region.
  • 8. Vendor -specific memory (511Mbytes) Private peripheral bus (1.0Mbytes) External device (1.0Gbytes) External RAM (1.0Gbytes) Peripheral (0.5Gbytes) SRAM (0.5Gbytes) Code (0.5Gbytes)
  • 9. Memory type:- ● Memory types are divided into Normal Memory and Device Memory. 1) Normal memory:- ● It is used to access general instruction ● It allows to perform some memory access optimization such as access reordering and merging ● Normal memory can have several attributes that can be applied to it a) cacheability:- memory can be cacheable or non-cacheable b) Shareability:- normal memory can Shareable or non-shareable c) eXecute never:- memory can be marked as executable or execute never
  • 10. ● The cacheability 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 Shareability:- 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.
  • 11. Device Memory:- ● Device memory must be used for memory regions that cover peripherals control registers The Device memory type has several attributes:- • G or nG – Gathering or non-Gathering. Multiple accesses to a device can be merged into a single transaction except for operations with memory ordering semantics, for example, memory barrier instructions, load acquire/store release. • R or nR – Reordering or Non-reordering. • E or nE – Early Write Acknowledge (similar to bufferable).
  • 12. MPU registers :- ● The MPU registers are banked between Secure and Non-secure states ● The programmers’ model for Secure MPU and Non-secure MPU are the same, but the number of MPU regions for the two MPUs can be different. ● MPU registers are privileged access only (unprivileged accesses generate a fault exception) ● By default the MPU is disabled after reset. ● The memory type is encoded as an 8-bit field that is stored in one of the Memory Attribute Indirection Registers (MAIR). ● Each MAIR register has four 8-bit fields, allowing eight memory types to be defined at any one time.
  • 13. Register address NS address description MPU_TYPE 0xE000ED90 0xE002ED90 MPU Type Register MPU_CTRL 0xE000ED94 0xE002ED94 MPU control register MPU_RNR 0XE000ED98 0xE002ED98 MPU region number Register MPU_RBAR 0xE000ED9C 0xE002ED9C MPU Region Base Address register MPU_RLAR 0xE000EDA0 0xE002EDA0 MPU Region Base Limit register MPU_RBAR_A1 0xE000EDA4 0xE002EDA4 MPU Region Base Address register alias 1
  • 14. register Address NS Address Alias Description MPU_RBAR_A2 0xE000EDAC 0xE002EDAC MPU Region Base Address register alias 2 MPU_RBAR_A3 0xE000EDB4 0xE002EDB4 MPU Region Base Address Register Alias 3 MPU_RLAR_A1 0xE000EDA8 0xE002EDA8 MPU Region Limit Address Register Alias 1 MPU_RLAR_A2 0xE000EDB0 0xE002EDB0 MPU Region Limit Address Register Alias 2 MPU_RLAR_A3 0xE000EDA8 0xE002EDB8 MPU Region Limit Address Register Alias 3 MPU_MAIR0 0xE000EDC0 0xE002EDC0 MPU Memory Attribute Indirection Register 0 MPU_MAIR1 0xE000EDC4 0xE002EDC4 MPU Memory Attribute Indirection Register 1
  • 15. MPU_TYPE:- The MPU Type register indicates how many regions the MPU supports for the selected security state. This register is read only. [31:16]-> reserved [15:8] -> region [7:1] ->reserved [0] -> separate
  • 16. MPU_CTRL:- The MPU Control register provides various programmable bit fields for MPU enable and features. [31:3] -> reserved [2] ->Privileged background region enable [1] ->MPU Enable for HardFault and NMI(non-maskable) [0] ->MPU enable/disable
  • 17. MPU_RNR: The MPU Region Number Register selects the region that is accessed by the MPU_RBAR and MPU_RLAR [31:8] -> reserved [7:0] -> Region number. Selects and indicates the region that is accessed by the MPU_RBAR and MPU_RLAR.
  • 18. MPU_RBAR: The MPU Region Base Address Register defines the starting address of an MPU region and access permission [31:5] ->Starting address of MPU region address [4:3] ->Shareability for Normal memory [2:1] ->Access permissions [0] ->eXecute never attribute
  • 19. 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 [31:5] -> ending address of MPU region address. [4] -> reserved [3:1] ->Attribute Index. Select memory attributes from attribute sets in MPU_MAIR0 and MPU_MAIR [0] -> enable /disable the region
  • 20. MPU_RBAR_A1/2/3 and MPU_RLAR_A1/2/3:- An alias of MPU_RBAR register to allow faster programming of different MPU regions. The region number that is selected when using MPU_RBARn and MPU_RLARn is equal to (MPU_RNR[7:2]<<2) Condition When Accessing MPU Region accessed MPU_RNR=0 MPU_RBAR / MPU_RLAR 0 MPU_PNR=1 MPU_RBAR_A1 / MPU_RLAR_A1 1 MPU_PNR=4 MPU_RBAR / MPU_RLAR 4 MPU_PNR=5 MPU_RBAR_A1 / MPU_RLAR_A1 5 MPU_PNR=6 MPU_RBAR_A2 / MPU_RLAR_A2 6
  • 21. MPU_MAIR0, MPU_MAIR1:- The MPU Attribute Indirection Register 0 and 1 provide eight sets of 8-bit memory attributes, which can be referenced by AttrIndx in MPU_RLAR to determine the memory attribute for an MPU region.