summaryrefslogtreecommitdiff
path: root/nuttx/configs/sama5d4-ek/src
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-11 14:29:43 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-11 14:29:43 -0600
commitc3d48a6b4f7b1b340876d4460a77e58e3fa5e5c5 (patch)
tree34548c82d1e28ee44f0738985eef5ad5494dc748 /nuttx/configs/sama5d4-ek/src
parent65a029c74614adbfaba41ef0192c7e03d993ff30 (diff)
downloadpx4-nuttx-c3d48a6b4f7b1b340876d4460a77e58e3fa5e5c5.tar.gz
px4-nuttx-c3d48a6b4f7b1b340876d4460a77e58e3fa5e5c5.tar.bz2
px4-nuttx-c3d48a6b4f7b1b340876d4460a77e58e3fa5e5c5.zip
SAMA5: Enable the 32.768 crystal if SCHED_TICKLESS is selected
Diffstat (limited to 'nuttx/configs/sama5d4-ek/src')
-rw-r--r--nuttx/configs/sama5d4-ek/src/sam_boot.c9
-rw-r--r--nuttx/configs/sama5d4-ek/src/sam_wm8904.c6
2 files changed, 11 insertions, 4 deletions
diff --git a/nuttx/configs/sama5d4-ek/src/sam_boot.c b/nuttx/configs/sama5d4-ek/src/sam_boot.c
index d1ea4a500..fb6f32cfe 100644
--- a/nuttx/configs/sama5d4-ek/src/sam_boot.c
+++ b/nuttx/configs/sama5d4-ek/src/sam_boot.c
@@ -41,6 +41,7 @@
#include <debug.h>
+#include "sam_sckc.h"
#include "sama5d4-ek.h"
/************************************************************************************
@@ -60,13 +61,19 @@
*
* Description:
* All SAMA5 architectures must provide the following entry point. This entry
- * point is called early in the intitialization -- after all memory has been
+ * point is called early in the initialization -- after all memory has been
* configured and mapped but before any devices have been initialized.
*
************************************************************************************/
void sam_boardinitialize(void)
{
+#ifdef CONFIG_SAMA5D4EK_SLOWCLOCK
+ /* Enable the external slow clock */
+
+ sam_sckc_enable(true);
+#endif
+
/* Configure SPI chip selects if 1) SPI is enable, and 2) the weak function
* sam_spiinitialize() has been brought into the link.
*/
diff --git a/nuttx/configs/sama5d4-ek/src/sam_wm8904.c b/nuttx/configs/sama5d4-ek/src/sam_wm8904.c
index c11eb1457..b42498353 100644
--- a/nuttx/configs/sama5d4-ek/src/sam_wm8904.c
+++ b/nuttx/configs/sama5d4-ek/src/sam_wm8904.c
@@ -56,7 +56,6 @@
#include "sam_pio.h"
#include "sam_twi.h"
#include "sam_ssc.h"
-#include "sam_sckc.h"
#include "sam_pck.h"
#include "sama5d4-ek.h"
@@ -293,9 +292,10 @@ int sam_wm8904_initialize(int minor)
*/
#ifdef CONFIG_SAMA5D4EK_WM8904_SRCSCK
- /* Drive the DAC with the slow clock (32.768 KHz) */
+ /* Drive the DAC with the slow clock (32.768 KHz). The slow clock was
+ * enabled in sam_boot.c if needed.
+ */
- sam_sckc_enable(true);
(void)sam_pck_configure(PCK2, PCKSRC_SCK, BOARD_SLOWCLK_FREQUENCY);
#else
/* Drive the DAC with the main clock (12 MHz) */