]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/arm/ast27x0: Share single SCU instance across PSP, SSP, and TSP
authorJamin Lin <jamin_lin@aspeedtech.com>
Wed, 15 Oct 2025 06:22:00 +0000 (14:22 +0800)
committerCédric Le Goater <clg@redhat.com>
Wed, 22 Oct 2025 06:14:08 +0000 (08:14 +0200)
commit362e54b10ddd76ac9989900f53b7acede09ca86f
tree9fa0f8f67d872fcec96353bc8c887f0d6bbcbba0
parent2c9078b8d2e31af6c33d530f9edb4ba6387b77bd
hw/arm/ast27x0: Share single SCU instance across PSP, SSP, and TSP

AST2700 has a single SCU hardware block, memory-mapped at
0x12C02000–0x12C03FFF from the perspective of the main CA35 processor (PSP).
The SSP and TSP coprocessors access this same SCU block at different
addresses: 0x72C02000–0x72C03FFF.

Previously, each subsystem (PSP, SSP, and TSP) instantiated its own SCU
device, resulting in three independent SCU instances in the QEMU model.
In real hardware, however, only a single SCU exists and is shared among
all processors.

This commit reworks the SCU model to correctly reflect the hardware
behavior by allowing SSP and TSP to reference the PSP’s SCU instance.
The following changes are introduced:

- Add a scu property to AspeedCoprocessorState for linking the
  coprocessor to the PSP’s SCU instance.
- Replace per-coprocessor SCU instantiation with a shared SCU link.
- Add "MemoryRegion scu_alias" to model address remapping for SSP and TSP.
- Create SCU alias regions in both SSP and TSP coprocessors and map
  them at 0x72C02000 to mirror the PSP’s SCU registers.
- Ensure the SCU device in PSP is realized before SSP/TSP alias setup.

With this change, PSP, SSP, and TSP now share a consistent SCU state,
matching the single-SCU hardware design of AST2700.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251015062210.3128710-6-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/arm/aspeed_ast27x0-fc.c
hw/arm/aspeed_ast27x0-ssp.c
hw/arm/aspeed_ast27x0-tsp.c
hw/arm/aspeed_coprocessor_common.c
include/hw/arm/aspeed_coprocessor.h