Skip to content

Commit

Permalink
soc: k64f MPU configured to always allow USB
Browse files Browse the repository at this point in the history
Because NXP MPU's regions are dynamically enabled/disabled, USB
device's access maybe restricted when switching out of a task.
Background DMA transfers to/from RAM may happen during MPU region
reconfiguration or core idling.
Enabled USB (Kinetis MPU Master 4) to always have access to RAM address
space.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
  • Loading branch information
agansari authored and ioannisg committed Jul 30, 2019
1 parent d0dd1fb commit 11d8f1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions include/arch/arm/cortex_m/mpu/nxp_mpu.h
Expand Up @@ -118,11 +118,12 @@
#define REGION_USER_RO_ATTR {(MPU_REGION_READ | \ #define REGION_USER_RO_ATTR {(MPU_REGION_READ | \
MPU_REGION_SU)} MPU_REGION_SU)}


/* ENET device (Master 3) will not be able to access RAM when /* ENET (Master 3) and USB (Master 4) devices will not be able
ram region is dynamically disabled in NXP MPU. to access RAM when the region is dynamically disabled in NXP MPU.
DEBUGGER (Master 1) can't be disabled in Region 0. */ DEBUGGER (Master 1) can't be disabled in Region 0. */
#define REGION_DEBUGGER_AND_DEVICE_ATTR {((MPU_REGION_SU) | \ #define REGION_DEBUGGER_AND_DEVICE_ATTR {((MPU_REGION_SU) | \
((UM_READ | UM_WRITE) << BM3_UM_SHIFT))} ((UM_READ | UM_WRITE) << BM3_UM_SHIFT) | \
(BM4_PERMISSIONS))}


#define REGION_DEBUG_ATTR {MPU_REGION_SU} #define REGION_DEBUG_ATTR {MPU_REGION_SU}


Expand Down
4 changes: 2 additions & 2 deletions soc/arm/nxp_kinetis/k6x/nxp_mpu_regions.c
Expand Up @@ -8,8 +8,8 @@


static const struct nxp_mpu_region mpu_regions[] = { static const struct nxp_mpu_region mpu_regions[] = {
/* Region 0 */ /* Region 0 */
/* Debugger access can't be disabled; ENET devices will not be able to /* Debugger access can't be disabled; ENET and USB devices will not be able
* access RAM when it's region is dynamically disabled in NXP MPU. * to access RAM when their regions are dynamically disabled in NXP MPU.
*/ */
MPU_REGION_ENTRY("DEBUGGER_0", MPU_REGION_ENTRY("DEBUGGER_0",
0, 0,
Expand Down

0 comments on commit 11d8f1a

Please sign in to comment.