mcuboot
mcuboot copied to clipboard
Add Cortex-R support
This PR adds support for Booting on a Cortex-R core. It has been tested with the following branch which also includes some instructions what Kconfig options need to be set: https://github.com/siemens/zephyr/tree/mika/ti/ti-am2434-native-boot
Thanks for the review. I addressed the changes in the last force-push and added a comment to the MPU
@nordicjm can you please take a look again? I changed the MPU code to be more readable via macros but if you insist I can also add a #include <zephyr/../../arch/arm/core/mpu/cortex_a_r/arm_mpu_internal.h> to use the internal Zephyr functions.
Also sorry but I didn't notice that I removed the Copyright notices for the small changes in the release note commit instead of the original commit while rebasing
First force-push is a capitalize first letter in the comment fix that I previously missed; second force-push are your suggestions.
Do you mean it's ok to add the internal header or the inline ASM to read/write coprocessor registers via the macros?
First force-push is a capitalize first letter in the comment fix that I previously missed; second force-push are your suggestions.
Do you mean it's ok to add the internal header or the inline ASM to read/write coprocessor registers via the macros?
PR is OK as-is, would be good to move from here to zephyr itself then just call from here but that is optional/nice to have not required
@m-braunschweig seemingly this branch has conflicts that must be resolved? Not sure what those are but can you check and fix?
@m-braunschweig seemingly this branch has conflicts that must be resolved? Not sure what those are but can you check and fix?
Resolved. Was due to the Copyright line in the main.c
Can we have explicate ifdefry
#ifdef CONFIG_CPU_CORTEX_R5for code for supporting Cortex-R in that patch. This would help wit maintenance and improve legibility of Cortex-R relevant code.
Yeah. Are you fine with me splitting the arm_cleanup.c into cleanup/arm_cortex_m.c and cleanup/arm_cortex_r.c with both providing the same functions and only one being compiled via CMake? For the main.c I don't have an idea currently on how to effectivly remove/decrease the #ifdefs
@m-braunschweig I actually men rather using #ifdef CONFIG_CPU_CORTEX_R for code dedicated for Cortex-R than #ifndef CONFIG_CPU_CORTEX_M. If you want to go with separate files/functions - that will help wit clean code as well.
Updated it. One problem is that we can't use CONFIG_CPU_CORTEX_R since that Kconfig option doesn't exist in Zephyr. For now I only use CONFIG_CPU_CORTEX_R5 since that's the exact core I'm using to test the code.
Edit: I just saw CONFIG_ARMV7_R exists. I will update it now
Updated it to use ARMV7_R and also the comment for Cortex-R to be more accurate
I will try to remember to do the changes when submitting a PR that provides default configs for the AM243x LaunchPad (which isn't supported by upstream Zephyr yet)