OSDN Git Service

watchdog: aspeed: Sanitize control register values
authorAndrew Jeffery <andrew@aj.id.au>
Mon, 20 Sep 2021 06:50:59 +0000 (08:50 +0200)
committerCédric Le Goater <clg@kaod.org>
Mon, 20 Sep 2021 06:50:59 +0000 (08:50 +0200)
commit709098fd37307a810ae4b8958ade348745b5c0fe
tree1ba8dcb3fe606bce1cda6a9c7d9a225b11eba9d2
parent5bb825c8359e69652f7f9fce40a58499093b2d26
watchdog: aspeed: Sanitize control register values

While some of the critical fields remain the same, there is variation in
the definition of the control register across the SoC generations.
Reserved regions are adjusted, while in other cases the mutability or
behaviour of fields change.

Introduce a callback to sanitize the value on writes to ensure model
behaviour reflects the hardware.

Fixes: 854123bf8d4b ("wdt: Add Aspeed watchdog device model")
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20210709053107.1829304-2-andrew@aj.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
hw/watchdog/wdt_aspeed.c
include/hw/watchdog/wdt_aspeed.h