xref: /openbmc/u-boot/arch/x86/cpu/qemu/qemu.c (revision 83bf0057)
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 #ifndef CONFIG_EFI_STUB
29 int print_cpuinfo(void)
30 {
31 	post_code(POST_CPU_INFO);
32 	return default_print_cpuinfo();
33 }
34 #endif
35 
36 void reset_cpu(ulong addr)
37 {
38 	/* cold reset */
39 	x86_full_reset();
40 }
41 
42 int arch_misc_init(void)
43 {
44 	return pirq_init();
45 }
46