Received: from eggs.gnu.org ([140.186.70.92]:38822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt9Q7-0008Pf-EU for qemu-devel@nongnu.org; Thu, 02 Feb 2012 22:02:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rt9Q0-00063z-3K for qemu-devel@nongnu.org; Thu, 02 Feb 2012 22:02:39 -0500 Received: from cantor2.suse.de ([195.135.220.15]:55645 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt9Pz-00063Z-3o for qemu-devel@nongnu.org; Thu, 02 Feb 2012 22:02:31 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 3 Feb 2012 03:59:46 +0100 Message-Id: <1328237992-14953-16-git-send-email-afaerber@suse.de> In-Reply-To: <1328237992-14953-1-git-send-email-afaerber@suse.de> References: <1328237992-14953-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH RFC v3 15/21] target-arm: Store VFP FPSID register in ARMCPUClass List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Andreas=20F=C3=A4rber?= Signed-off-by: Andreas F=C3=A4rber Cc: Peter Maydell --- target-arm/cpu-core.h | 3 +++ target-arm/cpu.c | 11 +++++++++++ target-arm/cpu.h | 1 - target-arm/helper.c | 12 ------------ 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/target-arm/cpu-core.h b/target-arm/cpu-core.h index eac1a03..0b2eb0a 100644 --- a/target-arm/cpu-core.h +++ b/target-arm/cpu-core.h @@ -48,6 +48,9 @@ typedef struct ARMCPUClass { uint32_t c0_c2[8]; uint32_t c1_sys; } cp15; + struct { + uint32_t fpsid; + } vfp; uint64_t jtag_id; =20 /* Internal CPU feature flags. */ diff --git a/target-arm/cpu.c b/target-arm/cpu.c index bf4b272..7893fa8 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -52,6 +52,7 @@ static void arm_cpu_reset(CPU *c) =20 /* Genuine reset */ env->cp15.c1_sys =3D cpu_class->cp15.c1_sys; + env->vfp.xregs[ARM_VFP_FPSID] =3D cpu_class->vfp.fpsid; =20 #if defined(CONFIG_USER_ONLY) env->uncached_cpsr =3D ARM_CPU_MODE_USR; @@ -172,6 +173,7 @@ typedef struct ARMCPUInfo { uint32_t cp15_c0_c1[8]; uint32_t cp15_c0_c2[8]; uint32_t cp15_c1_sys; + uint32_t vfp_fpsid; uint32_t features; void (*class_init)(ARMCPUClass *klass, const struct ARMCPUInfo *info= ); } ARMCPUInfo; @@ -260,6 +262,7 @@ static const ARMCPUInfo arm_cpus[] =3D { .id =3D 0x41069265, .cp15_c0_cachetype =3D 0x1dd20d2, .cp15_c1_sys =3D 0x00090078, + .vfp_fpsid =3D 0x41011090, .features =3D ARM_FEATURE(V5) | ARM_FEATURE(VFP), }, @@ -276,6 +279,7 @@ static const ARMCPUInfo arm_cpus[] =3D { .id =3D 0x4106a262, .cp15_c0_cachetype =3D 0x1dd20d2, .cp15_c1_sys =3D 0x00090078, + .vfp_fpsid =3D 0x410110a0, .features =3D ARM_FEATURE(V5) | ARM_FEATURE(VFP) | ARM_FEATURE(AUXCR), @@ -302,6 +306,7 @@ static const ARMCPUInfo arm_cpus[] =3D { 0x141, 0, 0, 0 }, .cp15_c1_sys =3D 0x00050078, + .vfp_fpsid =3D 0x410120b4, .features =3D ARM_FEATURE(V6) | ARM_FEATURE(VFP), }, @@ -318,6 +323,7 @@ static const ARMCPUInfo arm_cpus[] =3D { 0x01141, 0, 0, 0 }, .cp15_c1_sys =3D 0x00050078, + .vfp_fpsid =3D 0x410120b5, .features =3D ARM_FEATURE(V6K) | ARM_FEATURE(VFP) | ARM_FEATURE(VAPA), @@ -334,6 +340,7 @@ static const ARMCPUInfo arm_cpus[] =3D { 0x00100011, 0x12002111, 0x11221011, 0x01102131, 0x141, 0, 0, 0 }, + .vfp_fpsid =3D 0x410120b4, .features =3D ARM_FEATURE(V6K) | ARM_FEATURE(VFP) | ARM_FEATURE(VAPA), @@ -357,6 +364,7 @@ static const ARMCPUInfo arm_cpus[] =3D { 0x00111142, 0, 0, 0 }, .cp15_c1_sys =3D 0x00c50078, + .vfp_fpsid =3D 0x410330c0, .features =3D ARM_FEATURE(V7) | ARM_FEATURE(VFP3) | ARM_FEATURE(NEON) | @@ -375,6 +383,7 @@ static const ARMCPUInfo arm_cpus[] =3D { 0x00111142, 0, 0, 0 }, .cp15_c1_sys =3D 0x00c50078, + .vfp_fpsid =3D 0x41034000, /* Guess */ .features =3D ARM_FEATURE(V7) | ARM_FEATURE(VFP3) | ARM_FEATURE(VFP_FP16) | @@ -399,6 +408,7 @@ static const ARMCPUInfo arm_cpus[] =3D { 0x10011142, 0, 0, 0 }, .cp15_c1_sys =3D 0x00c50078, + .vfp_fpsid =3D 0x410430f0, .features =3D ARM_FEATURE(V7) | ARM_FEATURE(VFP4) | ARM_FEATURE(VFP_FP16) | @@ -522,6 +532,7 @@ static void arm_cpu_class_init(ObjectClass *klass, vo= id *data) 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 =3D info->cp15_c1_sys; + k->vfp.fpsid =3D info->vfp_fpsid; k->features =3D info->features; =20 if (info->class_init !=3D NULL) { diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 32aaa4e..a1630b0 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -403,7 +403,6 @@ void cpu_arm_set_cp_io(CPUARMState *env, int cpnum, #define ARM_CPUID(env) (env->cp15.c0_cpuid) =20 #define ARM_CPUID_ARM1026 0x4106a262 -#define ARM_CPUID_ARM926 0x41069265 #define ARM_CPUID_TI915T 0x54029152 #define ARM_CPUID_TI925T 0x54029252 #define ARM_CPUID_ARM1136 0x4117b363 diff --git a/target-arm/helper.c b/target-arm/helper.c index 4a531b8..466519a 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -13,12 +13,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id) { switch (id) { - case ARM_CPUID_ARM926: - env->vfp.xregs[ARM_VFP_FPSID] =3D 0x41011090; - break; - case ARM_CPUID_ARM1026: - env->vfp.xregs[ARM_VFP_FPSID] =3D 0x410110a0; - break; case ARM_CPUID_ARM1136: /* This is the 1136 r1, which is a v6K core */ /* Fall through */ @@ -31,22 +25,18 @@ static void cpu_reset_model_id(CPUARMState *env, uint= 32_t id) * for 1136_r2 (in particular r0p2 does not actually implement m= ost * of the ID registers). */ - env->vfp.xregs[ARM_VFP_FPSID] =3D 0x410120b4; env->vfp.xregs[ARM_VFP_MVFR0] =3D 0x11111111; env->vfp.xregs[ARM_VFP_MVFR1] =3D 0x00000000; break; case ARM_CPUID_ARM1176: - env->vfp.xregs[ARM_VFP_FPSID] =3D 0x410120b5; env->vfp.xregs[ARM_VFP_MVFR0] =3D 0x11111111; env->vfp.xregs[ARM_VFP_MVFR1] =3D 0x00000000; break; case ARM_CPUID_ARM11MPCORE: - env->vfp.xregs[ARM_VFP_FPSID] =3D 0x410120b4; env->vfp.xregs[ARM_VFP_MVFR0] =3D 0x11111111; env->vfp.xregs[ARM_VFP_MVFR1] =3D 0x00000000; break; case ARM_CPUID_CORTEXA8: - env->vfp.xregs[ARM_VFP_FPSID] =3D 0x410330c0; env->vfp.xregs[ARM_VFP_MVFR0] =3D 0x11110222; env->vfp.xregs[ARM_VFP_MVFR1] =3D 0x00011100; env->cp15.c0_clid =3D (1 << 27) | (2 << 24) | 3; @@ -55,7 +45,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32= _t id) env->cp15.c0_ccsid[2] =3D 0xf0000000; /* No L2 icache. */ break; case ARM_CPUID_CORTEXA9: - env->vfp.xregs[ARM_VFP_FPSID] =3D 0x41034000; /* Guess */ env->vfp.xregs[ARM_VFP_MVFR0] =3D 0x11110222; env->vfp.xregs[ARM_VFP_MVFR1] =3D 0x01111111; env->cp15.c0_clid =3D (1 << 27) | (1 << 24) | 3; @@ -63,7 +52,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32= _t id) env->cp15.c0_ccsid[1] =3D 0x200fe015; /* 16k L1 icache. */ break; case ARM_CPUID_CORTEXA15: - env->vfp.xregs[ARM_VFP_FPSID] =3D 0x410430f0; env->vfp.xregs[ARM_VFP_MVFR0] =3D 0x10110222; env->vfp.xregs[ARM_VFP_MVFR1] =3D 0x11111111; env->cp15.c0_clid =3D 0x0a200023; --=20 1.7.7