* [PATCH v1 0/4] Refactor AST2700 SCU preparation for coprocessors
@ 2026-07-06 8:45 Jamin Lin
2026-07-06 8:45 ` [PATCH v1 1/4] hw/misc/aspeed_scu: Introduce Aspeed2700SCUState Jamin Lin
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Jamin Lin @ 2026-07-06 8:45 UTC (permalink / raw)
To: Cédric Le Goater, Peter Maydell, Steven Lee, Troy Lee,
Kane Chen, Andrew Jeffery, Joel Stanley, open list:ASPEED BMCs,
open list:All patches CC here
Cc: Jamin Lin, Troy Lee
The original AST2700 FC support series [1] is fairly large, making it
difficult to review all changes together.
To help speed up the review process, this series extracts the SCU-related
refactoring into a standalone prerequisite series.
Compared with the original series, the SCU preparation patch has been
split into three smaller patches:
Introduce Aspeed2700SCUState.
Convert AST1700/AST27x0 users to the new SCU subclass.
Move the SCU link property into the AST27x0-specific coprocessor
implementation.
In addition, the SCUIO reset handling has been separated into an
independent patch.
This series contains no functional changes. It is purely a refactoring
to isolate AST2700-specific SCU support from the generic implementation
and prepare for the subsequent AST2700 FC support.
This series depends on:
https://patchwork.ozlabs.org/project/qemu-devel/cover/20260706052701.1141740-1-jamin_lin@aspeedtech.com/
Supersedes the following patches from the original FC support series [1]:
Patch 1:
https://patchwork.ozlabs.org/project/qemu-devel/patch/20260417032837.2664122-2-jamin_lin@aspeedtech.com/
Patch 2:
https://patchwork.ozlabs.org/project/qemu-devel/patch/20260417032837.2664122-3-jamin_lin@aspeedtech.com/
[1] Original AST2700 FC support series:
https://patchwork.ozlabs.org/project/qemu-devel/cover/20260417032837.2664122-1-jamin_lin@aspeedtech.com/
Jamin Lin (4):
hw/misc/aspeed_scu: Introduce Aspeed2700SCUState
hw/arm/aspeed: Use Aspeed2700SCUState for AST2700 users
hw/arm/aspeed_ast27x0: Move SCU link into AST27x0 coprocessors
hw/misc/aspeed_scu: Add separate reset handler for AST2700 SCUIO
include/hw/arm/aspeed_ast1700.h | 2 +-
include/hw/arm/aspeed_coprocessor.h | 5 +++--
include/hw/arm/aspeed_soc.h | 1 +
include/hw/misc/aspeed_scu.h | 5 +++++
hw/arm/aspeed_ast27x0-fc.c | 4 ++--
hw/arm/aspeed_ast27x0-ssp.c | 19 +++++++++++++++----
hw/arm/aspeed_ast27x0-tsp.c | 19 +++++++++++++++----
hw/arm/aspeed_ast27x0.c | 16 ++++++++--------
hw/arm/aspeed_coprocessor_common.c | 2 --
hw/misc/aspeed_scu.c | 20 ++++++++++++++++++--
10 files changed, 68 insertions(+), 25 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v1 1/4] hw/misc/aspeed_scu: Introduce Aspeed2700SCUState
2026-07-06 8:45 [PATCH v1 0/4] Refactor AST2700 SCU preparation for coprocessors Jamin Lin
@ 2026-07-06 8:45 ` Jamin Lin
2026-07-06 8:45 ` [PATCH v1 2/4] hw/arm/aspeed: Use Aspeed2700SCUState for AST2700 users Jamin Lin
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Jamin Lin @ 2026-07-06 8:45 UTC (permalink / raw)
To: Cédric Le Goater, Peter Maydell, Steven Lee, Troy Lee,
Kane Chen, Andrew Jeffery, Joel Stanley, open list:ASPEED BMCs,
open list:All patches CC here
Cc: Jamin Lin, Troy Lee
Introduce Aspeed2700SCUState as an AST2700-specific subclass of
AspeedSCUState.
Currently, AST1700 and AST2700 reuse the generic AspeedSCUState.
However, AST2700 requires SCU functionality that is specific to the
platform, particularly for interactions with its coprocessors.
Introduce a dedicated Aspeed2700SCUState to provide an extension point
for AST2700-specific functionality while keeping the generic
AspeedSCUState unchanged.
Subsequent patches will migrate AST2700 users to the new subclass and
move AST2700-specific code into it.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
include/hw/misc/aspeed_scu.h | 5 +++++
hw/misc/aspeed_scu.c | 8 +++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/include/hw/misc/aspeed_scu.h b/include/hw/misc/aspeed_scu.h
index c30940ab76..904549465f 100644
--- a/include/hw/misc/aspeed_scu.h
+++ b/include/hw/misc/aspeed_scu.h
@@ -20,6 +20,7 @@ OBJECT_DECLARE_TYPE(AspeedSCUState, AspeedSCUClass, ASPEED_SCU)
#define TYPE_ASPEED_2500_SCU TYPE_ASPEED_SCU "-ast2500"
#define TYPE_ASPEED_2600_SCU TYPE_ASPEED_SCU "-ast2600"
#define TYPE_ASPEED_2700_SCU TYPE_ASPEED_SCU "-ast2700"
+OBJECT_DECLARE_SIMPLE_TYPE(Aspeed2700SCUState, ASPEED_2700_SCU)
#define TYPE_ASPEED_2700_SCUIO TYPE_ASPEED_SCU "io" "-ast2700"
#define TYPE_ASPEED_1030_SCU TYPE_ASPEED_SCU "-ast1030"
@@ -41,6 +42,10 @@ struct AspeedSCUState {
uint32_t hw_prot_key;
};
+struct Aspeed2700SCUState {
+ AspeedSCUState parent_obj;
+};
+
#define AST2400_A1_SILICON_REV 0x02010303U
#define AST2500_A1_SILICON_REV 0x04010303U
#define AST2600_A3_SILICON_REV 0x05030303U
diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c
index 5dbf81c0ce..efe1d6315b 100644
--- a/hw/misc/aspeed_scu.c
+++ b/hw/misc/aspeed_scu.c
@@ -930,6 +930,11 @@ static void aspeed_ast2700_scu_reset_hold(Object *obj, ResetType type)
s->regs[AST2700_HW_STRAP1] = s->hw_strap1;
}
+static void aspeed_2700_scu_realize(DeviceState *dev, Error **errp)
+{
+ aspeed_scu_realize(dev, errp);
+}
+
static void aspeed_2700_scu_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -937,6 +942,7 @@ static void aspeed_2700_scu_class_init(ObjectClass *klass, const void *data)
AspeedSCUClass *asc = ASPEED_SCU_CLASS(klass);
dc->desc = "ASPEED 2700 System Control Unit";
+ dc->realize = aspeed_2700_scu_realize;
rc->phases.hold = aspeed_ast2700_scu_reset_hold;
asc->resets = ast2700_a0_resets;
asc->calc_hpll = aspeed_2600_scu_calc_hpll;
@@ -1161,7 +1167,7 @@ static const TypeInfo aspeed_scu_types[] = {
{
.name = TYPE_ASPEED_2700_SCU,
.parent = TYPE_ASPEED_SCU,
- .instance_size = sizeof(AspeedSCUState),
+ .instance_size = sizeof(Aspeed2700SCUState),
.class_init = aspeed_2700_scu_class_init,
},
{
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v1 2/4] hw/arm/aspeed: Use Aspeed2700SCUState for AST2700 users
2026-07-06 8:45 [PATCH v1 0/4] Refactor AST2700 SCU preparation for coprocessors Jamin Lin
2026-07-06 8:45 ` [PATCH v1 1/4] hw/misc/aspeed_scu: Introduce Aspeed2700SCUState Jamin Lin
@ 2026-07-06 8:45 ` Jamin Lin
2026-07-06 8:45 ` [PATCH v1 3/4] hw/arm/aspeed_ast27x0: Move SCU link into AST27x0 coprocessors Jamin Lin
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Jamin Lin @ 2026-07-06 8:45 UTC (permalink / raw)
To: Cédric Le Goater, Peter Maydell, Steven Lee, Troy Lee,
Kane Chen, Andrew Jeffery, Joel Stanley, open list:ASPEED BMCs,
open list:All patches CC here
Cc: Jamin Lin, Troy Lee
Now that Aspeed2700SCUState has been introduced, update the AST1700 and
AST27x0 SoCs to instantiate the AST2700-specific SCU subclass instead of
the generic AspeedSCUState.
Also update the AST27x0 FC board to link the SSP/TSP coprocessors to the
AST2700 SCU instance.
This prepares the AST2700 platform for subsequent patches that move
AST2700-specific SCU functionality into the subclass.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
include/hw/arm/aspeed_ast1700.h | 2 +-
include/hw/arm/aspeed_soc.h | 1 +
hw/arm/aspeed_ast27x0-fc.c | 4 ++--
hw/arm/aspeed_ast27x0.c | 16 ++++++++--------
4 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/include/hw/arm/aspeed_ast1700.h b/include/hw/arm/aspeed_ast1700.h
index f7bd4e8650..39c5977cf1 100644
--- a/include/hw/arm/aspeed_ast1700.h
+++ b/include/hw/arm/aspeed_ast1700.h
@@ -41,7 +41,7 @@ struct AspeedAST1700SoCState {
MemoryRegion sram;
AspeedSMCState spi;
AspeedADCState adc;
- AspeedSCUState scu;
+ Aspeed2700SCUState scu;
AspeedGPIOState gpio;
AspeedSGPIOState sgpiom[AST1700_SGPIO_NUM];
AspeedI2CState i2c;
diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
index 41dc04e293..cd68c7f1ca 100644
--- a/include/hw/arm/aspeed_soc.h
+++ b/include/hw/arm/aspeed_soc.h
@@ -151,6 +151,7 @@ struct Aspeed27x0SoCState {
AspeedINTCState intcioexp[ASPEED_IOEXP_NUM];
GICv3State gic;
MemoryRegion dram_empty;
+ Aspeed2700SCUState scu;
};
#define TYPE_ASPEED27X0_SOC "aspeed27x0-soc"
diff --git a/hw/arm/aspeed_ast27x0-fc.c b/hw/arm/aspeed_ast27x0-fc.c
index 7d9fade68d..8d49bb95d6 100644
--- a/hw/arm/aspeed_ast27x0-fc.c
+++ b/hw/arm/aspeed_ast27x0-fc.c
@@ -158,7 +158,7 @@ static bool ast2700fc_ssp_init(MachineState *machine, Error **errp)
object_property_set_link(OBJECT(&s->ssp), "sram",
OBJECT(&psp->sram), &error_abort);
object_property_set_link(OBJECT(&s->ssp), "scu",
- OBJECT(&psp->scu), &error_abort);
+ OBJECT(&s->ca35.scu), &error_abort);
if (!qdev_realize(DEVICE(&s->ssp), NULL, errp)) {
return false;
}
@@ -190,7 +190,7 @@ static bool ast2700fc_tsp_init(MachineState *machine, Error **errp)
object_property_set_link(OBJECT(&s->tsp), "sram",
OBJECT(&psp->sram), &error_abort);
object_property_set_link(OBJECT(&s->tsp), "scu",
- OBJECT(&psp->scu), &error_abort);
+ OBJECT(&s->ca35.scu), &error_abort);
if (!qdev_realize(DEVICE(&s->tsp), NULL, errp)) {
return false;
}
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
index dddd7d2106..dd6dd0377c 100644
--- a/hw/arm/aspeed_ast27x0.c
+++ b/hw/arm/aspeed_ast27x0.c
@@ -435,12 +435,12 @@ static void aspeed_soc_ast2700_init(Object *obj)
object_initialize_child(obj, "gic", &a->gic, gicv3_class_name());
- object_initialize_child(obj, "scu", &s->scu, TYPE_ASPEED_2700_SCU);
- qdev_prop_set_uint32(DEVICE(&s->scu), "silicon-rev",
+ object_initialize_child(obj, "scu", &a->scu, TYPE_ASPEED_2700_SCU);
+ qdev_prop_set_uint32(DEVICE(&a->scu), "silicon-rev",
sc->silicon_rev);
- object_property_add_alias(obj, "hw-strap1", OBJECT(&s->scu),
+ object_property_add_alias(obj, "hw-strap1", OBJECT(&a->scu),
"hw-strap1");
- object_property_add_alias(obj, "hw-prot-key", OBJECT(&s->scu),
+ object_property_add_alias(obj, "hw-prot-key", OBJECT(&a->scu),
"hw-prot-key");
object_initialize_child(obj, "scuio", &s->scuio, TYPE_ASPEED_2700_SCUIO);
@@ -808,10 +808,10 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
sc->memmap[ASPEED_DEV_VBOOTROM], &s->vbootrom);
/* SCU */
- if (!sysbus_realize(SYS_BUS_DEVICE(&s->scu), errp)) {
+ if (!sysbus_realize(SYS_BUS_DEVICE(&a->scu), errp)) {
return;
}
- aspeed_mmio_map(s->memory, SYS_BUS_DEVICE(&s->scu), 0,
+ aspeed_mmio_map(s->memory, SYS_BUS_DEVICE(&a->scu), 0,
sc->memmap[ASPEED_DEV_SCU]);
/* SCU1 */
@@ -929,7 +929,7 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
AspeedWDTClass *awc = ASPEED_WDT_GET_CLASS(&s->wdt[i]);
hwaddr wdt_offset = sc->memmap[ASPEED_DEV_WDT] + i * awc->iosize;
- object_property_set_link(OBJECT(&s->wdt[i]), "scu", OBJECT(&s->scu),
+ object_property_set_link(OBJECT(&s->wdt[i]), "scu", OBJECT(&a->scu),
&error_abort);
if (!sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), errp)) {
return;
@@ -1032,7 +1032,7 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
aspeed_soc_ast2700_get_irq(s, ASPEED_DEV_EMMC));
/* Timer */
- object_property_set_link(OBJECT(&s->timerctrl), "scu", OBJECT(&s->scu),
+ object_property_set_link(OBJECT(&s->timerctrl), "scu", OBJECT(&a->scu),
&error_abort);
if (!sysbus_realize(SYS_BUS_DEVICE(&s->timerctrl), errp)) {
return;
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v1 3/4] hw/arm/aspeed_ast27x0: Move SCU link into AST27x0 coprocessors
2026-07-06 8:45 [PATCH v1 0/4] Refactor AST2700 SCU preparation for coprocessors Jamin Lin
2026-07-06 8:45 ` [PATCH v1 1/4] hw/misc/aspeed_scu: Introduce Aspeed2700SCUState Jamin Lin
2026-07-06 8:45 ` [PATCH v1 2/4] hw/arm/aspeed: Use Aspeed2700SCUState for AST2700 users Jamin Lin
@ 2026-07-06 8:45 ` Jamin Lin
2026-07-06 9:54 ` Philippe Mathieu-Daudé
2026-07-06 8:45 ` [PATCH v1 4/4] hw/misc/aspeed_scu: Add separate reset handler for AST2700 SCUIO Jamin Lin
2026-07-07 5:05 ` [PATCH v1 0/4] Refactor AST2700 SCU preparation for coprocessors Jamin Lin
4 siblings, 1 reply; 7+ messages in thread
From: Jamin Lin @ 2026-07-06 8:45 UTC (permalink / raw)
To: Cédric Le Goater, Peter Maydell, Steven Lee, Troy Lee,
Kane Chen, Andrew Jeffery, Joel Stanley, open list:ASPEED BMCs,
open list:All patches CC here
Cc: Jamin Lin, Troy Lee
The SCU link is only needed by the AST27x0 SSP/TSP coprocessors for their
AST2700-specific SCU alias window.
Move the link property from the common AspeedCoprocessorState into
Aspeed27x0CoprocessorState, so the generic coprocessor model no longer
contains an AST2700-specific dependency.
Also validate that the SCU link has been provided during device realize
before accessing it.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
include/hw/arm/aspeed_coprocessor.h | 5 +++--
hw/arm/aspeed_ast27x0-ssp.c | 19 +++++++++++++++----
hw/arm/aspeed_ast27x0-tsp.c | 19 +++++++++++++++----
hw/arm/aspeed_coprocessor_common.c | 2 --
4 files changed, 33 insertions(+), 12 deletions(-)
diff --git a/include/hw/arm/aspeed_coprocessor.h b/include/hw/arm/aspeed_coprocessor.h
index ac58a5f424..adfc3c4512 100644
--- a/include/hw/arm/aspeed_coprocessor.h
+++ b/include/hw/arm/aspeed_coprocessor.h
@@ -20,10 +20,8 @@ struct AspeedCoprocessorState {
MemoryRegion *sram;
MemoryRegion sram_alias;
MemoryRegion uart_alias;
- MemoryRegion scu_alias;
Clock *sysclk;
- AspeedSCUState *scu;
AspeedSCUState scuio;
AspeedTimerCtrlState timerctrl;
SerialMM *uart;
@@ -52,6 +50,9 @@ struct Aspeed27x0CoprocessorState {
UnimplementedDeviceState otp;
ARMv7MState armv7m;
+
+ MemoryRegion scu_alias;
+ Aspeed2700SCUState *scu;
};
#define TYPE_ASPEED27X0SSP_COPROCESSOR "aspeed27x0ssp-coprocessor"
diff --git a/hw/arm/aspeed_ast27x0-ssp.c b/hw/arm/aspeed_ast27x0-ssp.c
index 68a8ab26f7..17f3770770 100644
--- a/hw/arm/aspeed_ast27x0-ssp.c
+++ b/hw/arm/aspeed_ast27x0-ssp.c
@@ -167,6 +167,11 @@ static void aspeed_soc_ast27x0ssp_realize(DeviceState *dev_soc, Error **errp)
return;
}
+ if (!a->scu) {
+ error_setg(errp, "'scu' link is not set");
+ return;
+ }
+
/* AST27X0 SSP Core */
armv7m = DEVICE(&a->armv7m);
qdev_prop_set_uint32(armv7m, "num-irq", 256);
@@ -195,11 +200,11 @@ static void aspeed_soc_ast27x0ssp_realize(DeviceState *dev_soc, Error **errp)
&s->sram_alias);
/* SCU */
- memory_region_init_alias(&s->scu_alias, OBJECT(s), "scu.alias",
- &s->scu->iomem, 0,
- memory_region_size(&s->scu->iomem));
+ memory_region_init_alias(&a->scu_alias, OBJECT(a), "scu.alias",
+ &a->scu->parent_obj.iomem, 0,
+ memory_region_size(&a->scu->parent_obj.iomem));
memory_region_add_subregion(s->memory, sc->memmap[ASPEED_DEV_SCU],
- &s->scu_alias);
+ &a->scu_alias);
/* INTC */
if (!sysbus_realize(SYS_BUS_DEVICE(&a->intc[0]), errp)) {
@@ -275,6 +280,11 @@ static void aspeed_soc_ast27x0ssp_realize(DeviceState *dev_soc, Error **errp)
sc->memmap[ASPEED_DEV_OTP], 0x800);
}
+static const Property aspeed_27x0_coprocessor_properties[] = {
+ DEFINE_PROP_LINK("scu", Aspeed27x0CoprocessorState, scu,
+ TYPE_ASPEED_2700_SCU, Aspeed2700SCUState *),
+};
+
static void aspeed_soc_ast27x0ssp_class_init(ObjectClass *klass,
const void *data)
{
@@ -288,6 +298,7 @@ static void aspeed_soc_ast27x0ssp_class_init(ObjectClass *klass,
/* Reason: The Aspeed Coprocessor can only be instantiated from a board */
dc->user_creatable = false;
dc->realize = aspeed_soc_ast27x0ssp_realize;
+ device_class_set_props(dc, aspeed_27x0_coprocessor_properties);
sc->valid_cpu_types = valid_cpu_types;
sc->irqmap = aspeed_soc_ast27x0ssp_irqmap;
diff --git a/hw/arm/aspeed_ast27x0-tsp.c b/hw/arm/aspeed_ast27x0-tsp.c
index b8a4f7c91d..636bfb8d2c 100644
--- a/hw/arm/aspeed_ast27x0-tsp.c
+++ b/hw/arm/aspeed_ast27x0-tsp.c
@@ -167,6 +167,11 @@ static void aspeed_soc_ast27x0tsp_realize(DeviceState *dev_soc, Error **errp)
return;
}
+ if (!a->scu) {
+ error_setg(errp, "'scu' link is not set");
+ return;
+ }
+
/* AST27X0 TSP Core */
armv7m = DEVICE(&a->armv7m);
qdev_prop_set_uint32(armv7m, "num-irq", 256);
@@ -195,11 +200,11 @@ static void aspeed_soc_ast27x0tsp_realize(DeviceState *dev_soc, Error **errp)
&s->sram_alias);
/* SCU */
- memory_region_init_alias(&s->scu_alias, OBJECT(s), "scu.alias",
- &s->scu->iomem, 0,
- memory_region_size(&s->scu->iomem));
+ memory_region_init_alias(&a->scu_alias, OBJECT(a), "scu.alias",
+ &a->scu->parent_obj.iomem, 0,
+ memory_region_size(&a->scu->parent_obj.iomem));
memory_region_add_subregion(s->memory, sc->memmap[ASPEED_DEV_SCU],
- &s->scu_alias);
+ &a->scu_alias);
/* INTC */
if (!sysbus_realize(SYS_BUS_DEVICE(&a->intc[0]), errp)) {
@@ -275,6 +280,11 @@ static void aspeed_soc_ast27x0tsp_realize(DeviceState *dev_soc, Error **errp)
sc->memmap[ASPEED_DEV_OTP], 0x800);
}
+static const Property aspeed_27x0_coprocessor_properties[] = {
+ DEFINE_PROP_LINK("scu", Aspeed27x0CoprocessorState, scu,
+ TYPE_ASPEED_2700_SCU, Aspeed2700SCUState *),
+};
+
static void aspeed_soc_ast27x0tsp_class_init(ObjectClass *klass,
const void *data)
{
@@ -288,6 +298,7 @@ static void aspeed_soc_ast27x0tsp_class_init(ObjectClass *klass,
/* Reason: The Aspeed Coprocessor can only be instantiated from a board */
dc->user_creatable = false;
dc->realize = aspeed_soc_ast27x0tsp_realize;
+ device_class_set_props(dc, aspeed_27x0_coprocessor_properties);
sc->valid_cpu_types = valid_cpu_types;
sc->irqmap = aspeed_soc_ast27x0tsp_irqmap;
diff --git a/hw/arm/aspeed_coprocessor_common.c b/hw/arm/aspeed_coprocessor_common.c
index a0a4c73d08..43026d2a55 100644
--- a/hw/arm/aspeed_coprocessor_common.c
+++ b/hw/arm/aspeed_coprocessor_common.c
@@ -27,8 +27,6 @@ static const Property aspeed_coprocessor_properties[] = {
TYPE_MEMORY_REGION, MemoryRegion *),
DEFINE_PROP_LINK("sram", AspeedCoprocessorState, sram, TYPE_MEMORY_REGION,
MemoryRegion *),
- DEFINE_PROP_LINK("scu", AspeedCoprocessorState, scu, TYPE_ASPEED_SCU,
- AspeedSCUState *),
DEFINE_PROP_LINK("uart", AspeedCoprocessorState, uart, TYPE_SERIAL_MM,
SerialMM *),
DEFINE_PROP_INT32("uart-dev", AspeedCoprocessorState, uart_dev, 0),
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v1 4/4] hw/misc/aspeed_scu: Add separate reset handler for AST2700 SCUIO
2026-07-06 8:45 [PATCH v1 0/4] Refactor AST2700 SCU preparation for coprocessors Jamin Lin
` (2 preceding siblings ...)
2026-07-06 8:45 ` [PATCH v1 3/4] hw/arm/aspeed_ast27x0: Move SCU link into AST27x0 coprocessors Jamin Lin
@ 2026-07-06 8:45 ` Jamin Lin
2026-07-07 5:05 ` [PATCH v1 0/4] Refactor AST2700 SCU preparation for coprocessors Jamin Lin
4 siblings, 0 replies; 7+ messages in thread
From: Jamin Lin @ 2026-07-06 8:45 UTC (permalink / raw)
To: Cédric Le Goater, Peter Maydell, Steven Lee, Troy Lee,
Kane Chen, Andrew Jeffery, Joel Stanley, open list:ASPEED BMCs,
open list:All patches CC here
Cc: Jamin Lin, Troy Lee
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>
---
hw/misc/aspeed_scu.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c
index efe1d6315b..ca93c3699d 100644
--- a/hw/misc/aspeed_scu.c
+++ b/hw/misc/aspeed_scu.c
@@ -1069,6 +1069,16 @@ static const uint32_t ast2700_a0_resets_io[ASPEED_AST2700_SCU_NR_REGS] = {
[AST2700_SCUIO_FREQ_CNT_CTL] = 0x00000080,
};
+static void aspeed_ast2700_scuio_reset_hold(Object *obj, ResetType type)
+{
+ AspeedSCUState *s = ASPEED_SCU(obj);
+ AspeedSCUClass *asc = ASPEED_SCU_GET_CLASS(obj);
+
+ memcpy(s->regs, asc->resets, asc->nr_regs * 4);
+ s->regs[AST2700_SILICON_REV] = s->silicon_rev;
+ s->regs[AST2700_HW_STRAP1] = s->hw_strap1;
+}
+
static void aspeed_2700_scuio_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -1076,7 +1086,7 @@ static void aspeed_2700_scuio_class_init(ObjectClass *klass, const void *data)
AspeedSCUClass *asc = ASPEED_SCU_CLASS(klass);
dc->desc = "ASPEED 2700 System Control Unit I/O";
- rc->phases.hold = aspeed_ast2700_scu_reset_hold;
+ rc->phases.hold = aspeed_ast2700_scuio_reset_hold;
asc->resets = ast2700_a0_resets_io;
asc->calc_hpll = aspeed_2600_scu_calc_hpll;
asc->get_apb = aspeed_2700_scuio_get_apb_freq;
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v1 3/4] hw/arm/aspeed_ast27x0: Move SCU link into AST27x0 coprocessors
2026-07-06 8:45 ` [PATCH v1 3/4] hw/arm/aspeed_ast27x0: Move SCU link into AST27x0 coprocessors Jamin Lin
@ 2026-07-06 9:54 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-06 9:54 UTC (permalink / raw)
To: Jamin Lin, Cédric Le Goater, Peter Maydell, Steven Lee,
Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley,
open list:ASPEED BMCs, open list:All patches CC here
Cc: Troy Lee
On 6/7/26 10:45, Jamin Lin wrote:
> The SCU link is only needed by the AST27x0 SSP/TSP coprocessors for their
> AST2700-specific SCU alias window.
>
> Move the link property from the common AspeedCoprocessorState into
> Aspeed27x0CoprocessorState, so the generic coprocessor model no longer
> contains an AST2700-specific dependency.
>
> Also validate that the SCU link has been provided during device realize
> before accessing it.
>
> No functional change.
>
> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> ---
> include/hw/arm/aspeed_coprocessor.h | 5 +++--
> hw/arm/aspeed_ast27x0-ssp.c | 19 +++++++++++++++----
> hw/arm/aspeed_ast27x0-tsp.c | 19 +++++++++++++++----
> hw/arm/aspeed_coprocessor_common.c | 2 --
> 4 files changed, 33 insertions(+), 12 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH v1 0/4] Refactor AST2700 SCU preparation for coprocessors
2026-07-06 8:45 [PATCH v1 0/4] Refactor AST2700 SCU preparation for coprocessors Jamin Lin
` (3 preceding siblings ...)
2026-07-06 8:45 ` [PATCH v1 4/4] hw/misc/aspeed_scu: Add separate reset handler for AST2700 SCUIO Jamin Lin
@ 2026-07-07 5:05 ` Jamin Lin
4 siblings, 0 replies; 7+ messages in thread
From: Jamin Lin @ 2026-07-07 5:05 UTC (permalink / raw)
To: Cédric Le Goater, Peter Maydell, Steven Lee, Troy Lee,
Kane Chen, Andrew Jeffery, Joel Stanley, open list:ASPEED BMCs,
open list:All patches CC here
Cc: Troy Lee
Sorry
I will resend v2 due to split [1] Original AST2700 FC support series
> Subject: [PATCH v1 0/4] Refactor AST2700 SCU preparation for coprocessors
>
> The original AST2700 FC support series [1] is fairly large, making it difficult to
> review all changes together.
>
> To help speed up the review process, this series extracts the SCU-related
> refactoring into a standalone prerequisite series.
>
> Compared with the original series, the SCU preparation patch has been split
> into three smaller patches:
>
> Introduce Aspeed2700SCUState.
> Convert AST1700/AST27x0 users to the new SCU subclass.
> Move the SCU link property into the AST27x0-specific coprocessor
> implementation.
>
> In addition, the SCUIO reset handling has been separated into an independent
> patch.
>
> This series contains no functional changes. It is purely a refactoring to isolate
> AST2700-specific SCU support from the generic implementation and prepare
> for the subsequent AST2700 FC support.
>
> This series depends on:
>
> https://patchwork.ozlabs.org/project/qemu-devel/cover/20260706052701.114
> 1740-1-jamin_lin@aspeedtech.com/
>
> Supersedes the following patches from the original FC support series [1]:
>
> Patch 1:
> https://patchwork.ozlabs.org/project/qemu-devel/patch/20260417032837.266
> 4122-2-jamin_lin@aspeedtech.com/
>
> Patch 2:
> https://patchwork.ozlabs.org/project/qemu-devel/patch/20260417032837.266
> 4122-3-jamin_lin@aspeedtech.com/
>
> [1] Original AST2700 FC support series:
> https://patchwork.ozlabs.org/project/qemu-devel/cover/20260417032837.266
> 4122-1-jamin_lin@aspeedtech.com/
>
> Jamin Lin (4):
> hw/misc/aspeed_scu: Introduce Aspeed2700SCUState
> hw/arm/aspeed: Use Aspeed2700SCUState for AST2700 users
> hw/arm/aspeed_ast27x0: Move SCU link into AST27x0 coprocessors
> hw/misc/aspeed_scu: Add separate reset handler for AST2700 SCUIO
>
> include/hw/arm/aspeed_ast1700.h | 2 +-
> include/hw/arm/aspeed_coprocessor.h | 5 +++--
> include/hw/arm/aspeed_soc.h | 1 +
> include/hw/misc/aspeed_scu.h | 5 +++++
> hw/arm/aspeed_ast27x0-fc.c | 4 ++--
> hw/arm/aspeed_ast27x0-ssp.c | 19 +++++++++++++++----
> hw/arm/aspeed_ast27x0-tsp.c | 19 +++++++++++++++----
> hw/arm/aspeed_ast27x0.c | 16 ++++++++--------
> hw/arm/aspeed_coprocessor_common.c | 2 --
> hw/misc/aspeed_scu.c | 20 ++++++++++++++++++--
> 10 files changed, 68 insertions(+), 25 deletions(-)
>
> --
> 2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-07-07 5:05 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06 8:45 [PATCH v1 0/4] Refactor AST2700 SCU preparation for coprocessors Jamin Lin
2026-07-06 8:45 ` [PATCH v1 1/4] hw/misc/aspeed_scu: Introduce Aspeed2700SCUState Jamin Lin
2026-07-06 8:45 ` [PATCH v1 2/4] hw/arm/aspeed: Use Aspeed2700SCUState for AST2700 users Jamin Lin
2026-07-06 8:45 ` [PATCH v1 3/4] hw/arm/aspeed_ast27x0: Move SCU link into AST27x0 coprocessors Jamin Lin
2026-07-06 9:54 ` Philippe Mathieu-Daudé
2026-07-06 8:45 ` [PATCH v1 4/4] hw/misc/aspeed_scu: Add separate reset handler for AST2700 SCUIO Jamin Lin
2026-07-07 5:05 ` [PATCH v1 0/4] Refactor AST2700 SCU preparation for coprocessors Jamin Lin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.