Revision 2e4d7e3e target-arm/helper.c

b/target-arm/helper.c
7 7
#endif
8 8
#include "sysemu.h"
9 9

  
10
static uint32_t cortexa15_cp15_c0_c1[8] = {
11
    0x00001131, 0x00011011, 0x02010555, 0x00000000,
12
    0x10201105, 0x20000000, 0x01240000, 0x02102211
13
};
14

  
15
static uint32_t cortexa15_cp15_c0_c2[8] = {
16
    0x02101110, 0x13112111, 0x21232041, 0x11112131, 0x10011142, 0, 0, 0
17
};
18

  
19
static uint32_t cortexa9_cp15_c0_c1[8] =
20
{ 0x1031, 0x11, 0x000, 0, 0x00100103, 0x20000000, 0x01230000, 0x00002111 };
21

  
22
static uint32_t cortexa9_cp15_c0_c2[8] =
23
{ 0x00101111, 0x13112111, 0x21232041, 0x11112131, 0x00111142, 0, 0, 0 };
24

  
25
static uint32_t cortexa8_cp15_c0_c1[8] =
26
{ 0x1031, 0x11, 0x400, 0, 0x31100003, 0x20000000, 0x01202000, 0x11 };
27

  
28
static uint32_t cortexa8_cp15_c0_c2[8] =
29
{ 0x00101111, 0x12112111, 0x21232031, 0x11112131, 0x00111142, 0, 0, 0 };
30

  
31
static uint32_t mpcore_cp15_c0_c1[8] =
32
{ 0x111, 0x1, 0, 0x2, 0x01100103, 0x10020302, 0x01222000, 0 };
33

  
34
static uint32_t mpcore_cp15_c0_c2[8] =
35
{ 0x00100011, 0x12002111, 0x11221011, 0x01102131, 0x141, 0, 0, 0 };
36

  
37
static uint32_t arm1136_cp15_c0_c1[8] =
38
{ 0x111, 0x1, 0x2, 0x3, 0x01130003, 0x10030302, 0x01222110, 0 };
39

  
40
static uint32_t arm1136_cp15_c0_c2[8] =
41
{ 0x00140011, 0x12002111, 0x11231111, 0x01102131, 0x141, 0, 0, 0 };
42

  
43
static uint32_t arm1176_cp15_c0_c1[8] =
44
{ 0x111, 0x11, 0x33, 0, 0x01130003, 0x10030302, 0x01222100, 0 };
45

  
46
static uint32_t arm1176_cp15_c0_c2[8] =
47
{ 0x0140011, 0x12002111, 0x11231121, 0x01102131, 0x01141, 0, 0, 0 };
48

  
49 10
static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
50 11
{
51 12
    switch (id) {
......
58 19
    case ARM_CPUID_ARM1136:
59 20
        /* This is the 1136 r1, which is a v6K core */
60 21
    case ARM_CPUID_ARM1136_R2:
61
        /* What qemu calls "arm1136_r2" is actually the 1136 r0p2, ie an
62
         * older core than plain "arm1136". In particular this does not
63
         * have the v6K features.
64
         */
65
        /* These ID register values are correct for 1136 but may be wrong
66
         * for 1136_r2 (in particular r0p2 does not actually implement most
67
         * of the ID registers).
68
         */
69
        memcpy(env->cp15.c0_c1, arm1136_cp15_c0_c1, 8 * sizeof(uint32_t));
70
        memcpy(env->cp15.c0_c2, arm1136_cp15_c0_c2, 8 * sizeof(uint32_t));
71 22
        break;
72 23
    case ARM_CPUID_ARM1176:
73
        memcpy(env->cp15.c0_c1, arm1176_cp15_c0_c1, 8 * sizeof(uint32_t));
74
        memcpy(env->cp15.c0_c2, arm1176_cp15_c0_c2, 8 * sizeof(uint32_t));
75 24
        break;
76 25
    case ARM_CPUID_ARM11MPCORE:
77
        memcpy(env->cp15.c0_c1, mpcore_cp15_c0_c1, 8 * sizeof(uint32_t));
78
        memcpy(env->cp15.c0_c2, mpcore_cp15_c0_c2, 8 * sizeof(uint32_t));
79 26
        break;
80 27
    case ARM_CPUID_CORTEXA8:
81
        memcpy(env->cp15.c0_c1, cortexa8_cp15_c0_c1, 8 * sizeof(uint32_t));
82
        memcpy(env->cp15.c0_c2, cortexa8_cp15_c0_c2, 8 * sizeof(uint32_t));
83 28
        env->cp15.c0_clid = (1 << 27) | (2 << 24) | 3;
84 29
        env->cp15.c0_ccsid[0] = 0xe007e01a; /* 16k L1 dcache. */
85 30
        env->cp15.c0_ccsid[1] = 0x2007e01a; /* 16k L1 icache. */
86 31
        env->cp15.c0_ccsid[2] = 0xf0000000; /* No L2 icache. */
87 32
        break;
88 33
    case ARM_CPUID_CORTEXA9:
89
        memcpy(env->cp15.c0_c1, cortexa9_cp15_c0_c1, 8 * sizeof(uint32_t));
90
        memcpy(env->cp15.c0_c2, cortexa9_cp15_c0_c2, 8 * sizeof(uint32_t));
91 34
        env->cp15.c0_clid = (1 << 27) | (1 << 24) | 3;
92 35
        env->cp15.c0_ccsid[0] = 0xe00fe015; /* 16k L1 dcache. */
93 36
        env->cp15.c0_ccsid[1] = 0x200fe015; /* 16k L1 icache. */
94 37
        break;
95 38
    case ARM_CPUID_CORTEXA15:
96
        memcpy(env->cp15.c0_c1, cortexa15_cp15_c0_c1, 8 * sizeof(uint32_t));
97
        memcpy(env->cp15.c0_c2, cortexa15_cp15_c0_c2, 8 * sizeof(uint32_t));
98 39
        env->cp15.c0_clid = 0x0a200023;
99 40
        env->cp15.c0_ccsid[0] = 0x701fe00a; /* 32K L1 dcache */
100 41
        env->cp15.c0_ccsid[1] = 0x201fe00a; /* 32K L1 icache */
......
159 100
    env->vfp.xregs[ARM_VFP_MVFR1] = cpu->mvfr1;
160 101
    env->cp15.c0_cachetype = cpu->ctr;
161 102
    env->cp15.c1_sys = cpu->reset_sctlr;
103
    env->cp15.c0_c1[0] = cpu->id_pfr0;
104
    env->cp15.c0_c1[1] = cpu->id_pfr1;
105
    env->cp15.c0_c1[2] = cpu->id_dfr0;
106
    env->cp15.c0_c1[3] = cpu->id_afr0;
107
    env->cp15.c0_c1[4] = cpu->id_mmfr0;
108
    env->cp15.c0_c1[5] = cpu->id_mmfr1;
109
    env->cp15.c0_c1[6] = cpu->id_mmfr2;
110
    env->cp15.c0_c1[7] = cpu->id_mmfr3;
111
    env->cp15.c0_c2[0] = cpu->id_isar0;
112
    env->cp15.c0_c2[1] = cpu->id_isar1;
113
    env->cp15.c0_c2[2] = cpu->id_isar2;
114
    env->cp15.c0_c2[3] = cpu->id_isar3;
115
    env->cp15.c0_c2[4] = cpu->id_isar4;
116
    env->cp15.c0_c2[5] = cpu->id_isar5;
162 117

  
163 118
    if (arm_feature(env, ARM_FEATURE_IWMMXT)) {
164 119
        env->iwmmxt.cregs[ARM_IWMMXT_wCID] = 0x69051000 | 'Q';

Also available in: Unified diff