summaryrefslogtreecommitdiff
path: root/arch/x86/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/cpu')
-rw-r--r--arch/x86/cpu/coreboot/coreboot.c15
-rw-r--r--arch/x86/cpu/coreboot/sdram.c18
-rw-r--r--arch/x86/cpu/cpu.c23
-rw-r--r--arch/x86/cpu/interrupts.c7
-rw-r--r--arch/x86/cpu/u-boot.lds23
5 files changed, 51 insertions, 35 deletions
diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
index 9c9431e0d9..f8e28f0c82 100644
--- a/arch/x86/cpu/coreboot/coreboot.c
+++ b/arch/x86/cpu/coreboot/coreboot.c
@@ -68,24 +68,21 @@ int board_early_init_r(void)
void show_boot_progress(int val)
{
#if MIN_PORT80_KCLOCKS_DELAY
- static uint32_t prev_stamp;
- static uint32_t base;
-
/*
* Scale the time counter reading to avoid using 64 bit arithmetics.
* Can't use get_timer() here becuase it could be not yet
* initialized or even implemented.
*/
- if (!prev_stamp) {
- base = rdtsc() / 1000;
- prev_stamp = 0;
+ if (!gd->arch.tsc_prev) {
+ gd->arch.tsc_base_kclocks = rdtsc() / 1000;
+ gd->arch.tsc_prev = 0;
} else {
uint32_t now;
do {
- now = rdtsc() / 1000 - base;
- } while (now < (prev_stamp + MIN_PORT80_KCLOCKS_DELAY));
- prev_stamp = now;
+ now = rdtsc() / 1000 - gd->arch.tsc_base_kclocks;
+ } while (now < (gd->arch.tsc_prev + MIN_PORT80_KCLOCKS_DELAY));
+ gd->arch.tsc_prev = now;
}
#endif
outb(val, 0x80);
diff --git a/arch/x86/cpu/coreboot/sdram.c b/arch/x86/cpu/coreboot/sdram.c
index 76274cb88e..a8136a06ab 100644
--- a/arch/x86/cpu/coreboot/sdram.c
+++ b/arch/x86/cpu/coreboot/sdram.c
@@ -60,12 +60,8 @@ unsigned install_e820_map(unsigned max_entries, struct e820entry *entries)
* address, and how far U-Boot is moved by relocation are set in the global
* data structure.
*/
-int calculate_relocation_address(void)
+ulong board_get_usable_ram_top(ulong total_size)
{
- const uint64_t uboot_size = (uintptr_t)&__bss_end -
- (uintptr_t)&__text_start;
- const uint64_t total_size = uboot_size + CONFIG_SYS_MALLOC_LEN +
- CONFIG_SYS_STACK_SIZE;
uintptr_t dest_addr = 0;
int i;
@@ -87,21 +83,15 @@ int calculate_relocation_address(void)
continue;
/* Use this address if it's the largest so far. */
- if (end - uboot_size > dest_addr)
+ if (end > dest_addr)
dest_addr = end;
}
/* If no suitable area was found, return an error. */
if (!dest_addr)
- return 1;
+ panic("No available memory found for relocation");
- dest_addr -= uboot_size;
- dest_addr &= ~((1 << 12) - 1);
- gd->relocaddr = dest_addr;
- gd->reloc_off = dest_addr - (uintptr_t)&__text_start;
- gd->start_addr_sp = dest_addr - CONFIG_SYS_MALLOC_LEN;
-
- return 0;
+ return (ulong)dest_addr;
}
int dram_init_f(void)
diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index 6a23974ff5..1a2f85c1fe 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -228,3 +228,26 @@ void flush_dcache_range(unsigned long start, unsigned long stop)
void invalidate_dcache_range(unsigned long start, unsigned long stop)
{
}
+
+void dcache_enable(void)
+{
+ enable_caches();
+}
+
+void dcache_disable(void)
+{
+ disable_caches();
+}
+
+void icache_enable(void)
+{
+}
+
+void icache_disable(void)
+{
+}
+
+int icache_status(void)
+{
+ return 1;
+}
diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c
index dd30a05a9d..6dc74e34c6 100644
--- a/arch/x86/cpu/interrupts.c
+++ b/arch/x86/cpu/interrupts.c
@@ -626,13 +626,12 @@ asm(".globl irq_common_entry\n" \
*/
u64 get_ticks(void)
{
- static u64 tick_base;
u64 now_tick = rdtsc();
- if (!tick_base)
- tick_base = now_tick;
+ if (!gd->arch.tsc_base)
+ gd->arch.tsc_base = now_tick;
- return now_tick - tick_base;
+ return now_tick - gd->arch.tsc_base;
}
#define PLATFORM_INFO_MSR 0xce
diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds
index 2313cd793a..ef5aa951c9 100644
--- a/arch/x86/cpu/u-boot.lds
+++ b/arch/x86/cpu/u-boot.lds
@@ -36,7 +36,7 @@ SECTIONS
. = ALIGN(4);
.u_boot_list : {
- #include <u-boot.lst>
+ KEEP(*(SORT(.u_boot_list*)));
}
. = ALIGN(4);
@@ -46,9 +46,6 @@ SECTIONS
.data : { *(.data*) }
. = ALIGN(4);
- .dynsym : { *(.dynsym*) }
-
- . = ALIGN(4);
.hash : { *(.hash*) }
. = ALIGN(4);
@@ -58,15 +55,25 @@ SECTIONS
__data_end = .;
. = ALIGN(4);
- __bss_start = ABSOLUTE(.);
- .bss (NOLOAD) : { *(.bss) }
- . = ALIGN(4);
- __bss_end = ABSOLUTE(.);
+ .dynsym : { *(.dynsym*) }
. = ALIGN(4);
__rel_dyn_start = .;
.rel.dyn : { *(.rel.dyn) }
__rel_dyn_end = .;
+ . = ALIGN(4);
+ _end = .;
+
+ . = ALIGN(4);
+
+ __end = .;
+ .bss __rel_dyn_start (OVERLAY) : {
+ __bss_start = .;
+ *(.bss)
+ *(COM*)
+ . = ALIGN(4);
+ __bss_end = .;
+ }
/DISCARD/ : { *(.dynstr*) }
/DISCARD/ : { *(.dynamic*) }