#include "hw/sysbus.h"
#include "hw/ptimer.h"
+#include "qom/object.h"
#define TYPE_CMSDK_APB_WATCHDOG "cmsdk-apb-watchdog"
-#define CMSDK_APB_WATCHDOG(obj) OBJECT_CHECK(CMSDKAPBWatchdog, (obj), \
- TYPE_CMSDK_APB_WATCHDOG)
+typedef struct CMSDKAPBWatchdog CMSDKAPBWatchdog;
+DECLARE_INSTANCE_CHECKER(CMSDKAPBWatchdog, CMSDK_APB_WATCHDOG,
+ TYPE_CMSDK_APB_WATCHDOG)
-typedef struct CMSDKAPBWatchdog {
+/*
+ * This shares the same struct (and cast macro) as the base
+ * cmsdk-apb-watchdog device.
+ */
+#define TYPE_LUMINARY_WATCHDOG "luminary-watchdog"
+
+struct CMSDKAPBWatchdog {
/*< private >*/
SysBusDevice parent_obj;
MemoryRegion iomem;
qemu_irq wdogint;
uint32_t wdogclk_frq;
+ bool is_luminary;
struct ptimer_state *timer;
uint32_t control;
uint32_t itcr;
uint32_t itop;
uint32_t resetstatus;
-} CMSDKAPBWatchdog;
+ const uint32_t *id;
+};
#endif