All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org,
	zach.pfeffer@xilinx.com, ozaki.ryota@gmail.com,
	qemu-devel@nongnu.org, alistair.francis@xilinx.com,
	michals@xilinx.com
Subject: Re: [Qemu-devel] [PATCH target-arm v2 01/15] target-arm: cpu64: Factor out ARM cortex init
Date: Thu, 05 Mar 2015 12:12:15 +0000	[thread overview]
Message-ID: <87pp8n63ts.fsf@linaro.org> (raw)
In-Reply-To: <7ea116b3ecfef321212b8c1516917eec4c56e398.1425340265.git.peter.crosthwaite@xilinx.com>


Peter Crosthwaite <peter.crosthwaite@xilinx.com> writes:

> In preparation for support for Cortex a53. Use "axx" to describe the
> shareable features. Some of the CP15 registers (such as ACTLR) are
> specific to implementation, but we currently just RAZ them so continue
> with that as the policy for all cortex A processors under a shared
> definition.
>
> The cache sizes and geometeries, the L1 I-cache policy and the physical
> address range differ between A53 and A57 so those particulars are left
> as A57 specific. The rest are moved to the generalisation.
>
> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  target-arm/cpu64.c | 32 +++++++++++++++++++-------------
>  1 file changed, 19 insertions(+), 13 deletions(-)
>
> diff --git a/target-arm/cpu64.c b/target-arm/cpu64.c
> index 823c739..5cf3121 100644
> --- a/target-arm/cpu64.c
> +++ b/target-arm/cpu64.c
> @@ -38,22 +38,22 @@ static inline void unset_feature(CPUARMState *env, int feature)
>  }
>  
>  #ifndef CONFIG_USER_ONLY
> -static uint64_t a57_l2ctlr_read(CPUARMState *env, const ARMCPRegInfo *ri)
> +static uint64_t axx_l2ctlr_read(CPUARMState *env, const ARMCPRegInfo *ri)
>  {
>      /* Number of processors is in [25:24]; otherwise we RAZ */
>      return (smp_cpus - 1) << 24;
>  }
>  #endif
>  
> -static const ARMCPRegInfo cortexa57_cp_reginfo[] = {
> +static const ARMCPRegInfo cortexaxx_cp_reginfo[] = {
>  #ifndef CONFIG_USER_ONLY
>      { .name = "L2CTLR_EL1", .state = ARM_CP_STATE_AA64,
>        .opc0 = 3, .opc1 = 1, .crn = 11, .crm = 0, .opc2 = 2,
> -      .access = PL1_RW, .readfn = a57_l2ctlr_read,
> +      .access = PL1_RW, .readfn = axx_l2ctlr_read,
>        .writefn = arm_cp_write_ignore },
>      { .name = "L2CTLR",
>        .cp = 15, .opc1 = 1, .crn = 9, .crm = 0, .opc2 = 2,
> -      .access = PL1_RW, .readfn = a57_l2ctlr_read,
> +      .access = PL1_RW, .readfn = axx_l2ctlr_read,
>        .writefn = arm_cp_write_ignore },
>  #endif
>      { .name = "L2ECTLR_EL1", .state = ARM_CP_STATE_AA64,
> @@ -92,10 +92,8 @@ static const ARMCPRegInfo cortexa57_cp_reginfo[] = {
>      REGINFO_SENTINEL
>  };
>  
> -static void aarch64_a57_initfn(Object *obj)
> +static void aarch64_axx_initfn(ARMCPU *cpu)
>  {
> -    ARMCPU *cpu = ARM_CPU(obj);
> -
>      set_feature(&cpu->env, ARM_FEATURE_V8);
>      set_feature(&cpu->env, ARM_FEATURE_VFP4);
>      set_feature(&cpu->env, ARM_FEATURE_NEON);
> @@ -107,13 +105,10 @@ static void aarch64_a57_initfn(Object *obj)
>      set_feature(&cpu->env, ARM_FEATURE_V8_SHA256);
>      set_feature(&cpu->env, ARM_FEATURE_V8_PMULL);
>      set_feature(&cpu->env, ARM_FEATURE_CRC);
> -    cpu->kvm_target = QEMU_KVM_ARM_TARGET_CORTEX_A57;
> -    cpu->midr = 0x411fd070;
>      cpu->reset_fpsid = 0x41034070;
>      cpu->mvfr0 = 0x10110222;
>      cpu->mvfr1 = 0x12111111;
>      cpu->mvfr2 = 0x00000043;
> -    cpu->ctr = 0x8444c004;
>      cpu->reset_sctlr = 0x00c50838;
>      cpu->id_pfr0 = 0x00000131;
>      cpu->id_pfr1 = 0x00011011;
> @@ -132,14 +127,25 @@ static void aarch64_a57_initfn(Object *obj)
>      cpu->id_aa64pfr0 = 0x00002222;
>      cpu->id_aa64dfr0 = 0x10305106;
>      cpu->id_aa64isar0 = 0x00011120;
> -    cpu->id_aa64mmfr0 = 0x00001124;
>      cpu->dbgdidr = 0x3516d000;
>      cpu->clidr = 0x0a200023;
> +    cpu->dcz_blocksize = 4; /* 64 bytes */
> +    define_arm_cp_regs(cpu, cortexaxx_cp_reginfo);
> +}
> +
> +static void aarch64_a57_initfn(Object *obj)
> +{
> +    ARMCPU *cpu = ARM_CPU(obj);
> +
> +    aarch64_axx_initfn(cpu);
> +
> +    cpu->kvm_target = QEMU_KVM_ARM_TARGET_CORTEX_A57;
> +    cpu->midr = 0x411fd070;
> +    cpu->ctr = 0x8444c004; /* L1Ip = PIPT */
> +    cpu->id_aa64mmfr0 = 0x00001124; /* 44 bit physical addr */
>      cpu->ccsidr[0] = 0x701fe00a; /* 32KB L1 dcache */
>      cpu->ccsidr[1] = 0x201fe012; /* 48KB L1 icache */
>      cpu->ccsidr[2] = 0x70ffe07a; /* 2048KB L2 cache */
> -    cpu->dcz_blocksize = 4; /* 64 bytes */
> -    define_arm_cp_regs(cpu, cortexa57_cp_reginfo);
>  }
>  
>  #ifdef CONFIG_USER_ONLY

-- 
Alex Bennée

  reply	other threads:[~2015-03-05 12:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03  0:28 [Qemu-devel] [PATCH target-arm v2 00/15] Next Generation Xilinx Zynq SoC Peter Crosthwaite
2015-03-03  0:28 ` [Qemu-devel] [PATCH target-arm v2 01/15] target-arm: cpu64: Factor out ARM cortex init Peter Crosthwaite
2015-03-05 12:12   ` Alex Bennée [this message]
2015-03-03  0:28 ` [Qemu-devel] [PATCH target-arm v2 03/15] arm: Introduce Xilinx ZynqMP SoC Peter Crosthwaite
2015-03-05  4:41   ` Alistair Francis
2015-03-16  9:26     ` Peter Crosthwaite
2015-03-03  0:28 ` [Qemu-devel] [PATCH target-arm v2 02/15] target-arm: cpu64: Add support for cortex-a53 Peter Crosthwaite
2015-03-05 12:12   ` Alex Bennée
2015-03-03  0:28 ` [Qemu-devel] [PATCH target-arm v2 04/15] arm: xlnx-zynqmp: Add GIC Peter Crosthwaite
2015-03-03  0:28 ` [Qemu-devel] [PATCH target-arm v2 05/15] arm: xlnx-zynqmp: Connect CPU Timers to GIC Peter Crosthwaite
2015-03-03  0:28 ` [Qemu-devel] [PATCH target-arm v2 06/15] net: cadence_gem: Clean up variable names Peter Crosthwaite
2015-03-05 12:17   ` Alex Bennée
2015-03-03  0:28 ` [Qemu-devel] [PATCH target-arm v2 07/15] net: cadence_gem: Split state struct and type into header Peter Crosthwaite
2015-03-03  0:28 ` [Qemu-devel] [PATCH target-arm v2 09/15] char: cadence_uart: Clean up variable names Peter Crosthwaite
2015-03-03  0:28 ` [Qemu-devel] [PATCH target-arm v2 10/15] char: cadence_uart: Split state struct and type into header Peter Crosthwaite
2015-03-03  0:28 ` [Qemu-devel] [PATCH target-arm v2 12/15] arm: Add xlnx-ep108 machine Peter Crosthwaite
2015-03-03  0:28 ` [Qemu-devel] [PATCH target-arm v2 13/15] arm: xilinx-ep108: Add external RAM Peter Crosthwaite
2015-03-03  0:28 ` [Qemu-devel] [PATCH target-arm v2 15/15] arm: xlnx-zynqmp: Add PSCI setup Peter Crosthwaite

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pp8n63ts.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=alistair.francis@xilinx.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=michals@xilinx.com \
    --cc=ozaki.ryota@gmail.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zach.pfeffer@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.