On 10/13/25 07:43, Jamin Lin wrote:
Refactor the AST27x0 SSP implementation to derive from the newly introduced
AspeedCoprocessor base class rather than AspeedSoC. The AspeedSoC class
contains many SoC-level fields and behaviors that are not applicable to
coprocessor subsystems like SSP, leading to unnecessary coupling and code size.

This change moves the Aspeed27x0SSPSoCState structure definition into
aspeed_coprocessor.h and updates related references in
aspeed_ast27x0-ssp.c and aspeed_ast27x0-fc.c to use
AspeedCoprocessorState and AspeedCoprocessorClass.

Key updates include:

- Replace inheritance from AspeedSoC -> AspeedCoprocessor.
- Replace type casts and class access macros (ASPEED_SOC_*) with
ASPEED_COPROCESSOR_*.

This refactor improves modularity, reduces memory footprint, and prepares
for future coprocessor variants to share a lighter-weight common base.

No functional change.

Signed-off-by: Jamin Lin <[email protected]>
---
  include/hw/arm/aspeed_coprocessor.h | 12 ++++++++++++
  include/hw/arm/aspeed_soc.h         | 12 ------------
  hw/arm/aspeed_ast27x0-fc.c          | 10 +++++-----
  hw/arm/aspeed_ast27x0-ssp.c         | 30 +++++++++++++----------------
  hw/arm/meson.build                  |  2 +-
  5 files changed, 31 insertions(+), 35 deletions(-)




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

Thanks,

C.



Reply via email to