Skip to content
Commit ec424b7a authored by Tomasz Gorochowik's avatar Tomasz Gorochowik Committed by Kumar Gala
Browse files

arch: arm: mpu: nxp: disable mpu before reprogramming



This is needed, because an interrupt can happen after the main/static
MPU region is disabled and before it is re-enabled.

This region gets implicitly disabled inside the _region_init call, when
its configuration registers change:

  SYSMPU->WORD[index][0] = region_base;
  SYSMPU->WORD[index][1] = region_end;
  SYSMPU->WORD[index][2] = region_attr;
  SYSMPU->WORD[index][3] = SYSMPU_WORD_VLD_MASK;

The TRM says this about the WORD0, WORD1 and WORD2 registers:

  Writes to this register clear the region descriptor’s valid bit
  (RGDn_WORD3[VLD]).

And thus if an interrupt happens after writing to WORD0 and before
writing VLD to WORD3 again, the code executes with enabled and yet
misconfigured MPU.

Fixes #13482

Signed-off-by: default avatarTomasz Gorochowik <tgorochowik@antmicro.com>
parent b0c71afc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment