Add support so that the W25 FLASH can be used with both the Shenzhou and Fire-stm32v2 boards

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5166 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2012-09-19 14:34:17 +00:00
parent 2b7f90d569
commit efda9c5de5
2 changed files with 66 additions and 2 deletions

View File

@ -57,6 +57,7 @@
#define HAVE_MMCSD 1
#define HAVE_USBDEV 1
#define HAVE_W25 1
/* Configuration ************************************************************/
/* SPI1 connects to the SD CARD (and to the SPI FLASH) */
@ -96,6 +97,24 @@
# endif
#endif
/* Can't support the W25 device if it SPI1 or W25 support is not enabled */
#if !defined(CONFIG_STM32_SPI1) || !defined(CONFIG_MTD_W25)
# undef HAVE_W25
#endif
/* Can't support W25 features if mountpoints are disabled */
#if defined(CONFIG_DISABLE_MOUNTPOINT)
# undef HAVE_W25
#endif
/* Default W25 minor number */
#if defined(HAVE_W25) && !defined(CONFIG_NSH_W25MINOR)
# define CONFIG_NSH_W25MINOR 0
#endif
/* Can't support USB host or device features if the USB peripheral or the USB
* device infrastructure is not enabled
*/
@ -134,11 +153,25 @@
int nsh_archinitialize(void)
{
#ifdef HAVE_MMCSD
#if defined(HAVE_MMCSD) || defined(HAVE_W25)
int ret;
#endif
/* Initialize and register the W25 FLASH file system. */
#ifdef HAVE_W25
ret = stm32_w25initialize(CONFIG_NSH_W25MINOR);
if (ret < 0)
{
message("nsh_archinitialize: Failed to initialize W25 minor %d: %d\n",
CONFIG_NSH_W25MINOR, ret);
return ret;
}
#endif
/* Initialize the SDIO-based MMC/SD slot */
#ifdef HAVE_MMCSD
ret = stm32_sdinitialize(CONFIG_NSH_MMCSDMINOR);
if (ret < 0)
{

View File

@ -58,6 +58,7 @@
#define HAVE_MMCSD 1
#define HAVE_USBDEV 1
#define HAVE_USBHOST 1
#define HAVE_W25 1
/* Configuration ************************************************************/
/* SPI1 connects to the SD CARD (and to the SPI FLASH) */
@ -107,6 +108,24 @@
# endif
#endif
/* Can't support the W25 device if it SPI1 or W25 support is not enabled */
#if !defined(CONFIG_STM32_SPI1) || !defined(CONFIG_MTD_W25)
# undef HAVE_W25
#endif
/* Can't support W25 features if mountpoints are disabled */
#if defined(CONFIG_DISABLE_MOUNTPOINT)
# undef HAVE_W25
#endif
/* Default W25 minor number */
#if defined(HAVE_W25) && !defined(CONFIG_NSH_W25MINOR)
# define CONFIG_NSH_W25MINOR 0
#endif
/* Can't support USB host or device features if USB OTG FS is not enabled */
#ifndef CONFIG_STM32_OTGFS
@ -156,10 +175,22 @@
int nsh_archinitialize(void)
{
#if defined(HAVE_MMCSD) || defined(HAVE_USBHOST)
#if defined(HAVE_MMCSD) || defined(HAVE_USBHOST) || defined(HAVE_W25)
int ret;
#endif
/* Initialize and register the W25 FLASH file system. */
#ifdef HAVE_W25
ret = stm32_w25initialize(CONFIG_NSH_W25MINOR);
if (ret < 0)
{
message("nsh_archinitialize: Failed to initialize W25 minor %d: %d\n",
CONFIG_NSH_W25MINOR, ret);
return ret;
}
#endif
/* Initialize the SPI-based MMC/SD slot */
#ifdef HAVE_MMCSD