diff mbox series

[08/14] ppc/pnv: Introduce version and device_id class atributes for PHB4 devices

Message ID 20211202144235.1276352-9-clg@kaod.org (mailing list archive)
State New, archived
Headers show
Series ppc/pnv: Add support for user created PHB3/PHB4 devices | expand

Commit Message

Cédric Le Goater Dec. 2, 2021, 2:42 p.m. UTC
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 include/hw/pci-host/pnv_phb4.h | 2 ++
 hw/pci-host/pnv_phb4_pec.c     | 2 ++
 hw/ppc/pnv.c                   | 4 ++--
 3 files changed, 6 insertions(+), 2 deletions(-)

Comments

Daniel Henrique Barboza Dec. 2, 2021, 5:37 p.m. UTC | #1
On 12/2/21 11:42, Cédric Le Goater wrote:
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>

>   include/hw/pci-host/pnv_phb4.h | 2 ++
>   hw/pci-host/pnv_phb4_pec.c     | 2 ++
>   hw/ppc/pnv.c                   | 4 ++--
>   3 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h
> index 27556ae53425..b2864233641e 100644
> --- a/include/hw/pci-host/pnv_phb4.h
> +++ b/include/hw/pci-host/pnv_phb4.h
> @@ -219,6 +219,8 @@ struct PnvPhb4PecClass {
>       int compat_size;
>       const char *stk_compat;
>       int stk_compat_size;
> +    uint64_t version;
> +    uint64_t device_id;
>   };
>   
>   #endif /* PCI_HOST_PNV_PHB4_H */
> diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
> index 741ddc90ed8d..9f722729ac50 100644
> --- a/hw/pci-host/pnv_phb4_pec.c
> +++ b/hw/pci-host/pnv_phb4_pec.c
> @@ -499,6 +499,8 @@ static void pnv_pec_class_init(ObjectClass *klass, void *data)
>       pecc->compat_size = sizeof(compat);
>       pecc->stk_compat = stk_compat;
>       pecc->stk_compat_size = sizeof(stk_compat);
> +    pecc->version = PNV_PHB4_VERSION;
> +    pecc->device_id = PNV_PHB4_DEVICE_ID;
>   }
>   
>   static const TypeInfo pnv_pec_type_info = {
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 185464a1d443..0c65e1e88cf5 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -1408,9 +1408,9 @@ static void pnv_chip_power9_phb_realize(PnvChip *chip, Error **errp)
>               object_property_set_int(obj, "index", phb_id, &error_fatal);
>               object_property_set_int(obj, "chip-id", chip->chip_id,
>                                       &error_fatal);
> -            object_property_set_int(obj, "version", PNV_PHB4_VERSION,
> +            object_property_set_int(obj, "version", pecc->version,
>                                       &error_fatal);
> -            object_property_set_int(obj, "device-id", PNV_PHB4_DEVICE_ID,
> +            object_property_set_int(obj, "device-id", pecc->device_id,
>                                       &error_fatal);
>               object_property_set_link(obj, "stack", OBJECT(stack),
>                                        &error_abort);
>
Frederic Barrat Dec. 7, 2021, 10:01 a.m. UTC | #2
On 02/12/2021 15:42, Cédric Le Goater wrote:
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---


Empty log message ok in qemu?
But it looks ok to me.
Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com>


>   include/hw/pci-host/pnv_phb4.h | 2 ++
>   hw/pci-host/pnv_phb4_pec.c     | 2 ++
>   hw/ppc/pnv.c                   | 4 ++--
>   3 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h
> index 27556ae53425..b2864233641e 100644
> --- a/include/hw/pci-host/pnv_phb4.h
> +++ b/include/hw/pci-host/pnv_phb4.h
> @@ -219,6 +219,8 @@ struct PnvPhb4PecClass {
>       int compat_size;
>       const char *stk_compat;
>       int stk_compat_size;
> +    uint64_t version;
> +    uint64_t device_id;
>   };
>   
>   #endif /* PCI_HOST_PNV_PHB4_H */
> diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
> index 741ddc90ed8d..9f722729ac50 100644
> --- a/hw/pci-host/pnv_phb4_pec.c
> +++ b/hw/pci-host/pnv_phb4_pec.c
> @@ -499,6 +499,8 @@ static void pnv_pec_class_init(ObjectClass *klass, void *data)
>       pecc->compat_size = sizeof(compat);
>       pecc->stk_compat = stk_compat;
>       pecc->stk_compat_size = sizeof(stk_compat);
> +    pecc->version = PNV_PHB4_VERSION;
> +    pecc->device_id = PNV_PHB4_DEVICE_ID;
>   }
>   
>   static const TypeInfo pnv_pec_type_info = {
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 185464a1d443..0c65e1e88cf5 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -1408,9 +1408,9 @@ static void pnv_chip_power9_phb_realize(PnvChip *chip, Error **errp)
>               object_property_set_int(obj, "index", phb_id, &error_fatal);
>               object_property_set_int(obj, "chip-id", chip->chip_id,
>                                       &error_fatal);
> -            object_property_set_int(obj, "version", PNV_PHB4_VERSION,
> +            object_property_set_int(obj, "version", pecc->version,
>                                       &error_fatal);
> -            object_property_set_int(obj, "device-id", PNV_PHB4_DEVICE_ID,
> +            object_property_set_int(obj, "device-id", pecc->device_id,
>                                       &error_fatal);
>               object_property_set_link(obj, "stack", OBJECT(stack),
>                                        &error_abort);
>
Cédric Le Goater Dec. 7, 2021, 10:21 a.m. UTC | #3
On 12/7/21 11:01, Frederic Barrat wrote:
> 
> 
> On 02/12/2021 15:42, Cédric Le Goater wrote:
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>> ---
> 
> 
> Empty log message ok in qemu?

checkpatch didn't complain :) I might make an effort for v2.

Thanks,

C.


> But it looks ok to me.> Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com>
> 
> 
>>   include/hw/pci-host/pnv_phb4.h | 2 ++
>>   hw/pci-host/pnv_phb4_pec.c     | 2 ++
>>   hw/ppc/pnv.c                   | 4 ++--
>>   3 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h
>> index 27556ae53425..b2864233641e 100644
>> --- a/include/hw/pci-host/pnv_phb4.h
>> +++ b/include/hw/pci-host/pnv_phb4.h
>> @@ -219,6 +219,8 @@ struct PnvPhb4PecClass {
>>       int compat_size;
>>       const char *stk_compat;
>>       int stk_compat_size;
>> +    uint64_t version;
>> +    uint64_t device_id;
>>   };
>>   #endif /* PCI_HOST_PNV_PHB4_H */
>> diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
>> index 741ddc90ed8d..9f722729ac50 100644
>> --- a/hw/pci-host/pnv_phb4_pec.c
>> +++ b/hw/pci-host/pnv_phb4_pec.c
>> @@ -499,6 +499,8 @@ static void pnv_pec_class_init(ObjectClass *klass, void *data)
>>       pecc->compat_size = sizeof(compat);
>>       pecc->stk_compat = stk_compat;
>>       pecc->stk_compat_size = sizeof(stk_compat);
>> +    pecc->version = PNV_PHB4_VERSION;
>> +    pecc->device_id = PNV_PHB4_DEVICE_ID;
>>   }
>>   static const TypeInfo pnv_pec_type_info = {
>> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
>> index 185464a1d443..0c65e1e88cf5 100644
>> --- a/hw/ppc/pnv.c
>> +++ b/hw/ppc/pnv.c
>> @@ -1408,9 +1408,9 @@ static void pnv_chip_power9_phb_realize(PnvChip *chip, Error **errp)
>>               object_property_set_int(obj, "index", phb_id, &error_fatal);
>>               object_property_set_int(obj, "chip-id", chip->chip_id,
>>                                       &error_fatal);
>> -            object_property_set_int(obj, "version", PNV_PHB4_VERSION,
>> +            object_property_set_int(obj, "version", pecc->version,
>>                                       &error_fatal);
>> -            object_property_set_int(obj, "device-id", PNV_PHB4_DEVICE_ID,
>> +            object_property_set_int(obj, "device-id", pecc->device_id,
>>                                       &error_fatal);
>>               object_property_set_link(obj, "stack", OBJECT(stack),
>>                                        &error_abort);
>>
diff mbox series

Patch

diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h
index 27556ae53425..b2864233641e 100644
--- a/include/hw/pci-host/pnv_phb4.h
+++ b/include/hw/pci-host/pnv_phb4.h
@@ -219,6 +219,8 @@  struct PnvPhb4PecClass {
     int compat_size;
     const char *stk_compat;
     int stk_compat_size;
+    uint64_t version;
+    uint64_t device_id;
 };
 
 #endif /* PCI_HOST_PNV_PHB4_H */
diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
index 741ddc90ed8d..9f722729ac50 100644
--- a/hw/pci-host/pnv_phb4_pec.c
+++ b/hw/pci-host/pnv_phb4_pec.c
@@ -499,6 +499,8 @@  static void pnv_pec_class_init(ObjectClass *klass, void *data)
     pecc->compat_size = sizeof(compat);
     pecc->stk_compat = stk_compat;
     pecc->stk_compat_size = sizeof(stk_compat);
+    pecc->version = PNV_PHB4_VERSION;
+    pecc->device_id = PNV_PHB4_DEVICE_ID;
 }
 
 static const TypeInfo pnv_pec_type_info = {
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 185464a1d443..0c65e1e88cf5 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -1408,9 +1408,9 @@  static void pnv_chip_power9_phb_realize(PnvChip *chip, Error **errp)
             object_property_set_int(obj, "index", phb_id, &error_fatal);
             object_property_set_int(obj, "chip-id", chip->chip_id,
                                     &error_fatal);
-            object_property_set_int(obj, "version", PNV_PHB4_VERSION,
+            object_property_set_int(obj, "version", pecc->version,
                                     &error_fatal);
-            object_property_set_int(obj, "device-id", PNV_PHB4_DEVICE_ID,
+            object_property_set_int(obj, "device-id", pecc->device_id,
                                     &error_fatal);
             object_property_set_link(obj, "stack", OBJECT(stack),
                                      &error_abort);