diff mbox series

[v3,04/28] hw/arm/aspeed: Rename IRQ table and machine name for AST2700 A0

Message ID 20250213033531.3367697-5-jamin_lin@aspeedtech.com (mailing list archive)
State New
Headers show
Series Support AST2700 A1 | expand

Commit Message

Jamin Lin Feb. 13, 2025, 3:35 a.m. UTC
Currently, AST2700 SoC only supports A0. To support AST2700 A1, rename its IRQ
table and machine name.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
 hw/arm/aspeed.c         | 8 ++++----
 hw/arm/aspeed_ast27x0.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

Comments

Cédric Le Goater Feb. 18, 2025, 5:47 a.m. UTC | #1
On 2/13/25 04:35, Jamin Lin wrote:
> Currently, AST2700 SoC only supports A0. To support AST2700 A1, rename its IRQ
> table and machine name.
> 
> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> ---
>   hw/arm/aspeed.c         | 8 ++++----
>   hw/arm/aspeed_ast27x0.c | 8 ++++----
>   2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
> index d9418e2b9f..6ddfdbdeba 100644
> --- a/hw/arm/aspeed.c
> +++ b/hw/arm/aspeed.c
> @@ -1654,12 +1654,12 @@ static void ast2700_evb_i2c_init(AspeedMachineState *bmc)
>                               TYPE_TMP105, 0x4d);
>   }
>   
> -static void aspeed_machine_ast2700_evb_class_init(ObjectClass *oc, void *data)
> +static void aspeed_machine_ast2700a0_evb_class_init(ObjectClass *oc, void *data)
>   {
>       MachineClass *mc = MACHINE_CLASS(oc);
>       AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
>   
> -    mc->desc = "Aspeed AST2700 EVB (Cortex-A35)";
> +    mc->desc = "Aspeed AST2700 A0 EVB (Cortex-A35)";
>       amc->soc_name  = "ast2700-a0";
>       amc->hw_strap1 = AST2700_EVB_HW_STRAP1;
>       amc->hw_strap2 = AST2700_EVB_HW_STRAP2;
> @@ -1795,9 +1795,9 @@ static const TypeInfo aspeed_machine_types[] = {
>           .class_init     = aspeed_minibmc_machine_ast1030_evb_class_init,
>   #ifdef TARGET_AARCH64
>       }, {
> -        .name          = MACHINE_TYPE_NAME("ast2700-evb"),
> +        .name          = MACHINE_TYPE_NAME("ast2700a0-evb"),

machine "ast2700-evb" has now disappeared from QEMU. You need to add
an alias with "mc->alias" to restore the initial machine name, or
follow the deprecation process :

   https://qemu.readthedocs.io/en/v9.2.0/about/deprecated.html

Thanks,

C.



>           .parent        = TYPE_ASPEED_MACHINE,
> -        .class_init    = aspeed_machine_ast2700_evb_class_init,
> +        .class_init    = aspeed_machine_ast2700a0_evb_class_init,
>   #endif
>       }, {
>           .name          = TYPE_ASPEED_MACHINE,
> diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
> index 2d0c99f159..6e3375f5d3 100644
> --- a/hw/arm/aspeed_ast27x0.c
> +++ b/hw/arm/aspeed_ast27x0.c
> @@ -72,7 +72,7 @@ static const hwaddr aspeed_soc_ast2700_memmap[] = {
>   #define AST2700_MAX_IRQ 256
>   
>   /* Shared Peripheral Interrupt values below are offset by -32 from datasheet */
> -static const int aspeed_soc_ast2700_irqmap[] = {
> +static const int aspeed_soc_ast2700a0_irqmap[] = {
>       [ASPEED_DEV_UART0]     = 132,
>       [ASPEED_DEV_UART1]     = 132,
>       [ASPEED_DEV_UART2]     = 132,
> @@ -740,7 +740,7 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
>       create_unimplemented_device("ast2700.io", 0x0, 0x4000000);
>   }
>   
> -static void aspeed_soc_ast2700_class_init(ObjectClass *oc, void *data)
> +static void aspeed_soc_ast2700a0_class_init(ObjectClass *oc, void *data)
>   {
>       static const char * const valid_cpu_types[] = {
>           ARM_CPU_TYPE_NAME("cortex-a35"),
> @@ -763,7 +763,7 @@ static void aspeed_soc_ast2700_class_init(ObjectClass *oc, void *data)
>       sc->uarts_num    = 13;
>       sc->num_cpus     = 4;
>       sc->uarts_base   = ASPEED_DEV_UART0;
> -    sc->irqmap       = aspeed_soc_ast2700_irqmap;
> +    sc->irqmap       = aspeed_soc_ast2700a0_irqmap;
>       sc->memmap       = aspeed_soc_ast2700_memmap;
>       sc->get_irq      = aspeed_soc_ast2700_get_irq;
>   }
> @@ -778,7 +778,7 @@ static const TypeInfo aspeed_soc_ast27x0_types[] = {
>           .name           = "ast2700-a0",
>           .parent         = TYPE_ASPEED27X0_SOC,
>           .instance_init  = aspeed_soc_ast2700_init,
> -        .class_init     = aspeed_soc_ast2700_class_init,
> +        .class_init     = aspeed_soc_ast2700a0_class_init,
>       },
>   };
>
Jamin Lin Feb. 21, 2025, 2:23 a.m. UTC | #2
Hi Cedric,

> Cc: Troy Lee <troy_lee@aspeedtech.com>
> Subject: Re: [PATCH v3 04/28] hw/arm/aspeed: Rename IRQ table and machine
> name for AST2700 A0
> 
> On 2/13/25 04:35, Jamin Lin wrote:
> > Currently, AST2700 SoC only supports A0. To support AST2700 A1, rename
> > its IRQ table and machine name.
> >
> > Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> > ---
> >   hw/arm/aspeed.c         | 8 ++++----
> >   hw/arm/aspeed_ast27x0.c | 8 ++++----
> >   2 files changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index
> > d9418e2b9f..6ddfdbdeba 100644
> > --- a/hw/arm/aspeed.c
> > +++ b/hw/arm/aspeed.c
> > @@ -1654,12 +1654,12 @@ static void
> ast2700_evb_i2c_init(AspeedMachineState *bmc)
> >                               TYPE_TMP105, 0x4d);
> >   }
> >
> > -static void aspeed_machine_ast2700_evb_class_init(ObjectClass *oc,
> > void *data)
> > +static void aspeed_machine_ast2700a0_evb_class_init(ObjectClass *oc,
> > +void *data)
> >   {
> >       MachineClass *mc = MACHINE_CLASS(oc);
> >       AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
> >
> > -    mc->desc = "Aspeed AST2700 EVB (Cortex-A35)";
> > +    mc->desc = "Aspeed AST2700 A0 EVB (Cortex-A35)";
> >       amc->soc_name  = "ast2700-a0";
> >       amc->hw_strap1 = AST2700_EVB_HW_STRAP1;
> >       amc->hw_strap2 = AST2700_EVB_HW_STRAP2; @@ -1795,9 +1795,9
> @@
> > static const TypeInfo aspeed_machine_types[] = {
> >           .class_init     =
> aspeed_minibmc_machine_ast1030_evb_class_init,
> >   #ifdef TARGET_AARCH64
> >       }, {
> > -        .name          = MACHINE_TYPE_NAME("ast2700-evb"),
> > +        .name          = MACHINE_TYPE_NAME("ast2700a0-evb"),
> 
> machine "ast2700-evb" has now disappeared from QEMU. You need to add an
> alias with "mc->alias" to restore the initial machine name, or follow the


Will add

> deprecation process :
> 
>    https://qemu.readthedocs.io/en/v9.2.0/about/deprecated.html
> 
Thanks for letting me know about the machine deprecation rules.
I understand why you suggest aliasing the initial machine "ast2700-evb" to "ast2700a0-evb."

To follow the machine deprecation rule, the initial machine "ast2700-evb" is aliased to "ast2700a0-evb."
In the future, we will alias "ast2700-evb" to new SoCs, such as "ast2700a1-evb."
Does this progress meet your expectations?

Thanks-Jamin

> Thanks,
> 
> C.
> 
> 
> 
> >           .parent        = TYPE_ASPEED_MACHINE,
> > -        .class_init    = aspeed_machine_ast2700_evb_class_init,
> > +        .class_init    = aspeed_machine_ast2700a0_evb_class_init,
> >   #endif
> >       }, {
> >           .name          = TYPE_ASPEED_MACHINE,
> > diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c index
> > 2d0c99f159..6e3375f5d3 100644
> > --- a/hw/arm/aspeed_ast27x0.c
> > +++ b/hw/arm/aspeed_ast27x0.c
> > @@ -72,7 +72,7 @@ static const hwaddr aspeed_soc_ast2700_memmap[] =
> {
> >   #define AST2700_MAX_IRQ 256
> >
> >   /* Shared Peripheral Interrupt values below are offset by -32 from
> > datasheet */ -static const int aspeed_soc_ast2700_irqmap[] = {
> > +static const int aspeed_soc_ast2700a0_irqmap[] = {
> >       [ASPEED_DEV_UART0]     = 132,
> >       [ASPEED_DEV_UART1]     = 132,
> >       [ASPEED_DEV_UART2]     = 132,
> > @@ -740,7 +740,7 @@ static void aspeed_soc_ast2700_realize(DeviceState
> *dev, Error **errp)
> >       create_unimplemented_device("ast2700.io", 0x0, 0x4000000);
> >   }
> >
> > -static void aspeed_soc_ast2700_class_init(ObjectClass *oc, void
> > *data)
> > +static void aspeed_soc_ast2700a0_class_init(ObjectClass *oc, void
> > +*data)
> >   {
> >       static const char * const valid_cpu_types[] = {
> >           ARM_CPU_TYPE_NAME("cortex-a35"), @@ -763,7 +763,7 @@
> static
> > void aspeed_soc_ast2700_class_init(ObjectClass *oc, void *data)
> >       sc->uarts_num    = 13;
> >       sc->num_cpus     = 4;
> >       sc->uarts_base   = ASPEED_DEV_UART0;
> > -    sc->irqmap       = aspeed_soc_ast2700_irqmap;
> > +    sc->irqmap       = aspeed_soc_ast2700a0_irqmap;
> >       sc->memmap       = aspeed_soc_ast2700_memmap;
> >       sc->get_irq      = aspeed_soc_ast2700_get_irq;
> >   }
> > @@ -778,7 +778,7 @@ static const TypeInfo aspeed_soc_ast27x0_types[] = {
> >           .name           = "ast2700-a0",
> >           .parent         = TYPE_ASPEED27X0_SOC,
> >           .instance_init  = aspeed_soc_ast2700_init,
> > -        .class_init     = aspeed_soc_ast2700_class_init,
> > +        .class_init     = aspeed_soc_ast2700a0_class_init,
> >       },
> >   };
> >
Cédric Le Goater Feb. 21, 2025, 2:04 p.m. UTC | #3
On 2/21/25 03:23, Jamin Lin wrote:
> Hi Cedric,
> 
>> Cc: Troy Lee <troy_lee@aspeedtech.com>
>> Subject: Re: [PATCH v3 04/28] hw/arm/aspeed: Rename IRQ table and machine
>> name for AST2700 A0
>>
>> On 2/13/25 04:35, Jamin Lin wrote:
>>> Currently, AST2700 SoC only supports A0. To support AST2700 A1, rename
>>> its IRQ table and machine name.
>>>
>>> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
>>> ---
>>>    hw/arm/aspeed.c         | 8 ++++----
>>>    hw/arm/aspeed_ast27x0.c | 8 ++++----
>>>    2 files changed, 8 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index
>>> d9418e2b9f..6ddfdbdeba 100644
>>> --- a/hw/arm/aspeed.c
>>> +++ b/hw/arm/aspeed.c
>>> @@ -1654,12 +1654,12 @@ static void
>> ast2700_evb_i2c_init(AspeedMachineState *bmc)
>>>                                TYPE_TMP105, 0x4d);
>>>    }
>>>
>>> -static void aspeed_machine_ast2700_evb_class_init(ObjectClass *oc,
>>> void *data)
>>> +static void aspeed_machine_ast2700a0_evb_class_init(ObjectClass *oc,
>>> +void *data)
>>>    {
>>>        MachineClass *mc = MACHINE_CLASS(oc);
>>>        AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
>>>
>>> -    mc->desc = "Aspeed AST2700 EVB (Cortex-A35)";
>>> +    mc->desc = "Aspeed AST2700 A0 EVB (Cortex-A35)";
>>>        amc->soc_name  = "ast2700-a0";
>>>        amc->hw_strap1 = AST2700_EVB_HW_STRAP1;
>>>        amc->hw_strap2 = AST2700_EVB_HW_STRAP2; @@ -1795,9 +1795,9
>> @@
>>> static const TypeInfo aspeed_machine_types[] = {
>>>            .class_init     =
>> aspeed_minibmc_machine_ast1030_evb_class_init,
>>>    #ifdef TARGET_AARCH64
>>>        }, {
>>> -        .name          = MACHINE_TYPE_NAME("ast2700-evb"),
>>> +        .name          = MACHINE_TYPE_NAME("ast2700a0-evb"),
>>
>> machine "ast2700-evb" has now disappeared from QEMU. You need to add an
>> alias with "mc->alias" to restore the initial machine name, or follow the
> 
> 
> Will add
> 
>> deprecation process :
>>
>>     https://qemu.readthedocs.io/en/v9.2.0/about/deprecated.html
>>
> Thanks for letting me know about the machine deprecation rules.
> I understand why you suggest aliasing the initial machine "ast2700-evb" to "ast2700a0-evb."

yes. This to maintain compatibility for the user.

Also, this change is breaking the tests. Please run 'make check'
  
> To follow the machine deprecation rule, the initial machine "ast2700-evb" is aliased to "ast2700a0-evb."

You don't need the alias to deprecate a machine. You need the alias
to maintain compatibility when renaming a machine.

To deprecate, you should update docs/about/deprecated.rst.

> In the future, we will alias "ast2700-evb" to new SoCs, such as "ast2700a1-evb."

Yes we could do that.

Or we could keep the ast2700a0-evb and ast2700a1-evb machines,
change the alias to point to ast2700a1-evb first and later on
deprecate ast2700a0-evb.


Thanks,

C.



> Does this progress meet your expectations?
> 
> Thanks-Jamin
> 
>> Thanks,
>>
>> C.
>>
>>
>>
>>>            .parent        = TYPE_ASPEED_MACHINE,
>>> -        .class_init    = aspeed_machine_ast2700_evb_class_init,
>>> +        .class_init    = aspeed_machine_ast2700a0_evb_class_init,
>>>    #endif
>>>        }, {
>>>            .name          = TYPE_ASPEED_MACHINE,
>>> diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c index
>>> 2d0c99f159..6e3375f5d3 100644
>>> --- a/hw/arm/aspeed_ast27x0.c
>>> +++ b/hw/arm/aspeed_ast27x0.c
>>> @@ -72,7 +72,7 @@ static const hwaddr aspeed_soc_ast2700_memmap[] =
>> {
>>>    #define AST2700_MAX_IRQ 256
>>>
>>>    /* Shared Peripheral Interrupt values below are offset by -32 from
>>> datasheet */ -static const int aspeed_soc_ast2700_irqmap[] = {
>>> +static const int aspeed_soc_ast2700a0_irqmap[] = {
>>>        [ASPEED_DEV_UART0]     = 132,
>>>        [ASPEED_DEV_UART1]     = 132,
>>>        [ASPEED_DEV_UART2]     = 132,
>>> @@ -740,7 +740,7 @@ static void aspeed_soc_ast2700_realize(DeviceState
>> *dev, Error **errp)
>>>        create_unimplemented_device("ast2700.io", 0x0, 0x4000000);
>>>    }
>>>
>>> -static void aspeed_soc_ast2700_class_init(ObjectClass *oc, void
>>> *data)
>>> +static void aspeed_soc_ast2700a0_class_init(ObjectClass *oc, void
>>> +*data)
>>>    {
>>>        static const char * const valid_cpu_types[] = {
>>>            ARM_CPU_TYPE_NAME("cortex-a35"), @@ -763,7 +763,7 @@
>> static
>>> void aspeed_soc_ast2700_class_init(ObjectClass *oc, void *data)
>>>        sc->uarts_num    = 13;
>>>        sc->num_cpus     = 4;
>>>        sc->uarts_base   = ASPEED_DEV_UART0;
>>> -    sc->irqmap       = aspeed_soc_ast2700_irqmap;
>>> +    sc->irqmap       = aspeed_soc_ast2700a0_irqmap;
>>>        sc->memmap       = aspeed_soc_ast2700_memmap;
>>>        sc->get_irq      = aspeed_soc_ast2700_get_irq;
>>>    }
>>> @@ -778,7 +778,7 @@ static const TypeInfo aspeed_soc_ast27x0_types[] = {
>>>            .name           = "ast2700-a0",
>>>            .parent         = TYPE_ASPEED27X0_SOC,
>>>            .instance_init  = aspeed_soc_ast2700_init,
>>> -        .class_init     = aspeed_soc_ast2700_class_init,
>>> +        .class_init     = aspeed_soc_ast2700a0_class_init,
>>>        },
>>>    };
>>>
>
diff mbox series

Patch

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index d9418e2b9f..6ddfdbdeba 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -1654,12 +1654,12 @@  static void ast2700_evb_i2c_init(AspeedMachineState *bmc)
                             TYPE_TMP105, 0x4d);
 }
 
-static void aspeed_machine_ast2700_evb_class_init(ObjectClass *oc, void *data)
+static void aspeed_machine_ast2700a0_evb_class_init(ObjectClass *oc, void *data)
 {
     MachineClass *mc = MACHINE_CLASS(oc);
     AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
 
-    mc->desc = "Aspeed AST2700 EVB (Cortex-A35)";
+    mc->desc = "Aspeed AST2700 A0 EVB (Cortex-A35)";
     amc->soc_name  = "ast2700-a0";
     amc->hw_strap1 = AST2700_EVB_HW_STRAP1;
     amc->hw_strap2 = AST2700_EVB_HW_STRAP2;
@@ -1795,9 +1795,9 @@  static const TypeInfo aspeed_machine_types[] = {
         .class_init     = aspeed_minibmc_machine_ast1030_evb_class_init,
 #ifdef TARGET_AARCH64
     }, {
-        .name          = MACHINE_TYPE_NAME("ast2700-evb"),
+        .name          = MACHINE_TYPE_NAME("ast2700a0-evb"),
         .parent        = TYPE_ASPEED_MACHINE,
-        .class_init    = aspeed_machine_ast2700_evb_class_init,
+        .class_init    = aspeed_machine_ast2700a0_evb_class_init,
 #endif
     }, {
         .name          = TYPE_ASPEED_MACHINE,
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
index 2d0c99f159..6e3375f5d3 100644
--- a/hw/arm/aspeed_ast27x0.c
+++ b/hw/arm/aspeed_ast27x0.c
@@ -72,7 +72,7 @@  static const hwaddr aspeed_soc_ast2700_memmap[] = {
 #define AST2700_MAX_IRQ 256
 
 /* Shared Peripheral Interrupt values below are offset by -32 from datasheet */
-static const int aspeed_soc_ast2700_irqmap[] = {
+static const int aspeed_soc_ast2700a0_irqmap[] = {
     [ASPEED_DEV_UART0]     = 132,
     [ASPEED_DEV_UART1]     = 132,
     [ASPEED_DEV_UART2]     = 132,
@@ -740,7 +740,7 @@  static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
     create_unimplemented_device("ast2700.io", 0x0, 0x4000000);
 }
 
-static void aspeed_soc_ast2700_class_init(ObjectClass *oc, void *data)
+static void aspeed_soc_ast2700a0_class_init(ObjectClass *oc, void *data)
 {
     static const char * const valid_cpu_types[] = {
         ARM_CPU_TYPE_NAME("cortex-a35"),
@@ -763,7 +763,7 @@  static void aspeed_soc_ast2700_class_init(ObjectClass *oc, void *data)
     sc->uarts_num    = 13;
     sc->num_cpus     = 4;
     sc->uarts_base   = ASPEED_DEV_UART0;
-    sc->irqmap       = aspeed_soc_ast2700_irqmap;
+    sc->irqmap       = aspeed_soc_ast2700a0_irqmap;
     sc->memmap       = aspeed_soc_ast2700_memmap;
     sc->get_irq      = aspeed_soc_ast2700_get_irq;
 }
@@ -778,7 +778,7 @@  static const TypeInfo aspeed_soc_ast27x0_types[] = {
         .name           = "ast2700-a0",
         .parent         = TYPE_ASPEED27X0_SOC,
         .instance_init  = aspeed_soc_ast2700_init,
-        .class_init     = aspeed_soc_ast2700_class_init,
+        .class_init     = aspeed_soc_ast2700a0_class_init,
     },
 };