obj-y += hvm.o
obj-y += device.o
obj-y += decode.o
+obj-y += processor.o
#obj-bin-y += ....o
subdir-y += lib
obj-y += entry.o
-obj-y += proc-v7.o
+obj-y += proc-v7.o proc-caxx.o
obj-y += traps.o
obj-y += domain.o
--- /dev/null
+/*
+ * xen/arch/arm/arm32/proc-caxx.c
+ *
+ * arm V7 Cortex A15 and A7 initialisation
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (c) 2014 Linaro Limited.
+ *
+ * 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/procinfo.h>
+#include <asm/processor.h>
+
+#define ACTLR_SMP (1 << 6)
+
+static void caxx_vcpu_initialise(struct vcpu *v)
+{
+ /* If the guest has more 1 VCPU, enable the SMP bit in ACTLR */
+ if ( v->domain->max_vcpus > 1 )
+ v->arch.actlr |= ACTLR_SMP;
+ else
+ v->arch.actlr &= ~ACTLR_SMP;
+}
+
+const struct processor caxx_processor = {
+ .vcpu_initialise = caxx_vcpu_initialise,
+};
.long 0x410FC0F0 /* Cortex-A15 */
.long 0xFF0FFFF0 /* Mask */
.long ca15mp_init
+ .long caxx_processor
.size __v7_ca15mp_proc_info, . - __v7_ca15mp_proc_info
.section ".init.proc.info", #alloc, #execinstr
.long 0x410FC070 /* Cortex-A7 */
.long 0xFF0FFFF0 /* Mask */
.long ca7mp_init
+ .long caxx_processor
.size __v7_ca7mp_proc_info, . - __v7_ca7mp_proc_info
.section ".init.proc.info", #alloc, #execinstr
.long 0x420F00F2 /* Broadcom Brahma-B15 */
.long 0xFF0FFFFF /* Mask */
.long brahma15mp_init
+ .long caxx_processor
.size __v7_brahma15mp_proc_info, . - __v7_brahma15mp_proc_info
/*
#include <asm/irq.h>
#include <asm/cpufeature.h>
#include <asm/vfp.h>
-#include <asm/processor-ca15.h>
+#include <asm/procinfo.h>
#include <asm/gic.h>
#include <asm/platform.h>
v->arch.actlr = READ_SYSREG32(ACTLR_EL1);
- /* XXX: Handle other than CA15 cpus */
- if ( v->domain->max_vcpus > 1 )
- v->arch.actlr |= ACTLR_CA15_SMP;
- else
- v->arch.actlr &= ~ACTLR_CA15_SMP;
+ processor_vcpu_initialise(v);
if ( (rc = vcpu_vgic_init(v)) != 0 )
return rc;
--- /dev/null
+/*
+ * xen/arch/arm/processor.c
+ *
+ * Helpers to execute processor specific code.
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (C) 2014 Linaro Limited.
+ *
+ * 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/procinfo.h>
+
+static const struct processor *processor = NULL;
+
+void __init processor_setup(void)
+{
+ const struct proc_info_list *procinfo;
+
+ procinfo = lookup_processor_type();
+ if ( !procinfo )
+ return;
+
+ processor = procinfo->processor;
+}
+
+void processor_vcpu_initialise(struct vcpu *v)
+{
+ if ( !processor || !processor->vcpu_initialise )
+ return;
+
+ processor->vcpu_initialise(v);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
#include <asm/gic.h>
#include <asm/cpufeature.h>
#include <asm/platform.h>
+#include <asm/procinfo.h>
struct cpuinfo_arm __read_mostly boot_cpu_data;
{
printk("32-bit Execution: Unsupported\n");
}
+
+ processor_setup();
}
static void dt_unreserved_regions(paddr_t s, paddr_t e,
#ifndef __ASM_ARM_PROCINFO_H
#define __ASM_ARM_PROCINFO_H
+#include <xen/sched.h>
+
+struct processor {
+ /* Initialize specific processor register for the new VPCU*/
+ void (*vcpu_initialise)(struct vcpu *v);
+};
+
struct proc_info_list {
- unsigned int cpu_val;
- unsigned int cpu_mask;
+ unsigned int cpu_val;
+ unsigned int cpu_mask;
void (*cpu_init)(void);
+ struct processor *processor;
};
+const __init struct proc_info_list *lookup_processor_type(void);
+
+void __init processor_setup(void);
+void processor_vcpu_initialise(struct vcpu *v);
+
#endif