diff options
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/global_data.h | 21 | ||||
-rw-r--r-- | arch/x86/include/asm/init_helpers.h | 44 | ||||
-rw-r--r-- | arch/x86/include/asm/init_wrappers.h | 42 | ||||
-rw-r--r-- | arch/x86/include/asm/processor.h | 24 | ||||
-rw-r--r-- | arch/x86/include/asm/relocate.h | 33 | ||||
-rw-r--r-- | arch/x86/include/asm/string.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/u-boot-x86.h | 5 |
7 files changed, 159 insertions, 12 deletions
diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h index 05a2139d00..908a02c900 100644 --- a/arch/x86/include/asm/global_data.h +++ b/arch/x86/include/asm/global_data.h @@ -36,6 +36,8 @@ #ifndef __ASSEMBLY__ typedef struct global_data { + /* NOTE: gd_addr MUST be first member of struct global_data! */ + unsigned long gd_addr; /* Location of Global Data */ bd_t *bd; unsigned long flags; unsigned long baudrate; @@ -51,13 +53,24 @@ typedef struct global_data { unsigned long bus_clk; unsigned long relocaddr; /* Start address of U-Boot in RAM */ unsigned long start_addr_sp; /* start_addr_stackpointer */ + unsigned long gdt_addr; /* Location of GDT */ + unsigned long new_gd_addr; /* New location of Global Data */ phys_size_t ram_size; /* RAM size */ unsigned long reset_status; /* reset status register at boot */ void **jt; /* jump table */ char env_buf[32]; /* buffer for getenv() before reloc. */ } gd_t; -extern gd_t *gd; +static inline gd_t *get_fs_gd_ptr(void) +{ + gd_t *gd_ptr; + + asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr)); + + return gd_ptr; +} + +#define gd get_fs_gd_ptr() #endif @@ -73,12 +86,6 @@ extern gd_t *gd; #define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */ #define GD_FLG_ENV_READY 0x00080 /* Environment imported into hash table */ -#if 0 #define DECLARE_GLOBAL_DATA_PTR -#else -#define XTRN_DECLARE_GLOBAL_DATA_PTR extern -#define DECLARE_GLOBAL_DATA_PTR XTRN_DECLARE_GLOBAL_DATA_PTR \ -gd_t *gd -#endif #endif /* __ASM_GBL_DATA_H */ diff --git a/arch/x86/include/asm/init_helpers.h b/arch/x86/include/asm/init_helpers.h new file mode 100644 index 0000000000..192f18e1d5 --- /dev/null +++ b/arch/x86/include/asm/init_helpers.h @@ -0,0 +1,44 @@ +/* + * (C) Copyright 2011 + * Graeme Russ, <graeme.russ@gmail.com> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef _INIT_HELPERS_H_ +#define _INIT_HELPERS_H_ + +int display_banner(void); +int display_dram_config(void); +int init_baudrate_f(void); +int calculate_relocation_address(void); + +int copy_gd_to_ram_f_r(void); +int init_cache_f_r(void); + +int set_reloc_flag_r(void); +int mem_malloc_init_r(void); +int init_bd_struct_r(void); +int flash_init_r(void); +int init_ip_address_r(void); +int status_led_set_r(void); +int set_bootfile_r(void); +int set_load_addr_r(void); + +#endif /* !_INIT_HELPERS_H_ */ diff --git a/arch/x86/include/asm/init_wrappers.h b/arch/x86/include/asm/init_wrappers.h new file mode 100644 index 0000000000..899ffb1544 --- /dev/null +++ b/arch/x86/include/asm/init_wrappers.h @@ -0,0 +1,42 @@ +/* + * (C) Copyright 2011 + * Graeme Russ, <graeme.russ@gmail.com> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef _INIT_WRAPPERS_H_ +#define _INIT_WRAPPERS_H_ + +int serial_initialize_r(void); +int env_relocate_r(void); +int pci_init_r(void); +int jumptable_init_r(void); +int pcmcia_init_r(void); +int kgdb_init_r(void); +int enable_interrupts_r(void); +int eth_initialize_r(void); +int reset_phy_r(void); +int ide_init_r(void); +int scsi_init_r(void); +int doc_init_r(void); +int bb_miiphy_init_r(void); +int post_run_r(void); + +#endif /* !_INIT_WRAPPERS_H_ */ diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 1e5dccd342..6eb518063b 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -24,9 +24,25 @@ #ifndef __ASM_PROCESSOR_H_ #define __ASM_PROCESSOR_H_ 1 -#define GDT_ENTRY_32BIT_CS 2 -#define GDT_ENTRY_32BIT_DS (GDT_ENTRY_32BIT_CS + 1) -#define GDT_ENTRY_16BIT_CS (GDT_ENTRY_32BIT_DS + 1) -#define GDT_ENTRY_16BIT_DS (GDT_ENTRY_16BIT_CS + 1) +#define X86_GDT_ENTRY_SIZE 8 + +#ifndef __ASSEMBLY__ + +enum { + X86_GDT_ENTRY_NULL = 0, + X86_GDT_ENTRY_UNUSED, + X86_GDT_ENTRY_32BIT_CS, + X86_GDT_ENTRY_32BIT_DS, + X86_GDT_ENTRY_32BIT_FS, + X86_GDT_ENTRY_16BIT_CS, + X86_GDT_ENTRY_16BIT_DS, + X86_GDT_NUM_ENTRIES +}; +#else +/* NOTE: If the above enum is modified, this define must be checked */ +#define X86_GDT_ENTRY_32BIT_DS 3 +#endif + +#define X86_GDT_SIZE (X86_GDT_NUM_ENTRIES * X86_GDT_ENTRY_SIZE) #endif diff --git a/arch/x86/include/asm/relocate.h b/arch/x86/include/asm/relocate.h new file mode 100644 index 0000000000..33129ef64b --- /dev/null +++ b/arch/x86/include/asm/relocate.h @@ -0,0 +1,33 @@ +/* + * (C) Copyright 2011 + * Graeme Russ, <graeme.russ@gmail.com> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef _RELOCATE_H_ +#define _RELOCATE_H_ + +#include <common.h> + +int copy_uboot_to_ram(void); +int clear_bss(void); +int do_elf_reloc_fixups(void); + +#endif /* !_RELOCATE_H_ */ diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h index 3aa6c1131b..0ad612f627 100644 --- a/arch/x86/include/asm/string.h +++ b/arch/x86/include/asm/string.h @@ -14,7 +14,7 @@ extern char * strrchr(const char * s, int c); #undef __HAVE_ARCH_STRCHR extern char * strchr(const char * s, int c); -#undef __HAVE_ARCH_MEMCPY +#define __HAVE_ARCH_MEMCPY extern void * memcpy(void *, const void *, __kernel_size_t); #undef __HAVE_ARCH_MEMMOVE diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h index 755f88af04..878a1ee77b 100644 --- a/arch/x86/include/asm/u-boot-x86.h +++ b/arch/x86/include/asm/u-boot-x86.h @@ -37,6 +37,9 @@ int x86_cpu_init_r(void); int cpu_init_r(void); int x86_cpu_init_f(void); int cpu_init_f(void); +void init_gd(gd_t *id, u64 *gdt_addr); +void setup_gdt(gd_t *id, u64 *gdt_addr); +int init_cache(void); /* cpu/.../timer.c */ void timer_isr(void *); @@ -61,5 +64,7 @@ u32 isa_map_rom(u32 bus_addr, int size); int video_bios_init(void); int video_init(void); +void board_init_f_r_trampoline(ulong) __attribute__ ((noreturn)); +void board_init_f_r(void) __attribute__ ((noreturn)); #endif /* _U_BOOT_I386_H_ */ |