diff options
Diffstat (limited to 'arch/x86/cpu')
| -rw-r--r-- | arch/x86/cpu/Makefile | 2 | ||||
| -rw-r--r-- | arch/x86/cpu/coreboot/coreboot.c | 13 | ||||
| -rw-r--r-- | arch/x86/cpu/coreboot/timestamp.c | 42 | ||||
| -rw-r--r-- | arch/x86/cpu/cpu.c | 5 | ||||
| -rw-r--r-- | arch/x86/cpu/interrupts.c | 2 | ||||
| -rw-r--r-- | arch/x86/cpu/timer.c | 17 | ||||
| -rw-r--r-- | arch/x86/cpu/u-boot.lds | 12 | 
7 files changed, 62 insertions, 31 deletions
| diff --git a/arch/x86/cpu/Makefile b/arch/x86/cpu/Makefile index 7b520f8dc..cddf0dd2b 100644 --- a/arch/x86/cpu/Makefile +++ b/arch/x86/cpu/Makefile @@ -30,7 +30,7 @@ LIB	= $(obj)lib$(CPU).o  START-y	= start.o  START-$(CONFIG_X86_RESET_VECTOR) += resetvec.o start16.o -COBJS	= interrupts.o cpu.o timer.o +COBJS	= interrupts.o cpu.o  SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)  OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS)) diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index f8e28f0c8..14cb6994c 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -26,6 +26,7 @@  #include <asm/u-boot-x86.h>  #include <flash.h>  #include <netdev.h> +#include <ns16550.h>  #include <asm/msr.h>  #include <asm/cache.h>  #include <asm/io.h> @@ -90,6 +91,9 @@ void show_boot_progress(int val)  int last_stage_init(void)  { +	if (gd->flags & GD_FLG_COLD_BOOT) +		timestamp_add_to_bootstage(); +  	return 0;  } @@ -135,3 +139,12 @@ int board_final_cleanup(void)  	return 0;  } + +void panic_puts(const char *str) +{ +	NS16550_t port = (NS16550_t)0x3f8; + +	NS16550_init(port, 1); +	while (*str) +		NS16550_putc(port, *str++); +} diff --git a/arch/x86/cpu/coreboot/timestamp.c b/arch/x86/cpu/coreboot/timestamp.c index 2ca7a57bc..bd3558a02 100644 --- a/arch/x86/cpu/coreboot/timestamp.c +++ b/arch/x86/cpu/coreboot/timestamp.c @@ -39,7 +39,9 @@ static struct timestamp_table *ts_table  __attribute__((section(".data")));  void timestamp_init(void)  {  	ts_table = lib_sysinfo.tstamp_table; -	timer_set_tsc_base(ts_table->base_time); +#ifdef CONFIG_SYS_X86_TSC_TIMER +	timer_set_base(ts_table->base_time); +#endif  	timestamp_add_now(TS_U_BOOT_INITTED);  } @@ -59,3 +61,41 @@ void timestamp_add_now(enum timestamp_id id)  {  	timestamp_add(id, rdtsc());  } + +int timestamp_add_to_bootstage(void) +{ +	uint i; + +	if (!ts_table) +		return -1; + +	for (i = 0; i < ts_table->num_entries; i++) { +		struct timestamp_entry *tse = &ts_table->entries[i]; +		const char *name = NULL; + +		switch (tse->entry_id) { +		case TS_START_ROMSTAGE: +			name = "start-romstage"; +			break; +		case TS_BEFORE_INITRAM: +			name = "before-initram"; +			break; +		case TS_DEVICE_INITIALIZE: +			name = "device-initialize"; +			break; +		case TS_DEVICE_DONE: +			name = "device-done"; +			break; +		case TS_SELFBOOT_JUMP: +			name = "selfboot-jump"; +			break; +		} +		if (name) { +			bootstage_add_record(0, name, BOOTSTAGEF_ALLOC, +					     tse->entry_stamp / +							get_tbclk_mhz()); +		} +	} + +	return 0; +} diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index 1a2f85c1f..7a914a575 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -120,6 +120,11 @@ void setup_gdt(gd_t *id, u64 *gdt_addr)  int __weak x86_cleanup_before_linux(void)  { +#ifdef CONFIG_BOOTSTAGE_STASH +	bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH, +			CONFIG_BOOTSTAGE_STASH_SIZE); +#endif +  	return 0;  } diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c index 6dc74e34c..e733bcb30 100644 --- a/arch/x86/cpu/interrupts.c +++ b/arch/x86/cpu/interrupts.c @@ -37,6 +37,8 @@  #include <asm/msr.h>  #include <asm/u-boot-x86.h> +DECLARE_GLOBAL_DATA_PTR; +  #define DECLARE_INTERRUPT(x) \  	".globl irq_"#x"\n" \  	".hidden irq_"#x"\n" \ diff --git a/arch/x86/cpu/timer.c b/arch/x86/cpu/timer.c deleted file mode 100644 index 149109d4f..000000000 --- a/arch/x86/cpu/timer.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - */ - -#include <common.h> - -unsigned long timer_get_us(void) -{ -	printf("timer_get_us used but not implemented.\n"); -	return 0; -} diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds index 2d6911aa4..b4ecd4bd4 100644 --- a/arch/x86/cpu/u-boot.lds +++ b/arch/x86/cpu/u-boot.lds @@ -79,18 +79,6 @@ SECTIONS  	/DISCARD/ : { *(.interp*) }  	/DISCARD/ : { *(.gnu*) } -	/* 16bit realmode trampoline code */ -	.realmode REALMODE_BASE : AT ( LOADADDR(.rel.dyn) + SIZEOF(.rel.dyn) ) { KEEP(*(.realmode)) } - -	__realmode_start = LOADADDR(.realmode); -	__realmode_size = SIZEOF(.realmode); - -	/* 16bit BIOS emulation code (just enough to boot Linux) */ -	.bios 0 : AT ( LOADADDR(.realmode) + SIZEOF(.realmode) ) { KEEP(*(.bios)) } - -	__bios_start = LOADADDR(.bios); -	__bios_size = SIZEOF(.bios); -  #ifdef CONFIG_X86_RESET_VECTOR  	/* |