All USB MSC-related files under nuttx/configs changed to use the corrected syslog interfaces

This commit is contained in:
Gregory Nutt 2014-10-08 14:59:10 -06:00
parent f40857c04f
commit 8c1e954b84
22 changed files with 144 additions and 572 deletions

View File

@ -43,7 +43,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "stm32.h" #include "stm32.h"
@ -57,26 +57,6 @@
# define CONFIG_SYSTEM_USBMSC_DEVMINOR1 0 # define CONFIG_SYSTEM_USBMSC_DEVMINOR1 0
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "stm32.h" #include "stm32.h"
@ -56,26 +56,6 @@
# define CONFIG_SYSTEM_USBMSC_DEVMINOR1 0 # define CONFIG_SYSTEM_USBMSC_DEVMINOR1 0
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/sdio.h> #include <nuttx/sdio.h>
@ -74,27 +74,6 @@
# error "Unrecognized STM32 board" # error "Unrecognized STM32 board"
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -120,34 +99,31 @@ int usbmsc_archinitialize(void)
/* First, get an instance of the SDIO interface */ /* First, get an instance of the SDIO interface */
message("usbmsc_archinitialize: " syslog(LOG_INFO, "Initializing SDIO slot %d\n", STM32_MMCSDSLOTNO);
"Initializing SDIO slot %d\n",
STM32_MMCSDSLOTNO);
sdio = sdio_initialize(STM32_MMCSDSLOTNO); sdio = sdio_initialize(STM32_MMCSDSLOTNO);
if (!sdio) if (!sdio)
{ {
message("usbmsc_archinitialize: Failed to initialize SDIO slot %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
STM32_MMCSDSLOTNO); STM32_MMCSDSLOTNO);
return -ENODEV; return -ENODEV;
} }
/* Now bind the SDIO interface to the MMC/SD driver */ /* Now bind the SDIO interface to the MMC/SD driver */
message("usbmsc_archinitialize: " syslog(LOG_INFO,"Bind SDIO to the MMC/SD driver, minor=%d\n",
"Bind SDIO to the MMC/SD driver, minor=%d\n", CONFIG_SYSTEM_USBMSC_DEVMINOR1);
CONFIG_SYSTEM_USBMSC_DEVMINOR1);
ret = mmcsd_slotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, sdio); ret = mmcsd_slotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, sdio);
if (ret != OK) if (ret != OK)
{ {
message("usbmsc_archinitialize: " syslog(LOG_ERR, ""
"Failed to bind SDIO to the MMC/SD driver: %d\n", "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n",
ret); ret);
return ret; return ret;
} }
message("usbmsc_archinitialize: "
"Successfully bound SDIO to the MMC/SD driver\n"); syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n");
/* Then let's guess and say that there is a card in the slot. I need to check to /* Then let's guess and say that there is a card in the slot. I need to check to
* see if the Hy-Mini STM32v board supports a GPIO to detect if there is a card in * see if the Hy-Mini STM32v board supports a GPIO to detect if there is a card in

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/sdio.h> #include <nuttx/sdio.h>
@ -70,27 +70,6 @@
# error "Unrecognized Kinetis board" # error "Unrecognized Kinetis board"
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@ -70,27 +70,6 @@
# error "Unrecognized LPC17xx board" # error "Unrecognized LPC17xx board"
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -110,34 +89,34 @@ int usbmsc_archinitialize(void)
/* Get the SPI port */ /* Get the SPI port */
message("usbmsc_archinitialize: Initializing SPI port %d\n", syslog(LOG_INFO, "Initializing SPI port %d\n", LPC17XX_MMCSDSPIPORTNO);
LPC17XX_MMCSDSPIPORTNO);
spi = lpc17_sspinitialize(LPC17XX_MMCSDSPIPORTNO); spi = lpc17_sspinitialize(LPC17XX_MMCSDSPIPORTNO);
if (!spi) if (!spi)
{ {
message("usbmsc_archinitialize: Failed to initialize SPI port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO); LPC17XX_MMCSDSPIPORTNO);
return -ENODEV; return -ENODEV;
} }
message("usbmsc_archinitialize: Successfully initialized SPI port %d\n", syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO); LPC17XX_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */ /* Bind the SPI port to the slot */
message("usbmsc_archinitialize: Binding SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO); LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC17XX_MMCSDSLOTNO, spi); ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC17XX_MMCSDSLOTNO, spi);
if (ret < 0) if (ret < 0)
{ {
message("usbmsc_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", syslog(LOG_ERR,
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret); "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret);
return ret; return ret;
} }
message("usbmsc_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Successfully bound SPI port %d to MMC/SD slot %d\n",
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO); LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
return OK; return OK;
} }

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@ -70,27 +70,6 @@
# error "Unrecognized LPC214x board" # error "Unrecognized LPC214x board"
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -110,34 +89,36 @@ int usbmsc_archinitialize(void)
/* Get the SPI port */ /* Get the SPI port */
message("usbmsc_archinitialize: Initializing SPI port %d\n", syslog(LOG_INFO, "Initializing SPI port %d\n",
LPC214X_MMCSDSPIPORTNO); LPC214X_MMCSDSPIPORTNO);
spi = up_spiinitialize(LPC214X_MMCSDSPIPORTNO); spi = up_spiinitialize(LPC214X_MMCSDSPIPORTNO);
if (!spi) if (!spi)
{ {
message("usbmsc_archinitialize: Failed to initialize SPI port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
LPC214X_MMCSDSPIPORTNO); LPC214X_MMCSDSPIPORTNO);
return -ENODEV; return -ENODEV;
} }
message("usbmsc_archinitialize: Successfully initialized SPI port %d\n", syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
LPC214X_MMCSDSPIPORTNO); LPC214X_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */ /* Bind the SPI port to the slot */
message("usbmsc_archinitialize: Binding SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO); LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC214X_MMCSDSLOTNO, spi); ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1,
LPC214X_MMCSDSLOTNO, spi);
if (ret < 0) if (ret < 0)
{ {
message("usbmsc_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", syslog(LOG_ERR,
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO, ret); "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO, ret);
return ret; return ret;
} }
message("usbmsc_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Successfully bound SPI port %d to MMC/SD slot %d\n",
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO); LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO);
return OK; return OK;
} }

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@ -70,27 +70,6 @@
# error "Unrecognized LPC17xx board" # error "Unrecognized LPC17xx board"
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -110,34 +89,36 @@ int usbmsc_archinitialize(void)
/* Get the SPI port */ /* Get the SPI port */
message("usbmsc_archinitialize: Initializing SPI port %d\n", syslog(LOG_INFO, "Initializing SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO); LPC17XX_MMCSDSPIPORTNO);
spi = lpc17_sspinitialize(LPC17XX_MMCSDSPIPORTNO); spi = lpc17_sspinitialize(LPC17XX_MMCSDSPIPORTNO);
if (!spi) if (!spi)
{ {
message("usbmsc_archinitialize: Failed to initialize SPI port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO); LPC17XX_MMCSDSPIPORTNO);
return -ENODEV; return -ENODEV;
} }
message("usbmsc_archinitialize: Successfully initialized SPI port %d\n", syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO); LPC17XX_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */ /* Bind the SPI port to the slot */
message("usbmsc_archinitialize: Binding SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO); LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC17XX_MMCSDSLOTNO, spi); ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1,
LPC17XX_MMCSDSLOTNO, spi);
if (ret < 0) if (ret < 0)
{ {
message("usbmsc_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", syslog(LOG_ERR,
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret); "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret);
return ret; return ret;
} }
message("usbmsc_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Successfully bound SPI port %d to MMC/SD slot %d\n",
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO); LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
return OK; return OK;
} }

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@ -73,26 +73,6 @@
# error "Unrecognized LPC17xx board" # error "Unrecognized LPC17xx board"
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -116,36 +96,39 @@ int usbmsc_archinitialize(void)
/* Get the SPI port */ /* Get the SPI port */
message("usbmsc_archinitialize: Initializing SPI port %d\n", syslog(LOG_INFO, "Initializing SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO); LPC17XX_MMCSDSPIPORTNO);
spi = lpc17_sspinitialize(LPC17XX_MMCSDSPIPORTNO); spi = lpc17_sspinitialize(LPC17XX_MMCSDSPIPORTNO);
if (!spi) if (!spi)
{ {
message("usbmsc_archinitialize: Failed to initialize SPI port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO); LPC17XX_MMCSDSPIPORTNO);
ret = -ENODEV; ret = -ENODEV;
goto errout; goto errout;
} }
message("usbmsc_archinitialize: Successfully initialized SPI port %d\n", syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO); LPC17XX_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */ /* Bind the SPI port to the slot */
message("usbmsc_archinitialize: Binding SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO); LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC17XX_MMCSDSLOTNO, spi); ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1,
LPC17XX_MMCSDSLOTNO, spi);
if (ret < 0) if (ret < 0)
{ {
message("usbmsc_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", syslog(LOG_ERR,
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret); "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret);
goto errout; goto errout;
} }
message("usbmsc_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO,
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO); "Successfully bound SPI port %d to MMC/SD slot %d\n",
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
return OK; return OK;
/* Disable power to the SD/MMC via a GPIO. HIGH disables SD/MMC. */ /* Disable power to the SD/MMC via a GPIO. HIGH disables SD/MMC. */

View File

@ -6,14 +6,14 @@ index 3cc6323..ad42790 100644
* for all IO regions (Including the vector region). * for all IO regions (Including the vector region).
*/ */
+lowsyslog("Calling a1x_setupmappings\n"); // REMOVE ME +lowsyslog(LOG_INFO, "Calling a1x_setupmappings\n"); // REMOVE ME
a1x_setupmappings(); a1x_setupmappings();
/* Provide a special mapping for the IRAM interrupt vector positioned in /* Provide a special mapping for the IRAM interrupt vector positioned in
* high memory. * high memory.
*/ */
+lowsyslog("Calling a1x_vectormapping\n"); // REMOVE ME +lowsyslog(LOG_INFO, "Calling a1x_vectormapping\n"); // REMOVE ME
a1x_vectormapping(); a1x_vectormapping();
#endif /* CONFIG_ARCH_ROMPGTABLE */ #endif /* CONFIG_ARCH_ROMPGTABLE */
@ -21,19 +21,19 @@ index 3cc6323..ad42790 100644
* arm_vector.S * arm_vector.S
*/ */
+lowsyslog("Calling a1x_copyvectorblock\n"); // REMOVE ME +lowsyslog(LOG_INFO, "Calling a1x_copyvectorblock\n"); // REMOVE ME
a1x_copyvectorblock(); a1x_copyvectorblock();
/* Initialize the FPU */ /* Initialize the FPU */
#ifdef CONFIG_ARCH_FPU #ifdef CONFIG_ARCH_FPU
+lowsyslog("Calling arm_fpuconfig\n"); // REMOVE ME +lowsyslog(LOG_INFO, "Calling arm_fpuconfig\n"); // REMOVE ME
arm_fpuconfig(); arm_fpuconfig();
#endif #endif
/* Perform common, low-level chip initialization (might do nothing) */ /* Perform common, low-level chip initialization (might do nothing) */
+lowsyslog("Calling a1x_lowsetup\n"); // REMOVE ME +lowsyslog(LOG_INFO, "Calling a1x_lowsetup\n"); // REMOVE ME
a1x_lowsetup(); a1x_lowsetup();
/* Perform early serial initialization if we are going to use the serial /* Perform early serial initialization if we are going to use the serial
@ -41,7 +41,7 @@ index 3cc6323..ad42790 100644
*/ */
#ifdef USE_EARLYSERIALINIT #ifdef USE_EARLYSERIALINIT
+lowsyslog("Calling up_earlyserialinit\n"); // REMOVE ME +lowsyslog(LOG_INFO, "Calling up_earlyserialinit\n"); // REMOVE ME
up_earlyserialinit(); up_earlyserialinit();
#endif #endif
@ -49,7 +49,7 @@ index 3cc6323..ad42790 100644
*/ */
#ifdef CONFIG_BUILD_PROTECTED #ifdef CONFIG_BUILD_PROTECTED
+lowsyslog("Calling a1x_userspace\n"); // REMOVE ME +lowsyslog(LOG_INFO, "Calling a1x_userspace\n"); // REMOVE ME
a1x_userspace(); a1x_userspace();
#endif #endif
@ -57,9 +57,9 @@ index 3cc6323..ad42790 100644
* - Configuration of board specific resources (PIOs, LEDs, etc). * - Configuration of board specific resources (PIOs, LEDs, etc).
*/ */
+lowsyslog("Calling a1x_boardinitialize\n"); // REMOVE ME +lowsyslog(LOG_INFO, "Calling a1x_boardinitialize\n"); // REMOVE ME
a1x_boardinitialize(); a1x_boardinitialize();
+lowsyslog("Returning\n"); // REMOVE ME +lowsyslog(LOG_INFO, "Returning\n"); // REMOVE ME
} }
diff --git a/nuttx/arch/arm/src/armv7-a/arm_head.S b/nuttx/arch/arm/src/armv7-a/arm_head.S diff --git a/nuttx/arch/arm/src/armv7-a/arm_head.S b/nuttx/arch/arm/src/armv7-a/arm_head.S
index bce82d5..924bd24 100644 index bce82d5..924bd24 100644

View File

@ -44,28 +44,6 @@
/**************************************************************************** /****************************************************************************
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* Configuration ************************************************************/
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions

View File

@ -44,28 +44,6 @@
/**************************************************************************** /****************************************************************************
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* Configuration ************************************************************/
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/sdio.h> #include <nuttx/sdio.h>
@ -67,26 +67,6 @@
#undef SAM_MMCSDSLOTNO #undef SAM_MMCSDSLOTNO
#define SAM_MMCSDSLOTNO 0 #define SAM_MMCSDSLOTNO 0
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -106,34 +86,33 @@ int usbmsc_archinitialize(void)
/* First, get an instance of the SDIO interface */ /* First, get an instance of the SDIO interface */
message("usbmsc_archinitialize: " syslg(LOG_INFO, "Initializing SDIO slot %d\n",
"Initializing SDIO slot %d\n",
SAM_MMCSDSLOTNO); SAM_MMCSDSLOTNO);
sdio = sdio_initialize(SAM_MMCSDSLOTNO); sdio = sdio_initialize(SAM_MMCSDSLOTNO);
if (!sdio) if (!sdio)
{ {
message("usbmsc_archinitialize: Failed to initialize SDIO slot %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
SAM_MMCSDSLOTNO); SAM_MMCSDSLOTNO);
return -ENODEV; return -ENODEV;
} }
/* Now bind the SPI interface to the MMC/SD driver */ /* Now bind the SPI interface to the MMC/SD driver */
message("usbmsc_archinitialize: " syslog(LOG_INFO, ""
"Bind SDIO to the MMC/SD driver, minor=%d\n", "Bind SDIO to the MMC/SD driver, minor=%d\n",
CONFIG_SYSTEM_USBMSC_DEVMINOR1); CONFIG_SYSTEM_USBMSC_DEVMINOR1);
ret = mmcsd_slotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, sdio); ret = mmcsd_slotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, sdio);
if (ret != OK) if (ret != OK)
{ {
message("usbmsc_archinitialize: " syslog(LOG_ERR,
"Failed to bind SDIO to the MMC/SD driver: %d\n", "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n",
ret); ret);
return ret; return ret;
} }
message("usbmsc_archinitialize: "
"Successfully bound SDIO to the MMC/SD driver\n"); syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n");
/* Then let's guess and say that there is a card in the slot. I need to check to /* Then let's guess and say that there is a card in the slot. I need to check to
* see if the SAM3U10E-EVAL board supports a GPIO to detect if there is a card in * see if the SAM3U10E-EVAL board supports a GPIO to detect if there is a card in

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "sam4e-ek.h" #include "sam4e-ek.h"
@ -74,26 +74,6 @@
# undef CONFIG_SAM4EEK_HSMCI_BLOCKDEVICE # undef CONFIG_SAM4EEK_HSMCI_BLOCKDEVICE
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -114,7 +94,7 @@ int usbmsc_archinitialize(void)
int ret = sam_at25_automount(0); int ret = sam_at25_automount(0);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_at25_automount failed: %d\n", ret); syslog(LOG_ERR, "ERROR: sam_at25_automount failed: %d\n", ret);
} }
return ret; return ret;
@ -122,10 +102,10 @@ int usbmsc_archinitialize(void)
#elif defined(CONFIG_SAM4EEK_HSMCI_BLOCKDEVICE) #elif defined(CONFIG_SAM4EEK_HSMCI_BLOCKDEVICE)
/* Initialize the HSMCI driver */ /* Initialize the HSMCI driver */
ret = sam_hsmci_initialize(0); int ret = sam_hsmci_initialize(0);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_hsmci_initialize(0) failed: %d\n", ret); syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(0) failed: %d\n", ret);
} }
return ret; return ret;

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "sama5d3-xplained.h" #include "sama5d3-xplained.h"
@ -73,26 +73,6 @@
# undef HAVE_AT25 # undef HAVE_AT25
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -113,7 +93,7 @@ int usbmsc_archinitialize(void)
int ret = sam_at25_automount(AT25_MINOR); int ret = sam_at25_automount(AT25_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_at25_automount failed: %d\n", ret); syslog(LOG_ERR, "ERROR: sam_at25_automount failed: %d\n", ret);
} }
return ret; return ret;

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "sama5d3x-ek.h" #include "sama5d3x-ek.h"
@ -73,26 +73,6 @@
# undef HAVE_AT25 # undef HAVE_AT25
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -113,7 +93,7 @@ int usbmsc_archinitialize(void)
int ret = sam_at25_automount(AT25_MINOR); int ret = sam_at25_automount(AT25_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_at25_automount failed: %d\n", ret); syslog(LOG_ERR, "ERROR: sam_at25_automount failed: %d\n", ret);
} }
return ret; return ret;

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "sama5d4-ek.h" #include "sama5d4-ek.h"
@ -73,26 +73,6 @@
# undef HAVE_AT25 # undef HAVE_AT25
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -113,7 +93,7 @@ int usbmsc_archinitialize(void)
int ret = sam_at25_automount(AT25_MINOR); int ret = sam_at25_automount(AT25_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_at25_automount failed: %d\n", ret); syslog(LOG_ERR, "ERROR: sam_at25_automount failed: %d\n", ret);
} }
return ret; return ret;

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "stm32.h" #include "stm32.h"
@ -56,26 +56,6 @@
# define CONFIG_SYSTEM_USBMSC_DEVMINOR1 0 # define CONFIG_SYSTEM_USBMSC_DEVMINOR1 0
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/sdio.h> #include <nuttx/sdio.h>
@ -74,27 +74,6 @@
# error "Unrecognized STM32 board" # error "Unrecognized STM32 board"
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -110,7 +89,7 @@
int usbmsc_archinitialize(void) int usbmsc_archinitialize(void)
{ {
/* If system/usbmsc is built as an NSH command, then SD slot should /* If system/usbmsc is built as an NSH command, then SD slot should
* already have been initized in nsh_archinitialize() (see up_nsh.c). In * already have been initialized in nsh_archinitialize() (see up_nsh.c). In
* this case, there is nothing further to be done here. * this case, there is nothing further to be done here.
*/ */
@ -120,34 +99,31 @@ int usbmsc_archinitialize(void)
/* First, get an instance of the SDIO interface */ /* First, get an instance of the SDIO interface */
message("usbmsc_archinitialize: " syslog(LOG_INFO, "Initializing SDIO slot %d\n", STM32_MMCSDSLOTNO);
"Initializing SDIO slot %d\n",
STM32_MMCSDSLOTNO);
sdio = sdio_initialize(STM32_MMCSDSLOTNO); sdio = sdio_initialize(STM32_MMCSDSLOTNO);
if (!sdio) if (!sdio)
{ {
message("usbmsc_archinitialize: Failed to initialize SDIO slot %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
STM32_MMCSDSLOTNO); STM32_MMCSDSLOTNO);
return -ENODEV; return -ENODEV;
} }
/* Now bind the SDIO interface to the MMC/SD driver */ /* Now bind the SDIO interface to the MMC/SD driver */
message("usbmsc_archinitialize: " syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
"Bind SDIO to the MMC/SD driver, minor=%d\n", CONFIG_SYSTEM_USBMSC_DEVMINOR1);
CONFIG_SYSTEM_USBMSC_DEVMINOR1);
ret = mmcsd_slotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, sdio); ret = mmcsd_slotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, sdio);
if (ret != OK) if (ret != OK)
{ {
message("usbmsc_archinitialize: " syslog(LOG_ERR,
"Failed to bind SDIO to the MMC/SD driver: %d\n", "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n",
ret); ret);
return ret; return ret;
} }
message("usbmsc_archinitialize: "
"Successfully bound SDIO to the MMC/SD driver\n"); syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n");
/* Then let's guess and say that there is a card in the slot. I need to check to /* Then let's guess and say that there is a card in the slot. I need to check to
* see if the STM3210E-EVAL board supports a GPIO to detect if there is a card in * see if the STM3210E-EVAL board supports a GPIO to detect if there is a card in

View File

@ -43,7 +43,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@ -74,26 +74,6 @@
# error "Unrecognized AVR board" # error "Unrecognized AVR board"
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -113,23 +93,23 @@ int usbmsc_archinitialize(void)
/* Get the SPI port */ /* Get the SPI port */
message("Initializing SPI port\n"); syslog(LOG_INFO, "Initializing SPI port\n");
spi = up_spiinitialize(AVR_MMCSDSPIPORTNO); spi = up_spiinitialize(AVR_MMCSDSPIPORTNO);
if (!spi) if (!spi)
{ {
message("up_spiinitialize failed\n"); syslog(LOG_ERR, "ERROR: up_spiinitialize failed\n");
return -ENODEV; return -ENODEV;
} }
/* Bind the SPI port to the slot */ /* Bind the SPI port to the slot */
message("Binding SPI port to MMC/SD slot\n"); syslog(LOG_INFO, "Binding SPI port to MMC/SD slot\n");
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, AVR_MMCSDSLOTNO, spi); ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, AVR_MMCSDSLOTNO, spi);
if (ret < 0) if (ret < 0)
{ {
message("mmcsd_spislotinitialize failed: %d\n", ret); syslog(LOG_ERR, "ERROR: mmcsd_spislotinitialize failed: %d\n", ret);
return ret; return ret;
} }

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/sdio.h> #include <nuttx/sdio.h>
@ -70,27 +70,6 @@
# error "Unrecognized Kinetis board" # error "Unrecognized Kinetis board"
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/

View File

@ -42,7 +42,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "stm32.h" #include "stm32.h"
@ -57,26 +57,6 @@
# define CONFIG_SYSTEM_USBMSC_DEVMINOR1 VIEWTOOL_MMCSD_SLOTNO # define CONFIG_SYSTEM_USBMSC_DEVMINOR1 VIEWTOOL_MMCSD_SLOTNO
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/

View File

@ -47,7 +47,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@ -78,26 +78,6 @@
# error "Unrecognized LPC17xx board" # error "Unrecognized LPC17xx board"
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -117,34 +97,37 @@ int usbmsc_archinitialize(void)
/* Get the SPI port */ /* Get the SPI port */
message("usbmsc_archinitialize: Initializing SPI port %d\n", syslog(LOG_INFO, "Initializing SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO); LPC17XX_MMCSDSPIPORTNO);
zkit_spiinitialize(); zkit_spiinitialize();
spi = lpc17_spiinitialize(LPC17XX_MMCSDSPIPORTNO); spi = lpc17_spiinitialize(LPC17XX_MMCSDSPIPORTNO);
if (!spi) if (!spi)
{ {
message("usbmsc_archinitialize: Failed to initialize SPI port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO); LPC17XX_MMCSDSPIPORTNO);
return -ENODEV; return -ENODEV;
} }
message("usbmsc_archinitialize: Successfully initialized SPI port %d\n", syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO); LPC17XX_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */ /* Bind the SPI port to the slot */
message("usbmsc_archinitialize: Binding SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO); LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC17XX_MMCSDSLOTNO, spi); ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1,
LPC17XX_MMCSDSLOTNO, spi);
if (ret < 0) if (ret < 0)
{ {
message("usbmsc_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", syslog(LOG_ERR,
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret); "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret);
return ret; return ret;
} }
message("usbmsc_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Successfully bound SPI port %d to MMC/SD slot %d\n",
LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO); LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO);
return OK; return OK;
} }