From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH RFC v3 12/21] target-arm: Move cp15 c1_sys register to ARMCPUClass
Date: Fri, 3 Feb 2012 03:59:43 +0100 [thread overview]
Message-ID: <1328237992-14953-13-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1328237992-14953-1-git-send-email-afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Peter Maydell <peter.maydell@linaro.org>
---
target-arm/cpu-core.h | 1 +
target-arm/cpu.c | 19 +++++++++++++++++++
target-arm/cpu.h | 3 ---
target-arm/helper.c | 17 -----------------
4 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/target-arm/cpu-core.h b/target-arm/cpu-core.h
index 1d5adc8..3e7dfae 100644
--- a/target-arm/cpu-core.h
+++ b/target-arm/cpu-core.h
@@ -46,6 +46,7 @@ typedef struct ARMCPUClass {
uint32_t c0_cachetype;
uint32_t c0_c1[8];
uint32_t c0_c2[8];
+ uint32_t c1_sys;
} cp15;
/* Internal CPU feature flags. */
diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index fe34b31..2c1e1a6 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -50,6 +50,9 @@ static void arm_cpu_reset(CPU *c)
memcpy(env->cp15.c0_c1, cpu_class->cp15.c0_c1, 8 * sizeof(uint32_t));
memcpy(env->cp15.c0_c2, cpu_class->cp15.c0_c2, 8 * sizeof(uint32_t));
+ /* Genuine reset */
+ env->cp15.c1_sys = cpu_class->cp15.c1_sys;
+
#if defined(CONFIG_USER_ONLY)
env->uncached_cpsr = ARM_CPU_MODE_USR;
/* For user mode we must enable access to coprocessors */
@@ -168,6 +171,7 @@ typedef struct ARMCPUInfo {
uint32_t cp15_c0_cachetype;
uint32_t cp15_c0_c1[8];
uint32_t cp15_c0_c2[8];
+ uint32_t cp15_c1_sys;
uint32_t features;
void (*class_init)(ARMCPUClass *klass, const struct ARMCPUInfo *info);
} ARMCPUInfo;
@@ -188,6 +192,7 @@ static void arm1136_r0_class_init(ARMCPUClass *k, const ARMCPUInfo *info)
k->cp15.c0_cachetype = r1_class->cp15.c0_cachetype;
memcpy(k->cp15.c0_c1, r1_class->cp15.c0_c1, 8 * sizeof(uint32_t));
memcpy(k->cp15.c0_c2, r1_class->cp15.c0_c2, 8 * sizeof(uint32_t));
+ k->cp15.c1_sys = r1_class->cp15.c1_sys;
}
static void ti925t_reset(CPU *c)
@@ -209,12 +214,15 @@ static void ti925t_class_init(ARMCPUClass *klass, const ARMCPUInfo *info)
static void sa11xx_class_init(ARMCPUClass *k, const ARMCPUInfo *info)
{
+ k->cp15.c1_sys = 0x00000070;
+
set_class_feature(k, ARM_FEATURE_STRONGARM);
}
static void pxa25x_class_init(ARMCPUClass *k, const ARMCPUInfo *info)
{
k->cp15.c0_cachetype = 0xd172172;
+ k->cp15.c1_sys = 0x00000078;
set_class_feature(k, ARM_FEATURE_V5);
set_class_feature(k, ARM_FEATURE_XSCALE);
@@ -223,6 +231,7 @@ static void pxa25x_class_init(ARMCPUClass *k, const ARMCPUInfo *info)
static void pxa270_class_init(ARMCPUClass *k, const ARMCPUInfo *info)
{
k->cp15.c0_cachetype = 0xd172172;
+ k->cp15.c1_sys = 0x00000078;
set_class_feature(k, ARM_FEATURE_V5);
set_class_feature(k, ARM_FEATURE_XSCALE);
@@ -234,6 +243,7 @@ static const ARMCPUInfo arm_cpus[] = {
.name = "arm926",
.id = 0x41069265,
.cp15_c0_cachetype = 0x1dd20d2,
+ .cp15_c1_sys = 0x00090078,
.features = ARM_FEATURE(V5) |
ARM_FEATURE(VFP),
},
@@ -241,6 +251,7 @@ static const ARMCPUInfo arm_cpus[] = {
.name = "arm946",
.id = 0x41059461,
.cp15_c0_cachetype = 0x0f004006,
+ .cp15_c1_sys = 0x00000078,
.features = ARM_FEATURE(V5) |
ARM_FEATURE(MPU),
},
@@ -248,6 +259,7 @@ static const ARMCPUInfo arm_cpus[] = {
.name = "arm1026",
.id = 0x4106a262,
.cp15_c0_cachetype = 0x1dd20d2,
+ .cp15_c1_sys = 0x00090078,
.features = ARM_FEATURE(V5) |
ARM_FEATURE(VFP) |
ARM_FEATURE(AUXCR),
@@ -273,6 +285,7 @@ static const ARMCPUInfo arm_cpus[] = {
0x00140011, 0x12002111, 0x11231111, 0x01102131,
0x141, 0, 0, 0
},
+ .cp15_c1_sys = 0x00050078,
.features = ARM_FEATURE(V6) |
ARM_FEATURE(VFP),
},
@@ -288,6 +301,7 @@ static const ARMCPUInfo arm_cpus[] = {
0x0140011, 0x12002111, 0x11231121, 0x01102131,
0x01141, 0, 0, 0
},
+ .cp15_c1_sys = 0x00050078,
.features = ARM_FEATURE(V6K) |
ARM_FEATURE(VFP) |
ARM_FEATURE(VAPA),
@@ -326,6 +340,7 @@ static const ARMCPUInfo arm_cpus[] = {
0x00101111, 0x12112111, 0x21232031, 0x11112131,
0x00111142, 0, 0, 0
},
+ .cp15_c1_sys = 0x00c50078,
.features = ARM_FEATURE(V7) |
ARM_FEATURE(VFP3) |
ARM_FEATURE(NEON) |
@@ -343,6 +358,7 @@ static const ARMCPUInfo arm_cpus[] = {
0x00101111, 0x13112111, 0x21232041, 0x11112131,
0x00111142, 0, 0, 0
},
+ .cp15_c1_sys = 0x00c50078,
.features = ARM_FEATURE(V7) |
ARM_FEATURE(VFP3) |
ARM_FEATURE(VFP_FP16) |
@@ -366,6 +382,7 @@ static const ARMCPUInfo arm_cpus[] = {
0x02101110, 0x13112111, 0x21232041, 0x11112131,
0x10011142, 0, 0, 0
},
+ .cp15_c1_sys = 0x00c50078,
.features = ARM_FEATURE(V7) |
ARM_FEATURE(VFP4) |
ARM_FEATURE(VFP_FP16) |
@@ -379,6 +396,7 @@ static const ARMCPUInfo arm_cpus[] = {
.name = "ti925t",
.id = 0x54029252,
.cp15_c0_cachetype = 0x5109149,
+ .cp15_c1_sys = 0x00000070,
.features = ARM_FEATURE(V4T) |
ARM_FEATURE(OMAPCP),
.class_init = ti925t_class_init,
@@ -487,6 +505,7 @@ static void arm_cpu_class_init(ObjectClass *klass, void *data)
k->cp15.c0_cachetype = info->cp15_c0_cachetype;
memcpy(k->cp15.c0_c1, info->cp15_c0_c1, 8 * sizeof(uint32_t));
memcpy(k->cp15.c0_c2, info->cp15_c0_c2, 8 * sizeof(uint32_t));
+ k->cp15.c1_sys = info->cp15_c1_sys;
k->features = info->features;
if (info->class_init != NULL) {
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 6731256..e16befd 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -404,11 +404,8 @@ void cpu_arm_set_cp_io(CPUARMState *env, int cpnum,
#define ARM_CPUID_ARM1026 0x4106a262
#define ARM_CPUID_ARM926 0x41069265
-#define ARM_CPUID_ARM946 0x41059461
#define ARM_CPUID_TI915T 0x54029152
#define ARM_CPUID_TI925T 0x54029252
-#define ARM_CPUID_SA1100 0x4401A11B
-#define ARM_CPUID_SA1110 0x6901B119
#define ARM_CPUID_PXA250 0x69052100
#define ARM_CPUID_PXA255 0x69052d00
#define ARM_CPUID_PXA260 0x69052903
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 9a4afad..32319e4 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -15,14 +15,9 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
switch (id) {
case ARM_CPUID_ARM926:
env->vfp.xregs[ARM_VFP_FPSID] = 0x41011090;
- env->cp15.c1_sys = 0x00090078;
- break;
- case ARM_CPUID_ARM946:
- env->cp15.c1_sys = 0x00000078;
break;
case ARM_CPUID_ARM1026:
env->vfp.xregs[ARM_VFP_FPSID] = 0x410110a0;
- env->cp15.c1_sys = 0x00090078;
break;
case ARM_CPUID_ARM1136:
/* This is the 1136 r1, which is a v6K core */
@@ -39,13 +34,11 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
env->vfp.xregs[ARM_VFP_FPSID] = 0x410120b4;
env->vfp.xregs[ARM_VFP_MVFR0] = 0x11111111;
env->vfp.xregs[ARM_VFP_MVFR1] = 0x00000000;
- env->cp15.c1_sys = 0x00050078;
break;
case ARM_CPUID_ARM1176:
env->vfp.xregs[ARM_VFP_FPSID] = 0x410120b5;
env->vfp.xregs[ARM_VFP_MVFR0] = 0x11111111;
env->vfp.xregs[ARM_VFP_MVFR1] = 0x00000000;
- env->cp15.c1_sys = 0x00050078;
break;
case ARM_CPUID_ARM11MPCORE:
env->vfp.xregs[ARM_VFP_FPSID] = 0x410120b4;
@@ -60,7 +53,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
env->cp15.c0_ccsid[0] = 0xe007e01a; /* 16k L1 dcache. */
env->cp15.c0_ccsid[1] = 0x2007e01a; /* 16k L1 icache. */
env->cp15.c0_ccsid[2] = 0xf0000000; /* No L2 icache. */
- env->cp15.c1_sys = 0x00c50078;
break;
case ARM_CPUID_CORTEXA9:
env->vfp.xregs[ARM_VFP_FPSID] = 0x41034000; /* Guess */
@@ -69,7 +61,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
env->cp15.c0_clid = (1 << 27) | (1 << 24) | 3;
env->cp15.c0_ccsid[0] = 0xe00fe015; /* 16k L1 dcache. */
env->cp15.c0_ccsid[1] = 0x200fe015; /* 16k L1 icache. */
- env->cp15.c1_sys = 0x00c50078;
break;
case ARM_CPUID_CORTEXA15:
env->vfp.xregs[ARM_VFP_FPSID] = 0x410430f0;
@@ -79,11 +70,9 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
env->cp15.c0_ccsid[0] = 0x701fe00a; /* 32K L1 dcache */
env->cp15.c0_ccsid[1] = 0x201fe00a; /* 32K L1 icache */
env->cp15.c0_ccsid[2] = 0x711fe07a; /* 4096K L2 unified cache */
- env->cp15.c1_sys = 0x00c50078;
break;
case ARM_CPUID_TI915T:
case ARM_CPUID_TI925T:
- env->cp15.c1_sys = 0x00000070;
env->cp15.c15_i_max = 0x000;
env->cp15.c15_i_min = 0xff0;
break;
@@ -93,7 +82,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
case ARM_CPUID_PXA261:
case ARM_CPUID_PXA262:
/* JTAG_ID is ((id << 28) | 0x09265013) */
- env->cp15.c1_sys = 0x00000078;
break;
case ARM_CPUID_PXA270_A0:
case ARM_CPUID_PXA270_A1:
@@ -103,11 +91,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
case ARM_CPUID_PXA270_C5:
/* JTAG_ID is ((id << 28) | 0x09265013) */
env->iwmmxt.cregs[ARM_IWMMXT_wCID] = 0x69051000 | 'Q';
- env->cp15.c1_sys = 0x00000078;
- break;
- case ARM_CPUID_SA1100:
- case ARM_CPUID_SA1110:
- env->cp15.c1_sys = 0x00000070;
break;
default:
break;
--
1.7.7
next prev parent reply other threads:[~2012-02-03 3:02 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-03 2:59 [Qemu-devel] [PATCH RFC v3 00/21] Introduce QOM CPU and use it for ARM Andreas Färber
2012-02-03 2:59 ` [Qemu-devel] [PATCH v3 01/21] qom: Register QOM infrastructure early Andreas Färber
2012-02-06 19:14 ` Anthony Liguori
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 02/21] qom: Add QOM support to user emulators Andreas Färber
2012-02-06 19:16 ` Anthony Liguori
2012-02-06 23:23 ` Andreas Färber
2012-02-07 17:25 ` Peter Maydell
2012-02-07 17:51 ` Anthony Liguori
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 03/21] qom: Introduce CPU class Andreas Färber
2012-02-06 19:24 ` Anthony Liguori
2012-02-06 20:01 ` Peter Maydell
2012-02-06 20:14 ` Andreas Färber
2012-02-06 21:22 ` Anthony Liguori
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 04/21] target-arm: Introduce QOM CPU and use it for CPUID lookup Andreas Färber
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 05/21] target-arm: Embed CPUARMState in QOM ARMCPU Andreas Färber
2012-02-06 23:00 ` Anthony Liguori
2012-02-06 23:05 ` Andreas Färber
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 06/21] target-arm: Prepare model-specific class_init function Andreas Färber
2012-02-06 23:03 ` Anthony Liguori
2012-02-06 23:08 ` Andreas Färber
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 07/21] target-arm: Overwrite reset handler for ti925t Andreas Färber
2012-02-07 17:30 ` Peter Maydell
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 08/21] target-arm: Move CPU feature flags out of CPUState Andreas Färber
2012-02-07 17:28 ` Peter Maydell
2012-02-07 17:43 ` Andreas Färber
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 09/21] target-arm: No longer abort on unhandled CPUIDs on reset Andreas Färber
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 10/21] target-arm: Store cp15 c0_c1 and c0_c2 in ARMCPUClass Andreas Färber
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 11/21] target-arm: Store cp15 c0_cachetype register " Andreas Färber
2012-02-03 2:59 ` Andreas Färber [this message]
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 13/21] target-arm: Store JTAG_ID " Andreas Färber
2012-02-07 17:47 ` Peter Maydell
2012-02-07 18:41 ` Andreas Färber
2012-02-07 19:06 ` Peter Maydell
2012-02-07 22:07 ` Andreas Färber
2012-02-07 23:30 ` Peter Maydell
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 14/21] target-arm: Move the PXA270's iwMMXt reset to pxa270_reset() Andreas Färber
2012-02-17 9:59 ` andrzej zaborowski
2012-02-17 12:03 ` Andreas Färber
2012-02-17 12:44 ` andrzej zaborowski
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 15/21] target-arm: Store VFP FPSID register in ARMCPUClass Andreas Färber
2012-02-07 17:44 ` Peter Maydell
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 16/21] target-arm: Store VFP MVFR0 and MVFR1 " Andreas Färber
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 17/21] target-arm: Store CLIDR " Andreas Färber
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 18/21] target-arm: Store CCSIDRs " Andreas Färber
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 19/21] target-arm: Kill off cpu_reset_model_id() Andreas Färber
2012-02-03 2:59 ` [Qemu-devel] [PATCH RFC v3 20/21] target-arm: Prepare halted property for CPU Andreas Färber
2012-02-03 2:59 ` [Qemu-devel] [FYI v3 21/21] target-arm: Just for testing! Andreas Färber
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=1328237992-14953-13-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).