2002-11-18 00:14:45 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2002
|
2011-08-04 16:45:45 +00:00
|
|
|
* Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
|
2002-11-18 00:14:45 +00:00
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2002-11-18 00:14:45 +00:00
|
|
|
*/
|
|
|
|
|
2003-03-12 10:41:04 +00:00
|
|
|
#ifndef _U_BOOT_I386_H_
|
|
|
|
#define _U_BOOT_I386_H_ 1
|
2002-11-18 00:14:45 +00:00
|
|
|
|
2015-06-07 03:33:13 +00:00
|
|
|
extern char gdt_rom[];
|
|
|
|
|
2002-11-18 00:14:45 +00:00
|
|
|
/* cpu/.../cpu.c */
|
2014-11-06 20:20:06 +00:00
|
|
|
int arch_cpu_init(void);
|
2011-02-12 04:11:35 +00:00
|
|
|
int x86_cpu_init_f(void);
|
2009-11-24 09:04:21 +00:00
|
|
|
int cpu_init_f(void);
|
2011-12-31 11:58:15 +00:00
|
|
|
void init_gd(gd_t *id, u64 *gdt_addr);
|
|
|
|
void setup_gdt(gd_t *id, u64 *gdt_addr);
|
2015-06-07 03:33:13 +00:00
|
|
|
/*
|
|
|
|
* Setup FSP execution environment GDT to use the one we used in
|
|
|
|
* arch/x86/cpu/start16.S and reload the segment registers.
|
|
|
|
*/
|
|
|
|
void setup_fsp_gdt(void);
|
2011-12-27 11:46:43 +00:00
|
|
|
int init_cache(void);
|
2012-10-20 12:33:10 +00:00
|
|
|
int cleanup_before_linux(void);
|
2009-02-24 10:14:45 +00:00
|
|
|
|
|
|
|
/* cpu/.../timer.c */
|
|
|
|
void timer_isr(void *);
|
|
|
|
typedef void (timer_fnc_t) (void);
|
|
|
|
int register_timer_isr (timer_fnc_t *isr_func);
|
2013-04-17 16:13:36 +00:00
|
|
|
unsigned long get_tbclk_mhz(void);
|
|
|
|
void timer_set_base(uint64_t base);
|
2013-04-17 16:13:39 +00:00
|
|
|
int pcat_timer_init(void);
|
2009-02-24 10:14:45 +00:00
|
|
|
|
2009-02-24 10:13:40 +00:00
|
|
|
/* cpu/.../interrupts.c */
|
|
|
|
int cpu_init_interrupts(void);
|
|
|
|
|
2014-11-06 20:20:08 +00:00
|
|
|
int cleanup_before_linux(void);
|
|
|
|
int x86_cleanup_before_linux(void);
|
|
|
|
void x86_enable_caches(void);
|
|
|
|
void x86_disable_caches(void);
|
|
|
|
int x86_init_cache(void);
|
|
|
|
void reset_cpu(ulong addr);
|
|
|
|
ulong board_get_usable_ram_top(ulong total_size);
|
|
|
|
void dram_init_banksize(void);
|
2014-11-11 01:00:26 +00:00
|
|
|
int default_print_cpuinfo(void);
|
2014-11-06 20:20:08 +00:00
|
|
|
|
2015-01-28 05:13:42 +00:00
|
|
|
/* Set up a UART which can be used with printch(), printhex8(), etc. */
|
|
|
|
int setup_early_uart(void);
|
|
|
|
|
2010-04-23 14:05:48 +00:00
|
|
|
void setup_pcat_compatibility(void);
|
|
|
|
|
2003-05-31 18:35:21 +00:00
|
|
|
void isa_unmap_rom(u32 addr);
|
|
|
|
u32 isa_map_rom(u32 bus_addr, int size);
|
|
|
|
|
2011-04-13 09:43:28 +00:00
|
|
|
/* arch/x86/lib/... */
|
2003-05-31 18:35:21 +00:00
|
|
|
int video_bios_init(void);
|
2002-11-18 00:14:45 +00:00
|
|
|
|
2015-06-07 03:33:14 +00:00
|
|
|
/* arch/x86/lib/fsp/... */
|
|
|
|
int x86_fsp_init(void);
|
|
|
|
|
2012-01-01 04:06:39 +00:00
|
|
|
void board_init_f_r_trampoline(ulong) __attribute__ ((noreturn));
|
|
|
|
void board_init_f_r(void) __attribute__ ((noreturn));
|
2002-11-18 00:14:45 +00:00
|
|
|
|
2015-04-24 10:10:06 +00:00
|
|
|
int arch_misc_init(void);
|
|
|
|
|
2012-10-23 18:04:32 +00:00
|
|
|
/* Read the time stamp counter */
|
2013-06-11 18:14:52 +00:00
|
|
|
static inline __attribute__((no_instrument_function)) uint64_t rdtsc(void)
|
2012-10-23 18:04:32 +00:00
|
|
|
{
|
|
|
|
uint32_t high, low;
|
|
|
|
__asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high));
|
|
|
|
return (((uint64_t)high) << 32) | low;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* board/... */
|
|
|
|
void timer_set_tsc_base(uint64_t new_base);
|
|
|
|
uint64_t timer_get_tsc(void);
|
|
|
|
|
2014-11-13 05:42:28 +00:00
|
|
|
void quick_ram_check(void);
|
|
|
|
|
2015-04-30 04:26:01 +00:00
|
|
|
int x86_init_cpus(void);
|
|
|
|
|
2014-12-30 02:32:24 +00:00
|
|
|
#define PCI_VGA_RAM_IMAGE_START 0xc0000
|
|
|
|
|
2003-03-12 10:41:04 +00:00
|
|
|
#endif /* _U_BOOT_I386_H_ */
|