aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2012-03-20 17:25:53 +0000
committerPeter Maydell <peter.maydell@linaro.org>2012-03-23 13:42:41 +0000
commit4fa1dd2cb880159dfdac2b82d2543ea1ecea2b7b (patch)
tree46a0b6cf080fcb2bcd359d67e79d6e3d4d3af25b
parent762f99b62467e8b3325f98ecf55cf450f5f72afa (diff)
downloadqemu-arm-4fa1dd2cb880159dfdac2b82d2543ea1ecea2b7b.tar.gz
target-arm: Convert generic timer cp15 regs
Convert the (dummy) generic timer cp15 implementation. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--target-arm/helper.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 0c666bfe92..e660f9bde6 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -502,6 +502,14 @@ static const ARMCPRegInfo v6k_cp_reginfo[] = {
REGINFO_SENTINEL
};
+static const ARMCPRegInfo generic_timer_cp_reginfo[] = {
+ /* Dummy implementation: RAZ/WI the whole crn=14 space */
+ { .name = "GENERIC_TIMER", .cp = 15, .crn = 14,
+ .crm = CP_ANY, .opc1 = CP_ANY, .opc2 = CP_ANY,
+ .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
+ REGINFO_SENTINEL
+};
+
void register_cp_regs_for_features(ARMCPU *cpu)
{
/* Register all the coprocessor registers based on feature bits */
@@ -528,6 +536,9 @@ void register_cp_regs_for_features(ARMCPU *cpu)
if (arm_feature(env, ARM_FEATURE_THUMB2EE)) {
define_arm_cp_regs(env, t2ee_cp_reginfo);
}
+ if (arm_feature(env, ARM_FEATURE_GENERIC_TIMER)) {
+ define_arm_cp_regs(env, generic_timer_cp_reginfo);
+ }
}
CPUARMState *cpu_arm_init(const char *cpu_model)
@@ -1864,12 +1875,6 @@ void HELPER(set_cp15)(CPUARMState *env, uint32_t insn, uint32_t val)
goto bad_reg;
}
break;
- case 14: /* Generic timer */
- if (arm_feature(env, ARM_FEATURE_GENERIC_TIMER)) {
- /* Dummy implementation: RAZ/WI for all */
- break;
- }
- goto bad_reg;
case 15: /* Implementation specific. */
if (arm_feature(env, ARM_FEATURE_XSCALE)) {
if (op2 == 0 && crm == 1) {
@@ -2209,12 +2214,6 @@ uint32_t HELPER(get_cp15)(CPUARMState *env, uint32_t insn)
default:
goto bad_reg;
}
- case 14: /* Generic timer */
- if (arm_feature(env, ARM_FEATURE_GENERIC_TIMER)) {
- /* Dummy implementation: RAZ/WI for all */
- return 0;
- }
- goto bad_reg;
case 15: /* Implementation specific. */
if (arm_feature(env, ARM_FEATURE_XSCALE)) {
if (op2 == 0 && crm == 1)