From 7589e940b6edd140fdad2ddf53ee19c238878f69 Mon Sep 17 00:00:00 2001
From: "Paul A. Patience" <paul-a.patience@polymtl.ca>
Date: Mon, 14 Dec 2015 09:27:40 -0500
Subject: [PATCH 1/3] STM32: Fix typos in STM32F30xxx pinmap

---
 arch/arm/src/stm32/chip/stm32f30xxx_pinmap.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/src/stm32/chip/stm32f30xxx_pinmap.h b/arch/arm/src/stm32/chip/stm32f30xxx_pinmap.h
index 38ae3f0c36..7bc9ed67db 100644
--- a/arch/arm/src/stm32/chip/stm32f30xxx_pinmap.h
+++ b/arch/arm/src/stm32/chip/stm32f30xxx_pinmap.h
@@ -258,7 +258,7 @@
 #define GPIO_TIM1_CH1IN_1   (GPIO_ALT|GPIO_FLOAT|GPIO_AF2|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN9)
 #define GPIO_TIM1_CH1OUT_1  (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF2|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN9)
 #define GPIO_TIM1_CH1IN_2   (GPIO_ALT|GPIO_FLOAT|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN8)
-#define GPIO_TIM1_CH1OUT_2  (GPIO_ALT|GPIO_PUSHPULL|PIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1OUT_2  (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN8)
 #define GPIO_TIM1_CH1N_1    (GPIO_ALT|GPIO_AF2|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN8)
 #define GPIO_TIM1_CH1N_2    (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_PORTC|GPIO_PIN13)
 #define GPIO_TIM1_CH1N_3    (GPIO_ALT|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN11)
@@ -267,7 +267,7 @@
 #define GPIO_TIM1_CH2IN_1   (GPIO_ALT|GPIO_FLOAT|GPIO_AF2|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN11)
 #define GPIO_TIM1_CH2OUT_1  (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF2|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN11)
 #define GPIO_TIM1_CH2IN_2   (GPIO_ALT|GPIO_FLOAT|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN9)
-#define GPIO_TIM1_CHOUT2_2  (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2OUT_2  (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN9)
 #define GPIO_TIM1_CH2N_1    (GPIO_ALT|GPIO_AF2|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN10)
 #define GPIO_TIM1_CH2N_2    (GPIO_ALT|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN12)
 #define GPIO_TIM1_CH2N_3    (GPIO_ALT|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN0)
@@ -443,7 +443,7 @@
 #define GPIO_TIM16_CH1IN_4  (GPIO_ALT|GPIO_FLOAT|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN8)
 #define GPIO_TIM16_CH1OUT_4 (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN8)
 #define GPIO_TIM16_CH1IN_5  (GPIO_ALT|GPIO_FLOAT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN0)
-#define GPIO_TIM16_CHOUT1_5 (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN0)
+#define GPIO_TIM16_CH1OUT_5 (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN0)
 #define GPIO_TIM16_CH1N_1   (GPIO_ALT|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN13)
 #define GPIO_TIM16_CH1N_2   (GPIO_ALT|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN6)
 
@@ -451,7 +451,7 @@
 #define GPIO_TIM17_BKIN_2   (GPIO_ALT|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN10)
 #define GPIO_TIM17_CH1IN_1  (GPIO_ALT|GPIO_FLOAT|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN7)
 #define GPIO_TIM17_CH1OUT_1 (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN7)
-#define GPIO_TIM17_CH1IN_2  (GPIO_ALT|GGPIO_FLOAT|PIO_AF10|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_TIM17_CH1IN_2  (GPIO_ALT|GPIO_FLOAT|GPIO_AF10|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN5)
 #define GPIO_TIM17_CH1OUT_2 (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF10|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN5)
 #define GPIO_TIM17_CH1IN_3  (GPIO_ALT|GPIO_FLOAT|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN9)
 #define GPIO_TIM17_CH1OUT_3 (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN9)

From 89da1f27dd23d6309a3dea48c1282bdd6f924fef Mon Sep 17 00:00:00 2001
From: "Paul A. Patience" <paul-a.patience@polymtl.ca>
Date: Mon, 14 Dec 2015 09:40:25 -0500
Subject: [PATCH 2/3] STM32: Fix typos in pinmaps

---
 arch/arm/src/stm32/chip/stm32f103v_pinmap.h  | 2 +-
 arch/arm/src/stm32/chip/stm32f105v_pinmap.h  | 2 +-
 arch/arm/src/stm32/chip/stm32f107v_pinmap.h  | 2 +-
 arch/arm/src/stm32/chip/stm32f37xxx_pinmap.h | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/src/stm32/chip/stm32f103v_pinmap.h b/arch/arm/src/stm32/chip/stm32f103v_pinmap.h
index c63a5f96bf..61895a74e9 100644
--- a/arch/arm/src/stm32/chip/stm32f103v_pinmap.h
+++ b/arch/arm/src/stm32/chip/stm32f103v_pinmap.h
@@ -338,7 +338,7 @@
 #define GPIO_TIM5_CH2OUT        (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN1)
 #define GPIO_TIM5_CH3IN         (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN2)
 #define GPIO_TIM5_CH3OUT        (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN2)
-#define GPIO_TIM5_CH4IN         (GGPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM5_CH4IN         (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
 #define GPIO_TIM5_CH4OUT        (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN3)
 
 #if 0 /* Needs further investigation */
diff --git a/arch/arm/src/stm32/chip/stm32f105v_pinmap.h b/arch/arm/src/stm32/chip/stm32f105v_pinmap.h
index 73a08bd353..71ffe84648 100644
--- a/arch/arm/src/stm32/chip/stm32f105v_pinmap.h
+++ b/arch/arm/src/stm32/chip/stm32f105v_pinmap.h
@@ -334,7 +334,7 @@
 #define GPIO_TIM5_CH2OUT        (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN1)
 #define GPIO_TIM5_CH3IN         (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN2)
 #define GPIO_TIM5_CH3OUT        (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN2)
-#define GPIO_TIM5_CH4IN         (GGPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM5_CH4IN         (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
 #define GPIO_TIM5_CH4OUT        (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN3)
 
 #if 0 /* Needs further investigation */
diff --git a/arch/arm/src/stm32/chip/stm32f107v_pinmap.h b/arch/arm/src/stm32/chip/stm32f107v_pinmap.h
index 66de9a70a0..33af482642 100644
--- a/arch/arm/src/stm32/chip/stm32f107v_pinmap.h
+++ b/arch/arm/src/stm32/chip/stm32f107v_pinmap.h
@@ -340,7 +340,7 @@
 #define GPIO_TIM5_CH2OUT        (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN1)
 #define GPIO_TIM5_CH3IN         (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN2)
 #define GPIO_TIM5_CH3OUT        (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN2)
-#define GPIO_TIM5_CH4IN         (GGPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM5_CH4IN         (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
 #define GPIO_TIM5_CH4OUT        (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN3)
 
 #if 0 /* Needs further investigation */
diff --git a/arch/arm/src/stm32/chip/stm32f37xxx_pinmap.h b/arch/arm/src/stm32/chip/stm32f37xxx_pinmap.h
index 4cc7543f74..6f48b4bf1e 100644
--- a/arch/arm/src/stm32/chip/stm32f37xxx_pinmap.h
+++ b/arch/arm/src/stm32/chip/stm32f37xxx_pinmap.h
@@ -341,7 +341,7 @@
 #define GPIO_TIM16_CH1IN_4  (GPIO_ALT|GPIO_FLOAT|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN8)
 #define GPIO_TIM16_CH1OUT_4 (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN8)
 #define GPIO_TIM16_CH1IN_5  (GPIO_ALT|GPIO_FLOAT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN0)
-#define GPIO_TIM16_CHOUT1_5 (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN0)
+#define GPIO_TIM16_CH1OUT_5 (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN0)
 #define GPIO_TIM16_CH1N_1   (GPIO_ALT|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN13)
 #define GPIO_TIM16_CH1N_2   (GPIO_ALT|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN6)
 
@@ -349,7 +349,7 @@
 #define GPIO_TIM17_BKIN_2   (GPIO_ALT|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN10)
 #define GPIO_TIM17_CH1IN_1  (GPIO_ALT|GPIO_FLOAT|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN7)
 #define GPIO_TIM17_CH1OUT_1 (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN7)
-#define GPIO_TIM17_CH1IN_2  (GPIO_ALT|GGPIO_FLOAT|PIO_AF10|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_TIM17_CH1IN_2  (GPIO_ALT|GPIO_FLOAT|GPIO_AF10|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN5)
 #define GPIO_TIM17_CH1OUT_2 (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF10|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN5)
 #define GPIO_TIM17_CH1IN_3  (GPIO_ALT|GPIO_FLOAT|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN9)
 #define GPIO_TIM17_CH1OUT_3 (GPIO_ALT|GPIO_PUSHPULL|GPIO_AF1|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN9)

From 6e9aa0a1d7de48a6d95524eef8d4b5bde08aa969 Mon Sep 17 00:00:00 2001
From: Gregory Nutt <gnutt@nuttx.org>
Date: Mon, 14 Dec 2015 11:56:02 -0600
Subject: [PATCH 3/3] ARMv7-A/M: Cosmetic changes

---
 arch/arm/src/armv7-a/arm_copyarmstate.c | 14 +-------------
 arch/arm/src/armv7-a/svcall.h           |  2 +-
 arch/arm/src/armv7-m/mpu.h              |  6 +++---
 arch/arm/src/armv7-m/svcall.h           |  2 +-
 4 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/arch/arm/src/armv7-a/arm_copyarmstate.c b/arch/arm/src/armv7-a/arm_copyarmstate.c
index 9c8a7797af..5684873766 100644
--- a/arch/arm/src/armv7-a/arm_copyarmstate.c
+++ b/arch/arm/src/armv7-a/arm_copyarmstate.c
@@ -47,18 +47,6 @@
 
 #ifdef CONFIG_ARCH_FPU
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -76,7 +64,7 @@ void up_copyarmstate(uint32_t *dest, uint32_t *src)
 {
   int i;
 
-  /* In the Cortex-M model, the state is copied from the stack to the TCB,
+  /* In the Cortex-A model, the state is copied from the stack to the TCB,
    * but only a reference is passed to get the state from the TCB.  So the
    * following check avoids copying the TCB save area onto itself:
    */
diff --git a/arch/arm/src/armv7-a/svcall.h b/arch/arm/src/armv7-a/svcall.h
index 513299c170..9e3c679e89 100644
--- a/arch/arm/src/armv7-a/svcall.h
+++ b/arch/arm/src/armv7-a/svcall.h
@@ -72,7 +72,7 @@
 #  endif
 #endif
 
-/* Cortex M3 system calls ***********************************************************/
+/* Cortex-A system calls ************************************************************/
 
 /* SYS call 0:
  *
diff --git a/arch/arm/src/armv7-m/mpu.h b/arch/arm/src/armv7-m/mpu.h
index 990e30aa1d..fa17d4fe3f 100644
--- a/arch/arm/src/armv7-m/mpu.h
+++ b/arch/arm/src/armv7-m/mpu.h
@@ -33,8 +33,8 @@
  *
  ************************************************************************************/
 
-#ifndef __ARCH_ARM_SRC_COMMON_CORTEXM_MPU_H
-#define __ARCH_ARM_SRC_COMMON_CORTEXM_MPU_H
+#ifndef __ARCH_ARM_SRC_ARMV7M_MPU_H
+#define __ARCH_ARM_SRC_ARMV7M_MPU_H
 
 /************************************************************************************
  * Included Files
@@ -570,5 +570,5 @@ static inline void mpu_peripheral(uintptr_t base, size_t size)
 #endif
 
 #endif  /* __ASSEMBLY__ */
-#endif  /* __ARCH_ARM_SRC_COMMON_CORTEXM_MPU_H */
+#endif  /* __ARCH_ARM_SRC_ARMV7M_MPU_H */
 
diff --git a/arch/arm/src/armv7-m/svcall.h b/arch/arm/src/armv7-m/svcall.h
index f9f85c597a..cc2b2716b2 100644
--- a/arch/arm/src/armv7-m/svcall.h
+++ b/arch/arm/src/armv7-m/svcall.h
@@ -72,7 +72,7 @@
 #  endif
 #endif
 
-/* Cortex M3 system calls ***********************************************************/
+/* Cortex-M system calls ************************************************************/
 
 /* SYS call 0:
  *