>From 93c088c486f2cf7b3fd260684aa714ccce3dfbd4 Mon Sep 17 00:00:00 2001
From: Jon Medhurst <tixy@linaro.org>
Date: Fri, 7 Sep 2012 09:28:49 +0100
Subject: [PATCH] bootwrapper: Get it working for big.LITTLE models

Note, this breaks other models.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
---
 boot.S |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/boot.S b/boot.S
index 61cd93f..60b59a6 100644
--- a/boot.S
+++ b/boot.S
@@ -67,6 +67,19 @@ start:
 	mov	r0, #0xf0000000
 	mcr	p15, 0, r0, c12, c0, 1		@ Monitor vector base address
 
+	@
+	@ Turn on CCI snoops
+	@
+	mov	r3, #3
+	ldr	r4, =0x2c090000
+	mov	r5, #0x4000		@ A15
+	str	r3, [r4, r5]
+	mov	r5, #0x5000		@ A7
+	str	r3, [r4, r5]
+0:	ldr	r3, [r4, #0xc]		@ status reg
+	tst	r3, #1
+	bne	0b
+
 	@ Set up hvbar so hvc comes back here.
 	ldr	r0, =vectors
 	mov	r7, #0xfffffff0
@@ -93,7 +106,7 @@ vectors:
 into_hyp_mode:
 	@ Check CPU nr again
 	mrc	p15, 0, r0, c0, c0, 5		@ MPIDR (ARMv7 only)
-	and	r0, r0, #15			@ CPU number
+	bfc	r0, #24, #8                     @ CPU number, taking multicluster into account
 	cmp	r0, #0				@ primary CPU?
 	beq	2f
 
-- 
1.7.10.4

