target/arm: Add cfgend parameter for ARM CPU selection.

Add a new "cfgend" property which selects whether the CPU resets into
big-endian mode or not. This setting affects whether we reset with
SCTLR_B (ARMv6 and earlier) or SCTLR_EE (ARMv7 and later) set.

Backports commit 3a062d5730266b2386eeda68b1a1c6e96451db31 from qemu
This commit is contained in:
Julian Brown 2018-03-02 00:18:09 -05:00 committed by Lioncash
parent 4324d1e97e
commit 1aedb26670
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 15 additions and 0 deletions

View file

@ -527,6 +527,14 @@ static int arm_cpu_realizefn(struct uc_struct *uc, DeviceState *dev, Error **err
cpu->reset_sctlr |= (1 << 13);
}
if (cpu->cfgend) {
if (arm_feature(&cpu->env, ARM_FEATURE_V7)) {
cpu->reset_sctlr |= SCTLR_EE;
} else {
cpu->reset_sctlr |= SCTLR_B;
}
}
if (!cpu->has_el3) {
/* If the has_el3 CPU property is disabled then we need to disable the
* feature.

View file

@ -672,6 +672,13 @@ typedef struct ARMCPU {
uint32_t dcz_blocksize;
uint64_t rvbar;
/* Whether the cfgend input is high (i.e. this CPU should reset into
* big-endian mode). This setting isn't used directly: instead it modifies
* the reset_sctlr value to have SCTLR_B or SCTLR_EE set, depending on the
* architecture version.
*/
bool cfgend;
ARMELChangeHook *el_change_hook;
void *el_change_hook_opaque;
} ARMCPU;