summaryrefslogtreecommitdiff
path: root/arch/x86/cpu/coreboot
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2013-03-11 12:02:40 -0400
committerTom Rini <trini@ti.com>2013-03-11 12:16:13 -0400
commit76b40ab41eff1f402ee52ba768b09daad293b9bb (patch)
tree4956296adbdc8939aa49d84fa9bd497eef65b7f4 /arch/x86/cpu/coreboot
parentde62688bb61c499ecc2d70a3aa8ccf90bb7a8ef6 (diff)
parentfc959081d41aab2d6f4614c5fb3dd1b77ffcdcf4 (diff)
Merge u-boot/master into u-boot-ti/master
In master we had already taken a patch to fix the davinci GPIO code for CONFIG_SOC_DM646X and in u-boot-ti we have additional patches to support DA830 (which is CONFIG_SOC_DA8XX && !CONFIG_SOC_DA850). Resolve these conflicts manually and comment the #else/#endif lines for clarity. Conflicts: arch/arm/include/asm/arch-davinci/gpio.h drivers/gpio/da8xx_gpio.c Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'arch/x86/cpu/coreboot')
-rw-r--r--arch/x86/cpu/coreboot/coreboot.c15
-rw-r--r--arch/x86/cpu/coreboot/sdram.c18
2 files changed, 10 insertions, 23 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)