#include <common.h>
#include <bloblist.h>
+#include <bootstage.h>
#include <clock_legacy.h>
#include <console.h>
#include <cpu.h>
#include <init.h>
#include <initcall.h>
#include <lcd.h>
+#include <log.h>
#include <malloc.h>
#include <mapmem.h>
#include <os.h>
#include <trace.h>
#include <video.h>
#include <watchdog.h>
+#include <asm/cache.h>
#ifdef CONFIG_MACH_TYPE
#include <asm/mach-types.h>
#endif
char desc[512];
int ret;
- ret = uclass_first_device_err(UCLASS_CPU, &dev);
- if (ret) {
- debug("%s: Could not get CPU device (err = %d)\n",
- __func__, ret);
- return ret;
+ dev = cpu_get_current_dev();
+ if (!dev) {
+ debug("%s: Could not get CPU device\n",
+ __func__);
+ return -ENODEV;
}
ret = cpu_get_desc(dev, desc, sizeof(desc));
/* Get the top of usable RAM */
__weak ulong board_get_usable_ram_top(ulong total_size)
{
-#ifdef CONFIG_SYS_SDRAM_BASE
+#if defined(CONFIG_SYS_SDRAM_BASE) && CONFIG_SYS_SDRAM_BASE > 0
/*
* Detect whether we have so much RAM that it goes past the end of our
* 32-bit address space. If so, clip the usable RAM so it doesn't.
return 0;
}
-#ifdef CONFIG_ARM
-__weak int reserve_mmu(void)
+__weak int arch_reserve_mmu(void)
{
-#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
- /* reserve TLB table */
- gd->arch.tlb_size = PGTABLE_SIZE;
- gd->relocaddr -= gd->arch.tlb_size;
-
- /* round down to next 64 kB limit */
- gd->relocaddr &= ~(0x10000 - 1);
-
- gd->arch.tlb_addr = gd->relocaddr;
- debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr,
- gd->arch.tlb_addr + gd->arch.tlb_size);
-
-#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
- /*
- * Record allocated tlb_addr in case gd->tlb_addr to be overwritten
- * with location within secure ram.
- */
- gd->arch.tlb_allocated = gd->arch.tlb_addr;
-#endif
-#endif
-
return 0;
}
-#endif
static int reserve_video(void)
{
#if defined(CONFIG_DM) && CONFIG_VAL(SYS_MALLOC_F_LEN)
int ret;
- bootstage_start(BOOTSTATE_ID_ACCUM_DM_F, "dm_f");
+ bootstage_start(BOOTSTAGE_ID_ACCUM_DM_F, "dm_f");
ret = dm_init_and_scan(true);
- bootstage_accum(BOOTSTATE_ID_ACCUM_DM_F);
+ bootstage_accum(BOOTSTAGE_ID_ACCUM_DM_F);
if (ret)
return ret;
#endif
reserve_pram,
#endif
reserve_round_4k,
-#ifdef CONFIG_ARM
- reserve_mmu,
-#endif
+ arch_reserve_mmu,
reserve_video,
reserve_trace,
reserve_uboot,