diff mbox

armv7m_nvic: fix CPUID Base Register

Message ID 1398036308-32166-1-git-send-email-rabin@rab.in
State New
Headers show

Commit Message

Rabin Vincent April 20, 2014, 11:25 p.m. UTC
cp15.c0_cpuid is never initialized for ARMv7-M; take the value directly
from cpu->midr instead.

Signed-off-by: Rabin Vincent <rabin@rab.in>
---
 hw/intc/armv7m_nvic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Maydell April 23, 2014, 10:56 a.m. UTC | #1
On 21 April 2014 00:25, Rabin Vincent <rabin@rab.in> wrote:
> cp15.c0_cpuid is never initialized for ARMv7-M; take the value directly
> from cpu->midr instead.
>
> Signed-off-by: Rabin Vincent <rabin@rab.in>

Hmm, I wonder how long that's been broken for...

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
diff mbox

Patch

diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
index 6066fa6..f5b0c3b 100644
--- a/hw/intc/armv7m_nvic.c
+++ b/hw/intc/armv7m_nvic.c
@@ -173,7 +173,7 @@  static uint32_t nvic_readl(nvic_state *s, uint32_t offset)
         return 10000;
     case 0xd00: /* CPUID Base.  */
         cpu = ARM_CPU(current_cpu);
-        return cpu->env.cp15.c0_cpuid;
+        return cpu->midr;
     case 0xd04: /* Interrupt Control State.  */
         /* VECTACTIVE */
         val = s->gic.running_irq[0];