From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: tim@xen.org, Ian.Campbell@citrix.com,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH 4/7] xen/arm: set the SMP bit in the ACTLR register
Date: Tue, 13 Nov 2012 15:42:13 +0000 [thread overview]
Message-ID: <1352821336-25837-4-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1211131521520.28049@kaball.uk.xensource.com>
>From the Cortex A15 manual:
"Enables the processor to receive instruction cache, BTB, and TLB maintenance
operations from other processors"
...
"You must set this bit before enabling the caches and MMU, or
performing any cache and TLB maintenance operations. The only time
you must clear this bit is during a processor power-down sequence"
Changes in v2:
- detect the processor ID and call a processor specific initialization
function;
- move the ACTLR initialization to the CortexA15 initialization
function;
- move the ACTLR_* defines to processor-ca15.h.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
---
xen/arch/arm/Makefile | 1 +
xen/arch/arm/head.S | 10 +++++++
xen/arch/arm/proc-ca15.S | 28 +++++++++++++++++++++
xen/include/asm-arm/cpregs.h | 1 +
xen/include/asm-arm/processor-ca15.h | 45 ++++++++++++++++++++++++++++++++++
xen/include/asm-arm/processor.h | 3 ++
6 files changed, 88 insertions(+), 0 deletions(-)
create mode 100644 xen/arch/arm/proc-ca15.S
create mode 100644 xen/include/asm-arm/processor-ca15.h
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 634b620..d3e34bc 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -13,6 +13,7 @@ obj-y += irq.o
obj-y += kernel.o
obj-y += mm.o
obj-y += mode_switch.o
+obj-y += proc-ca15.o
obj-y += p2m.o
obj-y += percpu.o
obj-y += guestcopy.o
diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 4506244..25993d6 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -19,6 +19,7 @@
#include <asm/config.h>
#include <asm/page.h>
+#include <asm/processor-ca15.h>
#include <asm/asm_defns.h>
#define PT_PT 0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
@@ -148,6 +149,15 @@ skip_bss:
PRINT("- Setting up control registers -\r\n")
+ /* Read CPU ID */
+ mrc CP32(r0, MIDR)
+ ldr r1, =(MIDR_MASK)
+ and r0, r0, r1
+ /* Is this a Cortex A15? */
+ ldr r1, =(CORTEX_A15_ID)
+ teq r0, r1
+ bleq cortex_a15_init
+
/* Set up memory attribute type tables */
ldr r0, =MAIR0VAL
ldr r1, =MAIR1VAL
diff --git a/xen/arch/arm/proc-ca15.S b/xen/arch/arm/proc-ca15.S
new file mode 100644
index 0000000..5a5bf64
--- /dev/null
+++ b/xen/arch/arm/proc-ca15.S
@@ -0,0 +1,28 @@
+/*
+ * xen/arch/arm/proc-ca15.S
+ *
+ * Cortex A15 specific initializations
+ *
+ * Copyright (c) 2011 Citrix Systems.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <asm/asm_defns.h>
+#include <asm/processor-ca15.h>
+
+.globl cortex_a15_init
+cortex_a15_init:
+ /* Set up the SMP bit in ACTLR */
+ mrc CP32(r0, ACTLR)
+ orr r0, r0, #(ACTLR_CA15_SMP) /* enable SMP bit*/
+ mcr CP32(r0, ACTLR)
+ mov pc, lr
diff --git a/xen/include/asm-arm/cpregs.h b/xen/include/asm-arm/cpregs.h
index 34a9e93..3b51845 100644
--- a/xen/include/asm-arm/cpregs.h
+++ b/xen/include/asm-arm/cpregs.h
@@ -104,6 +104,7 @@
/* Coprocessor 15 */
/* CP15 CR0: CPUID and Cache Type Registers */
+#define MIDR p15,0,c0,c0,0 /* Main ID Register */
#define MPIDR p15,0,c0,c0,5 /* Multiprocessor Affinity Register */
#define ID_PFR0 p15,0,c0,c1,0 /* Processor Feature Register 0 */
#define ID_PFR1 p15,0,c0,c1,1 /* Processor Feature Register 1 */
diff --git a/xen/include/asm-arm/processor-ca15.h b/xen/include/asm-arm/processor-ca15.h
new file mode 100644
index 0000000..86231b3
--- /dev/null
+++ b/xen/include/asm-arm/processor-ca15.h
@@ -0,0 +1,45 @@
+#ifndef __ASM_ARM_PROCESSOR_CA15_H
+#define __ASM_ARM_PROCESSOR_CA15_H
+
+
+#define CORTEX_A15_ID (0x410FC0F0)
+
+/* ACTLR Auxiliary Control Register, Cortex A15 */
+#define ACTLR_CA15_SNOOP_DELAYED (1<<31)
+#define ACTLR_CA15_MAIN_CLOCK (1<<30)
+#define ACTLR_CA15_NEON_CLOCK (1<<29)
+#define ACTLR_CA15_NONCACHE (1<<24)
+#define ACTLR_CA15_INORDER_REQ (1<<23)
+#define ACTLR_CA15_INORDER_LOAD (1<<22)
+#define ACTLR_CA15_L2_TLB_PREFETCH (1<<21)
+#define ACTLR_CA15_L2_IPA_PA_CACHE (1<<20)
+#define ACTLR_CA15_L2_CACHE (1<<19)
+#define ACTLR_CA15_L2_PA_CACHE (1<<18)
+#define ACTLR_CA15_TLB (1<<17)
+#define ACTLR_CA15_STRONGY_ORDERED (1<<16)
+#define ACTLR_CA15_INORDER (1<<15)
+#define ACTLR_CA15_FORCE_LIM (1<<14)
+#define ACTLR_CA15_CP_FLUSH (1<<13)
+#define ACTLR_CA15_CP_PUSH (1<<12)
+#define ACTLR_CA15_LIM (1<<11)
+#define ACTLR_CA15_SER (1<<10)
+#define ACTLR_CA15_OPT (1<<9)
+#define ACTLR_CA15_WFI (1<<8)
+#define ACTLR_CA15_WFE (1<<7)
+#define ACTLR_CA15_SMP (1<<6)
+#define ACTLR_CA15_PLD (1<<5)
+#define ACTLR_CA15_IP (1<<4)
+#define ACTLR_CA15_MICRO_BTB (1<<3)
+#define ACTLR_CA15_LOOP_ONE (1<<2)
+#define ACTLR_CA15_LOOP_DISABLE (1<<1)
+#define ACTLR_CA15_BTB (1<<0)
+
+#endif /* __ASM_ARM_PROCESSOR_CA15_H */
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 3849b23..e0c0beb 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -3,6 +3,9 @@
#include <asm/cpregs.h>
+/* MIDR Main ID Register */
+#define MIDR_MASK 0xff0ffff0
+
/* TTBCR Translation Table Base Control Register */
#define TTBCR_EAE 0x80000000
#define TTBCR_N_MASK 0x07
--
1.7.2.5
next prev parent reply other threads:[~2012-11-13 15:42 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-13 15:40 [PATCH v2 0/7] xen/arm: run on real hardware Stefano Stabellini
2012-11-13 15:42 ` [PATCH 1/7] xen/arm: pass the correct bit-per-interrupt argument to vgic_irq_rank Stefano Stabellini
2012-11-15 10:26 ` Ian Campbell
2012-11-13 15:42 ` [PATCH 2/7] xen/arm: setup the fixmap in head.S Stefano Stabellini
2012-11-15 10:27 ` Ian Campbell
2012-11-13 15:42 ` [PATCH 3/7] pl011: set baud and clock_hz to the right defaults for Versatile Express Stefano Stabellini
2012-11-15 10:27 ` Ian Campbell
2012-11-13 15:42 ` Stefano Stabellini [this message]
2012-11-15 10:27 ` [PATCH 4/7] xen/arm: set the SMP bit in the ACTLR register Ian Campbell
2012-11-13 15:42 ` [PATCH 5/7] xen/arm: wake up secondary cpus Stefano Stabellini
2012-11-15 10:28 ` Ian Campbell
2012-11-13 15:42 ` [PATCH 6/7] xen/arm: flush D-cache and I-cache when appropriate Stefano Stabellini
2012-11-15 10:02 ` Ian Campbell
2012-11-16 15:36 ` Stefano Stabellini
2012-11-13 15:42 ` [PATCH 7/7] xen/arm: get the number of cpus from device tree Stefano Stabellini
2012-11-15 10:09 ` Ian Campbell
2012-11-15 15:26 ` Stefano Stabellini
2012-11-15 15:34 ` Ian Campbell
2012-11-15 16:18 ` Stefano Stabellini
2012-11-15 16:27 ` Ian Campbell
-- strict thread matches above, loose matches on Subject: below --
2012-10-24 15:03 [PATCH 0/7] xen/arm: run on real hardware Stefano Stabellini
2012-10-24 15:03 ` [PATCH 4/7] xen/arm: set the SMP bit in the ACTLR register Stefano Stabellini
2012-10-25 9:52 ` Ian Campbell
2012-10-25 11:57 ` Stefano Stabellini
2012-10-25 12:04 ` Ian Campbell
2012-10-26 8:56 ` Tim Deegan
2012-10-26 8:59 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1352821336-25837-4-git-send-email-stefano.stabellini@eu.citrix.com \
--to=stefano.stabellini@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).