hw/misc/mps2-fpgaio: Implement PSCNTR and COUNTER
commit93739075d28ce81ae06237b48084f26a377cdcad
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 24 Aug 2018 12:17:40 +0000 (24 13:17 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 24 Aug 2018 12:17:40 +0000 (24 13:17 +0100)
tree6c8645f36ae86f1668f279dedd5b24a43955f28d
parenta1982f90a42b22f2858e7d8497ab7223cd49b65d
hw/misc/mps2-fpgaio: Implement PSCNTR and COUNTER

In the MPS2 FPGAIO, PSCNTR is a free-running downcounter with
a reload value configured via the PRESCALE register, and
COUNTER counts up by 1 every time PSCNTR reaches zero.
Implement these counters.

We can just increment the counters migration subsection's
version ID because we only added it in the previous commit,
so no released QEMU versions will be using it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20180820141116.9118-3-peter.maydell@linaro.org
hw/misc/mps2-fpgaio.c
include/hw/misc/mps2-fpgaio.h