qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xlnx-zynqmp-efuse: hw/nvram: Remove deprecated device reset
@ 2023-10-04  5:57 Tong Ho
  2023-10-04 19:20 ` Francisco Iglesias
  2023-10-16 16:31 ` Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Tong Ho @ 2023-10-04  5:57 UTC (permalink / raw)
  To: qemu-arm; +Cc: qemu-devel, alistair, edgar.iglesias, peter.maydell, tong.ho

This change implements the ResettableClass interface for the device.

Signed-off-by: Tong Ho <tong.ho@amd.com>
---
 hw/nvram/xlnx-zynqmp-efuse.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/hw/nvram/xlnx-zynqmp-efuse.c b/hw/nvram/xlnx-zynqmp-efuse.c
index 228ba0bbfa..3db5f98ec1 100644
--- a/hw/nvram/xlnx-zynqmp-efuse.c
+++ b/hw/nvram/xlnx-zynqmp-efuse.c
@@ -2,6 +2,7 @@
  * QEMU model of the ZynqMP eFuse
  *
  * Copyright (c) 2015 Xilinx Inc.
+ * Copyright (c) 2023 Advanced Micro Devices, Inc.
  *
  * Written by Edgar E. Iglesias <edgari@xilinx.com>
  *
@@ -769,9 +770,9 @@ static void zynqmp_efuse_register_reset(RegisterInfo *reg)
     register_reset(reg);
 }
 
-static void zynqmp_efuse_reset(DeviceState *dev)
+static void zynqmp_efuse_reset_hold(Object *obj)
 {
-    XlnxZynqMPEFuse *s = XLNX_ZYNQMP_EFUSE(dev);
+    XlnxZynqMPEFuse *s = XLNX_ZYNQMP_EFUSE(obj);
     unsigned int i;
 
     for (i = 0; i < ARRAY_SIZE(s->regs_info); ++i) {
@@ -837,8 +838,9 @@ static Property zynqmp_efuse_props[] = {
 static void zynqmp_efuse_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
+    ResettableClass *rc = RESETTABLE_CLASS(klass);
 
-    dc->reset = zynqmp_efuse_reset;
+    rc->phases.hold = zynqmp_efuse_reset_hold;
     dc->realize = zynqmp_efuse_realize;
     dc->vmsd = &vmstate_efuse;
     device_class_set_props(dc, zynqmp_efuse_props);
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xlnx-zynqmp-efuse: hw/nvram: Remove deprecated device reset
  2023-10-04  5:57 [PATCH] xlnx-zynqmp-efuse: hw/nvram: Remove deprecated device reset Tong Ho
@ 2023-10-04 19:20 ` Francisco Iglesias
  2023-10-16 16:31 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Francisco Iglesias @ 2023-10-04 19:20 UTC (permalink / raw)
  To: Tong Ho; +Cc: qemu-arm, qemu-devel, alistair, edgar.iglesias, peter.maydell

On [2023 Oct 03] Tue 22:57:13, Tong Ho wrote:
> This change implements the ResettableClass interface for the device.
> 
> Signed-off-by: Tong Ho <tong.ho@amd.com>

Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>

> ---
>  hw/nvram/xlnx-zynqmp-efuse.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/nvram/xlnx-zynqmp-efuse.c b/hw/nvram/xlnx-zynqmp-efuse.c
> index 228ba0bbfa..3db5f98ec1 100644
> --- a/hw/nvram/xlnx-zynqmp-efuse.c
> +++ b/hw/nvram/xlnx-zynqmp-efuse.c
> @@ -2,6 +2,7 @@
>   * QEMU model of the ZynqMP eFuse
>   *
>   * Copyright (c) 2015 Xilinx Inc.
> + * Copyright (c) 2023 Advanced Micro Devices, Inc.
>   *
>   * Written by Edgar E. Iglesias <edgari@xilinx.com>
>   *
> @@ -769,9 +770,9 @@ static void zynqmp_efuse_register_reset(RegisterInfo *reg)
>      register_reset(reg);
>  }
>  
> -static void zynqmp_efuse_reset(DeviceState *dev)
> +static void zynqmp_efuse_reset_hold(Object *obj)
>  {
> -    XlnxZynqMPEFuse *s = XLNX_ZYNQMP_EFUSE(dev);
> +    XlnxZynqMPEFuse *s = XLNX_ZYNQMP_EFUSE(obj);
>      unsigned int i;
>  
>      for (i = 0; i < ARRAY_SIZE(s->regs_info); ++i) {
> @@ -837,8 +838,9 @@ static Property zynqmp_efuse_props[] = {
>  static void zynqmp_efuse_class_init(ObjectClass *klass, void *data)
>  {
>      DeviceClass *dc = DEVICE_CLASS(klass);
> +    ResettableClass *rc = RESETTABLE_CLASS(klass);
>  
> -    dc->reset = zynqmp_efuse_reset;
> +    rc->phases.hold = zynqmp_efuse_reset_hold;
>      dc->realize = zynqmp_efuse_realize;
>      dc->vmsd = &vmstate_efuse;
>      device_class_set_props(dc, zynqmp_efuse_props);
> -- 
> 2.25.1
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xlnx-zynqmp-efuse: hw/nvram: Remove deprecated device reset
  2023-10-04  5:57 [PATCH] xlnx-zynqmp-efuse: hw/nvram: Remove deprecated device reset Tong Ho
  2023-10-04 19:20 ` Francisco Iglesias
@ 2023-10-16 16:31 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2023-10-16 16:31 UTC (permalink / raw)
  To: Tong Ho; +Cc: qemu-arm, qemu-devel, alistair, edgar.iglesias

On Wed, 4 Oct 2023 at 06:57, Tong Ho <tong.ho@amd.com> wrote:
>
> This change implements the ResettableClass interface for the device.
>
> Signed-off-by: Tong Ho <tong.ho@amd.com>
> ---

Applied to target-arm.next, thanks.

For the future, if you have a small set of basically
similar patches to related devices like these reset
ones, it's a bit less effort for me if you send them out
as a patch-series rather than as separate individual
patches.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-16 16:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-04  5:57 [PATCH] xlnx-zynqmp-efuse: hw/nvram: Remove deprecated device reset Tong Ho
2023-10-04 19:20 ` Francisco Iglesias
2023-10-16 16:31 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).