There is one hw-strap1 register in the SCU (CPU DIE) and another hw-strap1
register in the SCUIO (IO DIE). The values of these two registers should not be
the same. To reuse the current design of hw-strap, hw-strap1 is assigned to the
SCU and sets the value in the SCU hw-strap1 register, while hw-strap2 is
assigned to the SCUIO and sets the value in the SCUIO hw-strap1 register.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
hw/arm/aspeed_ast27x0.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
index a48f47b74e..8c225d4f90 100644
--- a/hw/arm/aspeed_ast27x0.c
+++ b/hw/arm/aspeed_ast27x0.c
@@ -331,16 +331,23 @@ static void aspeed_soc_ast2700_init(Object *obj)
object_initialize_child(obj, "scu", &s->scu, TYPE_ASPEED_2700_SCU);
qdev_prop_set_uint32(DEVICE(&s->scu), "silicon-rev",
sc->silicon_rev);
+ /*
+ * There is one hw-strap1 register in the SCU (CPU DIE) and another
+ * hw-strap1 register in the SCUIO (IO DIE). To reuse the current design
+ * of hw-strap, hw-strap1 is assigned to the SCU and sets the value in the
+ * SCU hw-strap1 register, while hw-strap2 is assigned to the SCUIO and
+ * sets the value in the SCUIO hw-strap1 register.
+ */
object_property_add_alias(obj, "hw-strap1", OBJECT(&s->scu),
"hw-strap1");
- object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scu),
- "hw-strap2");
object_property_add_alias(obj, "hw-prot-key", OBJECT(&s->scu),
"hw-prot-key");
object_initialize_child(obj, "scuio", &s->scuio, TYPE_ASPEED_2700_SCUIO);
qdev_prop_set_uint32(DEVICE(&s->scuio), "silicon-rev",
sc->silicon_rev);
+ object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scuio),
+ "hw-strap1");
snprintf(typename, sizeof(typename), "aspeed.fmc-%s", socname);
object_initialize_child(obj, "fmc", &s->fmc, typename);
--
2.34.1
On 3/3/25 08:35, Jamin Lin wrote:
> There is one hw-strap1 register in the SCU (CPU DIE) and another hw-strap1
> register in the SCUIO (IO DIE). The values of these two registers should not be
> the same. To reuse the current design of hw-strap, hw-strap1 is assigned to the
> SCU and sets the value in the SCU hw-strap1 register, while hw-strap2 is
> assigned to the SCUIO and sets the value in the SCUIO hw-strap1 register.
>
> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> ---
> hw/arm/aspeed_ast27x0.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
> index a48f47b74e..8c225d4f90 100644
> --- a/hw/arm/aspeed_ast27x0.c
> +++ b/hw/arm/aspeed_ast27x0.c
> @@ -331,16 +331,23 @@ static void aspeed_soc_ast2700_init(Object *obj)
> object_initialize_child(obj, "scu", &s->scu, TYPE_ASPEED_2700_SCU);
> qdev_prop_set_uint32(DEVICE(&s->scu), "silicon-rev",
> sc->silicon_rev);
> + /*
> + * There is one hw-strap1 register in the SCU (CPU DIE) and another
> + * hw-strap1 register in the SCUIO (IO DIE). To reuse the current design
> + * of hw-strap, hw-strap1 is assigned to the SCU and sets the value in the
> + * SCU hw-strap1 register, while hw-strap2 is assigned to the SCUIO and
> + * sets the value in the SCUIO hw-strap1 register.
> + */
please move the comment before
object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scuio),
"hw-strap1");
Thanks,
C.
> object_property_add_alias(obj, "hw-strap1", OBJECT(&s->scu),
> "hw-strap1");
> - object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scu),
> - "hw-strap2");
> object_property_add_alias(obj, "hw-prot-key", OBJECT(&s->scu),
> "hw-prot-key");
>
> object_initialize_child(obj, "scuio", &s->scuio, TYPE_ASPEED_2700_SCUIO);
> qdev_prop_set_uint32(DEVICE(&s->scuio), "silicon-rev",
> sc->silicon_rev);
> + object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scuio),
> + "hw-strap1");
>
> snprintf(typename, sizeof(typename), "aspeed.fmc-%s", socname);
> object_initialize_child(obj, "fmc", &s->fmc, typename);
Hi Cedric, > Subject: Re: [PATCH v4 5/6] hw/arm/aspeed_ast27x0.c Separate HW Strap > Registers for SCU and SCUIO > > On 3/3/25 08:35, Jamin Lin wrote: > > There is one hw-strap1 register in the SCU (CPU DIE) and another > > hw-strap1 register in the SCUIO (IO DIE). The values of these two > > registers should not be the same. To reuse the current design of > > hw-strap, hw-strap1 is assigned to the SCU and sets the value in the > > SCU hw-strap1 register, while hw-strap2 is assigned to the SCUIO and sets the > value in the SCUIO hw-strap1 register. > > > > Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com> > > --- > > hw/arm/aspeed_ast27x0.c | 11 +++++++++-- > > 1 file changed, 9 insertions(+), 2 deletions(-) > > > > diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c index > > a48f47b74e..8c225d4f90 100644 > > --- a/hw/arm/aspeed_ast27x0.c > > +++ b/hw/arm/aspeed_ast27x0.c > > @@ -331,16 +331,23 @@ static void aspeed_soc_ast2700_init(Object *obj) > > object_initialize_child(obj, "scu", &s->scu, TYPE_ASPEED_2700_SCU); > > qdev_prop_set_uint32(DEVICE(&s->scu), "silicon-rev", > > sc->silicon_rev); > > + /* > > + * There is one hw-strap1 register in the SCU (CPU DIE) and another > > + * hw-strap1 register in the SCUIO (IO DIE). To reuse the current > design > > + * of hw-strap, hw-strap1 is assigned to the SCU and sets the value in > the > > + * SCU hw-strap1 register, while hw-strap2 is assigned to the SCUIO > and > > + * sets the value in the SCUIO hw-strap1 register. > > + */ > > please move the comment before > > object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scuio), > "hw-strap1"); > Thanks for your suggestion and review. Will update it. Jamin > > Thanks, > > C. > > > > object_property_add_alias(obj, "hw-strap1", OBJECT(&s->scu), > > "hw-strap1"); > > - object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scu), > > - "hw-strap2"); > > object_property_add_alias(obj, "hw-prot-key", OBJECT(&s->scu), > > "hw-prot-key"); > > > > object_initialize_child(obj, "scuio", &s->scuio, > TYPE_ASPEED_2700_SCUIO); > > qdev_prop_set_uint32(DEVICE(&s->scuio), "silicon-rev", > > sc->silicon_rev); > > + object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scuio), > > + "hw-strap1"); > > > > snprintf(typename, sizeof(typename), "aspeed.fmc-%s", socname); > > object_initialize_child(obj, "fmc", &s->fmc, typename);
© 2016 - 2026 Red Hat, Inc.