#include <dm/uclass-internal.h>
#include <dm/device-internal.h>
#include <asm/armv8/mmu.h>
+#include <mach/k3-common-fdt.h>
#include <mach/k3-ddr.h>
#define PROC_BOOT_CTRL_FLAG_R5_CORE_HALT 0x00000001
void enable_caches(void)
{
+ void *fdt = (void *)gd->fdt_blob;
int ret;
ret = mem_map_from_dram_banks(K3_MEM_MAP_FIRST_BANK_IDX, K3_MEM_MAP_LEN,
mmu_setup();
+ if (CONFIG_K3_ATF_LOAD_ADDR >= CFG_SYS_SDRAM_BASE) {
+ ret = fdt_fixup_reserved(fdt, "tfa", CONFIG_K3_ATF_LOAD_ADDR,
+ 0x80000);
+ if (ret)
+ printf("%s: Failed to perform tfa fixups (%s)\n",
+ __func__, fdt_strerror(ret));
+ ret = mmu_unmap_reserved_mem("tfa", true);
+ if (ret)
+ printf("%s: Failed to unmap tfa reserved mem (%d)\n",
+ __func__, ret);
+ }
+
+ if (CONFIG_K3_OPTEE_LOAD_ADDR >= CFG_SYS_SDRAM_BASE) {
+ ret = fdt_fixup_reserved(fdt, "optee",
+ CONFIG_K3_OPTEE_LOAD_ADDR, 0x1800000);
+ if (ret)
+ printf("%s: Failed to perform optee fixups (%s)\n",
+ __func__, fdt_strerror(ret));
+ ret = mmu_unmap_reserved_mem("optee", true);
+ if (ret)
+ printf("%s: Failed to unmap optee reserved mem (%d)\n",
+ __func__, ret);
+ }
+
icache_enable();
dcache_enable();
}