There are a few things that should still depend on CONFIG_NSH_ARCHINT vs CONFIG_LIB_BOARDCTL

This commit is contained in:
Gregory Nutt 2016-02-04 14:14:43 -06:00
parent 3d5a2d5ca2
commit 7d30697408
18 changed files with 104 additions and 92 deletions

View File

@ -57,7 +57,7 @@
/* PORT and SLOT number probably depend on the board configuration */
#ifdef CONFIG_ARCH_BOARD_EAGLE100
#ifdef CONFIG_NSH_ARCHINIT
# undef NSH_HAVEUSBDEV
# define NSH_HAVEMMCSD 1
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 0
@ -71,10 +71,10 @@
# define CONFIG_NSH_MMCSDSLOTNO 0
# endif
#else
/* Add configuration for new LM3s boards here */
# error "Unrecognized lm3s board"
# undef NSH_HAVEUSBDEV
# undef NSH_HAVEMMCSD
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 0
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
#endif
/* Can't support USB features if USB is not enabled */

View File

@ -74,7 +74,7 @@
/* PORT and SLOT number depend on the board configuration */
#ifdef CONFIG_LIB_BOARDCTL
#ifdef CONFIG_NSH_ARCHINIT
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 0
# error "The LM3S6965 Eval Kit MMC/SD is on SSI0"
# undef CONFIG_NSH_MMCSDSPIPORTNO
@ -89,8 +89,11 @@
# define CONFIG_NSH_MMCSDMINOR 0
# endif
#else
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 0
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# undef CONFIG_NSH_MMCSDMINOR
# define CONFIG_NSH_MMCSDMINOR 0
#endif

View File

@ -61,7 +61,7 @@
/* PORT and SLOT number depend on the board configuration */
#ifdef CONFIG_LIB_BOARDCTL
#ifdef CONFIG_NSH_ARCHINIT
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 0
# error "The LM3S8962 Eval Kit MMC/SD is on SSI0"
# undef CONFIG_NSH_MMCSDSPIPORTNO
@ -79,8 +79,11 @@
# endif
#else
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 0
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# undef CONFIG_NSH_MMCSDMINOR
# define CONFIG_NSH_MMCSDMINOR 0
#endif

View File

@ -54,22 +54,17 @@
/* PORT and SLOT number probably depend on the board configuration */
#ifdef CONFIG_ARCH_BOARD_LPCXPRESSO
# define NSH_HAVEUSBDEV 1
# ifdef CONFIG_LPC17_SSP1
# define NSH_HAVEMMCSD 1
# else
# undef NSH_HAVEMMCSD
# endif
#define NSH_HAVEUSBDEV 1
#ifdef CONFIG_LPC17_SSP1
# define NSH_HAVEMMCSD 1
#else
# error "Unrecognized board"
# undef NSH_HAVEUSBDEV
# undef NSH_HAVEMMCSD
#endif
/* Do we have SPI support for MMC/SD? */
#ifdef NSH_HAVEMMCSD
#ifdef CONFIG_NSH_ARCHINIT
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 1
# error "The LPCXpresso MMC/SD is on SSP1"
# undef CONFIG_NSH_MMCSDSPIPORTNO
@ -80,6 +75,12 @@
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# endif
#else
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 1
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
#endif
#endif
/* Can't support USB device features if USB device is not enabled */

View File

@ -59,22 +59,17 @@
/* PORT and SLOT number probably depend on the board configuration */
#ifdef CONFIG_ARCH_BOARD_LPCXPRESSO
# define NSH_HAVEUSBDEV 1
# ifdef CONFIG_LPC17_SSP1
# define NSH_HAVEMMCSD 1
# else
# undef NSH_HAVEMMCSD
# endif
#define NSH_HAVEUSBDEV 1
#ifdef CONFIG_LPC17_SSP1
# define NSH_HAVEMMCSD 1
#else
# error "Unrecognized board"
# undef NSH_HAVEUSBDEV
# undef NSH_HAVEMMCSD
#endif
/* Do we have SPI support for MMC/SD? */
#ifdef NSH_HAVEMMCSD
#ifdef CONFIG_NSH_ARCHINIT
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 1
# error "The LPCXpresso MMC/SD is on SSP1"
# undef CONFIG_NSH_MMCSDSPIPORTNO
@ -85,6 +80,12 @@
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# endif
#else
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 1
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
#endif
#endif
/* Can't support USB device features if USB device is not enabled */
@ -109,14 +110,6 @@
# undef NSH_HAVEMMCSD
#endif /* CONFIG_LIB_BOARDCTL */
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -60,7 +60,7 @@
/* PORT and SLOT number depend on the board configuration */
#ifdef CONFIG_LIB_BOARDCTL
#ifdef CONFIG_NSH_ARCHINIT
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 1
# error "The LPC214x MMC/SD is on SPI1"
# undef CONFIG_NSH_MMCSDSPIPORTNO
@ -78,8 +78,11 @@
# endif
#else
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 1
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# undef CONFIG_NSH_MMCSDMINOR
# define CONFIG_NSH_MMCSDMINOR 0
#endif

View File

@ -60,7 +60,7 @@
/* PORT and SLOT number probably depend on the board configuration */
#ifdef CONFIG_LIB_BOARDCTL
#ifdef CONFIG_NSH_ARCHINIT
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 0
# error "The Nucleus-2G MMC/SD is on SSP0"
# undef CONFIG_NSH_MMCSDSPIPORTNO
@ -78,8 +78,11 @@
# endif
#else
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 0
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# undef CONFIG_NSH_MMCSDMINOR
# define CONFIG_NSH_MMCSDMINOR 0
#endif

View File

@ -66,7 +66,7 @@
/* MMC/SD is on SSP port 1. There is only a single slot, slot 0 */
#ifdef CONFIG_LIB_BOARDCTL
#ifdef CONFIG_NSH_ARCHINIT
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 1
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 1
@ -82,8 +82,11 @@
# endif
#else
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 1
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# undef CONFIG_NSH_MMCSDMINOR
# define CONFIG_NSH_MMCSDMINOR 0
#endif

View File

@ -57,10 +57,10 @@
/* PORT and SLOT number probably depend on the board configuration */
#ifdef CONFIG_ARCH_BOARD_OLIMEX_STRP711
# define NSH_HAVEUSBDEV 1
# ifdef CONFIG_STR71X_BSPI1
# define NSH_HAVEMMCSD 1
#define NSH_HAVEUSBDEV 1
#ifdef CONFIG_STR71X_BSPI1
# define NSH_HAVEMMCSD 1
# ifdef CONFIG_NSH_ARCHINIT
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 1
# error "The Olimex STR-P711 MMC/SD is on BSPI1"
# undef CONFIG_NSH_MMCSDSPIPORTNO
@ -72,12 +72,12 @@
# define CONFIG_NSH_MMCSDSLOTNO 0
# endif
# else
# undef NSH_HAVEMMCSD
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 0
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# endif
#else
/* Add configuration for new STR71x boards here */
# error "Unrecognized STR71x board"
# undef NSH_HAVEUSBDEV
# undef NSH_HAVEMMCSD
#endif

View File

@ -87,7 +87,9 @@
/* Make sure that the NSH configuration uses the slot */
# if !defined(CONFIG_NSH_MMCSDSLOTNO) || CONFIG_NSH_MMCSDSLOTNO != 0
# if !defined(CONFIG_NSH_MMCSDSLOTNO)
# define CONFIG_NSH_MMCSDSLOTNO 0
# elif CONFIG_NSH_MMCSDSLOTNO != 0
# warning "The PIC32 Starter Kit has only one slot (0)"
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0

View File

@ -86,7 +86,9 @@
* SD slot on the Mikroelektronica PIC32MX7 MMB).
*/
# if !defined(CONFIG_NSH_MMCSDSLOTNO) || CONFIG_NSH_MMCSDSLOTNO != 0
# if !defined(CONFIG_NSH_MMCSDSLOTNO)
# define CONFIG_NSH_MMCSDSLOTNO 0
# elif CONFIG_NSH_MMCSDSLOTNO != 0
# warning "The Mikroelektronika PIC32MX7 MMB has only one slot (0)"
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0

View File

@ -76,14 +76,10 @@
# if defined(CONFIG_NSH_MMCSDSLOTNO) && CONFIG_NSH_MMCSDSLOTNO != SAMDL_MMCSDSLOTNO
# error Only one MMC/SD slot: Slot 0 (CONFIG_NSH_MMCSDSLOTNO)
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO SAMDL_MMCSDSLOTNO
# endif
# if defined(CONFIG_NSH_MMCSDSPIPORTNO) && CONFIG_NSH_MMCSDSPIPORTNO != SPI_PORTNO
# error CONFIG_NSH_MMCSDSPIPORTNO must have the same value as SPI_PORTNO
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO SPI_PORTNO
# endif
/* Default MMC/SD minor number */

View File

@ -76,14 +76,10 @@
# if defined(CONFIG_NSH_MMCSDSLOTNO) && CONFIG_NSH_MMCSDSLOTNO != SAMDL_MMCSDSLOTNO
# error Only one MMC/SD slot: Slot 0 (CONFIG_NSH_MMCSDSLOTNO)
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO SAMDL_MMCSDSLOTNO
# endif
# if defined(CONFIG_NSH_MMCSDSPIPORTNO) && CONFIG_NSH_MMCSDSPIPORTNO != SPI_PORTNO
# error CONFIG_NSH_MMCSDSPIPORTNO must have the same value as SPI_PORTNO
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO SPI_PORTNO
# endif
/* Default MMC/SD minor number */

View File

@ -76,14 +76,10 @@
# if defined(CONFIG_NSH_MMCSDSLOTNO) && CONFIG_NSH_MMCSDSLOTNO != SAMDL_MMCSDSLOTNO
# error Only one MMC/SD slot: Slot 0 (CONFIG_NSH_MMCSDSLOTNO)
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO SAMDL_MMCSDSLOTNO
# endif
# if defined(CONFIG_NSH_MMCSDSPIPORTNO) && CONFIG_NSH_MMCSDSPIPORTNO != SPI_PORTNO
# error CONFIG_NSH_MMCSDSPIPORTNO must have the same value as SPI_PORTNO
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO SPI_PORTNO
# endif
/* Default MMC/SD minor number */

View File

@ -88,24 +88,12 @@
# if defined(CONFIG_NSH_MMCSDSLOTNO) && CONFIG_NSH_MMCSDSLOTNO != STM32_MMCSDSLOTNO
# error "Only one MMC/SD slot: Slot 0"
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO STM32_MMCSDSLOTNO
# endif
# ifndef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO STM32_MMCSDSLOTNO
# endif
/* Verify configured SPI port number */
# if defined(CONFIG_NSH_MMCSDSPIPORTNO) && CONFIG_NSH_MMCSDSPIPORTNO != STM32_MMCSDSPIPORTNO
# error "Only one MMC/SD port: SPI1"
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO STM32_MMCSDSPIPORTNO
# endif
# ifndef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO STM32_MMCSDSPIPORTNO
# endif
#endif
@ -183,7 +171,7 @@ int board_app_initialize(void)
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: Failed to initialize MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSLOTNO, ret);
STM32_MMCSDSLOTNO, ret);
return ret;
}
#endif

View File

@ -85,17 +85,26 @@
/* MMC/SD configuration */
#ifdef NSH_HAVE_MMCSD
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 2
# warning "The Sure PIC32MX MMC/SD is on SPI2"
# undef CONFIG_NSH_MMCSDSPIPORTNO
# ifdef CONFIG_NSH_ARCHINIT
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 2
# warning "The Sure PIC32MX MMC/SD is on SPI2"
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 2
# endif
# if !defined(CONFIG_NSH_MMCSDSLOTNO) || CONFIG_NSH_MMCSDSLOTNO != 0
# error "The Sure PIC32MX MMC/SD has only one slot (0)"
# warning CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# endif
# ifndef CONFIG_NSH_MMCSDMINOR
# define CONFIG_NSH_MMCSDMINOR 0
# endif
# else
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 2
# endif
# if !defined(CONFIG_NSH_MMCSDSLOTNO) || CONFIG_NSH_MMCSDSLOTNO != 0
# error "The Sure PIC32MX MMC/SD has only one slot (0)"
# warning CONFIG_NSH_MMCSDSLOTNO
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# endif
# ifndef CONFIG_NSH_MMCSDMINOR
# undef CONFIG_NSH_MMCSDMINOR
# define CONFIG_NSH_MMCSDMINOR 0
# endif
#endif

View File

@ -77,14 +77,21 @@
/* Do we have SPI support for MMC/SD? */
#ifdef NSH_HAVEMMCSD
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 0
# error "External MMC/SD on SSP0"
# undef CONFIG_NSH_MMCSDSPIPORTNO
# ifdef CONFIG_NSH_ARCHINIT
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 0
# error "External MMC/SD on SSP0"
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 0
# endif
# if !defined(CONFIG_NSH_MMCSDSLOTNO)
# error "Use MMC/SD slot 0 by default"
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# endif
# else
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 0
# endif
# if !defined(CONFIG_NSH_MMCSDSLOTNO)
# error "Use MMC/SD slot 0 by default"
# undef CONFIG_NSH_MMCSDSLOTNO
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# endif
#endif

View File

@ -78,13 +78,20 @@
/* Do we have SPI support for MMC/SD? */
#ifdef CONFIG_NSH_HAVEMMCSD
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 0
# error "The ZKit-arm MMC/SD is on SPI port 0"
# ifdef CONFIG_NSH_ARCHINIT
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 0
# error "The ZKit-arm MMC/SD is on SPI port 0"
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 0
# endif
# if !defined(CONFIG_NSH_MMCSDSLOTNO) || CONFIG_NSH_MMCSDSLOTNO != 0
# error "The ZKit-arm MMC/SD has only one slot (0)"
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# endif
# else
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 0
# endif
# if !defined(CONFIG_NSH_MMCSDSLOTNO) || CONFIG_NSH_MMCSDSLOTNO != 0
# error "The ZKit-arm MMC/SD has only one slot (0)"
# undef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# endif