hw/misc/mps2-scc: Fix condition for CFG3 register
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 6 Feb 2024 13:29:23 +0000 (13:29 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 15 Feb 2024 14:32:38 +0000 (14:32 +0000)
We currently guard the CFG3 register read with
 (scc_partno(s) == 0x524 && scc_partno(s) == 0x547)
which is clearly wrong as it is never true.

This register is present on all board types except AN524
and AN527; correct the condition.

Fixes: 6ac80818941829c0 ("hw/misc/mps2-scc: Implement changes for AN547")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20240206132931.38376-6-peter.maydell@linaro.org

hw/misc/mps2-scc.c

index 6cfb5ff1086a21515dd5c11831eca2f8d54a8939..6c1b1cd37956898014c4cd7ad3a941fbde4a132b 100644 (file)
@@ -118,7 +118,7 @@ static uint64_t mps2_scc_read(void *opaque, hwaddr offset, unsigned size)
         r = s->cfg2;
         break;
     case A_CFG3:
-        if (scc_partno(s) == 0x524 && scc_partno(s) == 0x547) {
+        if (scc_partno(s) == 0x524 || scc_partno(s) == 0x547) {
             /* CFG3 reserved on AN524 */
             goto bad_offset;
         }