@samitouri / QOSamiQemu / commits / 51011f7f36

arm: sbsa-gwdt: add 'wdat' option

it will be used by arm/virt board, to pick WDAT compatible watchdog impl. and act as switch over to WDAT ACPI table vesus default GTDT ACPI table. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-ID: <20260702145856.1539572-6-imammedo@redhat.com>

Igor Mammedov committed Jul 2, 2026 at 16:58 UTC 51011f7f36b4406718d9698530c4e9d920184755
2 files changed +10
hw/watchdog/sbsa_gwdt.c
+9
@@ -265,6 +265,14 @@ static void wdt_sbsa_gwdt_realize(DeviceState *dev, Error **errp)
265
266 sysbus_init_irq(sbd, &s->irq);
267
268 + /*
269 + * WDAT spec: "The clock interval that the WDT uses must be
270 + * greater than or equal to 1 millisecond."
271 + */
272 + if (s->wdat) {
273 + s->freq = 1000;
274 + }
275 +
276 s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, sbsa_gwdt_timer_sysinterrupt,
277 dev);
278 }
@@ -276,6 +284,7 @@ static const Property wdt_sbsa_gwdt_props[] = {
284 */
285 DEFINE_PROP_UINT64("clock-frequency", struct SBSA_GWDTState, freq,
286 1000000000),
287 + DEFINE_PROP_BOOL("wdat", struct SBSA_GWDTState, wdat, false),
288 };
289
290 static void wdt_sbsa_gwdt_class_init(ObjectClass *klass, const void *data)
include/hw/watchdog/sbsa_gwdt.h
+1
@@ -73,6 +73,7 @@ typedef struct SBSA_GWDTState {
73 uint32_t woru;
74 uint32_t wcvl;
75 uint32_t wcvu;
76 + bool wdat;
77 } SBSA_GWDTState;
78
79 #endif /* WDT_SBSA_GWDT_H */