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

ARM32 / ARM64 separation #32741

Closed
carlocaione opened this issue Mar 1, 2021 · 18 comments · Fixed by #33737
Closed

ARM32 / ARM64 separation #32741

carlocaione opened this issue Mar 1, 2021 · 18 comments · Fixed by #33737
Assignees
Labels
area: ARM ARM (32-bit) Architecture LTS Long term release branch related RFC Request For Comments: want input from the community
Milestone

Comments

@carlocaione
Copy link
Collaborator

ARM32 and ARM64 (AArch64) currently share the same code space: arch/arm,include/arch/arm, soc/arm and boards/arm.

This was done at the beginning of the time because the hope was that the two architectures would have shared more code. Reality is that ARM32 and AArch64 are two different architectures which shares almost nothing. The only thing they share is the GIC driver that is hosted outside of arch/arm.

So my proposal is that we should split the two and treat them as two different architectures. We could start separating them in soc/{arm,arm64} and boards/{arm,arm64} but I think that we should push this forward and moving to have a separate arch/arm64 directory as well.

Any thoughts?

@carlocaione carlocaione added the RFC Request For Comments: want input from the community label Mar 1, 2021
@carlocaione carlocaione self-assigned this Mar 1, 2021
@carlocaione
Copy link
Collaborator Author

carlocaione commented Mar 1, 2021

tagging the arm / arm64 people @ioannisg @npitre @stephanosio @galak @nashif @jharris-intel @sandeepbrcm @Abhishek-brcm

@carlocaione carlocaione added area: ARM ARM (32-bit) Architecture area: ARM_64 labels Mar 1, 2021
@ioannisg
Copy link
Member

ioannisg commented Mar 1, 2021

I am in favor of this separation. True that AARCH64 has little in common with other ARM 32-bit variants.

@carlocaione do the ARCHes share common build configuration code (e.g. cmake files, compiler options, etc)?

@carlocaione
Copy link
Collaborator Author

@carlocaione do the ARCHes share common build configuration code (e.g. cmake files, compiler options, etc)?

Nope, there is almost no overlap at all.

@npitre
Copy link
Collaborator

npitre commented Mar 1, 2021

+1

@jharris-intel
Copy link
Contributor

Any thoughts?

There are a few system registers that are (almost) shared between AArch32 and AArch64 (E.g. the ARMv8 generic timer), and they happen to share a memory model (...mostly), but yes, they have very little in common.

My one concern here is shared board/soc setup code - but I presume that there is somewhere I could put board setup code for board X that is shared between AArch32 and AArch64?

@npitre
Copy link
Collaborator

npitre commented Mar 1, 2021 via email

@jharris-intel
Copy link
Contributor

Do you have an actual example in mind?

Yes, but proprietary unfortunately. However, it fits into this:

extra SOC setup is typically done as part of the driver that handles part of that SOC, and that code lives in a common location
already.

so no worries.

@galak
Copy link
Collaborator

galak commented Mar 2, 2021

I have no issue with making this split/change.

@ioannisg
Copy link
Member

ioannisg commented Mar 2, 2021

Then I guess we could proceed with the idea,

Adding @carlescufi @MaureenHelm @erwango, to raise awareness across cortex-m vendors.

@MaureenHelm
Copy link
Member

My one concern here is shared board/soc setup code - but I presume that there is somewhere I could put board setup code for board X that is shared between AArch32 and AArch64?

I wonder about this too, which gets into a more general question about how we support multicore SoCs with different architectures. Examples are i.MX RT600 (CM33+Xtensa), i.MX8MM (CA53+CM4), and Vegaboard (2xRISC-V + 2xCortexM). I've wondered if we should organize boards and SoCs by vendor instead of architecture.

cc: @MrVan

@carlocaione
Copy link
Collaborator Author

I wonder about this too, which gets into a more general question about how we support multicore SoCs with different architectures.

Why is this a problem? In this case you end up having the AArch64 core under {soc,boards}/arm64 and the other core under {soc,boards}/arm. After all Zephyr is usually running only on one of the two cores.

The only real problem I see is for the DTS files that sometimes share a common DTSI. In that case I think we can allow a bit of duplication between dts/arm64 and dts/arm.

@MrVan
Copy link
Collaborator

MrVan commented Mar 3, 2021

I wonder about this too, which gets into a more general question about how we support multicore SoCs with different architectures.

Why is this a problem? In this case you end up having the AArch64 core under {soc,boards}/arm64 and the other core under {soc,boards}/arm. After all Zephyr is usually running only on one of the two cores.

The only real problem I see is for the DTS files that sometimes share a common DTSI. In that case I think we can allow a bit of duplication between dts/arm64 and dts/arm.

Could we directly import device tree from Linux Kernel for arm64?

@MrVan
Copy link
Collaborator

MrVan commented Mar 3, 2021

My one concern here is shared board/soc setup code - but I presume that there is somewhere I could put board setup code for board X that is shared between AArch32 and AArch64?

I wonder about this too, which gets into a more general question about how we support multicore SoCs with different architectures. Examples are i.MX RT600 (CM33+Xtensa), i.MX8MM (CA53+CM4), and Vegaboard (2xRISC-V + 2xCortexM). I've wondered if we should organize boards and SoCs by vendor instead of architecture.

For i.MX8MM, I think it is ok to split A53 and M4. For CPU core, there is almost nothing shared, they only share some drivers.

@erwango
Copy link
Member

erwango commented Mar 3, 2021

Why is this a problem? In this case you end up having the AArch64 core under {soc,boards}/arm64 and the other core under {soc,boards}/arm. After all Zephyr is usually running only on one of the two cores.

Having both targets under a same directory is useful to share Kconfig and dts settings and hence avoid specific configuration issues, specifically about shared resources.
This being said, unless I missed something, I don't see the direct need of modifying boards/ organisation due to a modification under arch/.

@carlocaione
Copy link
Collaborator Author

carlocaione commented Mar 3, 2021

Having both targets under a same directory is useful to share Kconfig and dts settings and hence avoid specific configuration issues, specifically about shared resources.

I can see the problem with DTS, with Kconfig definitely less assuming that we are talking about cores with different architectures. But also in that case I think we can survive with a bit of duplication.

This being said, unless I missed something, I don't see the direct need of modifying boards/ organisation due to a modification under arch/.

Because I'm planning to also split boards/arm in boards/{arm,arm64}, same for soc, otherwise it gets confusing. Also given that arm64 will be a new architecture I think having arm and arm64 in a common directory (but being now two different arch) can confuse twister and other tools.

@erwango
Copy link
Member

erwango commented Mar 3, 2021

[..] with Kconfig definitely less assuming that we are talking about cores with different architecture [...]

I don't think having different architecture totally exclude the possibility of having Kconfig options that could impact both cores (specifically in resource sharing domain). Anyway, this is only a configuration coherency problematic and not a blocker at all.

Because I'm planning to also split boards/arm in boards/{arm,arm64}, same for soc, otherwise it gets confusing. Also given that arm64 will be a new architecture I think having arm and arm64 in a common directory (but being now two different arch) can confuse twister and other tools.

Makes sense, txs.

@carlocaione
Copy link
Collaborator Author

update: this is currently on hold waiting for all the userspace work to be merged.

@ioannisg
Copy link
Member

update: this is currently on hold waiting for all the userspace work to be merged.

That's ok.

@galak galak added this to the v2.6.0 milestone Mar 17, 2021
@galak galak added the LTS Long term release branch related label Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture LTS Long term release branch related RFC Request For Comments: want input from the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants