Skip to content

Commit

Permalink
target: arm: Add updates to CBAR
Browse files Browse the repository at this point in the history
Support CBAR for aarch32.

Signed-off-by: Sai Pavan Boddu <[email protected]>
Signed-off-by: Edgar E. Iglesias <[email protected]>
  • Loading branch information
saipava authored and edgarigl committed Sep 15, 2022
1 parent b15d8d6 commit 74d70f8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
1 change: 1 addition & 0 deletions target/arm/cpu_tcg.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ static void cortex_r52_initfn(Object *obj)
set_feature(&cpu->env, ARM_FEATURE_EL2);
set_feature(&cpu->env, ARM_FEATURE_PMSA);
set_feature(&cpu->env, ARM_FEATURE_PMU);
set_feature(&cpu->env, ARM_FEATURE_CBAR_RO);
cpu->pmsav7_dregion = 16;
cpu->midr = 0x411fd132; /* r1p2 */
cpu->isar.id_pfr0 = 0x0131;
Expand Down
34 changes: 22 additions & 12 deletions target/arm/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -8644,19 +8644,29 @@ void register_cp_regs_for_features(ARMCPU *cpu)
assert(arm_feature(env, ARM_FEATURE_CBAR_RO));
define_arm_cp_regs(cpu, cbar_reginfo);
} else {
ARMCPRegInfo cbar = {
.name = "CBAR",
.cp = 15, .crn = 15, .crm = 0, .opc1 = 4, .opc2 = 0,
.access = PL1_R|PL3_W, .resetvalue = cpu->reset_cbar,
.fieldoffset = offsetof(CPUARMState,
cp15.c15_config_base_address)
};
if (arm_feature(env, ARM_FEATURE_CBAR_RO)) {
cbar.access = PL1_R;
cbar.fieldoffset = 0;
cbar.type = ARM_CP_CONST;
if (arm_feature(env, ARM_FEATURE_V8)) {
ARMCPRegInfo cbar = {
.name = "CBAR",
.type = ARM_CP_CONST,
.cp = 15, .crn = 15, .crm = 3, .opc1 = 1, .opc2 = 0,
.access = PL1_R | PL2_R, .resetvalue = cpu->reset_cbar
};
define_one_arm_cp_reg(cpu, &cbar);
} else {
ARMCPRegInfo cbar = {
.name = "CBAR",
.cp = 15, .crn = 15, .crm = 0, .opc1 = 4, .opc2 = 0,
.access = PL1_R|PL3_W, .resetvalue = cpu->reset_cbar,
.fieldoffset = offsetof(CPUARMState,
cp15.c15_config_base_address)
};
if (arm_feature(env, ARM_FEATURE_CBAR_RO)) {
cbar.access = PL1_R;
cbar.fieldoffset = 0;
cbar.type = ARM_CP_CONST;
}
define_one_arm_cp_reg(cpu, &cbar);
}
define_one_arm_cp_reg(cpu, &cbar);
}
}

Expand Down

0 comments on commit 74d70f8

Please sign in to comment.