aboutsummaryrefslogtreecommitdiff
path: root/core/drivers
diff options
context:
space:
mode:
authorJordan Rhee <jordanrh@microsoft.com>2018-05-02 11:02:08 -0700
committerJérôme Forissier <jerome.forissier@linaro.org>2018-05-08 23:28:29 +0200
commitbcf6d6c9e81887df432ef7a89e6b0a5b2c49b2a8 (patch)
treec2490a1f1a2328647d9ad038650e7885bdc9d907 /core/drivers
parentc27907e1bc5a46f3f95e72f901d7b0dfa3fa577f (diff)
plat-imx: remove dependency on CFG_DT=y
Enable IMX to run without a device tree (CFG_DT=n). The only use of the device tree is for the WDOG driver to get it's base address. Tested on Sabre IMX6 and Sabre IMX7. Reviewed-by: Peng Fan <peng.fan@nxp.com> Tested-by: Jordan Rhee <jordanrh@microsoft.com> Signed-off-by: Jordan Rhee <jordanrh@microsoft.com>
Diffstat (limited to 'core/drivers')
-rw-r--r--core/drivers/imx_wdog.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/core/drivers/imx_wdog.c b/core/drivers/imx_wdog.c
index fc8fa2c8..cb9b2bfa 100644
--- a/core/drivers/imx_wdog.c
+++ b/core/drivers/imx_wdog.c
@@ -34,7 +34,9 @@
#include <kernel/dt.h>
#include <kernel/generic_boot.h>
#include <kernel/panic.h>
+#ifdef CFG_DT
#include <libfdt.h>
+#endif
#include <mm/core_mmu.h>
#include <mm/core_memprot.h>
#include <util.h>
@@ -74,7 +76,8 @@ void imx_wdog_restart(void)
}
KEEP_PAGER(imx_wdog_restart);
-static TEE_Result imx_wdog_init(void)
+#ifdef CFG_DT
+static TEE_Result imx_wdog_base(vaddr_t *wdog_vbase)
{
enum teecore_memtypes mtype;
void *fdt;
@@ -155,8 +158,24 @@ static TEE_Result imx_wdog_init(void)
return TEE_ERROR_GENERIC;
}
- wdog_base = vbase;
+ *wdog_vbase = vbase;
return TEE_SUCCESS;
}
+#else
+register_phys_mem(MEM_AREA_IO_SEC, WDOG_BASE, CORE_MMU_DEVICE_SIZE);
+static TEE_Result imx_wdog_base(vaddr_t *wdog_vbase)
+{
+ *wdog_vbase = (vaddr_t)phys_to_virt(WDOG_BASE, MEM_AREA_IO_SEC);
+ return TEE_SUCCESS;
+}
+#endif
+
+static TEE_Result imx_wdog_init(void)
+{
+#ifdef PLATFORM_FLAVOR_mx7dsabresd
+ ext_reset = true;
+#endif
+ return imx_wdog_base(&wdog_base);
+}
driver_init(imx_wdog_init);