summaryrefslogtreecommitdiff
path: root/nuttx/arch/mips
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-06-01 19:07:17 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-06-01 19:07:17 +0000
commit54ab1a335a6892a9b923d08190c3e5d06a7a98c4 (patch)
tree39e6c482a599a2c0e7758471da045228218756a2 /nuttx/arch/mips
parentfeab93e78ac619c4ee3f646b2f002ea3c983d590 (diff)
downloadpx4-nuttx-54ab1a335a6892a9b923d08190c3e5d06a7a98c4.tar.gz
px4-nuttx-54ab1a335a6892a9b923d08190c3e5d06a7a98c4.tar.bz2
px4-nuttx-54ab1a335a6892a9b923d08190c3e5d06a7a98c4.zip
Fix device configuration... now Mikroelektronika PIC32MX7 MMB board works.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4794 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/mips')
-rw-r--r--nuttx/arch/mips/src/pic32mx/pic32mx-config.h36
-rw-r--r--nuttx/arch/mips/src/pic32mx/pic32mx-head.S5
2 files changed, 39 insertions, 2 deletions
diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-config.h b/nuttx/arch/mips/src/pic32mx/pic32mx-config.h
index 58b44017f..4ef88508d 100644
--- a/nuttx/arch/mips/src/pic32mx/pic32mx-config.h
+++ b/nuttx/arch/mips/src/pic32mx/pic32mx-config.h
@@ -729,6 +729,18 @@
/* DEVCFG1 */
+#ifdef BOARD_SOSC_ENABLE
+# define CONFIG_PIC32MX_FSOSCEN DEVCFG1_FSOSCEN
+#else
+# define CONFIG_PIC32MX_FSOSCEN 0
+#endif
+
+#ifdef BOARD_SOSC_IESO
+# define CONFIG_PIC32MX_IESO DEVCFG1_IESO
+#else
+# define CONFIG_PIC32MX_IESO 0
+#endif
+
#undef CONFIG_PIC32MX_PBDIV
#if BOARD_PBDIV == 1
# define CONFIG_PIC32MX_PBDIV DEVCFG1_FPBDIV_DIV1
@@ -742,6 +754,30 @@
# error "Unsupported BOARD_PBDIV"
#endif
+#undef CONFIG_PIC32MX_POSCMOD
+#if defined(BOARD_POSC_ECMODE)
+# define CONFIG_PIC32MX_POSCMOD DEVCFG1_POSCMOD_EC
+#elif defined(BOARD_POSC_XTMODE)
+# define CONFIG_PIC32MX_POSCMOD DEVCFG1_POSCMOD_XT
+#elif defined(BOARD_POSC_HSMODE)
+# define CONFIG_PIC32MX_POSCMOD DEVCFG1_POSCMOD_HS
+#elif defined(BOARD_POSC_DISABLED)
+# define CONFIG_PIC32MX_POSCMOD DEVCFG1_POSCMOD_DIS
+#else
+# error "Unknown board POSC mode"
+#endif
+
+#undef CONFIG_PIC32MX_FCKSM
+#if defined(BOARD_POSC_SWITCH)
+# if defined(BOARD_POSC_FSCM)
+# define CONFIG_PIC32MX_FCKSM DEVCFG1_FCKSM_BOTH
+# else
+# define CONFIG_PIC32MX_FCKSM DEVCFG1_FCKSM_CSONLY
+# endif
+#else
+# define CONFIG_PIC32MX_FCKSM DEVCFG1_FCKSM_NONE
+#endif
+
#undef CONFIG_PIC32MX_WDPS
#if BOARD_WD_PRESCALER == 1
# define CONFIG_PIC32MX_WDPS DEVCFG1_WDTPS_1
diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-head.S b/nuttx/arch/mips/src/pic32mx/pic32mx-head.S
index a0a775790..9d610aedd 100644
--- a/nuttx/arch/mips/src/pic32mx/pic32mx-head.S
+++ b/nuttx/arch/mips/src/pic32mx/pic32mx-head.S
@@ -610,8 +610,9 @@ devconfig2:
DEVCFG2_UNUSED
devconfig1:
- .long DEVCFG1_FNOSC_POSCPLL | DEVCFG1_POSCMOD_HS | \
- CONFIG_PIC32MX_PBDIV | DEVCFG1_FCKSM_NONE | \
+ .long DEVCFG1_FNOSC_POSCPLL | CONFIG_PIC32MX_FSOSCEN | \
+ CONFIG_PIC32MX_IESO | CONFIG_PIC32MX_POSCMOD | \
+ CONFIG_PIC32MX_PBDIV | CONFIG_PIC32MX_FCKSM | \
CONFIG_PIC32MX_WDENABLE | DEVCFG1_UNUSED
devconfig0: