Skip to content

Add GIC and SMP examples to the Xilinx Zynq-A9 - #207

Merged
jonathanpallant merged 3 commits into
rust-embedded:mainfrom
sriramster:xilinx-a9-smp-example
Jul 25, 2026
Merged

Add GIC and SMP examples to the Xilinx Zynq-A9#207
jonathanpallant merged 3 commits into
rust-embedded:mainfrom
sriramster:xilinx-a9-smp-example

Conversation

@sriramster

Copy link
Copy Markdown

xlinx-zynq-a9 example to demonstrate the SMP ability. The enable SMP we develop the GIC, the GIC implementation is derived from arm_gic::v2 which is a superset of v1 & v2 together as defined here, https://developer.arm.com/documentation/198123/0302/What-is-a-Generic-Interrupt-Controller-

  • Add building an for the
    memory-mapped GIC. PERIPHBASE is hardcoded to 0xF8F0_0000 (fixed for
    this SoC) rather than read from CBAR, because
    issues the Cortex-R52 CBAR encoding, which is undefined on the A9.
  • The example runs its SGI in Group 0: on this GIC (which reports the
    Security Extensions) only enables Group 0 on the CPU
    interface, so it also enables Group 0 in the Distributor and uses that
    group for configure/ack/EOI.
  • The SMP example boots the second core and checks atomics and a cross-core critical section. Each core enables its own MMU.

@sriramster

Copy link
Copy Markdown
Author

@thejpster the PR depends #205 .

Comment thread examples/xilinx-zynq-a9/src/lib.rs Outdated

@thejpster thejpster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you need a toolchain file to get the rustup target installed?

@sriramster

Copy link
Copy Markdown
Author

Did you mean, I don't need a toolchain inside the examples? I see that is how the other examples are written. The work with the root toolchain file. Let me remove the toolchain file and re-run the local tests once.

@sriramster

Copy link
Copy Markdown
Author

Done, removed the example specific toolchain file. The PR depends on 205 that is the CI failures, as I built it ontop of 205 and things work there.

@thejpster

Copy link
Copy Markdown
Contributor

I think your SMP test failed because both cores printed simultaneously. To help the tests be more deterministic it's probably best to have the cores only run one at a time

Core 1 Core 2
Boots Parked
Unparks Core 2 Parked
Waits Boots
Waits Pings Core 1
Does stuff Waits
Pings Core 2 Waits
Waits Does stuff
Waits Pings Core 1
Exits Exits

@thejpster

Copy link
Copy Markdown
Contributor

And feel free to rebase on #205 if you require it

@sriramster
sriramster force-pushed the xilinx-a9-smp-example branch from e446283 to 24c04e6 Compare July 17, 2026 16:59
@sriramster

Copy link
Copy Markdown
Author

I have rebased to #205 all checks pass. @thejpster please have a look.

@thejpster

Copy link
Copy Markdown
Contributor

LGTM but someone else needs to merge #205 first

Sriram Raghunathan added 3 commits July 25, 2026 09:10
Extending the xilinx-zynq-a9 example to demonstrate the SMP ability.
The enable SMP we develop the GIC, the GIC implementation is derived from
arm_gic::v2 which is a superset of v1 & v2 together as defined here,
https://developer.arm.com/documentation/198123/0302/What-is-a-Generic-Interrupt-Controller-

The SMP example boots the second core and checks atomics and a
cross-core critical section. Each core enables its own MMU.

Signed-off-by: Sriram Raghunathan <sriram@hcoop.net>
…_atomics.

Signed-off-by: Sriram Raghunathan <sriram@hcoop.net>
…e root toolchain file.

Signed-off-by: Sriram Raghunathan <sriram@hcoop.net>
@jonathanpallant
jonathanpallant force-pushed the xilinx-a9-smp-example branch from 24c04e6 to c2281dd Compare July 25, 2026 08:10
@jonathanpallant
jonathanpallant added this pull request to the merge queue Jul 25, 2026
Merged via the queue into rust-embedded:main with commit f13d9f5 Jul 25, 2026
96 checks passed
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.

3 participants