1fea25720SGraeme Russ /* 2fea25720SGraeme Russ * (C) Copyright 2002 3fa82f871SAlbert ARIBAUD * Daniel Engström, Omicron Ceti AB, daniel@omicron.se. 4fea25720SGraeme Russ * 5fea25720SGraeme Russ * See file CREDITS for list of people who contributed to this 6fea25720SGraeme Russ * project. 7fea25720SGraeme Russ * 8fea25720SGraeme Russ * This program is free software; you can redistribute it and/or 9fea25720SGraeme Russ * modify it under the terms of the GNU General Public License as 10fea25720SGraeme Russ * published by the Free Software Foundation; either version 2 of 11fea25720SGraeme Russ * the License, or (at your option) any later version. 12fea25720SGraeme Russ * 13fea25720SGraeme Russ * This program is distributed in the hope that it will be useful, 14fea25720SGraeme Russ * but WITHOUT ANY WARRANTY; without even the implied warranty of 15fea25720SGraeme Russ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16fea25720SGraeme Russ * GNU General Public License for more details. 17fea25720SGraeme Russ * 18fea25720SGraeme Russ * You should have received a copy of the GNU General Public License 19fea25720SGraeme Russ * along with this program; if not, write to the Free Software 20fea25720SGraeme Russ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21fea25720SGraeme Russ * MA 02111-1307 USA 22fea25720SGraeme Russ */ 23fea25720SGraeme Russ 24fea25720SGraeme Russ #ifndef _U_BOOT_I386_H_ 25fea25720SGraeme Russ #define _U_BOOT_I386_H_ 1 26fea25720SGraeme Russ 27fea25720SGraeme Russ /* cpu/.../cpu.c */ 28fea25720SGraeme Russ int x86_cpu_init_r(void); 29fea25720SGraeme Russ int cpu_init_r(void); 30fea25720SGraeme Russ int x86_cpu_init_f(void); 31fea25720SGraeme Russ int cpu_init_f(void); 329e6c572fSGraeme Russ void init_gd(gd_t *id, u64 *gdt_addr); 339e6c572fSGraeme Russ void setup_gdt(gd_t *id, u64 *gdt_addr); 34d653244bSGraeme Russ int init_cache(void); 35f30fc4deSGabe Black int cleanup_before_linux(void); 36*c78a62acSSimon Glass void panic_puts(const char *str); 37fea25720SGraeme Russ 38fea25720SGraeme Russ /* cpu/.../timer.c */ 39fea25720SGraeme Russ void timer_isr(void *); 40fea25720SGraeme Russ typedef void (timer_fnc_t) (void); 41fea25720SGraeme Russ int register_timer_isr (timer_fnc_t *isr_func); 42fea25720SGraeme Russ 43fea25720SGraeme Russ /* Architecture specific - can be in arch/x86/cpu/, arch/x86/lib/, or $(BOARD)/ */ 44fea25720SGraeme Russ int dram_init_f(void); 45fea25720SGraeme Russ 46fea25720SGraeme Russ /* cpu/.../interrupts.c */ 47fea25720SGraeme Russ int cpu_init_interrupts(void); 48fea25720SGraeme Russ 49fea25720SGraeme Russ /* board/.../... */ 50fea25720SGraeme Russ int dram_init(void); 51fea25720SGraeme Russ 52fea25720SGraeme Russ void setup_pcat_compatibility(void); 53fea25720SGraeme Russ 54fea25720SGraeme Russ void isa_unmap_rom(u32 addr); 55fea25720SGraeme Russ u32 isa_map_rom(u32 bus_addr, int size); 56fea25720SGraeme Russ 57fea25720SGraeme Russ /* arch/x86/lib/... */ 58fea25720SGraeme Russ int video_bios_init(void); 59fea25720SGraeme Russ 60f48dd6fcSGraeme Russ void board_init_f_r_trampoline(ulong) __attribute__ ((noreturn)); 61f48dd6fcSGraeme Russ void board_init_f_r(void) __attribute__ ((noreturn)); 62fea25720SGraeme Russ 632f899e03SVadim Bendebury /* Read the time stamp counter */ 642f899e03SVadim Bendebury static inline uint64_t rdtsc(void) 652f899e03SVadim Bendebury { 662f899e03SVadim Bendebury uint32_t high, low; 672f899e03SVadim Bendebury __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high)); 682f899e03SVadim Bendebury return (((uint64_t)high) << 32) | low; 692f899e03SVadim Bendebury } 702f899e03SVadim Bendebury 712f899e03SVadim Bendebury /* board/... */ 722f899e03SVadim Bendebury void timer_set_tsc_base(uint64_t new_base); 732f899e03SVadim Bendebury uint64_t timer_get_tsc(void); 742f899e03SVadim Bendebury 75fea25720SGraeme Russ #endif /* _U_BOOT_I386_H_ */ 76