summaryrefslogtreecommitdiffstats
path: root/bsps/arm/imxrt/start/bspstart.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bsps/arm/imxrt/start/bspstart.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/bsps/arm/imxrt/start/bspstart.c b/bsps/arm/imxrt/start/bspstart.c
index 445af04563..1d583d7ca4 100644
--- a/bsps/arm/imxrt/start/bspstart.c
+++ b/bsps/arm/imxrt/start/bspstart.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2020 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -47,6 +47,7 @@ uint32_t imxrt_systick_frequency(void)
static void imxrt_disable_wait_mode(void)
{
+#if IMXRT_IS_MIMXRT10xx
/*
* Prevent processor from entering WAIT or SLEEP mode when a WFI is executed.
* This would switch off the normal interrupt controller and activate an
@@ -58,6 +59,16 @@ static void imxrt_disable_wait_mode(void)
* every WFI.
*/
CLOCK_SetMode(kCLOCK_ModeRun);
+#elif IMXRT_IS_MIMXRT11xx
+ /*
+ * i.MX RT11xx doesn't support disabling power saving for WFI. On the other
+ * hand it doesn't have a separate interrupt controller like the i.MX RT1050.
+ * So a power save during WFI is only annoying during debugging but doesn't
+ * hurt otherwise.
+ */
+#else
+ #error Disabling wait mode not implemented for this chip.
+#endif
}
void bsp_start(void)
@@ -125,6 +136,22 @@ uint32_t bsp_fdt_map_intr(const uint32_t *intr, size_t icells)
return intr[0];
}
+/*
+ * Clock frequencies for peripherals like SD card. These are used by libbsd
+ * drivers.
+ */
+#if IMXRT_IS_MIMXRT11xx
+uint32_t
+imx_ccm_sdhci_hz(void)
+{
+ /*
+ * We don't know which SDHCI is used. So just return the clock frequency
+ * of the first SDHCI and hope the best.
+ */
+ return CLOCK_GetRootClockFreq(kCLOCK_Root_Usdhc1);
+}
+#endif
+
/* Make sure to pull in the flash headers */
__attribute__((used)) static const void *hdr_dcd = &imxrt_dcd_data;
__attribute__((used)) static const void *hdr_ivt = &imxrt_image_vector_table;