From 868fa211bc0929b62417913f8a4202a3f250d594 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 7 Oct 2014 15:25:31 -0600 Subject: [PATCH] Remove non-functional vestiges of OTGHS in FS mode (including OTGFS2); try to convert the stm32f429i-disco configuration to use OTGHS instead of OTFHS in FS mode (OTGFS2). But I don't have the boards and can't test --- arch/arm/src/stm32/Kconfig | 3 --- arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h | 6 ------ arch/arm/src/stm32/stm32_otgfsdev.c | 4 ---- configs/stm32f429i-disco/extflash/setenv.sh | 1 + configs/stm32f429i-disco/nsh/setenv.sh | 1 + configs/stm32f429i-disco/src/Makefile | 2 +- configs/stm32f429i-disco/src/stm32_boot.c | 2 +- configs/stm32f429i-disco/src/stm32_nsh.c | 4 ++-- configs/stm32f429i-disco/src/stm32_usb.c | 8 ++++---- configs/stm32f429i-disco/src/stm32f429i-disco.h | 4 ++-- configs/stm32f429i-disco/usbmsc/defconfig | 2 -- configs/stm32f429i-disco/usbmsc/setenv.sh | 1 + configs/stm32f429i-disco/usbnsh/defconfig | 2 -- configs/stm32f429i-disco/usbnsh/setenv.sh | 1 + 14 files changed, 14 insertions(+), 27 deletions(-) diff --git a/arch/arm/src/stm32/Kconfig b/arch/arm/src/stm32/Kconfig index 4dcdc0a5a0..c706cfed7b 100644 --- a/arch/arm/src/stm32/Kconfig +++ b/arch/arm/src/stm32/Kconfig @@ -1403,9 +1403,6 @@ config STM32_I2C config STM32_CAN bool -config STM32_OTGFS2 - bool - menu "Alternate Pin Mapping" choice diff --git a/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h b/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h index 79c9789a21..7ded147fc2 100644 --- a/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h +++ b/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h @@ -400,12 +400,6 @@ #define GPIO_OTGHSFS_DP (GPIO_ALT|GPIO_FLOAT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN15) #define GPIO_OTGHSFS_ID (GPIO_ALT|GPIO_PULLUP|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN12) -#ifdef CONFIG_STM32_OTGFS2 -# define GPIO_OTGFS2_DM (GPIO_ALT|GPIO_FLOAT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN14) -# define GPIO_OTGFS2_DP (GPIO_ALT|GPIO_FLOAT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN15) -# define GPIO_OTGFS2_ID (GPIO_ALT|GPIO_PULLUP|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN12) -#endif - #define GPIO_OTGHS_DM (GPIO_ALT|GPIO_FLOAT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN14) #define GPIO_OTGHS_DP (GPIO_ALT|GPIO_FLOAT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN15) #define GPIO_OTGHS_ID (GPIO_ALT|GPIO_PULLUP|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN12) diff --git a/arch/arm/src/stm32/stm32_otgfsdev.c b/arch/arm/src/stm32/stm32_otgfsdev.c index 051cf5510f..861a10c039 100644 --- a/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/arch/arm/src/stm32/stm32_otgfsdev.c @@ -5132,10 +5132,6 @@ static void stm32_hwinitialize(FAR struct stm32_usbdev_s *priv) stm32_putreg(OTGFS_GAHBCFG_TXFELVL, STM32_OTGFS_GAHBCFG); - /* For OTGFS2 mode (FS mode of the HS module), we must select the FS PHY - * mode prior to issuing a soft reset. - */ - /* Common USB OTG core initialization */ /* Reset after a PHY select and set Host mode. First, wait for AHB master * IDLE state. diff --git a/configs/stm32f429i-disco/extflash/setenv.sh b/configs/stm32f429i-disco/extflash/setenv.sh index a11e9434ad..275653e1a7 100644 --- a/configs/stm32f429i-disco/extflash/setenv.sh +++ b/configs/stm32f429i-disco/extflash/setenv.sh @@ -57,6 +57,7 @@ fi # the CodeSourcery toolchain in any other location #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" +#export TOOLCHAIN_BIN="/cygdrive/c/Users/MyName/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" # These are the Cygwin paths to the locations where I installed the Atollic # toolchain under windows. You will also have to edit this if you install diff --git a/configs/stm32f429i-disco/nsh/setenv.sh b/configs/stm32f429i-disco/nsh/setenv.sh index a11e9434ad..275653e1a7 100644 --- a/configs/stm32f429i-disco/nsh/setenv.sh +++ b/configs/stm32f429i-disco/nsh/setenv.sh @@ -57,6 +57,7 @@ fi # the CodeSourcery toolchain in any other location #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" +#export TOOLCHAIN_BIN="/cygdrive/c/Users/MyName/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" # These are the Cygwin paths to the locations where I installed the Atollic # toolchain under windows. You will also have to edit this if you install diff --git a/configs/stm32f429i-disco/src/Makefile b/configs/stm32f429i-disco/src/Makefile index 9c6b04791a..126dee35ed 100644 --- a/configs/stm32f429i-disco/src/Makefile +++ b/configs/stm32f429i-disco/src/Makefile @@ -68,7 +68,7 @@ ifeq ($(CONFIG_STM32_FSMC),y) CSRCS += stm32_extmem.c endif -ifeq ($(CONFIG_STM32_OTGFS2),y) +ifeq ($(CONFIG_STM32_OTGFHS),y) CSRCS += stm32_usb.c endif diff --git a/configs/stm32f429i-disco/src/stm32_boot.c b/configs/stm32f429i-disco/src/stm32_boot.c index 6e21112c8b..6590934479 100644 --- a/configs/stm32f429i-disco/src/stm32_boot.c +++ b/configs/stm32f429i-disco/src/stm32_boot.c @@ -88,7 +88,7 @@ void stm32_boardinitialize(void) * selected. */ -#ifdef CONFIG_STM32_OTGFS2 +#ifdef CONFIG_STM32_OTGHS if (stm32_usbinitialize) { stm32_usbinitialize(); diff --git a/configs/stm32f429i-disco/src/stm32_nsh.c b/configs/stm32f429i-disco/src/stm32_nsh.c index 58e49d5f48..c949ececa7 100644 --- a/configs/stm32f429i-disco/src/stm32_nsh.c +++ b/configs/stm32f429i-disco/src/stm32_nsh.c @@ -68,7 +68,7 @@ #endif #endif -#ifdef CONFIG_STM32_OTGFS2 +#ifdef CONFIG_STM32_OTGHS # include "stm32_usbhost.h" #endif @@ -87,7 +87,7 @@ /* Can't support USB host or device features if USB OTG HS is not enabled */ -#ifndef CONFIG_STM32_OTGFS2 +#ifndef CONFIG_STM32_OTGHS # undef HAVE_USBDEV # undef HAVE_USBHOST # undef HAVE_USBMONITOR diff --git a/configs/stm32f429i-disco/src/stm32_usb.c b/configs/stm32f429i-disco/src/stm32_usb.c index 6740bd3ace..c37a69c5b7 100644 --- a/configs/stm32f429i-disco/src/stm32_usb.c +++ b/configs/stm32f429i-disco/src/stm32_usb.c @@ -55,7 +55,7 @@ #include "stm32_otgfs.h" #include "stm32f429i-disco.h" -#ifdef CONFIG_STM32_OTGFS2 +#ifdef CONFIG_STM32_OTGHS /************************************************************************************ * Pre-processor Definitions @@ -64,7 +64,7 @@ #if defined(CONFIG_USBDEV) || defined(CONFIG_USBHOST) # define HAVE_USB 1 #else -# warning "CONFIG_STM32_OTGFS2 is enabled but neither CONFIG_USBDEV nor CONFIG_USBHOST" +# warning "CONFIG_STM32_OTGHS is enabled but neither CONFIG_USBDEV nor CONFIG_USBHOST" # undef HAVE_USB #endif @@ -148,7 +148,7 @@ void stm32_usbinitialize(void) /* Configure the OTG HS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ -#ifdef CONFIG_STM32_OTGFS2 +#ifdef CONFIG_STM32_OTGHS stm32_configgpio(GPIO_OTGHS_VBUS); stm32_configgpio(GPIO_OTGHS_PWRON); stm32_configgpio(GPIO_OTGHS_OVER); @@ -288,5 +288,5 @@ void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) } #endif -#endif /* CONFIG_STM32_OTGFS2 */ +#endif /* CONFIG_STM32_OTGHS */ diff --git a/configs/stm32f429i-disco/src/stm32f429i-disco.h b/configs/stm32f429i-disco/src/stm32f429i-disco.h index 90a769c534..68728d51b3 100644 --- a/configs/stm32f429i-disco/src/stm32f429i-disco.h +++ b/configs/stm32f429i-disco/src/stm32f429i-disco.h @@ -149,7 +149,7 @@ void weak_function stm32_spiinitialize(void); * ****************************************************************************************************/ -#ifdef CONFIG_STM32_OTGFS2 +#ifdef CONFIG_STM32_OTGHS void weak_function stm32_usbinitialize(void); #endif @@ -162,7 +162,7 @@ void weak_function stm32_usbinitialize(void); * ****************************************************************************************************/ -#if defined(CONFIG_STM32_OTGFS2) && defined(CONFIG_USBHOST) +#if defined(CONFIG_STM32_OTGHS) && defined(CONFIG_USBHOST) int stm32_usbhost_initialize(void); #endif diff --git a/configs/stm32f429i-disco/usbmsc/defconfig b/configs/stm32f429i-disco/usbmsc/defconfig index 93eed3eb96..e207130f6d 100644 --- a/configs/stm32f429i-disco/usbmsc/defconfig +++ b/configs/stm32f429i-disco/usbmsc/defconfig @@ -262,7 +262,6 @@ CONFIG_STM32_FSMC=y # CONFIG_STM32_LTDC is not set # CONFIG_STM32_OTGFS is not set CONFIG_STM32_OTGHS=y -CONFIG_STM32_OTGHS_FS_MODE=y CONFIG_STM32_PWR=y # CONFIG_STM32_RNG is not set # CONFIG_STM32_SDIO is not set @@ -298,7 +297,6 @@ CONFIG_STM32_USART1=y # CONFIG_STM32_IWDG is not set # CONFIG_STM32_WWDG is not set CONFIG_STM32_SPI=y -CONFIG_STM32_OTGFS2=y # # Alternate Pin Mapping diff --git a/configs/stm32f429i-disco/usbmsc/setenv.sh b/configs/stm32f429i-disco/usbmsc/setenv.sh index a11e9434ad..275653e1a7 100644 --- a/configs/stm32f429i-disco/usbmsc/setenv.sh +++ b/configs/stm32f429i-disco/usbmsc/setenv.sh @@ -57,6 +57,7 @@ fi # the CodeSourcery toolchain in any other location #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" +#export TOOLCHAIN_BIN="/cygdrive/c/Users/MyName/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" # These are the Cygwin paths to the locations where I installed the Atollic # toolchain under windows. You will also have to edit this if you install diff --git a/configs/stm32f429i-disco/usbnsh/defconfig b/configs/stm32f429i-disco/usbnsh/defconfig index 3a71260297..1c7f40e335 100644 --- a/configs/stm32f429i-disco/usbnsh/defconfig +++ b/configs/stm32f429i-disco/usbnsh/defconfig @@ -259,7 +259,6 @@ CONFIG_STM32_FSMC=y # CONFIG_STM32_LTDC is not set # CONFIG_STM32_OTGFS is not set CONFIG_STM32_OTGHS=y -CONFIG_STM32_OTGHS_FS_MODE=y CONFIG_STM32_PWR=y # CONFIG_STM32_RNG is not set # CONFIG_STM32_SDIO is not set @@ -295,7 +294,6 @@ CONFIG_STM32_USART1=y # CONFIG_STM32_IWDG is not set # CONFIG_STM32_WWDG is not set CONFIG_STM32_SPI=y -CONFIG_STM32_OTGFS2=y # # Alternate Pin Mapping diff --git a/configs/stm32f429i-disco/usbnsh/setenv.sh b/configs/stm32f429i-disco/usbnsh/setenv.sh index a11e9434ad..275653e1a7 100644 --- a/configs/stm32f429i-disco/usbnsh/setenv.sh +++ b/configs/stm32f429i-disco/usbnsh/setenv.sh @@ -57,6 +57,7 @@ fi # the CodeSourcery toolchain in any other location #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" +#export TOOLCHAIN_BIN="/cygdrive/c/Users/MyName/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" # These are the Cygwin paths to the locations where I installed the Atollic # toolchain under windows. You will also have to edit this if you install