From 5b5ece9ef4ac1a859179b894c3067e2841d76472 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 29 Nov 2012 16:23:41 +0000 Subject: x86: Allow compiling out realmode/bios code We don't want this for coreboot, so provide a way of compiling it out. Signed-off-by: Gabe Black Signed-off-by: Stefan Reinauer Signed-off-by: Simon Glass --- arch/x86/lib/zimage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/x86/lib/zimage.c') diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 22142864c22..b8c672babdd 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -171,7 +171,7 @@ struct boot_params *load_zimage(char *image, unsigned long kernel_size, else *load_address = (void *)ZIMAGE_LOAD_ADDR; -#if defined CONFIG_ZBOOT_32 +#if (defined CONFIG_ZBOOT_32 || defined CONFIG_X86_NO_REAL_MODE) printf("Building boot_params at 0x%8.8lx\n", (ulong)setup_base); memset(setup_base, 0, sizeof(*setup_base)); setup_base->hdr = params->hdr; @@ -237,7 +237,7 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, struct setup_header *hdr = &setup_base->hdr; int bootproto = get_boot_protocol(hdr); -#if defined CONFIG_ZBOOT_32 +#if (defined CONFIG_ZBOOT_32 || defined CONFIG_X86_NO_REAL_MODE) setup_base->e820_entries = install_e820_map( ARRAY_SIZE(setup_base->e820_map), setup_base->e820_map); #endif -- cgit v1.2.3 From 3cdc18a8de1b67af0ef7357f9c07bc77a935045c Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Tue, 23 Oct 2012 18:04:34 +0000 Subject: x86: Add a CBMEM timestamp generated right before the kernel startup. To maintain the initialization state of the timestamp facility, thesq pointer to the CBMEM section containing the timestamp table should be kept in the .data section (so that it is maintained across u-boot relocation). Signed-off-by: Vadim Bendebury Signed-off-by: Simon Glass --- arch/x86/lib/zimage.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/x86/lib/zimage.c') diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index b8c672babdd..238ed614e86 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -36,6 +36,9 @@ #include #include #include +#ifdef CONFIG_SYS_COREBOOT +#include +#endif /* * Memory lay-out: @@ -283,6 +286,9 @@ void boot_zimage(void *setup_base, void *load_address) { printf("\nStarting kernel ...\n\n"); +#ifdef CONFIG_SYS_COREBOOT + timestamp_add_now(TS_U_BOOT_START_KERNEL); +#endif #if defined CONFIG_ZBOOT_32 /* * Set %ebx, %ebp, and %edi to 0, %esi to point to the boot_params -- cgit v1.2.3 From 61e0ea900a3741920f7a74017a23e34bc13bd599 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Tue, 23 Oct 2012 18:04:37 +0000 Subject: x86: Provide a function to clean up just before booting a zimage This function can be used by boards which want to do some clean-up before booting a zImage. Signed-off-by: Stefan Reinauer Signed-off-by: Simon Glass --- arch/x86/lib/zimage.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'arch/x86/lib/zimage.c') diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 238ed614e86..1236d220caa 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -39,6 +39,7 @@ #ifdef CONFIG_SYS_COREBOOT #include #endif +#include /* * Memory lay-out: @@ -282,8 +283,18 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, return 0; } +/* + * Implement a weak default function for boards that optionally + * need to clean up the system before jumping to the kernel. + */ +__weak void board_final_cleanup(void) +{ +} + void boot_zimage(void *setup_base, void *load_address) { + board_final_cleanup(); + printf("\nStarting kernel ...\n\n"); #ifdef CONFIG_SYS_COREBOOT -- cgit v1.2.3 From 1484311286c2a66ed2158c2db443e3cebbc187d0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 23 Oct 2012 18:04:40 +0000 Subject: x86: Fix indirect jmp warning in zimage.c This fixes the following warning: zimage.c:312: Warning: indirect jmp without `*' Also fixed these warnings to keep checkpatch quiet: warning: arch/x86/lib/zimage.c,311: unnecessary whitespace before a quoted newline warning: arch/x86/lib/zimage.c,312: unnecessary whitespace before a quoted newline warning: arch/x86/lib/zimage.c,313: unnecessary whitespace before a quoted newline Signed-off-by: Simon Glass --- arch/x86/lib/zimage.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/x86/lib/zimage.c') diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 1236d220caa..46af391f29f 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -309,9 +309,9 @@ void boot_zimage(void *setup_base, void *load_address) * itself in arch/i386/cpu/cpu.c. */ __asm__ __volatile__ ( - "movl $0, %%ebp \n" - "cli \n" - "jmp %[kernel_entry] \n" + "movl $0, %%ebp\n" + "cli\n" + "jmp *%[kernel_entry]\n" :: [kernel_entry]"a"(load_address), [boot_params] "S"(setup_base), "b"(0), "D"(0) -- cgit v1.2.3