-
Couldn't load subscription status.
- Fork 8.1k
arm: soc: nxp k6x: MPU: add Bus Master 3 User Mode access bits #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh > 80 chars. Fixing. (same below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MaureenHelm Thank you for the clarification. I'll fix this up along with @galak comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice!
…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]