blob: 9e525dd7820b7f4ef7e77d25cdfafad83d784df3 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001/*
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 */
12int x86_cpu_init_r(void);
13int cpu_init_r(void);
14int x86_cpu_init_f(void);
15int cpu_init_f(void);
16void init_gd(gd_t *id, u64 *gdt_addr);
17void setup_gdt(gd_t *id, u64 *gdt_addr);
18int init_cache(void);
19int cleanup_before_linux(void);
20void panic_puts(const char *str);
21
22/* cpu/.../timer.c */
23void timer_isr(void *);
24typedef void (timer_fnc_t) (void);
25int register_timer_isr (timer_fnc_t *isr_func);
26unsigned long get_tbclk_mhz(void);
27void timer_set_base(uint64_t base);
28int pcat_timer_init(void);
29
30/* Architecture specific - can be in arch/x86/cpu/, arch/x86/lib/, or $(BOARD)/ */
31int dram_init_f(void);
32
33/* cpu/.../interrupts.c */
34int cpu_init_interrupts(void);
35
36/* board/.../... */
37int dram_init(void);
38
39void setup_pcat_compatibility(void);
40
41void isa_unmap_rom(u32 addr);
42u32 isa_map_rom(u32 bus_addr, int size);
43
44/* arch/x86/lib/... */
45int video_bios_init(void);
46
47void board_init_f_r_trampoline(ulong) __attribute__ ((noreturn));
48void board_init_f_r(void) __attribute__ ((noreturn));
49
50/* Read the time stamp counter */
51static 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/... */
59void timer_set_tsc_base(uint64_t new_base);
60uint64_t timer_get_tsc(void);
61
62#endif /* _U_BOOT_I386_H_ */