[PATCH 2/4] hw/gpio: Handle clock migration in STM32L4x5 gpios

Inès Varhol posted 4 patches 1 year, 9 months ago
Maintainers: Arnaud Minier <arnaud.minier@telecom-paris.fr>, "Inès Varhol" <ines.varhol@telecom-paris.fr>, Peter Maydell <peter.maydell@linaro.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Alistair Francis <alistair@alistair23.me>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>
There is a newer version of this series
[PATCH 2/4] hw/gpio: Handle clock migration in STM32L4x5 gpios
Posted by Inès Varhol 1 year, 9 months ago
Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr>
---
 hw/gpio/stm32l4x5_gpio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/gpio/stm32l4x5_gpio.c b/hw/gpio/stm32l4x5_gpio.c
index 71bf5fddb2..14e6618d30 100644
--- a/hw/gpio/stm32l4x5_gpio.c
+++ b/hw/gpio/stm32l4x5_gpio.c
@@ -20,6 +20,7 @@
 #include "qemu/log.h"
 #include "hw/gpio/stm32l4x5_gpio.h"
 #include "hw/irq.h"
+#include "hw/clock.h"
 #include "hw/qdev-clock.h"
 #include "hw/qdev-properties.h"
 #include "qapi/visitor.h"
@@ -441,6 +442,7 @@ static const VMStateDescription vmstate_stm32l4x5_gpio = {
         VMSTATE_UINT32(ascr, Stm32l4x5GpioState),
         VMSTATE_UINT16(disconnected_pins, Stm32l4x5GpioState),
         VMSTATE_UINT16(pins_connected_high, Stm32l4x5GpioState),
+        VMSTATE_CLOCK(clk, Stm32l4x5GpioState),
         VMSTATE_END_OF_LIST()
     }
 };
-- 
2.43.2
Re: [PATCH 2/4] hw/gpio: Handle clock migration in STM32L4x5 gpios
Posted by Philippe Mathieu-Daudé 1 year, 9 months ago
Hi Inès,

On 5/5/24 16:05, Inès Varhol wrote:

Fixes: 1cdcfb6e93 ("hw/gpio: Implement STM32L4x5 GPIO")

> Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr>
> ---
>   hw/gpio/stm32l4x5_gpio.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/hw/gpio/stm32l4x5_gpio.c b/hw/gpio/stm32l4x5_gpio.c
> index 71bf5fddb2..14e6618d30 100644
> --- a/hw/gpio/stm32l4x5_gpio.c
> +++ b/hw/gpio/stm32l4x5_gpio.c
> @@ -20,6 +20,7 @@
>   #include "qemu/log.h"
>   #include "hw/gpio/stm32l4x5_gpio.h"
>   #include "hw/irq.h"
> +#include "hw/clock.h"
>   #include "hw/qdev-clock.h"
>   #include "hw/qdev-properties.h"
>   #include "qapi/visitor.h"
> @@ -441,6 +442,7 @@ static const VMStateDescription vmstate_stm32l4x5_gpio = {
>           VMSTATE_UINT32(ascr, Stm32l4x5GpioState),
>           VMSTATE_UINT16(disconnected_pins, Stm32l4x5GpioState),
>           VMSTATE_UINT16(pins_connected_high, Stm32l4x5GpioState),
> +        VMSTATE_CLOCK(clk, Stm32l4x5GpioState),

IIUC we need to increase vmstate_stm32l4x5_gpio version_id (see
commit 8fd34dc0c4 "hw/arm/armsse: Wire up clocks" for example).

>           VMSTATE_END_OF_LIST()
>       }
>   };