qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 02/14] target-arm: Move feature bit settings


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v2 02/14] target-arm: Move feature bit settings to CPU init fns
Date: Fri, 20 Apr 2012 16:43:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120312 Thunderbird/11.0

Am 14.04.2012 18:42, schrieb Peter Maydell:
> Move the setting of the feature bits from cpu_reset_model_id()
> to each CPU's instance init function. This requires us to move
> the features field in CPUARMState so that it is not cleared
> on reset.
> 
> Signed-off-by: Peter Maydell <address@hidden>
> ---
[...]
> diff --git a/target-arm/cpu.c b/target-arm/cpu.c
> index 3565472..958f5c5 100644
> --- a/target-arm/cpu.c
> +++ b/target-arm/cpu.c
[...]
>  static void pxa270c0_initfn(Object *obj)
>  {
>      ARMCPU *cpu = ARM_CPU(obj);
> +    set_feature(&cpu->env, ARM_FEATURE_V5);
> +    set_feature(&cpu->env, ARM_FEATURE_XSCALE);
> +    set_feature(&cpu->env, ARM_FEATURE_IWMMXT);
>      cpu->midr = ARM_CPUID_PXA270_C0;
>  }
>  
>  static void pxa270c5_initfn(Object *obj)
>  {
>      ARMCPU *cpu = ARM_CPU(obj);
> +    set_feature(&cpu->env, ARM_FEATURE_V7);
> +    set_feature(&cpu->env, ARM_FEATURE_VFP4);
> +    set_feature(&cpu->env, ARM_FEATURE_VFP_FP16);
> +    set_feature(&cpu->env, ARM_FEATURE_NEON);
> +    set_feature(&cpu->env, ARM_FEATURE_THUMB2EE);
> +    set_feature(&cpu->env, ARM_FEATURE_ARM_DIV);
> +    set_feature(&cpu->env, ARM_FEATURE_V7MP);
>      cpu->midr = ARM_CPUID_PXA270_C5;
>  }

Beep! Glad I took the time to compare each model... :)

Once this is fixed, Acked-by.

/-F

>  
>  static void arm_any_initfn(Object *obj)
>  {
>      ARMCPU *cpu = ARM_CPU(obj);
> +    set_feature(&cpu->env, ARM_FEATURE_V7);
> +    set_feature(&cpu->env, ARM_FEATURE_VFP4);
> +    set_feature(&cpu->env, ARM_FEATURE_VFP_FP16);
> +    set_feature(&cpu->env, ARM_FEATURE_NEON);
> +    set_feature(&cpu->env, ARM_FEATURE_THUMB2EE);
> +    set_feature(&cpu->env, ARM_FEATURE_ARM_DIV);
> +    set_feature(&cpu->env, ARM_FEATURE_V7MP);
>      cpu->midr = ARM_CPUID_ANY;
>  }
>  
[...]
> diff --git a/target-arm/helper.c b/target-arm/helper.c
> index afcd68c..e495de6 100644
> --- a/target-arm/helper.c
> +++ b/target-arm/helper.c
[...]
> @@ -220,17 +163,13 @@ static void cpu_reset_model_id(CPUARMState *env, 
> uint32_t id)
>      case ARM_CPUID_PXA270_B1:
>      case ARM_CPUID_PXA270_C0:
>      case ARM_CPUID_PXA270_C5:
> -        set_feature(env, ARM_FEATURE_V5);
> -        set_feature(env, ARM_FEATURE_XSCALE);
>          /* JTAG_ID is ((id << 28) | 0x09265013) */
> -        set_feature(env, ARM_FEATURE_IWMMXT);
>          env->iwmmxt.cregs[ARM_IWMMXT_wCID] = 0x69051000 | 'Q';
>          env->cp15.c0_cachetype = 0xd172172;
>          env->cp15.c1_sys = 0x00000078;
>          break;
>      case ARM_CPUID_SA1100:
>      case ARM_CPUID_SA1110:
> -        set_feature(env, ARM_FEATURE_STRONGARM);
>          env->cp15.c1_sys = 0x00000070;
>          break;
>      default:

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]