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

sw: Support bare-metal SMP in software stack #85

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

emanueleparisi
Copy link

@emanueleparisi emanueleparisi commented Oct 31, 2023

This PR contains some modification to the Cheshire software stack to ease bare-metal SMP.
The following modifications are pushed:

  • move smp_pause and smp_resume to the bootrom crt0.S file, renaming them bootrom_smp_pause and bootrom_smp_resume, to support a future implementation in C of such functionalities.
  • Modify the common crt0.S so that each hart is assigned a private stack memory region and make sure every hart initializes its SP, GP, MTVEC and FPU.
  • Reimplemente smp_pause and smp_resume in C, in the file smp.c, and add a SMP Hello World test application.
  • Patch the ZSL so that smp_pause is called on entry and smp_resume is called before invoking the next stage.

Notice that while commit 8a65d72 modifies cheshire_bootrom.S, the changes do not affect the generated .sv file, and should be hardware-neutral. I double-checked that by computing the SHA256 digest of the cheshire_bootrom.sv file in the main branch, and at commit 53d71de after regenerating it by running make chs-bootrom-all with the active toolchain pointing to riscv64-unknown-elf-gcc-12.2.0. In both cases, I obtain 6ccbbc2d958008b1d9101100bcef9dd934545623d94ed329794d37bb47919606

@emanueleparisi emanueleparisi marked this pull request as ready for review November 21, 2023 22:29
@paulsc96 paulsc96 marked this pull request as draft November 22, 2023 16:19
@paulsc96 paulsc96 changed the title [Draft] Support bare-metal SMP in Cheshire software stack sw: Support bare-metal SMP in software stack Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant