summaryrefslogtreecommitdiff
path: root/nuttx/configs/sam3u-ek/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-04-07 03:00:34 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-04-07 03:00:34 +0000
commitdbcd8d0405401b1d295a515cc165dacaeaf88f30 (patch)
tree27f45d162fcb904397206a8f4e14b65e859b200d /nuttx/configs/sam3u-ek/include
parente48b94c16b0771e91cdb16d2da6c89c3f768bbbb (diff)
downloadpx4-nuttx-dbcd8d0405401b1d295a515cc165dacaeaf88f30.tar.gz
px4-nuttx-dbcd8d0405401b1d295a515cc165dacaeaf88f30.tar.bz2
px4-nuttx-dbcd8d0405401b1d295a515cc165dacaeaf88f30.zip
Update clock logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2576 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/sam3u-ek/include')
-rwxr-xr-xnuttx/configs/sam3u-ek/include/board.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/nuttx/configs/sam3u-ek/include/board.h b/nuttx/configs/sam3u-ek/include/board.h
index 5a07e9d3d..45335e6b0 100755
--- a/nuttx/configs/sam3u-ek/include/board.h
+++ b/nuttx/configs/sam3u-ek/include/board.h
@@ -87,6 +87,28 @@
#define SAM3U_PLLA_FREQUENCY (96000000)
#define SAM3U_CPU_FREQUENCY (48000000)
+/* HSMCI clocking
+ *
+ * Multimedia Card Interface clock (MCCK or MCI_CK) is Master Clock (MCK)
+ * divided by (2*(CLKDIV+1)).
+ *
+ * MCI_SPEED = MCK / (2*(CLKDIV+1))
+ * CLKDIV = MCI / MCI_SPEED / 2 - 1
+ */
+
+/* MCK = 48MHz, CLKDIV = 59, MCI_SPEED = 48MHz / 2 * (59+1) = 400 KHz */
+
+#define HSMCI_INIT_CLKDIV (59 << HSMCI_MR_CLKDIV_SHIFT)
+
+/* MCK = 48MHz, CLKDIV = 1, MCI_SPEED = 48MHz / 2 * (1+1) = 12 MHz */
+
+#define HSMCI_MMCXFR_CLKDIV (3 << HSMCI_MR_CLKDIV_SHIFT)
+
+/* MCK = 48MHz, CLKDIV = 0, MCI_SPEED = 48MHz / 2 * (0+1) = 24 MHz */
+
+#define HSMCI_SDXFR_CLKDIV (0 << HSMCI_MR_CLKDIV_SHIFT)
+#define HSMCI_SDWIDEXFR_CLKDIV HSMCI_SDXFR_CLKDIV
+
/* LED definitions ******************************************************************/
#define LED_STARTED 0 /* LED0=OFF LED1=OFF LED2=OFF */