xref: /openbmc/u-boot/arch/x86/include/asm/u-boot-x86.h (revision da4105df)
1 /*
2  * (C) Copyright 2002
3  * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 
8 #ifndef _U_BOOT_I386_H_
9 #define _U_BOOT_I386_H_	1
10 
11 /* cpu/.../cpu.c */
12 int x86_cpu_init_r(void);
13 int cpu_init_r(void);
14 int x86_cpu_init_f(void);
15 int cpu_init_f(void);
16 void init_gd(gd_t *id, u64 *gdt_addr);
17 void setup_gdt(gd_t *id, u64 *gdt_addr);
18 int init_cache(void);
19 int cleanup_before_linux(void);
20 void panic_puts(const char *str);
21 
22 /* cpu/.../timer.c */
23 void timer_isr(void *);
24 typedef void (timer_fnc_t) (void);
25 int register_timer_isr (timer_fnc_t *isr_func);
26 unsigned long get_tbclk_mhz(void);
27 void timer_set_base(uint64_t base);
28 int pcat_timer_init(void);
29 
30 /* Architecture specific - can be in arch/x86/cpu/, arch/x86/lib/, or $(BOARD)/ */
31 int dram_init_f(void);
32 
33 /* cpu/.../interrupts.c */
34 int cpu_init_interrupts(void);
35 
36 /* board/.../... */
37 int dram_init(void);
38 
39 void setup_pcat_compatibility(void);
40 
41 void isa_unmap_rom(u32 addr);
42 u32 isa_map_rom(u32 bus_addr, int size);
43 
44 /* arch/x86/lib/... */
45 int video_bios_init(void);
46 
47 void	board_init_f_r_trampoline(ulong) __attribute__ ((noreturn));
48 void	board_init_f_r(void) __attribute__ ((noreturn));
49 
50 /* Read the time stamp counter */
51 static inline __attribute__((no_instrument_function)) uint64_t rdtsc(void)
52 {
53 	uint32_t high, low;
54 	__asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high));
55 	return (((uint64_t)high) << 32) | low;
56 }
57 
58 /* board/... */
59 void timer_set_tsc_base(uint64_t new_base);
60 uint64_t timer_get_tsc(void);
61 
62 #endif	/* _U_BOOT_I386_H_ */
63