4 * Copyright (c) 2012 SUSE LINUX Products GmbH
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see
18 * <http://www.gnu.org/licenses/gpl-2.0.html>
22 #include "internals.h"
23 #include "qemu-common.h"
24 #include "hw/qdev-properties.h"
25 #include "qapi/qmp/qerror.h"
26 #if !defined(CONFIG_USER_ONLY)
27 #include "hw/loader.h"
29 #include "hw/arm/arm.h"
30 #include "sysemu/sysemu.h"
31 #include "sysemu/kvm.h"
34 static void arm_cpu_set_pc(CPUState
*cs
, vaddr value
)
36 ARMCPU
*cpu
= ARM_CPU(cs
);
38 cpu
->env
.regs
[15] = value
;
41 static bool arm_cpu_has_work(CPUState
*cs
)
43 return cs
->interrupt_request
&
44 (CPU_INTERRUPT_FIQ
| CPU_INTERRUPT_HARD
| CPU_INTERRUPT_EXITTB
);
47 static void cp_reg_reset(gpointer key
, gpointer value
, gpointer opaque
)
49 /* Reset a single ARMCPRegInfo register */
50 ARMCPRegInfo
*ri
= value
;
53 if (ri
->type
& ARM_CP_SPECIAL
) {
58 ri
->resetfn(&cpu
->env
, ri
);
62 /* A zero offset is never possible as it would be regs[0]
63 * so we use it to indicate that reset is being handled elsewhere.
64 * This is basically only used for fields in non-core coprocessors
65 * (like the pxa2xx ones).
67 if (!ri
->fieldoffset
) {
71 if (cpreg_field_is_64bit(ri
)) {
72 CPREG_FIELD64(&cpu
->env
, ri
) = ri
->resetvalue
;
74 CPREG_FIELD32(&cpu
->env
, ri
) = ri
->resetvalue
;
78 /* CPUClass::reset() */
79 static void arm_cpu_reset(CPUState
*s
)
81 ARMCPU
*cpu
= ARM_CPU(s
);
82 ARMCPUClass
*acc
= ARM_CPU_GET_CLASS(cpu
);
83 CPUARMState
*env
= &cpu
->env
;
87 memset(env
, 0, offsetof(CPUARMState
, features
));
88 g_hash_table_foreach(cpu
->cp_regs
, cp_reg_reset
, cpu
);
89 env
->vfp
.xregs
[ARM_VFP_FPSID
] = cpu
->reset_fpsid
;
90 env
->vfp
.xregs
[ARM_VFP_MVFR0
] = cpu
->mvfr0
;
91 env
->vfp
.xregs
[ARM_VFP_MVFR1
] = cpu
->mvfr1
;
92 env
->vfp
.xregs
[ARM_VFP_MVFR2
] = cpu
->mvfr2
;
94 if (arm_feature(env
, ARM_FEATURE_IWMMXT
)) {
95 env
->iwmmxt
.cregs
[ARM_IWMMXT_wCID
] = 0x69051000 | 'Q';
98 if (arm_feature(env
, ARM_FEATURE_AARCH64
)) {
99 /* 64 bit CPUs always start in 64 bit mode */
101 #if defined(CONFIG_USER_ONLY)
102 env
->pstate
= PSTATE_MODE_EL0t
;
103 /* Userspace expects access to CTL_EL0 and the cache ops */
104 env
->cp15
.c1_sys
|= SCTLR_UCT
| SCTLR_UCI
;
105 /* and to the FP/Neon instructions */
106 env
->cp15
.c1_coproc
= deposit64(env
->cp15
.c1_coproc
, 20, 2, 3);
108 env
->pstate
= PSTATE_MODE_EL1h
;
109 env
->pc
= cpu
->rvbar
;
112 #if defined(CONFIG_USER_ONLY)
113 /* Userspace expects access to cp10 and cp11 for FP/Neon */
114 env
->cp15
.c1_coproc
= deposit64(env
->cp15
.c1_coproc
, 20, 4, 0xf);
118 #if defined(CONFIG_USER_ONLY)
119 env
->uncached_cpsr
= ARM_CPU_MODE_USR
;
120 /* For user mode we must enable access to coprocessors */
121 env
->vfp
.xregs
[ARM_VFP_FPEXC
] = 1 << 30;
122 if (arm_feature(env
, ARM_FEATURE_IWMMXT
)) {
123 env
->cp15
.c15_cpar
= 3;
124 } else if (arm_feature(env
, ARM_FEATURE_XSCALE
)) {
125 env
->cp15
.c15_cpar
= 1;
128 /* SVC mode with interrupts disabled. */
129 env
->uncached_cpsr
= ARM_CPU_MODE_SVC
;
130 env
->daif
= PSTATE_D
| PSTATE_A
| PSTATE_I
| PSTATE_F
;
131 /* On ARMv7-M the CPSR_I is the value of the PRIMASK register, and is
132 clear at reset. Initial SP and PC are loaded from ROM. */
136 env
->daif
&= ~PSTATE_I
;
139 /* We should really use ldl_phys here, in case the guest
140 modified flash and reset itself. However images
141 loaded via -kernel have not been copied yet, so load the
142 values directly from there. */
143 env
->regs
[13] = ldl_p(rom
) & 0xFFFFFFFC;
146 env
->regs
[15] = pc
& ~1;
150 if (env
->cp15
.c1_sys
& SCTLR_V
) {
151 env
->regs
[15] = 0xFFFF0000;
154 env
->vfp
.xregs
[ARM_VFP_FPEXC
] = 0;
156 set_flush_to_zero(1, &env
->vfp
.standard_fp_status
);
157 set_flush_inputs_to_zero(1, &env
->vfp
.standard_fp_status
);
158 set_default_nan_mode(1, &env
->vfp
.standard_fp_status
);
159 set_float_detect_tininess(float_tininess_before_rounding
,
160 &env
->vfp
.fp_status
);
161 set_float_detect_tininess(float_tininess_before_rounding
,
162 &env
->vfp
.standard_fp_status
);
164 /* Reset is a state change for some CPUARMState fields which we
165 * bake assumptions about into translated code, so we need to
170 #ifndef CONFIG_USER_ONLY
172 kvm_arm_reset_vcpu(cpu
);
177 #ifndef CONFIG_USER_ONLY
178 static void arm_cpu_set_irq(void *opaque
, int irq
, int level
)
180 ARMCPU
*cpu
= opaque
;
181 CPUState
*cs
= CPU(cpu
);
186 cpu_interrupt(cs
, CPU_INTERRUPT_HARD
);
188 cpu_reset_interrupt(cs
, CPU_INTERRUPT_HARD
);
193 cpu_interrupt(cs
, CPU_INTERRUPT_FIQ
);
195 cpu_reset_interrupt(cs
, CPU_INTERRUPT_FIQ
);
199 hw_error("arm_cpu_set_irq: Bad interrupt line %d\n", irq
);
203 static void arm_cpu_kvm_set_irq(void *opaque
, int irq
, int level
)
206 ARMCPU
*cpu
= opaque
;
207 CPUState
*cs
= CPU(cpu
);
208 int kvm_irq
= KVM_ARM_IRQ_TYPE_CPU
<< KVM_ARM_IRQ_TYPE_SHIFT
;
212 kvm_irq
|= KVM_ARM_IRQ_CPU_IRQ
;
215 kvm_irq
|= KVM_ARM_IRQ_CPU_FIQ
;
218 hw_error("arm_cpu_kvm_set_irq: Bad interrupt line %d\n", irq
);
220 kvm_irq
|= cs
->cpu_index
<< KVM_ARM_IRQ_VCPU_SHIFT
;
221 kvm_set_irq(kvm_state
, kvm_irq
, level
? 1 : 0);
226 static inline void set_feature(CPUARMState
*env
, int feature
)
228 env
->features
|= 1ULL << feature
;
231 static void arm_cpu_initfn(Object
*obj
)
233 CPUState
*cs
= CPU(obj
);
234 ARMCPU
*cpu
= ARM_CPU(obj
);
237 cs
->env_ptr
= &cpu
->env
;
238 cpu_exec_init(&cpu
->env
);
239 cpu
->cp_regs
= g_hash_table_new_full(g_int_hash
, g_int_equal
,
242 #ifndef CONFIG_USER_ONLY
243 /* Our inbound IRQ and FIQ lines */
245 qdev_init_gpio_in(DEVICE(cpu
), arm_cpu_kvm_set_irq
, 2);
247 qdev_init_gpio_in(DEVICE(cpu
), arm_cpu_set_irq
, 2);
250 cpu
->gt_timer
[GTIMER_PHYS
] = timer_new(QEMU_CLOCK_VIRTUAL
, GTIMER_SCALE
,
251 arm_gt_ptimer_cb
, cpu
);
252 cpu
->gt_timer
[GTIMER_VIRT
] = timer_new(QEMU_CLOCK_VIRTUAL
, GTIMER_SCALE
,
253 arm_gt_vtimer_cb
, cpu
);
254 qdev_init_gpio_out(DEVICE(cpu
), cpu
->gt_timer_outputs
,
255 ARRAY_SIZE(cpu
->gt_timer_outputs
));
258 /* DTB consumers generally don't in fact care what the 'compatible'
259 * string is, so always provide some string and trust that a hypothetical
260 * picky DTB consumer will also provide a helpful error message.
262 cpu
->dtb_compatible
= "qemu,unknown";
263 cpu
->kvm_target
= QEMU_KVM_ARM_TARGET_NONE
;
265 if (tcg_enabled() && !inited
) {
267 arm_translate_init();
271 static Property arm_cpu_reset_cbar_property
=
272 DEFINE_PROP_UINT64("reset-cbar", ARMCPU
, reset_cbar
, 0);
274 static Property arm_cpu_reset_hivecs_property
=
275 DEFINE_PROP_BOOL("reset-hivecs", ARMCPU
, reset_hivecs
, false);
277 static Property arm_cpu_rvbar_property
=
278 DEFINE_PROP_UINT64("rvbar", ARMCPU
, rvbar
, 0);
280 static void arm_cpu_post_init(Object
*obj
)
282 ARMCPU
*cpu
= ARM_CPU(obj
);
284 if (arm_feature(&cpu
->env
, ARM_FEATURE_CBAR
) ||
285 arm_feature(&cpu
->env
, ARM_FEATURE_CBAR_RO
)) {
286 qdev_property_add_static(DEVICE(obj
), &arm_cpu_reset_cbar_property
,
290 if (!arm_feature(&cpu
->env
, ARM_FEATURE_M
)) {
291 qdev_property_add_static(DEVICE(obj
), &arm_cpu_reset_hivecs_property
,
295 if (arm_feature(&cpu
->env
, ARM_FEATURE_AARCH64
)) {
296 qdev_property_add_static(DEVICE(obj
), &arm_cpu_rvbar_property
,
301 static void arm_cpu_finalizefn(Object
*obj
)
303 ARMCPU
*cpu
= ARM_CPU(obj
);
304 g_hash_table_destroy(cpu
->cp_regs
);
307 static void arm_cpu_realizefn(DeviceState
*dev
, Error
**errp
)
309 CPUState
*cs
= CPU(dev
);
310 ARMCPU
*cpu
= ARM_CPU(dev
);
311 ARMCPUClass
*acc
= ARM_CPU_GET_CLASS(dev
);
312 CPUARMState
*env
= &cpu
->env
;
314 /* Some features automatically imply others: */
315 if (arm_feature(env
, ARM_FEATURE_V8
)) {
316 set_feature(env
, ARM_FEATURE_V7
);
317 set_feature(env
, ARM_FEATURE_ARM_DIV
);
318 set_feature(env
, ARM_FEATURE_LPAE
);
319 set_feature(env
, ARM_FEATURE_V8_AES
);
320 set_feature(env
, ARM_FEATURE_V8_SHA1
);
321 set_feature(env
, ARM_FEATURE_V8_SHA256
);
322 set_feature(env
, ARM_FEATURE_V8_PMULL
);
324 if (arm_feature(env
, ARM_FEATURE_V7
)) {
325 set_feature(env
, ARM_FEATURE_VAPA
);
326 set_feature(env
, ARM_FEATURE_THUMB2
);
327 set_feature(env
, ARM_FEATURE_MPIDR
);
328 if (!arm_feature(env
, ARM_FEATURE_M
)) {
329 set_feature(env
, ARM_FEATURE_V6K
);
331 set_feature(env
, ARM_FEATURE_V6
);
334 if (arm_feature(env
, ARM_FEATURE_V6K
)) {
335 set_feature(env
, ARM_FEATURE_V6
);
336 set_feature(env
, ARM_FEATURE_MVFR
);
338 if (arm_feature(env
, ARM_FEATURE_V6
)) {
339 set_feature(env
, ARM_FEATURE_V5
);
340 if (!arm_feature(env
, ARM_FEATURE_M
)) {
341 set_feature(env
, ARM_FEATURE_AUXCR
);
344 if (arm_feature(env
, ARM_FEATURE_V5
)) {
345 set_feature(env
, ARM_FEATURE_V4T
);
347 if (arm_feature(env
, ARM_FEATURE_M
)) {
348 set_feature(env
, ARM_FEATURE_THUMB_DIV
);
350 if (arm_feature(env
, ARM_FEATURE_ARM_DIV
)) {
351 set_feature(env
, ARM_FEATURE_THUMB_DIV
);
353 if (arm_feature(env
, ARM_FEATURE_VFP4
)) {
354 set_feature(env
, ARM_FEATURE_VFP3
);
356 if (arm_feature(env
, ARM_FEATURE_VFP3
)) {
357 set_feature(env
, ARM_FEATURE_VFP
);
359 if (arm_feature(env
, ARM_FEATURE_LPAE
)) {
360 set_feature(env
, ARM_FEATURE_V7MP
);
361 set_feature(env
, ARM_FEATURE_PXN
);
363 if (arm_feature(env
, ARM_FEATURE_CBAR_RO
)) {
364 set_feature(env
, ARM_FEATURE_CBAR
);
367 if (cpu
->reset_hivecs
) {
368 cpu
->reset_sctlr
|= (1 << 13);
371 register_cp_regs_for_features(cpu
);
372 arm_cpu_register_gdb_regs_for_features(cpu
);
374 init_cpreg_list(cpu
);
379 acc
->parent_realize(dev
, errp
);
382 static ObjectClass
*arm_cpu_class_by_name(const char *cpu_model
)
391 typename
= g_strdup_printf("%s-" TYPE_ARM_CPU
, cpu_model
);
392 oc
= object_class_by_name(typename
);
394 if (!oc
|| !object_class_dynamic_cast(oc
, TYPE_ARM_CPU
) ||
395 object_class_is_abstract(oc
)) {
401 /* CPU models. These are not needed for the AArch64 linux-user build. */
402 #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64)
404 static void arm926_initfn(Object
*obj
)
406 ARMCPU
*cpu
= ARM_CPU(obj
);
408 cpu
->dtb_compatible
= "arm,arm926";
409 set_feature(&cpu
->env
, ARM_FEATURE_V5
);
410 set_feature(&cpu
->env
, ARM_FEATURE_VFP
);
411 set_feature(&cpu
->env
, ARM_FEATURE_DUMMY_C15_REGS
);
412 set_feature(&cpu
->env
, ARM_FEATURE_CACHE_TEST_CLEAN
);
413 cpu
->midr
= 0x41069265;
414 cpu
->reset_fpsid
= 0x41011090;
415 cpu
->ctr
= 0x1dd20d2;
416 cpu
->reset_sctlr
= 0x00090078;
419 static void arm946_initfn(Object
*obj
)
421 ARMCPU
*cpu
= ARM_CPU(obj
);
423 cpu
->dtb_compatible
= "arm,arm946";
424 set_feature(&cpu
->env
, ARM_FEATURE_V5
);
425 set_feature(&cpu
->env
, ARM_FEATURE_MPU
);
426 set_feature(&cpu
->env
, ARM_FEATURE_DUMMY_C15_REGS
);
427 cpu
->midr
= 0x41059461;
428 cpu
->ctr
= 0x0f004006;
429 cpu
->reset_sctlr
= 0x00000078;
432 static void arm1026_initfn(Object
*obj
)
434 ARMCPU
*cpu
= ARM_CPU(obj
);
436 cpu
->dtb_compatible
= "arm,arm1026";
437 set_feature(&cpu
->env
, ARM_FEATURE_V5
);
438 set_feature(&cpu
->env
, ARM_FEATURE_VFP
);
439 set_feature(&cpu
->env
, ARM_FEATURE_AUXCR
);
440 set_feature(&cpu
->env
, ARM_FEATURE_DUMMY_C15_REGS
);
441 set_feature(&cpu
->env
, ARM_FEATURE_CACHE_TEST_CLEAN
);
442 cpu
->midr
= 0x4106a262;
443 cpu
->reset_fpsid
= 0x410110a0;
444 cpu
->ctr
= 0x1dd20d2;
445 cpu
->reset_sctlr
= 0x00090078;
446 cpu
->reset_auxcr
= 1;
448 /* The 1026 had an IFAR at c6,c0,0,1 rather than the ARMv6 c6,c0,0,2 */
449 ARMCPRegInfo ifar
= {
450 .name
= "IFAR", .cp
= 15, .crn
= 6, .crm
= 0, .opc1
= 0, .opc2
= 1,
452 .fieldoffset
= offsetofhigh32(CPUARMState
, cp15
.far_el1
),
455 define_one_arm_cp_reg(cpu
, &ifar
);
459 static void arm1136_r2_initfn(Object
*obj
)
461 ARMCPU
*cpu
= ARM_CPU(obj
);
462 /* What qemu calls "arm1136_r2" is actually the 1136 r0p2, ie an
463 * older core than plain "arm1136". In particular this does not
464 * have the v6K features.
465 * These ID register values are correct for 1136 but may be wrong
466 * for 1136_r2 (in particular r0p2 does not actually implement most
467 * of the ID registers).
470 cpu
->dtb_compatible
= "arm,arm1136";
471 set_feature(&cpu
->env
, ARM_FEATURE_V6
);
472 set_feature(&cpu
->env
, ARM_FEATURE_VFP
);
473 set_feature(&cpu
->env
, ARM_FEATURE_DUMMY_C15_REGS
);
474 set_feature(&cpu
->env
, ARM_FEATURE_CACHE_DIRTY_REG
);
475 set_feature(&cpu
->env
, ARM_FEATURE_CACHE_BLOCK_OPS
);
476 cpu
->midr
= 0x4107b362;
477 cpu
->reset_fpsid
= 0x410120b4;
478 cpu
->mvfr0
= 0x11111111;
479 cpu
->mvfr1
= 0x00000000;
480 cpu
->ctr
= 0x1dd20d2;
481 cpu
->reset_sctlr
= 0x00050078;
482 cpu
->id_pfr0
= 0x111;
486 cpu
->id_mmfr0
= 0x01130003;
487 cpu
->id_mmfr1
= 0x10030302;
488 cpu
->id_mmfr2
= 0x01222110;
489 cpu
->id_isar0
= 0x00140011;
490 cpu
->id_isar1
= 0x12002111;
491 cpu
->id_isar2
= 0x11231111;
492 cpu
->id_isar3
= 0x01102131;
493 cpu
->id_isar4
= 0x141;
494 cpu
->reset_auxcr
= 7;
497 static void arm1136_initfn(Object
*obj
)
499 ARMCPU
*cpu
= ARM_CPU(obj
);
501 cpu
->dtb_compatible
= "arm,arm1136";
502 set_feature(&cpu
->env
, ARM_FEATURE_V6K
);
503 set_feature(&cpu
->env
, ARM_FEATURE_V6
);
504 set_feature(&cpu
->env
, ARM_FEATURE_VFP
);
505 set_feature(&cpu
->env
, ARM_FEATURE_DUMMY_C15_REGS
);
506 set_feature(&cpu
->env
, ARM_FEATURE_CACHE_DIRTY_REG
);
507 set_feature(&cpu
->env
, ARM_FEATURE_CACHE_BLOCK_OPS
);
508 cpu
->midr
= 0x4117b363;
509 cpu
->reset_fpsid
= 0x410120b4;
510 cpu
->mvfr0
= 0x11111111;
511 cpu
->mvfr1
= 0x00000000;
512 cpu
->ctr
= 0x1dd20d2;
513 cpu
->reset_sctlr
= 0x00050078;
514 cpu
->id_pfr0
= 0x111;
518 cpu
->id_mmfr0
= 0x01130003;
519 cpu
->id_mmfr1
= 0x10030302;
520 cpu
->id_mmfr2
= 0x01222110;
521 cpu
->id_isar0
= 0x00140011;
522 cpu
->id_isar1
= 0x12002111;
523 cpu
->id_isar2
= 0x11231111;
524 cpu
->id_isar3
= 0x01102131;
525 cpu
->id_isar4
= 0x141;
526 cpu
->reset_auxcr
= 7;
529 static void arm1176_initfn(Object
*obj
)
531 ARMCPU
*cpu
= ARM_CPU(obj
);
533 cpu
->dtb_compatible
= "arm,arm1176";
534 set_feature(&cpu
->env
, ARM_FEATURE_V6K
);
535 set_feature(&cpu
->env
, ARM_FEATURE_VFP
);
536 set_feature(&cpu
->env
, ARM_FEATURE_VAPA
);
537 set_feature(&cpu
->env
, ARM_FEATURE_DUMMY_C15_REGS
);
538 set_feature(&cpu
->env
, ARM_FEATURE_CACHE_DIRTY_REG
);
539 set_feature(&cpu
->env
, ARM_FEATURE_CACHE_BLOCK_OPS
);
540 cpu
->midr
= 0x410fb767;
541 cpu
->reset_fpsid
= 0x410120b5;
542 cpu
->mvfr0
= 0x11111111;
543 cpu
->mvfr1
= 0x00000000;
544 cpu
->ctr
= 0x1dd20d2;
545 cpu
->reset_sctlr
= 0x00050078;
546 cpu
->id_pfr0
= 0x111;
550 cpu
->id_mmfr0
= 0x01130003;
551 cpu
->id_mmfr1
= 0x10030302;
552 cpu
->id_mmfr2
= 0x01222100;
553 cpu
->id_isar0
= 0x0140011;
554 cpu
->id_isar1
= 0x12002111;
555 cpu
->id_isar2
= 0x11231121;
556 cpu
->id_isar3
= 0x01102131;
557 cpu
->id_isar4
= 0x01141;
558 cpu
->reset_auxcr
= 7;
561 static void arm11mpcore_initfn(Object
*obj
)
563 ARMCPU
*cpu
= ARM_CPU(obj
);
565 cpu
->dtb_compatible
= "arm,arm11mpcore";
566 set_feature(&cpu
->env
, ARM_FEATURE_V6K
);
567 set_feature(&cpu
->env
, ARM_FEATURE_VFP
);
568 set_feature(&cpu
->env
, ARM_FEATURE_VAPA
);
569 set_feature(&cpu
->env
, ARM_FEATURE_MPIDR
);
570 set_feature(&cpu
->env
, ARM_FEATURE_DUMMY_C15_REGS
);
571 cpu
->midr
= 0x410fb022;
572 cpu
->reset_fpsid
= 0x410120b4;
573 cpu
->mvfr0
= 0x11111111;
574 cpu
->mvfr1
= 0x00000000;
575 cpu
->ctr
= 0x1d192992; /* 32K icache 32K dcache */
576 cpu
->id_pfr0
= 0x111;
580 cpu
->id_mmfr0
= 0x01100103;
581 cpu
->id_mmfr1
= 0x10020302;
582 cpu
->id_mmfr2
= 0x01222000;
583 cpu
->id_isar0
= 0x00100011;
584 cpu
->id_isar1
= 0x12002111;
585 cpu
->id_isar2
= 0x11221011;
586 cpu
->id_isar3
= 0x01102131;
587 cpu
->id_isar4
= 0x141;
588 cpu
->reset_auxcr
= 1;
591 static void cortex_m3_initfn(Object
*obj
)
593 ARMCPU
*cpu
= ARM_CPU(obj
);
594 set_feature(&cpu
->env
, ARM_FEATURE_V7
);
595 set_feature(&cpu
->env
, ARM_FEATURE_M
);
596 cpu
->midr
= 0x410fc231;
599 static void arm_v7m_class_init(ObjectClass
*oc
, void *data
)
601 #ifndef CONFIG_USER_ONLY
602 CPUClass
*cc
= CPU_CLASS(oc
);
604 cc
->do_interrupt
= arm_v7m_cpu_do_interrupt
;
608 static const ARMCPRegInfo cortexa8_cp_reginfo
[] = {
609 { .name
= "L2LOCKDOWN", .cp
= 15, .crn
= 9, .crm
= 0, .opc1
= 1, .opc2
= 0,
610 .access
= PL1_RW
, .type
= ARM_CP_CONST
, .resetvalue
= 0 },
611 { .name
= "L2AUXCR", .cp
= 15, .crn
= 9, .crm
= 0, .opc1
= 1, .opc2
= 2,
612 .access
= PL1_RW
, .type
= ARM_CP_CONST
, .resetvalue
= 0 },
616 static void cortex_a8_initfn(Object
*obj
)
618 ARMCPU
*cpu
= ARM_CPU(obj
);
620 cpu
->dtb_compatible
= "arm,cortex-a8";
621 set_feature(&cpu
->env
, ARM_FEATURE_V7
);
622 set_feature(&cpu
->env
, ARM_FEATURE_VFP3
);
623 set_feature(&cpu
->env
, ARM_FEATURE_NEON
);
624 set_feature(&cpu
->env
, ARM_FEATURE_THUMB2EE
);
625 set_feature(&cpu
->env
, ARM_FEATURE_DUMMY_C15_REGS
);
626 cpu
->midr
= 0x410fc080;
627 cpu
->reset_fpsid
= 0x410330c0;
628 cpu
->mvfr0
= 0x11110222;
629 cpu
->mvfr1
= 0x00011100;
630 cpu
->ctr
= 0x82048004;
631 cpu
->reset_sctlr
= 0x00c50078;
632 cpu
->id_pfr0
= 0x1031;
634 cpu
->id_dfr0
= 0x400;
636 cpu
->id_mmfr0
= 0x31100003;
637 cpu
->id_mmfr1
= 0x20000000;
638 cpu
->id_mmfr2
= 0x01202000;
639 cpu
->id_mmfr3
= 0x11;
640 cpu
->id_isar0
= 0x00101111;
641 cpu
->id_isar1
= 0x12112111;
642 cpu
->id_isar2
= 0x21232031;
643 cpu
->id_isar3
= 0x11112131;
644 cpu
->id_isar4
= 0x00111142;
645 cpu
->clidr
= (1 << 27) | (2 << 24) | 3;
646 cpu
->ccsidr
[0] = 0xe007e01a; /* 16k L1 dcache. */
647 cpu
->ccsidr
[1] = 0x2007e01a; /* 16k L1 icache. */
648 cpu
->ccsidr
[2] = 0xf0000000; /* No L2 icache. */
649 cpu
->reset_auxcr
= 2;
650 define_arm_cp_regs(cpu
, cortexa8_cp_reginfo
);
653 static const ARMCPRegInfo cortexa9_cp_reginfo
[] = {
654 /* power_control should be set to maximum latency. Again,
655 * default to 0 and set by private hook
657 { .name
= "A9_PWRCTL", .cp
= 15, .crn
= 15, .crm
= 0, .opc1
= 0, .opc2
= 0,
658 .access
= PL1_RW
, .resetvalue
= 0,
659 .fieldoffset
= offsetof(CPUARMState
, cp15
.c15_power_control
) },
660 { .name
= "A9_DIAG", .cp
= 15, .crn
= 15, .crm
= 0, .opc1
= 0, .opc2
= 1,
661 .access
= PL1_RW
, .resetvalue
= 0,
662 .fieldoffset
= offsetof(CPUARMState
, cp15
.c15_diagnostic
) },
663 { .name
= "A9_PWRDIAG", .cp
= 15, .crn
= 15, .crm
= 0, .opc1
= 0, .opc2
= 2,
664 .access
= PL1_RW
, .resetvalue
= 0,
665 .fieldoffset
= offsetof(CPUARMState
, cp15
.c15_power_diagnostic
) },
666 { .name
= "NEONBUSY", .cp
= 15, .crn
= 15, .crm
= 1, .opc1
= 0, .opc2
= 0,
667 .access
= PL1_RW
, .resetvalue
= 0, .type
= ARM_CP_CONST
},
668 /* TLB lockdown control */
669 { .name
= "TLB_LOCKR", .cp
= 15, .crn
= 15, .crm
= 4, .opc1
= 5, .opc2
= 2,
670 .access
= PL1_W
, .resetvalue
= 0, .type
= ARM_CP_NOP
},
671 { .name
= "TLB_LOCKW", .cp
= 15, .crn
= 15, .crm
= 4, .opc1
= 5, .opc2
= 4,
672 .access
= PL1_W
, .resetvalue
= 0, .type
= ARM_CP_NOP
},
673 { .name
= "TLB_VA", .cp
= 15, .crn
= 15, .crm
= 5, .opc1
= 5, .opc2
= 2,
674 .access
= PL1_RW
, .resetvalue
= 0, .type
= ARM_CP_CONST
},
675 { .name
= "TLB_PA", .cp
= 15, .crn
= 15, .crm
= 6, .opc1
= 5, .opc2
= 2,
676 .access
= PL1_RW
, .resetvalue
= 0, .type
= ARM_CP_CONST
},
677 { .name
= "TLB_ATTR", .cp
= 15, .crn
= 15, .crm
= 7, .opc1
= 5, .opc2
= 2,
678 .access
= PL1_RW
, .resetvalue
= 0, .type
= ARM_CP_CONST
},
682 static void cortex_a9_initfn(Object
*obj
)
684 ARMCPU
*cpu
= ARM_CPU(obj
);
686 cpu
->dtb_compatible
= "arm,cortex-a9";
687 set_feature(&cpu
->env
, ARM_FEATURE_V7
);
688 set_feature(&cpu
->env
, ARM_FEATURE_VFP3
);
689 set_feature(&cpu
->env
, ARM_FEATURE_VFP_FP16
);
690 set_feature(&cpu
->env
, ARM_FEATURE_NEON
);
691 set_feature(&cpu
->env
, ARM_FEATURE_THUMB2EE
);
692 /* Note that A9 supports the MP extensions even for
693 * A9UP and single-core A9MP (which are both different
694 * and valid configurations; we don't model A9UP).
696 set_feature(&cpu
->env
, ARM_FEATURE_V7MP
);
697 set_feature(&cpu
->env
, ARM_FEATURE_CBAR
);
698 cpu
->midr
= 0x410fc090;
699 cpu
->reset_fpsid
= 0x41033090;
700 cpu
->mvfr0
= 0x11110222;
701 cpu
->mvfr1
= 0x01111111;
702 cpu
->ctr
= 0x80038003;
703 cpu
->reset_sctlr
= 0x00c50078;
704 cpu
->id_pfr0
= 0x1031;
706 cpu
->id_dfr0
= 0x000;
708 cpu
->id_mmfr0
= 0x00100103;
709 cpu
->id_mmfr1
= 0x20000000;
710 cpu
->id_mmfr2
= 0x01230000;
711 cpu
->id_mmfr3
= 0x00002111;
712 cpu
->id_isar0
= 0x00101111;
713 cpu
->id_isar1
= 0x13112111;
714 cpu
->id_isar2
= 0x21232041;
715 cpu
->id_isar3
= 0x11112131;
716 cpu
->id_isar4
= 0x00111142;
717 cpu
->clidr
= (1 << 27) | (1 << 24) | 3;
718 cpu
->ccsidr
[0] = 0xe00fe015; /* 16k L1 dcache. */
719 cpu
->ccsidr
[1] = 0x200fe015; /* 16k L1 icache. */
720 define_arm_cp_regs(cpu
, cortexa9_cp_reginfo
);
723 #ifndef CONFIG_USER_ONLY
724 static uint64_t a15_l2ctlr_read(CPUARMState
*env
, const ARMCPRegInfo
*ri
)
726 /* Linux wants the number of processors from here.
727 * Might as well set the interrupt-controller bit too.
729 return ((smp_cpus
- 1) << 24) | (1 << 23);
733 static const ARMCPRegInfo cortexa15_cp_reginfo
[] = {
734 #ifndef CONFIG_USER_ONLY
735 { .name
= "L2CTLR", .cp
= 15, .crn
= 9, .crm
= 0, .opc1
= 1, .opc2
= 2,
736 .access
= PL1_RW
, .resetvalue
= 0, .readfn
= a15_l2ctlr_read
,
737 .writefn
= arm_cp_write_ignore
, },
739 { .name
= "L2ECTLR", .cp
= 15, .crn
= 9, .crm
= 0, .opc1
= 1, .opc2
= 3,
740 .access
= PL1_RW
, .type
= ARM_CP_CONST
, .resetvalue
= 0 },
744 static void cortex_a15_initfn(Object
*obj
)
746 ARMCPU
*cpu
= ARM_CPU(obj
);
748 cpu
->dtb_compatible
= "arm,cortex-a15";
749 set_feature(&cpu
->env
, ARM_FEATURE_V7
);
750 set_feature(&cpu
->env
, ARM_FEATURE_VFP4
);
751 set_feature(&cpu
->env
, ARM_FEATURE_VFP_FP16
);
752 set_feature(&cpu
->env
, ARM_FEATURE_NEON
);
753 set_feature(&cpu
->env
, ARM_FEATURE_THUMB2EE
);
754 set_feature(&cpu
->env
, ARM_FEATURE_ARM_DIV
);
755 set_feature(&cpu
->env
, ARM_FEATURE_GENERIC_TIMER
);
756 set_feature(&cpu
->env
, ARM_FEATURE_DUMMY_C15_REGS
);
757 set_feature(&cpu
->env
, ARM_FEATURE_CBAR_RO
);
758 set_feature(&cpu
->env
, ARM_FEATURE_LPAE
);
759 cpu
->kvm_target
= QEMU_KVM_ARM_TARGET_CORTEX_A15
;
760 cpu
->midr
= 0x412fc0f1;
761 cpu
->reset_fpsid
= 0x410430f0;
762 cpu
->mvfr0
= 0x10110222;
763 cpu
->mvfr1
= 0x11111111;
764 cpu
->ctr
= 0x8444c004;
765 cpu
->reset_sctlr
= 0x00c50078;
766 cpu
->id_pfr0
= 0x00001131;
767 cpu
->id_pfr1
= 0x00011011;
768 cpu
->id_dfr0
= 0x02010555;
769 cpu
->id_afr0
= 0x00000000;
770 cpu
->id_mmfr0
= 0x10201105;
771 cpu
->id_mmfr1
= 0x20000000;
772 cpu
->id_mmfr2
= 0x01240000;
773 cpu
->id_mmfr3
= 0x02102211;
774 cpu
->id_isar0
= 0x02101110;
775 cpu
->id_isar1
= 0x13112111;
776 cpu
->id_isar2
= 0x21232041;
777 cpu
->id_isar3
= 0x11112131;
778 cpu
->id_isar4
= 0x10011142;
779 cpu
->clidr
= 0x0a200023;
780 cpu
->ccsidr
[0] = 0x701fe00a; /* 32K L1 dcache */
781 cpu
->ccsidr
[1] = 0x201fe00a; /* 32K L1 icache */
782 cpu
->ccsidr
[2] = 0x711fe07a; /* 4096K L2 unified cache */
783 define_arm_cp_regs(cpu
, cortexa15_cp_reginfo
);
786 static void ti925t_initfn(Object
*obj
)
788 ARMCPU
*cpu
= ARM_CPU(obj
);
789 set_feature(&cpu
->env
, ARM_FEATURE_V4T
);
790 set_feature(&cpu
->env
, ARM_FEATURE_OMAPCP
);
791 cpu
->midr
= ARM_CPUID_TI925T
;
792 cpu
->ctr
= 0x5109149;
793 cpu
->reset_sctlr
= 0x00000070;
796 static void sa1100_initfn(Object
*obj
)
798 ARMCPU
*cpu
= ARM_CPU(obj
);
800 cpu
->dtb_compatible
= "intel,sa1100";
801 set_feature(&cpu
->env
, ARM_FEATURE_STRONGARM
);
802 set_feature(&cpu
->env
, ARM_FEATURE_DUMMY_C15_REGS
);
803 cpu
->midr
= 0x4401A11B;
804 cpu
->reset_sctlr
= 0x00000070;
807 static void sa1110_initfn(Object
*obj
)
809 ARMCPU
*cpu
= ARM_CPU(obj
);
810 set_feature(&cpu
->env
, ARM_FEATURE_STRONGARM
);
811 set_feature(&cpu
->env
, ARM_FEATURE_DUMMY_C15_REGS
);
812 cpu
->midr
= 0x6901B119;
813 cpu
->reset_sctlr
= 0x00000070;
816 static void pxa250_initfn(Object
*obj
)
818 ARMCPU
*cpu
= ARM_CPU(obj
);
820 cpu
->dtb_compatible
= "marvell,xscale";
821 set_feature(&cpu
->env
, ARM_FEATURE_V5
);
822 set_feature(&cpu
->env
, ARM_FEATURE_XSCALE
);
823 cpu
->midr
= 0x69052100;
824 cpu
->ctr
= 0xd172172;
825 cpu
->reset_sctlr
= 0x00000078;
828 static void pxa255_initfn(Object
*obj
)
830 ARMCPU
*cpu
= ARM_CPU(obj
);
832 cpu
->dtb_compatible
= "marvell,xscale";
833 set_feature(&cpu
->env
, ARM_FEATURE_V5
);
834 set_feature(&cpu
->env
, ARM_FEATURE_XSCALE
);
835 cpu
->midr
= 0x69052d00;
836 cpu
->ctr
= 0xd172172;
837 cpu
->reset_sctlr
= 0x00000078;
840 static void pxa260_initfn(Object
*obj
)
842 ARMCPU
*cpu
= ARM_CPU(obj
);
844 cpu
->dtb_compatible
= "marvell,xscale";
845 set_feature(&cpu
->env
, ARM_FEATURE_V5
);
846 set_feature(&cpu
->env
, ARM_FEATURE_XSCALE
);
847 cpu
->midr
= 0x69052903;
848 cpu
->ctr
= 0xd172172;
849 cpu
->reset_sctlr
= 0x00000078;
852 static void pxa261_initfn(Object
*obj
)
854 ARMCPU
*cpu
= ARM_CPU(obj
);
856 cpu
->dtb_compatible
= "marvell,xscale";
857 set_feature(&cpu
->env
, ARM_FEATURE_V5
);
858 set_feature(&cpu
->env
, ARM_FEATURE_XSCALE
);
859 cpu
->midr
= 0x69052d05;
860 cpu
->ctr
= 0xd172172;
861 cpu
->reset_sctlr
= 0x00000078;
864 static void pxa262_initfn(Object
*obj
)
866 ARMCPU
*cpu
= ARM_CPU(obj
);
868 cpu
->dtb_compatible
= "marvell,xscale";
869 set_feature(&cpu
->env
, ARM_FEATURE_V5
);
870 set_feature(&cpu
->env
, ARM_FEATURE_XSCALE
);
871 cpu
->midr
= 0x69052d06;
872 cpu
->ctr
= 0xd172172;
873 cpu
->reset_sctlr
= 0x00000078;
876 static void pxa270a0_initfn(Object
*obj
)
878 ARMCPU
*cpu
= ARM_CPU(obj
);
880 cpu
->dtb_compatible
= "marvell,xscale";
881 set_feature(&cpu
->env
, ARM_FEATURE_V5
);
882 set_feature(&cpu
->env
, ARM_FEATURE_XSCALE
);
883 set_feature(&cpu
->env
, ARM_FEATURE_IWMMXT
);
884 cpu
->midr
= 0x69054110;
885 cpu
->ctr
= 0xd172172;
886 cpu
->reset_sctlr
= 0x00000078;
889 static void pxa270a1_initfn(Object
*obj
)
891 ARMCPU
*cpu
= ARM_CPU(obj
);
893 cpu
->dtb_compatible
= "marvell,xscale";
894 set_feature(&cpu
->env
, ARM_FEATURE_V5
);
895 set_feature(&cpu
->env
, ARM_FEATURE_XSCALE
);
896 set_feature(&cpu
->env
, ARM_FEATURE_IWMMXT
);
897 cpu
->midr
= 0x69054111;
898 cpu
->ctr
= 0xd172172;
899 cpu
->reset_sctlr
= 0x00000078;
902 static void pxa270b0_initfn(Object
*obj
)
904 ARMCPU
*cpu
= ARM_CPU(obj
);
906 cpu
->dtb_compatible
= "marvell,xscale";
907 set_feature(&cpu
->env
, ARM_FEATURE_V5
);
908 set_feature(&cpu
->env
, ARM_FEATURE_XSCALE
);
909 set_feature(&cpu
->env
, ARM_FEATURE_IWMMXT
);
910 cpu
->midr
= 0x69054112;
911 cpu
->ctr
= 0xd172172;
912 cpu
->reset_sctlr
= 0x00000078;
915 static void pxa270b1_initfn(Object
*obj
)
917 ARMCPU
*cpu
= ARM_CPU(obj
);
919 cpu
->dtb_compatible
= "marvell,xscale";
920 set_feature(&cpu
->env
, ARM_FEATURE_V5
);
921 set_feature(&cpu
->env
, ARM_FEATURE_XSCALE
);
922 set_feature(&cpu
->env
, ARM_FEATURE_IWMMXT
);
923 cpu
->midr
= 0x69054113;
924 cpu
->ctr
= 0xd172172;
925 cpu
->reset_sctlr
= 0x00000078;
928 static void pxa270c0_initfn(Object
*obj
)
930 ARMCPU
*cpu
= ARM_CPU(obj
);
932 cpu
->dtb_compatible
= "marvell,xscale";
933 set_feature(&cpu
->env
, ARM_FEATURE_V5
);
934 set_feature(&cpu
->env
, ARM_FEATURE_XSCALE
);
935 set_feature(&cpu
->env
, ARM_FEATURE_IWMMXT
);
936 cpu
->midr
= 0x69054114;
937 cpu
->ctr
= 0xd172172;
938 cpu
->reset_sctlr
= 0x00000078;
941 static void pxa270c5_initfn(Object
*obj
)
943 ARMCPU
*cpu
= ARM_CPU(obj
);
945 cpu
->dtb_compatible
= "marvell,xscale";
946 set_feature(&cpu
->env
, ARM_FEATURE_V5
);
947 set_feature(&cpu
->env
, ARM_FEATURE_XSCALE
);
948 set_feature(&cpu
->env
, ARM_FEATURE_IWMMXT
);
949 cpu
->midr
= 0x69054117;
950 cpu
->ctr
= 0xd172172;
951 cpu
->reset_sctlr
= 0x00000078;
954 #ifdef CONFIG_USER_ONLY
955 static void arm_any_initfn(Object
*obj
)
957 ARMCPU
*cpu
= ARM_CPU(obj
);
958 set_feature(&cpu
->env
, ARM_FEATURE_V8
);
959 set_feature(&cpu
->env
, ARM_FEATURE_VFP4
);
960 set_feature(&cpu
->env
, ARM_FEATURE_VFP_FP16
);
961 set_feature(&cpu
->env
, ARM_FEATURE_NEON
);
962 set_feature(&cpu
->env
, ARM_FEATURE_THUMB2EE
);
963 set_feature(&cpu
->env
, ARM_FEATURE_ARM_DIV
);
964 set_feature(&cpu
->env
, ARM_FEATURE_V7MP
);
965 set_feature(&cpu
->env
, ARM_FEATURE_CRC
);
966 cpu
->midr
= 0xffffffff;
970 #endif /* !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) */
972 typedef struct ARMCPUInfo
{
974 void (*initfn
)(Object
*obj
);
975 void (*class_init
)(ObjectClass
*oc
, void *data
);
978 static const ARMCPUInfo arm_cpus
[] = {
979 #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64)
980 { .name
= "arm926", .initfn
= arm926_initfn
},
981 { .name
= "arm946", .initfn
= arm946_initfn
},
982 { .name
= "arm1026", .initfn
= arm1026_initfn
},
983 /* What QEMU calls "arm1136-r2" is actually the 1136 r0p2, i.e. an
984 * older core than plain "arm1136". In particular this does not
985 * have the v6K features.
987 { .name
= "arm1136-r2", .initfn
= arm1136_r2_initfn
},
988 { .name
= "arm1136", .initfn
= arm1136_initfn
},
989 { .name
= "arm1176", .initfn
= arm1176_initfn
},
990 { .name
= "arm11mpcore", .initfn
= arm11mpcore_initfn
},
991 { .name
= "cortex-m3", .initfn
= cortex_m3_initfn
,
992 .class_init
= arm_v7m_class_init
},
993 { .name
= "cortex-a8", .initfn
= cortex_a8_initfn
},
994 { .name
= "cortex-a9", .initfn
= cortex_a9_initfn
},
995 { .name
= "cortex-a15", .initfn
= cortex_a15_initfn
},
996 { .name
= "ti925t", .initfn
= ti925t_initfn
},
997 { .name
= "sa1100", .initfn
= sa1100_initfn
},
998 { .name
= "sa1110", .initfn
= sa1110_initfn
},
999 { .name
= "pxa250", .initfn
= pxa250_initfn
},
1000 { .name
= "pxa255", .initfn
= pxa255_initfn
},
1001 { .name
= "pxa260", .initfn
= pxa260_initfn
},
1002 { .name
= "pxa261", .initfn
= pxa261_initfn
},
1003 { .name
= "pxa262", .initfn
= pxa262_initfn
},
1004 /* "pxa270" is an alias for "pxa270-a0" */
1005 { .name
= "pxa270", .initfn
= pxa270a0_initfn
},
1006 { .name
= "pxa270-a0", .initfn
= pxa270a0_initfn
},
1007 { .name
= "pxa270-a1", .initfn
= pxa270a1_initfn
},
1008 { .name
= "pxa270-b0", .initfn
= pxa270b0_initfn
},
1009 { .name
= "pxa270-b1", .initfn
= pxa270b1_initfn
},
1010 { .name
= "pxa270-c0", .initfn
= pxa270c0_initfn
},
1011 { .name
= "pxa270-c5", .initfn
= pxa270c5_initfn
},
1012 #ifdef CONFIG_USER_ONLY
1013 { .name
= "any", .initfn
= arm_any_initfn
},
1019 static Property arm_cpu_properties
[] = {
1020 DEFINE_PROP_BOOL("start-powered-off", ARMCPU
, start_powered_off
, false),
1021 DEFINE_PROP_UINT32("midr", ARMCPU
, midr
, 0),
1022 DEFINE_PROP_END_OF_LIST()
1025 static void arm_cpu_class_init(ObjectClass
*oc
, void *data
)
1027 ARMCPUClass
*acc
= ARM_CPU_CLASS(oc
);
1028 CPUClass
*cc
= CPU_CLASS(acc
);
1029 DeviceClass
*dc
= DEVICE_CLASS(oc
);
1031 acc
->parent_realize
= dc
->realize
;
1032 dc
->realize
= arm_cpu_realizefn
;
1033 dc
->props
= arm_cpu_properties
;
1035 acc
->parent_reset
= cc
->reset
;
1036 cc
->reset
= arm_cpu_reset
;
1038 cc
->class_by_name
= arm_cpu_class_by_name
;
1039 cc
->has_work
= arm_cpu_has_work
;
1040 cc
->do_interrupt
= arm_cpu_do_interrupt
;
1041 cc
->dump_state
= arm_cpu_dump_state
;
1042 cc
->set_pc
= arm_cpu_set_pc
;
1043 cc
->gdb_read_register
= arm_cpu_gdb_read_register
;
1044 cc
->gdb_write_register
= arm_cpu_gdb_write_register
;
1045 #ifdef CONFIG_USER_ONLY
1046 cc
->handle_mmu_fault
= arm_cpu_handle_mmu_fault
;
1048 cc
->get_phys_page_debug
= arm_cpu_get_phys_page_debug
;
1049 cc
->vmsd
= &vmstate_arm_cpu
;
1051 cc
->gdb_num_core_regs
= 26;
1052 cc
->gdb_core_xml_file
= "arm-core.xml";
1055 static void cpu_register(const ARMCPUInfo
*info
)
1057 TypeInfo type_info
= {
1058 .parent
= TYPE_ARM_CPU
,
1059 .instance_size
= sizeof(ARMCPU
),
1060 .instance_init
= info
->initfn
,
1061 .class_size
= sizeof(ARMCPUClass
),
1062 .class_init
= info
->class_init
,
1065 type_info
.name
= g_strdup_printf("%s-" TYPE_ARM_CPU
, info
->name
);
1066 type_register(&type_info
);
1067 g_free((void *)type_info
.name
);
1070 static const TypeInfo arm_cpu_type_info
= {
1071 .name
= TYPE_ARM_CPU
,
1073 .instance_size
= sizeof(ARMCPU
),
1074 .instance_init
= arm_cpu_initfn
,
1075 .instance_post_init
= arm_cpu_post_init
,
1076 .instance_finalize
= arm_cpu_finalizefn
,
1078 .class_size
= sizeof(ARMCPUClass
),
1079 .class_init
= arm_cpu_class_init
,
1082 static void arm_cpu_register_types(void)
1084 const ARMCPUInfo
*info
= arm_cpus
;
1086 type_register_static(&arm_cpu_type_info
);
1088 while (info
->name
) {
1094 type_init(arm_cpu_register_types
)