hw/misc/a9scu: Do not allow invalid CPU count
commit14a560359d24d0f30ced8a2613b83323e9302490
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tue, 1 Sep 2020 14:40:57 +0000 (1 16:40 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 14 Sep 2020 13:23:19 +0000 (14 14:23 +0100)
tree40dda3f5042e8069999632aa587d2b085a9afe6f
parenta68694cd1f3e5448cca814ff39b871f9ebd71ed5
hw/misc/a9scu: Do not allow invalid CPU count

Per the datasheet (DDI0407 r2p0):

  "The SCU connects one to four Cortex-A9 processors to
   the memory system through the AXI interfaces."

Change the instance_init() handler to a device_realize()
one so we can verify the property is in range, and return
an error to the caller if not.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20200901144100.116742-2-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/misc/a9scu.c