@samitouri / QOSamiQemu / commits / 2fbefe0eb4

hw/misc/aspeed_scu: Add separate reset handler for AST2700 SCUIO

Introduce a dedicated reset handler for SCUIO. Previously, SCU and SCUIO shared the same reset handler. This no longer fits the AST2700 design, where SCU uses the Aspeed2700SCUState subclass and will handle coprocessor-related control in future changes. Since these controls are defined in SCU (not SCUIO), SCU and SCUIO should not share the same reset logic. This change gives SCUIO its own reset handler and prepares for upcoming SCU-specific functionality. No functional change. Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Link: https://lore.kernel.org/qemu-devel/20260717084559.3477061-5-jamin_lin@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>

Jamin Lin committed Jul 17, 2026 at 08:46 UTC 2fbefe0eb4a39cd3e2ce301602e94e3b2bbe9a9b
1 file changed +11 -1
hw/misc/aspeed_scu.c
+11 -1
@@ -1069,6 +1069,16 @@ static const uint32_t ast2700_a0_resets_io[ASPEED_AST2700_SCU_NR_REGS] = {
1069 [AST2700_SCUIO_FREQ_CNT_CTL] = 0x00000080,
1070 };
1071
1072 +static void aspeed_ast2700_scuio_reset_hold(Object *obj, ResetType type)
1073 +{
1074 + AspeedSCUState *s = ASPEED_SCU(obj);
1075 + AspeedSCUClass *asc = ASPEED_SCU_GET_CLASS(obj);
1076 +
1077 + memcpy(s->regs, asc->resets, asc->nr_regs * 4);
1078 + s->regs[AST2700_SILICON_REV] = s->silicon_rev;
1079 + s->regs[AST2700_HW_STRAP1] = s->hw_strap1;
1080 +}
1081 +
1082 static void aspeed_2700_scuio_class_init(ObjectClass *klass, const void *data)
1083 {
1084 DeviceClass *dc = DEVICE_CLASS(klass);
@@ -1076,7 +1086,7 @@ static void aspeed_2700_scuio_class_init(ObjectClass *klass, const void *data)
1086 AspeedSCUClass *asc = ASPEED_SCU_CLASS(klass);
1087
1088 dc->desc = "ASPEED 2700 System Control Unit I/O";
1079 - rc->phases.hold = aspeed_ast2700_scu_reset_hold;
1089 + rc->phases.hold = aspeed_ast2700_scuio_reset_hold;
1090 asc->resets = ast2700_a0_resets_io;
1091 asc->calc_hpll = aspeed_2600_scu_calc_hpll;
1092 asc->get_apb = aspeed_2700_scuio_get_apb_freq;