diff mbox series

[v2,1/8] aspeed: Set CPU memory property explicitly

Message ID 20220624003701.1363500-2-pdel@fb.com
State New
Headers show
Series aspeed: Add multi-SoC machine | expand

Commit Message

Peter Delevoryas June 24, 2022, 12:36 a.m. UTC
Signed-off-by: Peter Delevoryas <pdel@fb.com>
---
 hw/arm/aspeed_ast2600.c | 2 ++
 hw/arm/aspeed_soc.c     | 2 ++
 2 files changed, 4 insertions(+)

Comments

Cédric Le Goater June 24, 2022, 6:36 a.m. UTC | #1
On 6/24/22 02:36, Peter Delevoryas wrote:
> Signed-off-by: Peter Delevoryas <pdel@fb.com>

Please merge this patch with patch 2 in which the "memory" property
is defined.

Thanks,

C.


> ---
>   hw/arm/aspeed_ast2600.c | 2 ++
>   hw/arm/aspeed_soc.c     | 2 ++
>   2 files changed, 4 insertions(+)
> 
> diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c
> index f70b17d3f9..f950fff070 100644
> --- a/hw/arm/aspeed_ast2600.c
> +++ b/hw/arm/aspeed_ast2600.c
> @@ -294,6 +294,8 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
>   
>           object_property_set_int(OBJECT(&s->cpu[i]), "cntfrq", 1125000000,
>                                   &error_abort);
> +        object_property_set_link(OBJECT(&s->cpu[i]), "memory",
> +                                 OBJECT(get_system_memory()), &error_abort);
>   
>           if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, errp)) {
>               return;
> diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
> index f530028874..06e5629800 100644
> --- a/hw/arm/aspeed_soc.c
> +++ b/hw/arm/aspeed_soc.c
> @@ -247,6 +247,8 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
>   
>       /* CPU */
>       for (i = 0; i < sc->num_cpus; i++) {
> +        object_property_set_link(OBJECT(&s->cpu[i]), "memory",
> +                                 OBJECT(get_system_memory()), &error_abort);
>           if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, errp)) {
>               return;
>           }
Cédric Le Goater June 24, 2022, 6:55 a.m. UTC | #2
On 6/24/22 08:36, Cédric Le Goater wrote:
> On 6/24/22 02:36, Peter Delevoryas wrote:
>> Signed-off-by: Peter Delevoryas <pdel@fb.com>
> 
> Please merge this patch with patch 2 in which the "memory" property
> is defined.

Ah no. That's another link. I don't understand where that was done
before.

C.


> 
> Thanks,
> 
> C.
> 
> 
>> ---
>>   hw/arm/aspeed_ast2600.c | 2 ++
>>   hw/arm/aspeed_soc.c     | 2 ++
>>   2 files changed, 4 insertions(+)
>>
>> diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c
>> index f70b17d3f9..f950fff070 100644
>> --- a/hw/arm/aspeed_ast2600.c
>> +++ b/hw/arm/aspeed_ast2600.c
>> @@ -294,6 +294,8 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
>>           object_property_set_int(OBJECT(&s->cpu[i]), "cntfrq", 1125000000,
>>                                   &error_abort);
>> +        object_property_set_link(OBJECT(&s->cpu[i]), "memory",
>> +                                 OBJECT(get_system_memory()), &error_abort);
>>           if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, errp)) {
>>               return;
>> diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
>> index f530028874..06e5629800 100644
>> --- a/hw/arm/aspeed_soc.c
>> +++ b/hw/arm/aspeed_soc.c
>> @@ -247,6 +247,8 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
>>       /* CPU */
>>       for (i = 0; i < sc->num_cpus; i++) {
>> +        object_property_set_link(OBJECT(&s->cpu[i]), "memory",
>> +                                 OBJECT(get_system_memory()), &error_abort);
>>           if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, errp)) {
>>               return;
>>           }
> 
>
Peter Delevoryas June 24, 2022, 2 p.m. UTC | #3
> On Jun 23, 2022, at 11:55 PM, Cédric Le Goater <clg@kaod.org> wrote:
> 
> On 6/24/22 08:36, Cédric Le Goater wrote:
>> On 6/24/22 02:36, Peter Delevoryas wrote:
>>> Signed-off-by: Peter Delevoryas <pdel@fb.com>
>> Please merge this patch with patch 2 in which the "memory" property
>> is defined.
> 
> Ah no. That's another link. I don't understand where that was done
> before.

Yeah, sorry if this was confusing:

In the AST1030, we set the memory property on the armv7m core explicitly.

In the AST2400, AST2500, and AST2600, we have been relying on the
CPU init code implicitly setting it to get_system_memory().

The goal of this patch was just to make it consistent across all of the
Aspeed SoC’s, so that the next patch (2/8) can introduce an SoC
memory property at the machine:SoC level without changing anything
at the SoC:CPU level.

> 
> C.
> 
> 
>> Thanks,
>> C.
>>> ---
>>>   hw/arm/aspeed_ast2600.c | 2 ++
>>>   hw/arm/aspeed_soc.c     | 2 ++
>>>   2 files changed, 4 insertions(+)
>>> 
>>> diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c
>>> index f70b17d3f9..f950fff070 100644
>>> --- a/hw/arm/aspeed_ast2600.c
>>> +++ b/hw/arm/aspeed_ast2600.c
>>> @@ -294,6 +294,8 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
>>>           object_property_set_int(OBJECT(&s->cpu[i]), "cntfrq", 1125000000,
>>>                                   &error_abort);
>>> +        object_property_set_link(OBJECT(&s->cpu[i]), "memory",
>>> +                                 OBJECT(get_system_memory()), &error_abort);
>>>           if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, errp)) {
>>>               return;
>>> diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
>>> index f530028874..06e5629800 100644
>>> --- a/hw/arm/aspeed_soc.c
>>> +++ b/hw/arm/aspeed_soc.c
>>> @@ -247,6 +247,8 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
>>>       /* CPU */
>>>       for (i = 0; i < sc->num_cpus; i++) {
>>> +        object_property_set_link(OBJECT(&s->cpu[i]), "memory",
>>> +                                 OBJECT(get_system_memory()), &error_abort);
>>>           if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, errp)) {
>>>               return;
>>>           }
>
diff mbox series

Patch

diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c
index f70b17d3f9..f950fff070 100644
--- a/hw/arm/aspeed_ast2600.c
+++ b/hw/arm/aspeed_ast2600.c
@@ -294,6 +294,8 @@  static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
 
         object_property_set_int(OBJECT(&s->cpu[i]), "cntfrq", 1125000000,
                                 &error_abort);
+        object_property_set_link(OBJECT(&s->cpu[i]), "memory",
+                                 OBJECT(get_system_memory()), &error_abort);
 
         if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, errp)) {
             return;
diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
index f530028874..06e5629800 100644
--- a/hw/arm/aspeed_soc.c
+++ b/hw/arm/aspeed_soc.c
@@ -247,6 +247,8 @@  static void aspeed_soc_realize(DeviceState *dev, Error **errp)
 
     /* CPU */
     for (i = 0; i < sc->num_cpus; i++) {
+        object_property_set_link(OBJECT(&s->cpu[i]), "memory",
+                                 OBJECT(get_system_memory()), &error_abort);
         if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, errp)) {
             return;
         }