summaryrefslogtreecommitdiff
path: root/nuttx/arch/mips
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-06-20 19:29:20 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-06-20 19:29:20 +0000
commitfe19b6983e874ab10a1e3ad510829ad34a8612cd (patch)
treef89b678cd14ff74894b93a97d64c57e17abed82d /nuttx/arch/mips
parentc1688c046b5efdfaa67fcf892649ba3e9f54f056 (diff)
downloadpx4-nuttx-fe19b6983e874ab10a1e3ad510829ad34a8612cd.tar.gz
px4-nuttx-fe19b6983e874ab10a1e3ad510829ad34a8612cd.tar.bz2
px4-nuttx-fe19b6983e874ab10a1e3ad510829ad34a8612cd.zip
Updates to support the Mirtoo internal clocking
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4855 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/mips')
-rw-r--r--nuttx/arch/mips/src/pic32mx/pic32mx-config.h19
-rw-r--r--nuttx/arch/mips/src/pic32mx/pic32mx-head.S2
-rw-r--r--nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c2
3 files changed, 21 insertions, 2 deletions
diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-config.h b/nuttx/arch/mips/src/pic32mx/pic32mx-config.h
index f2ccd89b0..419cd5250 100644
--- a/nuttx/arch/mips/src/pic32mx/pic32mx-config.h
+++ b/nuttx/arch/mips/src/pic32mx/pic32mx-config.h
@@ -775,6 +775,25 @@
# error "Unknown board POSC mode"
#endif
+#undef CONFIG_PIC32MX_FNOSC
+#if defined(BOARD_FNOSC_FRC)
+# define CONFIG_PIC32MX_FNOSC DEVCFG1_FNOSC_FRC
+#elif defined(BOARD_FNOSC_FRCPLL)
+# define CONFIG_PIC32MX_FNOSC DEVCFG1_FNOSC_FRCPLL
+#elif defined(BOARD_FNOSC_POSC)
+# define CONFIG_PIC32MX_FNOSC DEVCFG1_FNOSC_POSC
+#elif defined(BOARD_FNOSC_POSCPLL)
+# define CONFIG_PIC32MX_FNOSC DEVCFG1_FNOSC_POSCPLL
+#elif defined(BOARD_FNOSC_SOSC)
+# define CONFIG_PIC32MX_FNOSC DEVCFG1_FNOSC_SOSC
+#elif defined(BOARD_FNOSC_LPRC)
+# define CONFIG_PIC32MX_FNOSC DEVCFG1_FNOSC_LPRC
+#elif defined(BOARD_FNOSC_FRCDIV)
+# define CONFIG_PIC32MX_FNOSC DEVCFG1_FNOSC_FRCDIV
+#else
+# error "Unknown board FNOSC selection"
+#endif
+
#undef CONFIG_PIC32MX_FCKSM
#if defined(BOARD_POSC_SWITCH)
# if defined(BOARD_POSC_FSCM)
diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-head.S b/nuttx/arch/mips/src/pic32mx/pic32mx-head.S
index 2a6ef39a8..3e9cfeb46 100644
--- a/nuttx/arch/mips/src/pic32mx/pic32mx-head.S
+++ b/nuttx/arch/mips/src/pic32mx/pic32mx-head.S
@@ -617,7 +617,7 @@ devconfig2:
DEVCFG2_UNUSED
devconfig1:
- .long DEVCFG1_FNOSC_POSCPLL | CONFIG_PIC32MX_FSOSCEN | \
+ .long CONFIG_PIC32MX_FNOSC | CONFIG_PIC32MX_FSOSCEN | \
CONFIG_PIC32MX_IESO | CONFIG_PIC32MX_POSCMOD | \
CONFIG_PIC32MX_PBDIV | CONFIG_PIC32MX_FCKSM | \
CONFIG_PIC32MX_WDENABLE | DEVCFG1_UNUSED
diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c b/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c
index 9cf77fb50..d6bc6a812 100644
--- a/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c
+++ b/nuttx/arch/mips/src/pic32mx/pic32mx-lowinit.c
@@ -63,7 +63,7 @@
/* Make sure that the selected clock parameters are sane */
-#define CALC_SYSCLOCK (((BOARD_POSC_FREQ / BOARD_PLL_IDIV) * BOARD_PLL_MULT) / BOARD_PLL_ODIV)
+#define CALC_SYSCLOCK (((BOARD_PLL_INPUT / BOARD_PLL_IDIV) * BOARD_PLL_MULT) / BOARD_PLL_ODIV)
#if CALC_SYSCLOCK != BOARD_CPU_CLOCK
# error "Bad BOARD_CPU_CLOCK calculcation in board.h"
#endif