arm: soc: nxp k6x: MPU: add Bus Master 3 User Mode access bits#261
arm: soc: nxp k6x: MPU: add Bus Master 3 User Mode access bits#261MaureenHelm merged 2 commits intozephyrproject-rtos:armfrom mike-scott:review-arm
Conversation
There was a problem hiding this comment.
Ugh > 80 chars. Fixing. (same below)
There was a problem hiding this comment.
We should clean up the magic # here.
Seems like you are setting M3UM field, if so should probably be 0x7 << 18, also why is execute (X) needed?
There was a problem hiding this comment.
Execute isn't needed. Mike misunderstood my fix a little bit, my fault for not being completely clear. I suggested that he add bits 20,19,18 to the rwx macros, but I should have said respectively. In other words, add bit 20 to the read macro, bit 19 to the write macro, and bit 18 to the exec macro.
Regarding the magic numbers, there are additional helper macros in MK64F12.h for the sysmpu register fields. You can use SYSMPU_WORD_M3UM(x)
There was a problem hiding this comment.
@MaureenHelm Thank you for the clarification. I'll fix this up along with @galak comments.
galak
left a comment
There was a problem hiding this comment.
Since M3UM is a field, we should shift the whole field value at once.
Also would be nice to add some #defines for:
NXP_MPU_UX
NXP_MPU_UR
NXP_MPU_UW
|
Hi all, also reported this issue on IRC previously (czrweb) and @mike-scott asked to test this fix, and reporting that it works (web-server example runs now). |
There was a problem hiding this comment.
Execute isn't needed. Mike misunderstood my fix a little bit, my fault for not being completely clear. I suggested that he add bits 20,19,18 to the rwx macros, but I should have said respectively. In other words, add bit 20 to the read macro, bit 19 to the write macro, and bit 18 to the exec macro.
Regarding the magic numbers, there are additional helper macros in MK64F12.h for the sysmpu register fields. You can use SYSMPU_WORD_M3UM(x)
|
Also tested using ping to echo_server sample. |
Let's clarify what bits are being set by removing magic numbers in the MPU READ/WRITE/EXECUTE User Mode and Supervisor Mode defines. Signed-off-by: Michael Scott <[email protected]>
Ethernet on K64F is connected via Logical Bus Master 3. Section 19.3.8 of K64F reference manual establishes bits 20-18 (M3UM) on page 427 as "Bus Master 3 User Mode Access Control". To fix RWX user mode access via Bus Master 3 when MPU is enabled, we need to add these bits to the MPU region descriptors. This fixes ETH0 on K64F when MPU is enabled. Fix recommended by Maureen Helm <[email protected]> Signed-off-by: Michael Scott <[email protected]>
|
Updated this patch into 2 patches:
|
…rtos#261) Signed-off-by: Geoff Gustafson <[email protected]>
Ethernet on K64F is connected via Logical Bus Master 3.
Section 19.3.8 of K64F reference manual establishes bits 20-18
(M3UM) on page 427 as "Bus Master 3 User Mode Access Control".
To fix RW via Bus Master 3 when MPU is enabled, we need to add
these bits to the MPU region descriptors.
This fixes ETH0 on K64F when MPU is enabled.
Fix recommended by Maureen Helm [email protected]
Signed-off-by: Michael Scott [email protected]