-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Add support for Cortex-r52 #42220
Add support for Cortex-r52 #42220
Conversation
10f1d34
to
d3786a4
Compare
Hello @julien-massot, thanks for this draft. Are you planning to continue the work started on this draft and make a pr? I'm interested on Cortex-R52 support. |
Yes thats the plan, this draft is functionnal so that you can use it and have the Gic v3 and arm arch timer working, but open many questions regarding integration. So I'm waiting for potential inputs on the right direction to take and will submit a PR. This is a requirement to support Renesas R-Car Gen4. |
@julien-massot this is good enough to be moved to PR. Devs usually do not take a look at drafts. |
1f4c08e
to
244824f
Compare
244824f
to
78c782f
Compare
Just as a FYI, this will require an update once #43040 is merged. |
701be70
to
9802a2f
Compare
Cortex-R52 is an ARMv8-R processor with AArch32 profile. Signed-off-by: Julien Massot <julien.massot@iot.bzh>
The ARMv8-R processors always boot into Hyp mode (EL2) To enter EL1: Program the HACTLR register because it defaults to only allowing EL2 accesses. HACTLR controls whether EL1 can access memory region registers and CPUACTLR. Program the SPSR before entering EL1. Other registers default to allowing accesses at EL1 from reset. Set VBAR to the correct location for the vector table. Set ELR to point to the entry point of the EL1 code and call ERET. Signed-off-by: Julien Massot <julien.massot@iot.bzh>
lib_helpers makes easier to access cp15 based registers, it is inspired from arm64 lib_helpers but use MRC instead of MRS and use cp15 register. Definitions on how to access system registers for AArch32 Armv8 processors can be found in the document: Arm Architecture Reference Manual Armv8, for Armv8-A architecture profile Signed-off-by: Julien Massot <julien.massot@iot.bzh>
This is mostly a copy of the existing arm64 implementation, at the difference that the AArch32 registers do not mention the execution level. Signed-off-by: Julien Massot <julien.massot@iot.bzh>
These definitions are required to be able to use GICv3 interrupts controller on an ARMv8 AArch32 processor. Signed-off-by: Julien Massot <julien.massot@iot.bzh>
This is required by drivers which query the current cpu, at this moment there is no arm aarch32 that use smp, so it seems safe to consider that the current cpu is always the first one. This patch enable the use of the GICv3 driver on ARM 32bits cpu. Signed-off-by: Julien Massot <julien.massot@iot.bzh>
9802a2f
to
1c4d5f9
Compare
@carlocaione @povergoing @microbuilder Any comments on this PR ? |
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.
LGTM :)
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.
As Julien said, we tested this patchset internally for some time now on Renesas V3U SoC CR52 core.
We are able to run all basic Zephyr samples and every basic features seems to work fine.
Thanks Julien.
@julien-massot How can I test this? There's no QEMU support available for the Cortex-r52, and I don't see a board in upstream Zephyr that I can do a build test with (please correct me if I'm wrong)? |
@microbuilder In order to do build/run testing I'm using this branch |
@julien-massot I was going to ask the same question about testing, but then I saw your response above. About FVP, I am using https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms and I think they are free of charge.
I built (west build -b fvp_baser_aemv8r samples/synchronization). And then I execute this :- ayankuma@xcbayankuma41x:/scratch/ayankuma/zephyr/zephyrproject/zephyr$ west build -t run I do not get any prints. Please let me know what I am missing. My aim is to build and run an application for Cortex R52 FVP. |
It's hard to approve without providing something to at least do build tests against, but Zephyr actually has support for using FVP for emulation already. See, for example:
Some FVP images are free, such as the MPS3 AN547 (Corestone 300), but the Did you put together a BSP for the R52 FVP already? If so, could that be provided in a separate PR? I believe there are evaluation licenses, but the FVP is something I could probably get a license for to test, at least, and may be useful for CI. |
No, It surely does not work. As I said, this PR may be the initial support of R52, you cannot use |
Actually,
|
It's better to provide something to do build tests
Thank you so much @povergoing, looks like we have something to test this support ! -- Build files have been written to: /home/julien/src/zephyr-new/fvp32-hello [34/40] Linking C executable zephyr/zephyr_pre1.elf [39/40] Linking C executable zephyr/zephyr.elf |
In that case please add a new FVP board for this. |
superseded by #43581 which also bring FVP platform. |
This PR introduces ARMv8-R AArch32 profile and adds support for the Cortex-R52.
Cortex-R52 processor is a mid-performance for use in automotive and industrial applications.
This PR adds definition for Cortex R52 and AArch32 ARMv8r, defines cp15 registers access
based on what is done on AArch64 (lib_helpers) that allows to reuse GICv3 driver and arm64 timer driver.
This Cortex-R52 support has been firstly tested with the FVP platforms then on Renesas V3U SoC.