This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
We're using HALCoGen 4.00 and would like to set up Region 1 as a Background Region instead of using the Default Background Region as described in the ARM DDI 0406C.b, Section B5.1.4:
"If a system requires a background region with a different set of memory attributes, region 0 can be programmed as a 4GB region with the required attributes. Because region 0 has the lowest priority this region then acts as a background region."
HALCoGen 4.00 has Region 1 set up as the full 4GB address range, but it has all Sub-Regions disabled.
1) To make Region 0 as the Background Region, I assume we'll need to uncheck the disables for all Sub-Regions and uncheck Enable MPU Background Region. Is this correct?
2) What is the purpose of defining a Region and disabling all Sub-Regions?
Thanks, Charlie Johnston
Hi Charles,
This device has total 12 regions. HalCoGen uses region 1 for he lowest priority and region 12 for the highest priority. Each region can be split into eight equal sized non-overlapping subregions. An access to a memory address in a disabled subregion does not use the attributes and permissions defined for that region. Instead, it uses the attributes and permissions of a lower priority region or generates a background fault if no other regions overlap at that address. This enables increased protection and memory attribute granularity.
Regards,
QJ
Hi QJ,
Thanks for responding so quickly.
" Instead, it uses the attributes and permissions of a lower priority region or generates a background fault if no other regions overlap at that address."
Does this imply that a disabled sub-region in the lowest priority region would revert to a background fault?
Also, what is the purpose of defining a Region and disabling all Sub-Regions?
Thanks, Charlie Johnston
Charles Johnston said:Does this imply that a disabled sub-region in the lowest priority region would revert to a background fault?
Yes. You fall through the lowest priority in this case and you are into the default mapping or just a fault.
Charles Johnston said:Also, what is the purpose of defining a Region and disabling all Sub-Regions?
We might be doing this in the case where the higher priority region is restricted say to privilege mode, but it otherwise overlaps a lower priority region.
If you see this in one of our examples (like default MPU settings in HalCoGen) then think of it this way. The person trying to get 'blinky' running out of the box doesn't want to get trapped by the MPU. But at the same time we want to provide an example of how you might configure the MPU with some regions privilege only and some open. So these privilege only with all subregions disabled can be thought of as placeholders for when you get past 'blinky' and want to start turning on the MPU.
Honestly though the settings in HalCoGen are not magic - just our best stab at how to use the MPU in a very generic way. You should feel comfortable making changes to these settings for your specific application requirements. For example if you are not using EMIF then by all means you can reuse MPU regions for something else...