blob: 7c03e0295beb9ab7d1787a3ced939fb93d170272 [file] [log] [blame]
Bin Menga65b25d2015-05-07 21:34:08 +08001/*
2 * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
Bin Meng5c564222015-06-03 09:20:06 +08008#include <asm/irq.h>
Bin Menga65b25d2015-05-07 21:34:08 +08009#include <asm/post.h>
10#include <asm/processor.h>
11
12int 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
Simon Glasseeae5102015-08-04 12:34:03 -060028#ifndef CONFIG_EFI_STUB
Bin Menga65b25d2015-05-07 21:34:08 +080029int print_cpuinfo(void)
30{
31 post_code(POST_CPU_INFO);
32 return default_print_cpuinfo();
33}
Simon Glasseeae5102015-08-04 12:34:03 -060034#endif
Bin Menga65b25d2015-05-07 21:34:08 +080035
36void reset_cpu(ulong addr)
37{
38 /* cold reset */
39 x86_full_reset();
40}
Bin Meng5c564222015-06-03 09:20:06 +080041
42int arch_misc_init(void)
43{
Simon Glass7e4be122015-08-10 07:05:08 -060044 return pirq_init();
Bin Meng5c564222015-06-03 09:20:06 +080045}