summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-05-23 18:13:03 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-05-23 18:13:03 +0000
commit6d12ed46f64ff4fc630479b3508a6c781b3e2a4e (patch)
tree40cca168fadffa290a82a67d966a04b8da72d5a1
parent69babf5fd1b826777f011217cd1b32f12015e807 (diff)
downloadnuttx-6d12ed46f64ff4fc630479b3508a6c781b3e2a4e.tar.gz
nuttx-6d12ed46f64ff4fc630479b3508a6c781b3e2a4e.tar.bz2
nuttx-6d12ed46f64ff4fc630479b3508a6c781b3e2a4e.zip
Fixes to PIC32 config words
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3641 42af7a65-404d-4744-a932-0658087f49c3
-rwxr-xr-xnuttx/arch/mips/src/pic32mx/pic32mx-config.h174
-rwxr-xr-xnuttx/arch/mips/src/pic32mx/pic32mx-devcfg.h4
-rw-r--r--nuttx/arch/mips/src/pic32mx/pic32mx-head.S22
-rwxr-xr-xnuttx/arch/mips/src/pic32mx/pic32mx-int.h11
-rwxr-xr-xnuttx/arch/mips/src/pic32mx/pic32mx-irq.c2
-rwxr-xr-xnuttx/configs/pcblogic-pic32mx/include/board.h2
6 files changed, 135 insertions, 80 deletions
diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-config.h b/nuttx/arch/mips/src/pic32mx/pic32mx-config.h
index 03ac6fa63..3d0d7031d 100755
--- a/nuttx/arch/mips/src/pic32mx/pic32mx-config.h
+++ b/nuttx/arch/mips/src/pic32mx/pic32mx-config.h
@@ -55,7 +55,7 @@
/* Interrupt Priorities *************************************************************/
#ifndef CONFIG_PIC32MX_CTPRIO /* Core Timer Interrupt */
-# define CONFIG_PIC32MX_CTPRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_CTPRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_CTPRIO < 4
# error "CONFIG_PIC32MX_CTPRIO is too small"
@@ -65,7 +65,7 @@
#endif
#ifndef CONFIG_PIC32MX_CS0PRIO /* Core Software Interrupt 0 */
-# define CONFIG_PIC32MX_CS0PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_CS0PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_CS0PRIO < 4
# error "CONFIG_PIC32MX_CS0PRIO is too small"
@@ -75,7 +75,7 @@
#endif
#ifndef CONFIG_PIC32MX_CS1PRIO /* Core Software Interrupt 1 */
-# define CONFIG_PIC32MX_CS1PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_CS1PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_CS1PRIO < 4
# error "CONFIG_PIC32MX_CS1PRIO is too small"
@@ -85,7 +85,7 @@
#endif
#ifndef CONFIG_PIC32MX_INT0PRIO /* External interrupt 0 */
-# define CONFIG_PIC32MX_INT0PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_INT0PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_INT0PRIO < 4
# error "CONFIG_PIC32MX_INT0PRIO is too small"
@@ -95,7 +95,7 @@
#endif
#ifndef CONFIG_PIC32MX_INT1PRIO /* External interrupt 1 */
-# define CONFIG_PIC32MX_INT1PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_INT1PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_INT1PRIO < 4
# error "CONFIG_PIC32MX_INT1PRIO is too small"
@@ -105,7 +105,7 @@
#endif
#ifndef CONFIG_PIC32MX_INT2PRIO /* External interrupt 2 */
-# define CONFIG_PIC32MX_INT2PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_INT2PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_INT2PRIO < 4
# error "CONFIG_PIC32MX_INT2PRIO is too small"
@@ -115,7 +115,7 @@
#endif
#ifndef CONFIG_PIC32MX_INT3PRIO /* External interrupt 3 */
-# define CONFIG_PIC32MX_INT3PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_INT3PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_INT3PRIO < 4
# error "CONFIG_PIC32MX_INT3PRIO is too small"
@@ -125,7 +125,7 @@
#endif
#ifndef CONFIG_PIC32MX_INT4PRIO /* External interrupt 4 */
-# define CONFIG_PIC32MX_INT4PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_INT4PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_INT4PRIO < 4
# error "CONFIG_PIC32MX_INT4PRIO is too small"
@@ -135,7 +135,7 @@
#endif
#ifndef CONFIG_PIC32MX_FSCMPRIO /* Fail-Safe Clock Monitor */
-# define CONFIG_PIC32MX_FSCMPRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_FSCMPRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_FSCMPRIO < 4
# error "CONFIG_PIC32MX_FSCMPRIO is too small"
@@ -145,7 +145,7 @@
#endif
#ifndef CONFIG_PIC32MX_T1PRIO /* Timer 1 (System timer) priority */
-# define CONFIG_PIC32MX_T1PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_T1PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_T1PRIO < 4
# error "CONFIG_PIC32MX_T1PRIO is too small"
@@ -155,7 +155,7 @@
#endif
#ifndef CONFIG_PIC32MX_T2PRIO /* Timer 2 priority */
-# define CONFIG_PIC32MX_T2PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_T2PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_T2PRIO < 4
# error "CONFIG_PIC32MX_T2PRIO is too small"
@@ -165,7 +165,7 @@
#endif
#ifndef CONFIG_PIC32MX_T3PRIO /* Timer 3 priority */
-# define CONFIG_PIC32MX_T3PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_T3PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_T3PRIO < 4
# error "CONFIG_PIC32MX_T3PRIO is too small"
@@ -175,7 +175,7 @@
#endif
#ifndef CONFIG_PIC32MX_T4PRIO /* Timer 4 priority */
-# define CONFIG_PIC32MX_T4PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_T4PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_T4PRIO < 4
# error "CONFIG_PIC32MX_T4PRIO is too small"
@@ -185,7 +185,7 @@
#endif
#ifndef CONFIG_PIC32MX_T5PRIO /* Timer 5 priority */
-# define CONFIG_PIC32MX_T5PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_T5PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_T5PRIO < 4
# error "CONFIG_PIC32MX_T5PRIO is too small"
@@ -195,7 +195,7 @@
#endif
#ifndef CONFIG_PIC32MX_IC1PRIO /* Input Capture 1 */
-# define CONFIG_PIC32MX_IC1PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_IC1PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_IC1PRIO < 4
# error "CONFIG_PIC32MX_IC1PRIO is too small"
@@ -205,7 +205,7 @@
#endif
#ifndef CONFIG_PIC32MX_IC2PRIO /* Input Capture 2 */
-# define CONFIG_PIC32MX_IC2PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_IC2PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_IC2PRIO < 4
# error "CONFIG_PIC32MX_IC2PRIO is too small"
@@ -215,7 +215,7 @@
#endif
#ifndef CONFIG_PIC32MX_IC3PRIO /* Input Capture 3 */
-# define CONFIG_PIC32MX_IC3PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_IC3PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_IC3PRIO < 4
# error "CONFIG_PIC32MX_IC3PRIO is too small"
@@ -225,7 +225,7 @@
#endif
#ifndef CONFIG_PIC32MX_IC4PRIO /* Input Capture 4 */
-# define CONFIG_PIC32MX_IC4PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_IC4PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_IC4PRIO < 4
# error "CONFIG_PIC32MX_IC4PRIO is too small"
@@ -235,7 +235,7 @@
#endif
#ifndef CONFIG_PIC32MX_IC5PRIO /* Input Capture 5 */
-# define CONFIG_PIC32MX_IC5PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_IC5PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_IC5PRIO < 4
# error "CONFIG_PIC32MX_IC5PRIO is too small"
@@ -245,7 +245,7 @@
#endif
#ifndef CONFIG_PIC32MX_OC1PRIO /* Output Compare 1 */
-# define CONFIG_PIC32MX_OC1PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_OC1PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_OC1PRIO < 4
# error "CONFIG_PIC32MX_OC1PRIO is too small"
@@ -255,7 +255,7 @@
#endif
#ifndef CONFIG_PIC32MX_OC2PRIO /* Output Compare 2 */
-# define CONFIG_PIC32MX_OC2PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_OC2PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_OC2PRIO < 4
# error "CONFIG_PIC32MX_OC2PRIO is too small"
@@ -265,7 +265,7 @@
#endif
#ifndef CONFIG_PIC32MX_OC3PRIO /* Output Compare 3 */
-# define CONFIG_PIC32MX_OC3PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_OC3PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_OC3PRIO < 4
# error "CONFIG_PIC32MX_OC3PRIO is too small"
@@ -275,7 +275,7 @@
#endif
#ifndef CONFIG_PIC32MX_OC4PRIO /* Output Compare 4 */
-# define CONFIG_PIC32MX_OC4PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_OC4PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_OC4PRIO < 4
# error "CONFIG_PIC32MX_OC4PRIO is too small"
@@ -285,7 +285,7 @@
#endif
#ifndef CONFIG_PIC32MX_OC5PRIO /* Output Compare 5 */
-# define CONFIG_PIC32MX_OC5PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_OC5PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_OC5PRIO < 4
# error "CONFIG_PIC32MX_OC5PRIO is too small"
@@ -295,7 +295,7 @@
#endif
#ifndef CONFIG_PIC32MX_I2C1PRIO /* I2C 1 */
-# define CONFIG_PIC32MX_I2C1PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_I2C1PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_I2C1PRIO < 4
# error "CONFIG_PIC32MX_I2C1PRIO is too small"
@@ -305,7 +305,7 @@
#endif
#ifndef CONFIG_PIC32MX_I2C2PRIO /* I2C 2 */
-# define CONFIG_PIC32MX_I2C2PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_I2C2PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_I2C2PRIO < 4
# error "CONFIG_PIC32MX_I2C2PRIO is too small"
@@ -315,7 +315,7 @@
#endif
#ifndef CONFIG_PIC32MX_SPI1PRIO /* SPI 1 */
-# define CONFIG_PIC32MX_SPI1PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_SPI1PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_SPI1PRIO < 4
# error "CONFIG_PIC32MX_SPI1PRIO is too small"
@@ -325,7 +325,7 @@
#endif
#ifndef CONFIG_PIC32MX_SPI2PRIO /* SPI 2 */
-# define CONFIG_PIC32MX_SPI2PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_SPI2PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_SPI2PRIO < 4
# error "CONFIG_PIC32MX_SPI2PRIO is too small"
@@ -335,7 +335,7 @@
#endif
#ifndef CONFIG_PIC32MX_UART1PRIO /* UART 1 */
-# define CONFIG_PIC32MX_UART1PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_UART1PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_UART1PRIO < 4
# error "CONFIG_PIC32MX_UART1PRIO is too small"
@@ -345,7 +345,7 @@
#endif
#ifndef CONFIG_PIC32MX_UART2PRIO /* UART 2 */
-# define CONFIG_PIC32MX_UART2PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_UART2PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_UART2PRIO < 4
# error "CONFIG_PIC32MX_UART2PRIO is too small"
@@ -355,7 +355,7 @@
#endif
#ifndef CONFIG_PIC32MX_CN /* Input Change Interrupt */
-# define CONFIG_PIC32MX_CN (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_CN (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_CN < 4
# error "CONFIG_PIC32MX_CN is too small"
@@ -365,7 +365,7 @@
#endif
#ifndef CONFIG_PIC32MX_ADCPRIO /* ADC1 Convert Done */
-# define CONFIG_PIC32MX_ADCPRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_ADCPRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_ADCPRIO < 4
# error "CONFIG_PIC32MX_ADCPRIO is too small"
@@ -375,7 +375,7 @@
#endif
#ifndef CONFIG_PIC32MX_PMPPRIO /* Parallel Master Port */
-# define CONFIG_PIC32MX_PMPPRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_PMPPRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_PMPPRIO < 4
# error "CONFIG_PIC32MX_PMPPRIO is too small"
@@ -385,7 +385,7 @@
#endif
#ifndef CONFIG_PIC32MX_CM1PRIO /* Comparator 1 */
-# define CONFIG_PIC32MX_CM1PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_CM1PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_CM1PRIO < 4
# error "CONFIG_PIC32MX_CM1PRIO is too small"
@@ -395,7 +395,7 @@
#endif
#ifndef CONFIG_PIC32MX_CM2PRIO /* Comparator 2 */
-# define CONFIG_PIC32MX_CM2PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_CM2PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_CM2PRIO < 4
# error "CONFIG_PIC32MX_CM2PRIO is too small"
@@ -405,7 +405,7 @@
#endif
#ifndef CONFIG_PIC32MX_FSCMPRIO /* Fail-Safe Clock Monitor */
-# define CONFIG_PIC32MX_FSCMPRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_FSCMPRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_FSCMPRIO < 4
# error "CONFIG_PIC32MX_FSCMPRIO is too small"
@@ -415,7 +415,7 @@
#endif
#ifndef CONFIG_PIC32MX_RTCCPRIO /* Real-Time Clock and Calendar */
-# define CONFIG_PIC32MX_RTCCPRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_RTCCPRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_RTCCPRIO < 4
# error "CONFIG_PIC32MX_RTCCPRIO is too small"
@@ -425,7 +425,7 @@
#endif
#ifndef CONFIG_PIC32MX_DMA0PRIO /* DMA Channel 0 */
-# define CONFIG_PIC32MX_DMA0PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_DMA0PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_DMA0PRIO < 4
# error "CONFIG_PIC32MX_DMA0PRIO is too small"
@@ -435,7 +435,7 @@
#endif
#ifndef CONFIG_PIC32MX_DMA1PRIO /* DMA Channel 1 */
-# define CONFIG_PIC32MX_DMA1PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_DMA1PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_DMA1PRIO < 4
# error "CONFIG_PIC32MX_DMA1PRIO is too small"
@@ -445,7 +445,7 @@
#endif
#ifndef CONFIG_PIC32MX_DMA2PRIO /* DMA Channel 2 */
-# define CONFIG_PIC32MX_DMA2PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_DMA2PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_DMA2PRIO < 4
# error "CONFIG_PIC32MX_DMA2PRIO is too small"
@@ -455,7 +455,7 @@
#endif
#ifndef CONFIG_PIC32MX_DMA3PRIO /* DMA Channel 3 */
-# define CONFIG_PIC32MX_DMA3PRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_DMA3PRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_DMA3PRIO < 4
# error "CONFIG_PIC32MX_DMA3PRIO is too small"
@@ -465,7 +465,7 @@
#endif
#ifndef CONFIG_PIC32MX_FCEPRIO /* Flash Control Event */
-# define CONFIG_PIC32MX_FCEPRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_FCEPRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_FCEPRIO < 4
# error "CONFIG_PIC32MX_FCEPRIO is too small"
@@ -475,7 +475,7 @@
#endif
#ifndef CONFIG_PIC32MX_USBPRIO /* USB */
-# define CONFIG_PIC32MX_USBPRIO (INT_CP0_MID_PRIORITY << 2)
+# define CONFIG_PIC32MX_USBPRIO (INT_ICP_MID_PRIORITY << 2)
#endif
#if CONFIG_PIC32MX_USBPRIO < 4
# error "CONFIG_PIC32MX_USBPRIO is too small"
@@ -534,26 +534,46 @@
/* Device Configuration *************************************************************/
/* DEVCFG3 */
-#ifndef CONFIG_PIC32MX_USERID
+#ifndef CONFIG_PIC32MX_USERID /* User ID */
# define CONFIG_PIC32MX_USERID 0x584e /* "NutX" */
#endif
-#ifndef CONFIG_PIC32MX_SRSSEL
-# define CONFIG_PIC32MX_SRSSEL 4 /* Middle priority */
+#ifndef CONFIG_PIC32MX_SRSSEL /* Shadow register interrupt priority */
+# define CONFIG_PIC32MX_SRSSEL INT_ICP_MIN_PRIORITY
#endif
+/* Unless overridden in the .config file, all pins are in the default setting */
+
+#ifndef CONFIG_PIC32MX_FMIIEN /* Ethernet MII enable */
+# define CONFIG_PIC32MX_FMIIEN 1 /* MII enabled */
+#endif
+
+#ifndef CONFIG_PIC32MX_FETHIO /* SCM1 pin C selection */
+# define CONFIG_PIC32MX_FETHIO 1 /* Default Ethernet I/O Pins */
+#endif
+
+#ifndef CONFIG_PIC32MX_FCANIO /* SCM1 pin C selection */
+# define CONFIG_PIC32MX_FCANIO 1 /* Default CAN I/O Pins */
+#endif
+
+#ifndef CONFIG_PIC32MX_FSCM1IO /* SCM1 pin C selection */
+# define CONFIG_PIC32MX_FSCM1IO 1 /* Default pin for SCM1C */
+#endif
+
+/* USB or Ports? */
+
#ifdef CONFIG_PIC32MX_USB
-# ifndef CONFIG_PIC32MX_USBIDO
+# ifndef CONFIG_PIC32MX_USBIDO /* USB USBID Selection */
# define CONFIG_PIC32MX_USBIDO 1 /* USBID pin is controlled by the USB module */
# endif
-# ifndef CONFIG_PIC32MX_VBUSIO
+# ifndef CONFIG_PIC32MX_VBUSIO /* USB VBUSON Selection */
# define CONFIG_PIC32MX_VBUSIO 1 /* VBUSON pin is controlled by the USB module */
# endif
#else
-# ifndef CONFIG_PIC32MX_USBIDO
+# ifndef CONFIG_PIC32MX_USBIDO /* USB USBID Selection */
# define CONFIG_PIC32MX_USBIDO 0 /* USBID pin is controlled by the Port function */
# endif
-# ifndef CONFIG_PIC32MX_VBUSIO
+# ifndef CONFIG_PIC32MX_VBUSIO /* USB VBUSON Selection */
# define CONFIG_PIC32MX_VBUSIO 0 /* VBUSON pin is controlled by the Port function */
# endif
#endif
@@ -603,22 +623,22 @@
#endif
#undef CONFIG_PIC32MX_UPLLIDIV
-#if BOARD_UPLL_IDIV == 15
-# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FPLLMULT_MUL15
-#elif BOARD_UPLL_IDIV == 16
-# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FPLLMULT_MUL16
-#elif BOARD_UPLL_IDIV == 17
-# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FPLLMULT_MUL17
-#elif BOARD_UPLL_IDIV == 18
-# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FPLLMULT_MUL18
-#elif BOARD_UPLL_IDIV == 19
-# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FPLLMULT_MUL19
-#elif BOARD_UPLL_IDIV == 20
-# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FPLLMULT_MUL20
-#elif BOARD_UPLL_IDIV == 21
-# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FPLLMULT_MUL21
-#elif BOARD_UPLL_IDIV == 24
-# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FPLLMULT_MUL24
+#if BOARD_UPLL_IDIV == 1
+# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FUPLLIDIV_DIV1
+#elif BOARD_UPLL_IDIV == 2
+# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FUPLLIDIV_DIV2
+#elif BOARD_UPLL_IDIV == 3
+# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FUPLLIDIV_DIV3
+#elif BOARD_UPLL_IDIV == 4
+# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FUPLLIDIV_DIV4
+#elif BOARD_UPLL_IDIV == 5
+# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FUPLLIDIV_DIV5
+#elif BOARD_UPLL_IDIV == 6
+# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FUPLLIDIV_DIV6
+#elif BOARD_UPLL_IDIV == 10
+# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FUPLLIDIV_DIV10
+#elif BOARD_UPLL_IDIV == 12
+# define CONFIG_PIC32MX_UPLLIDIV DEVCFG2_FUPLLIDIV_DIV12
#else
# error "Unsupported BOARD_UPLL_IDIV"
#endif
@@ -713,6 +733,28 @@
# define CONFIG_PIC32MX_WDENABLE 0
#endif
+/* DEVCFG0 */
+
+#ifndef CONFIG_PIC32MX_DEBUGGER /* Background Debugger Enable */
+# define CONFIG_PIC32MX_DEBUGGER 3 /* disabled */
+#endif
+
+#ifndef CONFIG_PIC32MX_ICESEL /* In-Circuit Emulator/Debugger Communication Channel Select */
+# define CONFIG_PIC32MX_ICESEL 1 /* default */
+#endif
+
+#ifndef CONFIG_PIC32MX_PROGFLASHWP /* Program FLASH write protect */
+# define CONFIG_PIC32MX_PROGFLASHWP 0xff /* Disabled */
+#endif
+
+#ifndef CONFIG_PIC32MX_BOOTFLASHWP
+# define CONFIG_PIC32MX_BOOTFLASHWP 1 /* Disabled */
+#endif
+
+#ifndef CONFIG_PIC32MX_CODEWP
+# define CONFIG_PIC32MX_CODEWP 1 /* Disabled */
+#endif
+
/************************************************************************************
* Public Types
************************************************************************************/
diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-devcfg.h b/nuttx/arch/mips/src/pic32mx/pic32mx-devcfg.h
index f34ae8a2b..03c5acad4 100755
--- a/nuttx/arch/mips/src/pic32mx/pic32mx-devcfg.h
+++ b/nuttx/arch/mips/src/pic32mx/pic32mx-devcfg.h
@@ -75,6 +75,7 @@
#define DEVCFG3_FSCM1IO (1 << 29) /* Bit 29: SCM1 pin C selection */
#define DEVCFG3_FUSBIDIO (1 << 30) /* Bit 30: USB USBID selection */
#define DEVCFG3_FVBUSIO (1 << 31) /* Bit 31: USB VBUSON selection */
+#define DEVCFG3_UNUSED 0x18f80000 /* Bits 19-23, 27-28 */
/* Device configuration word 2 */
@@ -119,6 +120,7 @@
# define DEVCFG2_FPLLODIV_DIV32 (5 << DEVCFG2_FPLLODIV_SHIFT)
# define DEVCFG2_FPLLODIV_DIV64 (6 << DEVCFG2_FPLLODIV_SHIFT)
# define DEVCFG2_FPLLODIV_DIV256 (7 << DEVCFG2_FPLLODIV_SHIFT)
+#define DEVCFG2_UNUSED 0xfff87888 /* Bits 3, 7, 11-14, 19-31 */
/* Device configuration word 1 */
@@ -176,6 +178,7 @@
# define DEVCFG1_WDTPS_1048576 (20 << DEVCFG1_WDTPS_SHIFT) /* 1:1048576 */
#define DEVCFG1_WINDIS (1 << 22) /* Bit 22: Windowed watchdog timer enable */
#define DEVCFG1_FWDTEN (1 << 23) /* Bit 23: WDT enable */
+#define DEVCFG1_UNUSED 0xff200858 /* Bits 3-4, 6, 11, 21, 24-31 */
/* Device configuration word 0 */
@@ -193,6 +196,7 @@
#define DEVCFG0_BWP (1 << 24) /* Bit 24: Boot flash write-protect */
#define DEVCFG0_CP (1 << 28) /* Bit 28: Code-protect */
#define DEVCFG0_SIGN (1 << 31) /* Bit 31: Signature */
+#define DEVCFG0_UNUSED 0x6ef00ff0 /* Bits 4-11, 20-23, 25-27, 29-30 */
/****************************************************************************
* Public Types
diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-head.S b/nuttx/arch/mips/src/pic32mx/pic32mx-head.S
index ba726b4e1..ec7b8a991 100644
--- a/nuttx/arch/mips/src/pic32mx/pic32mx-head.S
+++ b/nuttx/arch/mips/src/pic32mx/pic32mx-head.S
@@ -529,22 +529,30 @@ halt:
.type devconfig, object
devconfig:
devconfig3:
- .long CONFIG_PIC32MX_USERID << DEVCFG3_USERID_SHIFT | \
- CONFIG_PIC32MX_SRSSEL << DEVCFG3_FSRSSEL_SHIFT | \
- CONFIG_PIC32MX_USBIDO << 30 | \
- CONFIG_PIC32MX_VBUSIO << 31
+ .long CONFIG_PIC32MX_USERID << DEVCFG3_USERID_SHIFT | \
+ CONFIG_PIC32MX_SRSSEL << DEVCFG3_FSRSSEL_SHIFT | \
+ CONFIG_PIC32MX_FMIIEN << 24 | CONFIG_PIC32MX_FETHIO << 25 | \
+ CONFIG_PIC32MX_FCANIO << 26 | CONFIG_PIC32MX_FSCM1IO << 29 | \
+ CONFIG_PIC32MX_USBIDO << 30 | CONFIG_PIC32MX_VBUSIO << 31 | \
+ DEVCFG3_UNUSED
devconfig2:
.long CONFIG_PIC32MX_PLLIDIV | CONFIG_PIC32MX_PLLMULT | \
- CONFIG_PIC32MX_UPLLIDIV | DEVCFG2_FPLLODIV_DIV1
+ CONFIG_PIC32MX_UPLLIDIV | DEVCFG2_FPLLODIV_DIV1 | \
+ DEVCFG2_UNUSED
devconfig1:
.long DEVCFG1_FNOSC_POSCPLL | DEVCFG1_POSCMOD_HS | \
CONFIG_PIC32MX_PBDIV | DEVCFG1_FCKSM_NONE | \
- CONFIG_PIC32MX_WDENABLE
+ CONFIG_PIC32MX_WDENABLE | DEVCFG1_UNUSED
devconfig0:
- .long DEVCFG0_DEBUG_DISABLED | DEVCFG0_PWP_DISABLE
+ .long CONFIG_PIC32MX_DEBUGGER << DEVCFG0_DEBUG_SHIFT | \
+ CONFIG_PIC32MX_ICESEL << 3 | \
+ CONFIG_PIC32MX_PROGFLASHWP << DEVCFG0_PWP_SHIFT | \
+ CONFIG_PIC32MX_BOOTFLASHWP << 24 | \
+ CONFIG_PIC32MX_CODEWP << 28 | \
+ DEVCFG0_UNUSED
.size devconfig, .-devconfig
/****************************************************************************
diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-int.h b/nuttx/arch/mips/src/pic32mx/pic32mx-int.h
index 985c350ba..4f99d01b2 100755
--- a/nuttx/arch/mips/src/pic32mx/pic32mx-int.h
+++ b/nuttx/arch/mips/src/pic32mx/pic32mx-int.h
@@ -317,11 +317,12 @@
/* Interrupt priority control register 0-11 */
-#define INT_CP0_MIN_PRIORITY 0 /* Disabled! */
-#define INT_CP0_MID_PRIORITY 4 /* Can be used as the default */
-#define INT_CP0_MAX_PRIORITY 7 /* Maximum priority */
-#define INT_CP0_MIN_SUBPRIORITY 0 /* Minimum sub-priority */
-#define INT_CP0_MAX_SUBPRIORITY 0 /* Maximum sub-priority */
+#define INT_ICP_DISABLED 0 /* Disabled! */
+#define INT_ICP_MIN_PRIORITY 1 /* Minimum (enabled) priority */
+#define INT_ICP_MID_PRIORITY 4 /* Can be used as the default */
+#define INT_ICP_MAX_PRIORITY 7 /* Maximum priority */
+#define INT_ICP_MIN_SUBPRIORITY 0 /* Minimum sub-priority */
+#define INT_ICP_MAX_SUBPRIORITY 0 /* Maximum sub-priority */
#define INT_IPC0_CTIS_SHIFT (0) /* Bits 0-1, Vector: 0, Core Timer Interrupt */
#define INT_IPC0_CTIS_MASK (3 << INT_IPC0_CTIS_SHIFT)
diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-irq.c b/nuttx/arch/mips/src/pic32mx/pic32mx-irq.c
index ca860fb9a..1f30aa41e 100755
--- a/nuttx/arch/mips/src/pic32mx/pic32mx-irq.c
+++ b/nuttx/arch/mips/src/pic32mx/pic32mx-irq.c
@@ -102,7 +102,7 @@ void up_irqinitialize(void)
for (irq = 0; irq < NR_IRQS; irq++)
{
- (void)up_prioritize_irq(irq, (INT_CP0_MID_PRIORITY << 2));
+ (void)up_prioritize_irq(irq, (INT_ICP_MID_PRIORITY << 2));
}
/* Set the CP0 cause IV bit meaning that the interrupt exception uses
diff --git a/nuttx/configs/pcblogic-pic32mx/include/board.h b/nuttx/configs/pcblogic-pic32mx/include/board.h
index e0be789aa..5e94f1a63 100755
--- a/nuttx/configs/pcblogic-pic32mx/include/board.h
+++ b/nuttx/configs/pcblogic-pic32mx/include/board.h
@@ -68,7 +68,7 @@
* USB_CLOCK = ((POSC_XTAL / IDIV) * 24) / 2
*/
-#define BOARD_UPLL_IDIV 16 /* 2*/ /* USB PLL divider (revisit) */
+#define BOARD_UPLL_IDIV 2 /* USB PLL divider (revisit) */
#define BOARD_USB_CLOCK 48000000 /* USB clock (8MHz / (2*48MHz/24)) */
/* Peripheral clock is divided down from CPU clock.