xref: /openbmc/u-boot/arch/x86/cpu/qemu/qemu.c (revision 95de1e2f)
1 /*
2  * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
3  *
4  * SPDX-License-Identifier:	GPL-2.0+
5  */
6 
7 #include <common.h>
8 #include <asm/irq.h>
9 #include <asm/post.h>
10 #include <asm/processor.h>
11 
12 int arch_cpu_init(void)
13 {
14 	int ret;
15 
16 	post_code(POST_CPU_INIT);
17 #ifdef CONFIG_SYS_X86_TSC_TIMER
18 	timer_set_base(rdtsc());
19 #endif
20 
21 	ret = x86_cpu_init_f();
22 	if (ret)
23 		return ret;
24 
25 	return 0;
26 }
27 
28 int print_cpuinfo(void)
29 {
30 	post_code(POST_CPU_INFO);
31 	return default_print_cpuinfo();
32 }
33 
34 void reset_cpu(ulong addr)
35 {
36 	/* cold reset */
37 	x86_full_reset();
38 }
39 
40 int arch_misc_init(void)
41 {
42 	pirq_init();
43 
44 	return 0;
45 }
46