summaryrefslogtreecommitdiff
path: root/nuttx/configs/sama5d3-xplained
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/sama5d3-xplained
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/sama5d3-xplained')
-rw-r--r--nuttx/configs/sama5d3-xplained/Kconfig5
-rw-r--r--nuttx/configs/sama5d3-xplained/README.txt3
-rw-r--r--nuttx/configs/sama5d3-xplained/src/sam_boot.c7
3 files changed, 14 insertions, 1 deletions
diff --git a/nuttx/configs/sama5d3-xplained/Kconfig b/nuttx/configs/sama5d3-xplained/Kconfig
index 27139b53e..25d97d6fb 100644
--- a/nuttx/configs/sama5d3-xplained/Kconfig
+++ b/nuttx/configs/sama5d3-xplained/Kconfig
@@ -20,6 +20,11 @@ config SAMA5D3XPLAINED_528MHZ
endchoice # CPU Frequency
+config SAMA5D3XPLAINED_SLOWCLOCK
+ bool
+ default y if SCHED_TICKLESS
+ default n if !SCHED_TICKLESS
+
choice
prompt "SAMA5D3-Xplained DRAM Type"
default SAMA5D3XPLAINED_MT47H128M16RT
diff --git a/nuttx/configs/sama5d3-xplained/README.txt b/nuttx/configs/sama5d3-xplained/README.txt
index c9d855141..85342306d 100644
--- a/nuttx/configs/sama5d3-xplained/README.txt
+++ b/nuttx/configs/sama5d3-xplained/README.txt
@@ -2392,7 +2392,8 @@ Tickless OS
NOTE: In most cases, the slow clock will be used as the timer/counter
input. You should enable the 32.768KHz crystal for the slow clock by
calling sam_sckc_enable(). Otherwise, you will be doing all system
- timing using the RC clock!
+ timing using the RC clock! UPDATE: This will now be selected by default
+ when you configure for TICKLESS support.
SAMA5 Timer Usage
-----------------
diff --git a/nuttx/configs/sama5d3-xplained/src/sam_boot.c b/nuttx/configs/sama5d3-xplained/src/sam_boot.c
index fd651bf27..34d0a1593 100644
--- a/nuttx/configs/sama5d3-xplained/src/sam_boot.c
+++ b/nuttx/configs/sama5d3-xplained/src/sam_boot.c
@@ -41,6 +41,7 @@
#include <debug.h>
+#include "sam_sckc.h"
#include "sama5d3-xplained.h"
/************************************************************************************
@@ -67,6 +68,12 @@
void sam_boardinitialize(void)
{
+#ifdef CONFIG_SAMA5D3XPLAINED_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.
*/