Skip to content
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 ARMv8-R AArch32 FVP platform #43581

Merged
merged 9 commits into from
Mar 11, 2022

Conversation

julien-massot
Copy link
Collaborator

@julien-massot julien-massot commented Mar 9, 2022

This PR helps to test the Cortex-r52 support provided by #42220.

The fvp_baser_armv8r_aarch32 board is mostly a copy of the
fvp_baser_armv8r present in arm64 bu select the CORTEX_R52 cpu.

Documentation has not been imported since it's the same than fvp_baser_armv8r,
also we rely on the arm64/fvp-aemv8r/fvp-aemv8r.dtsi which can be odd for an arm32
based board.
Tested with FVP_Base_AEMv8R_11.17_21

*** Booting Zephyr OS build zephyr-v3.0.0-644-g08e4612ae972 ***
Hello World! fvp_baser_aemv8r_aarch32

@github-actions github-actions bot added area: API Changes to public APIs area: ARM ARM (32-bit) Architecture area: Boards area: Build System area: Devicetree area: Devicetree Binding PR modifies or adds a Device Tree binding labels Mar 9, 2022
@julien-massot julien-massot marked this pull request as draft March 9, 2022 09:14
@julien-massot julien-massot force-pushed the r52-fvp branch 2 times, most recently from 92dd97b to c3452c5 Compare March 9, 2022 09:23
@microbuilder microbuilder self-requested a review March 9, 2022 09:35
@julien-massot julien-massot marked this pull request as ready for review March 9, 2022 09:43
@julien-massot
Copy link
Collaborator Author

looks like there is one missing ifdef in irq_manage

@julien-massot
Copy link
Collaborator Author

looks like there is one missing ifdef in irq_manage

solved

include/arch/arm/aarch32/cortex_a_r/cpu.h Outdated Show resolved Hide resolved
arch/arm/core/aarch32/cortex_a_r/reset.S Outdated Show resolved Hide resolved
Copy link
Member

@povergoing povergoing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Julien Massot added 7 commits March 10, 2022 16:00
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>
This is mostly the same than the aarch64 one, excepted that we
force the armv8r fvp to run in aarch32 profile. So that we can simulate
the Cortex-R52.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
@julien-massot
Copy link
Collaborator Author

julien-massot commented Mar 10, 2022

Would you like to provide the documents for the fvp_baser_aemv8r_aarch32 please? refs:

  1. https://github.com/zephyrproject-rtos/zephyr/tree/main/boards/arm64/fvp_baser_aemv8r/doc
  2. https://github.com/zephyrproject-rtos/zephyr/tree/main/boards/arm64/fvp_base_revc_2xaemv8a/doc

I just add the documents for the fvp_baser_aemv8r_aarch32, it is mostly based on the two documents
you mentioned. I didn't test the debugging method through ARM DS, but it used to work when I was using
my trial license.

Julien Massot added 2 commits March 10, 2022 16:13
This board reuse the work did to simulate an
ARMv8-R AArch64 profile core using the FVP platform,
but use the AArch32 profile.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
On 32bit compiler the BIT_MASK(32) generate a warning,
after discussion on zephyrproject-rtos#42226 and zephyrproject-rtos#42163, advise was to use
BIT64_MASK instead.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
@povergoing
Copy link
Member

Would you like to provide the documents for the fvp_baser_aemv8r_aarch32 please? refs:

  1. https://github.com/zephyrproject-rtos/zephyr/tree/main/boards/arm64/fvp_baser_aemv8r/doc
  2. https://github.com/zephyrproject-rtos/zephyr/tree/main/boards/arm64/fvp_base_revc_2xaemv8a/doc

I just add the documents for the fvp_baser_aemv8r_aarch32, it is mostly based on the two documents you mentioned. I didn't test the debugging method through ARM DS, but it used to work when I was using my trial license.

No problem, no need to describe ARM DS.

@carlescufi carlescufi merged commit 03dffa5 into zephyrproject-rtos:main Mar 11, 2022
@julien-massot julien-massot deleted the r52-fvp branch March 23, 2022 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants