-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Cortex-R Improvement #20594
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
Comments
cc @bbolen @ioannisg @carlocaione @bbolen If, by any chance, you are working on any of the above already, please let me know. |
@stephanosio , I'm planning to start work on Armv7-R MPU and hope to push it into the mainline in the next couple of weeks. Let me know if someone is already working on this, so I don't end up duplicating the effort.. |
@bwasim Nobody is working on/planning to upstream ARMv7-R MPU support at the moment as far as I know, though it is possible that Lexmark guys already have it (see https://lists.zephyrproject.org/g/devel/message/6695). p.s. By the way, ARMv7-R MPU and ARMv7-M MPU are very similar (well, they are both PMSAv7 implementations), so the focus should be on trying to refactor/reuse the Cortex-M MPU code. We should not have two separate implementations of the same thing ... |
Yes, we do have something working but it is not in merge worthy shape right now. If you can wait until Monday, I can send you a patch of what we have in order to take a look. |
That would be great, Thanks.. |
The top three commits on https://github.com/bbolen/zephyr/commits/cortex_r_mpu are what we have. This is based on v2.2.0. We started working on this on 1.14 and merging has made just grabbing patches difficult so I had to just start clean on top of v2.2. I think I got everything, but if you have problems, let me know. |
@bbolen I used your commits to enable MPU in a Cortex-R5F based board. The MPU requires power-of-two alignment (Reference: ARM Cortex-R5 TRM r1p1 Table 4.34: Region Size) but when I enable Have you seen anything similar or can you please give a hint as to where should I look to debug this problem? If I make the global data read-only (by adding Thanks in advance! |
Sorry I haven't responded until now. We are working to get our MPU code rebased on v2.3 and get it cleaned up for upstreaming consideration. With respect to the problem you mention, I have seen something similar. I got around the problem by using "DISCARD" on the *.got section in the cortex R linker script. The problem is that the VMA and LMA drift apart, but I don't know what the correct thing to do is. |
I tried to figure out what the problem was and found the following: In the case of power-of-two alignment, there is extra padding added before the "datas" section due to which the addresses of the initialized global (rw) data change but the code still references the old address; without the padding offset. In this image, the date = 26 is stored in a (rw) global variable; which should go to the "datas" section. With and wo ^2 alignment, the code references the variable at the same address but in case of ^2 alignment, the address contains the padded bytes and the correct value of the variable is present at a different location (highlighted in small red rectangle in RHS image). I was able to work-around the issue using the following patch:
I am not exactly sure how this patch resolves the problem; I was experimenting with the linker file to see if I could get the code to generate correct addresses of global vars with ^2 alignment and making this change gave correct results. I also had to make changes to the syscall trampoline code in the commits you referenced; to make it comply with the Zephyr v2.3 Thank you for posting these patches. It would have taken me much longer to get this done on my own. |
Closing since this is more or less complete. Any other remaining issues, if any, should be tracked in separate issues. |
This is an epic for ARM Cortex-R port improvement, in preparation for the TI Hercules SoC support in #19644.
qemu_cortex_r5
test coverage (make CI test Cortex-R port)xilinx_zynqmp
SoC definition (RPU and APU should be separate)arm-generic-fdt
machine type (support RPU PL390 GIC emulation)Implement tickless capability forxlnx_psttc_timer
(forxilinx_zynqmp
)xilinx_zynqmp
(in arch code)The text was updated successfully, but these errors were encountered: