Enabling Cache in MQX

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Enabling Cache in MQX

Jump to solution
1,445 Views
ioseph_martinez
NXP Employee
NXP Employee

Hi, I have a couple of questions regarding cache enabling in MQX.

what exaclty _mmu_vinit does? on Vybrid we have this call:

_mmu_vinit(PSP_PAGE_TABLE_SECTION_SIZE(PSP_PAGE_TABLE_SECTION_SIZE_1MB) | PSP_PAGE_DESCR(PSP_PAGE_DESCR_ACCESS_RW_ALL) | PSP_PAGE_TYPE(PSP_PAGE_TYPE_STRONG_ORDER), (pointer)L1PageTable);

We have the following attribute: PSP_PAGE_TYPE_STRONG_ORDER. I don't understand to what memory page/region that attribute is applied? to all subsequent regions added by _mmu_add_vregion? ARM documentation says strongly ordereded memory won't be cached so my doubt is if we need to remove this parameter if we want to enable cache on Vybrid.

A user of Vybrid simply replaced PSP_PAGE_TYPE_CACHE_NON by PSP_PAGE_TYPE_CACHE_WBNWA and it worked (performances was improved meaning the cache was enabled). The question is, what risks or things could be affected by this change if we are using PSP_PAGE_TYPE_STRONG_ORDER

Thanks,

Ioseph

(alejandrolozano I know you are looking at some of this but I want to have this visible for someone bumping to the same problem, even on a different controller)

1 Solution
609 Views
BielikM
Contributor III

Hi Ioseph,

_mmu_init(...) just fill a MMU table with default entries before MMU is enabled. Strong order memory  type should be used for some regions. After MMU table is preinitialized by default conditions you can use _mmu_add_vregion(...) function to create region with different conditions. This function only changes MMU entries in the same table). By this function you can specify your cached region(DDR for example). Now we are supporting only 1MB granularity for region(You can not create region smaller than 1MB). In 4.0.2 release of MQX also 4kB granularity will be available.

Function _mmu_enable(...) turn MMU on, but you can change your regions freely in your application too. Should works.

Martin

View solution in original post

0 Kudos
1 Reply
610 Views
BielikM
Contributor III

Hi Ioseph,

_mmu_init(...) just fill a MMU table with default entries before MMU is enabled. Strong order memory  type should be used for some regions. After MMU table is preinitialized by default conditions you can use _mmu_add_vregion(...) function to create region with different conditions. This function only changes MMU entries in the same table). By this function you can specify your cached region(DDR for example). Now we are supporting only 1MB granularity for region(You can not create region smaller than 1MB). In 4.0.2 release of MQX also 4kB granularity will be available.

Function _mmu_enable(...) turn MMU on, but you can change your regions freely in your application too. Should works.

Martin

0 Kudos