On 10/15/25 08:22, Jamin Lin wrote:
In the original model, each subsystem (PSP, SSP, and TSP) created its own
set of 13 UART devices, resulting in a total of 39 UART instances. However,
on real AST2700 hardware, there is only one set of 13 UARTs shared among
all processors.

This commit reworks the UART handling to correctly model the shared
hardware design. The PSP now creates the full set of 13 UART instances,
while the SSP and TSP link to the corresponding shared UART device
through object properties.

Changes include:
- Add "DEFINE_PROP_LINK("uart", ...)" and "DEFINE_PROP_INT32("uart-dev", ...)"
   to allow each coprocessor to reference a specific shared UART instance.
- Modify SSP to link to PSP’s UART4, and TSP to link to PSP’s UART7.
- Introduce "uart_alias" to remap the UART’s MMIO region into the coprocessor’s
   memory space.
- Redirect the UART interrupt to the coprocessor’s NVIC, replacing the
   default routing to the PSP’s GIC.

With this change, only one set of 13 UART devices is instantiated by the PSP,
while the SSP and TSP reuse them via aliasing and shared interrupt routing,
matching the real AST2700 hardware behavior.

Signed-off-by: Jamin Lin <[email protected]>
---
  include/hw/arm/aspeed_coprocessor.h |  6 +++---
  hw/arm/aspeed_ast27x0-fc.c          | 24 ++++++++++++------------
  hw/arm/aspeed_ast27x0-ssp.c         | 29 ++++++++++++-----------------
  hw/arm/aspeed_ast27x0-tsp.c         | 29 ++++++++++++-----------------
  hw/arm/aspeed_coprocessor_common.c  |  3 +++
  5 files changed, 42 insertions(+), 49 deletions(-)




Reviewed-by: Cédric Le Goater <[email protected]>

Thanks,

C.



Reply via email to