hw/arm/armv7m: Handle disconnected clock inputs
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 8 Feb 2022 17:16:43 +0000 (17:16 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 21 Feb 2022 13:30:20 +0000 (13:30 +0000)
commit542e87c7a2d90076b07611987fd3d789865e5ea1
treeddd411355744af09ea0ca99b76a846b2c743c4ad
parente117e9748f6946dcddfea6f157f9ab2b5f069f70
hw/arm/armv7m: Handle disconnected clock inputs

In the armv7m object, handle clock inputs that aren't connected.
This is always an error for 'cpuclk'. For 'refclk' it is OK for this
to be disconnected, but we need to handle it by not trying to connect
a sourceless-clock to the systick device.

This fixes a bug where on the mps2-an521 and similar boards (which
do not have a refclk) the systick device incorrectly reset with
SYST_CSR.CLKSOURCE 0 ("use refclk") rather than 1 ("use CPU clock").

Cc: qemu-stable@nongnu.org
Reported-by: Richard Petri <git@rpls.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220208171643.3486277-1-peter.maydell@linaro.org
hw/arm/armv7m.c