target-arm queue:
* hw/arm: Silence xlnx-ep108 deprecation warning during tests * hw/arm/aspeed: Unlock SCU when running kernel * arm: check regime, not current state, for ATS write PAR format * nvic: Fix ARMv7M MPU_RBAR reads * target/arm: Report GICv3 sysregs present in ID registers if needed -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABCAAGBQJaExJdAAoJEDwlJe0UNgzeKCAP/0YzjL87it6HkbBzX9yP5Mpv UZk0HcNfrCGV69zy/4CiL33tqwwwSUZv16kVyNVtuqsJRDR3riy5C+YjqZBkvkCG iVAQ24i5NbSIvcOvNc4YBy2aA1FOU+qMbpdKZ1k8pkBwwLaNaY6OtbxwHYa9MqCZ iH/nylgRvOlNZKCmajRPudaagqEGrcj0xuszlhPM7HSYbYgYsnLabnaNJgSBLqxD MM4hCGFrJtNXDJoYu/FEZrKrWbuL9RHma31Vc2Fa1Lys9GO3sp+hhbZXDO7m/Q1L Id1/Q+EMAxuuSF7TyGAPBpKzHERTaOfYDqRY6CPcmBBxwwVx89E2KW49Tc8Gbijj i2tlWWrExUfMKnz51aoPaPrg97JIn3ql1UqsZ6RlqdZjT+pY3I3wt5o56Ys6PwCN 19J96AnMLKeglkSXztvsAGmo09uFRD4nuxueylUvrJoGCnPRbkvdJ1PDARw2XY8N gROwgw8eizxQ92d3yVzVl3v81jozwxX6X2ufNlLIiHRpg1LPTtQxWXxWJQobPia8 zZcm14QKF4r99UsfC/itkKi/D3ULUkH1r9eL8DH9EDyTd+E4rCuA+i8nlitDX7Tp 54UmWO62L9A6fidiYqNXTKJLLAosUpg0wGwWV4nN+7a2OaKembtbbs0Xyrb1uQOw ykdO9ZF2D5uwk7m20LrG =hxAO -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20171120' into staging target-arm queue: * hw/arm: Silence xlnx-ep108 deprecation warning during tests * hw/arm/aspeed: Unlock SCU when running kernel * arm: check regime, not current state, for ATS write PAR format * nvic: Fix ARMv7M MPU_RBAR reads * target/arm: Report GICv3 sysregs present in ID registers if needed # gpg: Signature made Mon 20 Nov 2017 17:35:25 GMT # gpg: using RSA key 0x3C2525ED14360CDE # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" # gpg: aka "Peter Maydell <pmaydell@gmail.com>" # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * remotes/pmaydell/tags/pull-target-arm-20171120: hw/arm: Silence xlnx-ep108 deprecation warning during tests hw/arm/aspeed: Unlock SCU when running kernel arm: check regime, not current state, for ATS write PAR format nvic: Fix ARMv7M MPU_RBAR reads target/arm: Report GICv3 sysregs present in ID registers if needed Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
5f49d73cb3
@ -186,6 +186,15 @@ static void aspeed_board_init(MachineState *machine,
|
||||
&error_abort);
|
||||
object_property_set_int(OBJECT(&bmc->soc), cfg->num_cs, "num-cs",
|
||||
&error_abort);
|
||||
if (machine->kernel_filename) {
|
||||
/*
|
||||
* When booting with a -kernel command line there is no u-boot
|
||||
* that runs to unlock the SCU. In this case set the default to
|
||||
* be unlocked as the kernel expects
|
||||
*/
|
||||
object_property_set_int(OBJECT(&bmc->soc), ASPEED_SCU_PROT_KEY,
|
||||
"hw-prot-key", &error_abort);
|
||||
}
|
||||
object_property_set_bool(OBJECT(&bmc->soc), true, "realized",
|
||||
&error_abort);
|
||||
|
||||
|
@ -154,6 +154,8 @@ static void aspeed_soc_init(Object *obj)
|
||||
"hw-strap1", &error_abort);
|
||||
object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scu),
|
||||
"hw-strap2", &error_abort);
|
||||
object_property_add_alias(obj, "hw-prot-key", OBJECT(&s->scu),
|
||||
"hw-prot-key", &error_abort);
|
||||
|
||||
object_initialize(&s->fmc, sizeof(s->fmc), sc->info->fmc_typename);
|
||||
object_property_add_child(obj, "fmc", OBJECT(&s->fmc), NULL);
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "qemu/error-report.h"
|
||||
#include "exec/address-spaces.h"
|
||||
#include "qemu/log.h"
|
||||
#include "sysemu/qtest.h"
|
||||
|
||||
typedef struct XlnxZCU102 {
|
||||
MachineState parent_obj;
|
||||
@ -164,8 +165,10 @@ static void xlnx_ep108_init(MachineState *machine)
|
||||
{
|
||||
XlnxZCU102 *s = EP108_MACHINE(machine);
|
||||
|
||||
info_report("The Xilinx EP108 machine is deprecated, please use the "
|
||||
"ZCU102 machine instead. It has the same features supported.");
|
||||
if (!qtest_enabled()) {
|
||||
info_report("The Xilinx EP108 machine is deprecated, please use the "
|
||||
"ZCU102 machine (which has the same features) instead.");
|
||||
}
|
||||
|
||||
xlnx_zynqmp_init(s, machine);
|
||||
}
|
||||
|
@ -977,7 +977,7 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs)
|
||||
if (region >= cpu->pmsav7_dregion) {
|
||||
return 0;
|
||||
}
|
||||
return (cpu->env.pmsav7.drbar[region] & 0x1f) | (region & 0xf);
|
||||
return (cpu->env.pmsav7.drbar[region] & ~0x1f) | (region & 0xf);
|
||||
}
|
||||
case 0xda0: /* MPU_RASR (v7M), MPU_RLAR (v8M) */
|
||||
case 0xda8: /* MPU_RASR_A1 (v7M), MPU_RLAR_A1 (v8M) */
|
||||
|
@ -85,7 +85,6 @@
|
||||
#define BMC_REV TO_REG(0x19C)
|
||||
#define BMC_DEV_ID TO_REG(0x1A4)
|
||||
|
||||
#define PROT_KEY_UNLOCK 0x1688A8A8
|
||||
#define SCU_IO_REGION_SIZE 0x1000
|
||||
|
||||
static const uint32_t ast2400_a0_resets[ASPEED_SCU_NR_REGS] = {
|
||||
@ -192,7 +191,7 @@ static void aspeed_scu_write(void *opaque, hwaddr offset, uint64_t data,
|
||||
}
|
||||
|
||||
if (reg > PROT_KEY && reg < CPU2_BASE_SEG1 &&
|
||||
s->regs[PROT_KEY] != PROT_KEY_UNLOCK) {
|
||||
s->regs[PROT_KEY] != ASPEED_SCU_PROT_KEY) {
|
||||
qemu_log_mask(LOG_GUEST_ERROR, "%s: SCU is locked!\n", __func__);
|
||||
return;
|
||||
}
|
||||
@ -246,6 +245,7 @@ static void aspeed_scu_reset(DeviceState *dev)
|
||||
s->regs[SILICON_REV] = s->silicon_rev;
|
||||
s->regs[HW_STRAP1] = s->hw_strap1;
|
||||
s->regs[HW_STRAP2] = s->hw_strap2;
|
||||
s->regs[PROT_KEY] = s->hw_prot_key;
|
||||
}
|
||||
|
||||
static uint32_t aspeed_silicon_revs[] = {
|
||||
@ -299,6 +299,7 @@ static Property aspeed_scu_properties[] = {
|
||||
DEFINE_PROP_UINT32("silicon-rev", AspeedSCUState, silicon_rev, 0),
|
||||
DEFINE_PROP_UINT32("hw-strap1", AspeedSCUState, hw_strap1, 0),
|
||||
DEFINE_PROP_UINT32("hw-strap2", AspeedSCUState, hw_strap2, 0),
|
||||
DEFINE_PROP_UINT32("hw-prot-key", AspeedSCUState, hw_prot_key, 0),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
|
@ -29,6 +29,7 @@ typedef struct AspeedSCUState {
|
||||
uint32_t silicon_rev;
|
||||
uint32_t hw_strap1;
|
||||
uint32_t hw_strap2;
|
||||
uint32_t hw_prot_key;
|
||||
} AspeedSCUState;
|
||||
|
||||
#define AST2400_A0_SILICON_REV 0x02000303U
|
||||
@ -38,6 +39,8 @@ typedef struct AspeedSCUState {
|
||||
|
||||
extern bool is_supported_silicon_rev(uint32_t silicon_rev);
|
||||
|
||||
#define ASPEED_SCU_PROT_KEY 0x1688A8A8
|
||||
|
||||
/*
|
||||
* Extracted from Aspeed SDK v00.03.21. Fixes and extra definitions
|
||||
* were added.
|
||||
|
@ -2169,7 +2169,7 @@ static uint64_t do_ats_write(CPUARMState *env, uint64_t value,
|
||||
|
||||
ret = get_phys_addr(env, value, access_type, mmu_idx, &phys_addr, &attrs,
|
||||
&prot, &page_size, &fsr, &fi, &cacheattrs);
|
||||
if (extended_addresses_enabled(env)) {
|
||||
if (arm_s1_regime_using_lpae_format(env, mmu_idx)) {
|
||||
/* fsr is a DFSR/IFSR value for the long descriptor
|
||||
* translation table format, but with WnR always clear.
|
||||
* Convert it to a 64-bit PAR.
|
||||
@ -4549,6 +4549,33 @@ static void define_debug_regs(ARMCPU *cpu)
|
||||
}
|
||||
}
|
||||
|
||||
/* We don't know until after realize whether there's a GICv3
|
||||
* attached, and that is what registers the gicv3 sysregs.
|
||||
* So we have to fill in the GIC fields in ID_PFR/ID_PFR1_EL1/ID_AA64PFR0_EL1
|
||||
* at runtime.
|
||||
*/
|
||||
static uint64_t id_pfr1_read(CPUARMState *env, const ARMCPRegInfo *ri)
|
||||
{
|
||||
ARMCPU *cpu = arm_env_get_cpu(env);
|
||||
uint64_t pfr1 = cpu->id_pfr1;
|
||||
|
||||
if (env->gicv3state) {
|
||||
pfr1 |= 1 << 28;
|
||||
}
|
||||
return pfr1;
|
||||
}
|
||||
|
||||
static uint64_t id_aa64pfr0_read(CPUARMState *env, const ARMCPRegInfo *ri)
|
||||
{
|
||||
ARMCPU *cpu = arm_env_get_cpu(env);
|
||||
uint64_t pfr0 = cpu->id_aa64pfr0;
|
||||
|
||||
if (env->gicv3state) {
|
||||
pfr0 |= 1 << 24;
|
||||
}
|
||||
return pfr0;
|
||||
}
|
||||
|
||||
void register_cp_regs_for_features(ARMCPU *cpu)
|
||||
{
|
||||
/* Register all the coprocessor registers based on feature bits */
|
||||
@ -4573,10 +4600,14 @@ void register_cp_regs_for_features(ARMCPU *cpu)
|
||||
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 0,
|
||||
.access = PL1_R, .type = ARM_CP_CONST,
|
||||
.resetvalue = cpu->id_pfr0 },
|
||||
/* ID_PFR1 is not a plain ARM_CP_CONST because we don't know
|
||||
* the value of the GIC field until after we define these regs.
|
||||
*/
|
||||
{ .name = "ID_PFR1", .state = ARM_CP_STATE_BOTH,
|
||||
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 1,
|
||||
.access = PL1_R, .type = ARM_CP_CONST,
|
||||
.resetvalue = cpu->id_pfr1 },
|
||||
.access = PL1_R, .type = ARM_CP_NO_RAW,
|
||||
.readfn = id_pfr1_read,
|
||||
.writefn = arm_cp_write_ignore },
|
||||
{ .name = "ID_DFR0", .state = ARM_CP_STATE_BOTH,
|
||||
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 2,
|
||||
.access = PL1_R, .type = ARM_CP_CONST,
|
||||
@ -4692,10 +4723,15 @@ void register_cp_regs_for_features(ARMCPU *cpu)
|
||||
* define new registers here.
|
||||
*/
|
||||
ARMCPRegInfo v8_idregs[] = {
|
||||
/* ID_AA64PFR0_EL1 is not a plain ARM_CP_CONST because we don't
|
||||
* know the right value for the GIC field until after we
|
||||
* define these regs.
|
||||
*/
|
||||
{ .name = "ID_AA64PFR0_EL1", .state = ARM_CP_STATE_AA64,
|
||||
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 0,
|
||||
.access = PL1_R, .type = ARM_CP_CONST,
|
||||
.resetvalue = cpu->id_aa64pfr0 },
|
||||
.access = PL1_R, .type = ARM_CP_NO_RAW,
|
||||
.readfn = id_aa64pfr0_read,
|
||||
.writefn = arm_cp_write_ignore },
|
||||
{ .name = "ID_AA64PFR1_EL1", .state = ARM_CP_STATE_AA64,
|
||||
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 1,
|
||||
.access = PL1_R, .type = ARM_CP_CONST,
|
||||
|
Loading…
Reference in New Issue
Block a user