Zkit-ARM-1868: MMC/SD is on SPI, not SSP0. From Rashid Fatah

This commit is contained in:
Gregory Nutt 2013-09-17 17:08:46 -06:00
parent 14ac82c11c
commit 5ee2ab3a72
2 changed files with 118 additions and 53 deletions

View File

@ -65,6 +65,7 @@ CONFIG_ARCH="arm"
# CONFIG_ARCH_CHIP_DM320 is not set
# CONFIG_ARCH_CHIP_IMX is not set
# CONFIG_ARCH_CHIP_KINETIS is not set
# CONFIG_ARCH_CHIP_KL is not set
# CONFIG_ARCH_CHIP_LM is not set
CONFIG_ARCH_CHIP_LPC17XX=y
# CONFIG_ARCH_CHIP_LPC214X is not set
@ -72,15 +73,24 @@ CONFIG_ARCH_CHIP_LPC17XX=y
# CONFIG_ARCH_CHIP_LPC31XX is not set
# CONFIG_ARCH_CHIP_LPC43XX is not set
# CONFIG_ARCH_CHIP_NUC1XX is not set
# CONFIG_ARCH_CHIP_SAM3U is not set
# CONFIG_ARCH_CHIP_SAMA5 is not set
# CONFIG_ARCH_CHIP_SAM34 is not set
# CONFIG_ARCH_CHIP_STM32 is not set
# CONFIG_ARCH_CHIP_STR71X is not set
# CONFIG_ARCH_ARM7TDMI is not set
# CONFIG_ARCH_ARM926EJS is not set
# CONFIG_ARCH_ARM920T is not set
# CONFIG_ARCH_CORTEXM0 is not set
CONFIG_ARCH_CORTEXM3=y
# CONFIG_ARCH_CORTEXM4 is not set
# CONFIG_ARCH_CORTEXA5 is not set
# CONFIG_ARCH_CORTEXA8 is not set
CONFIG_ARCH_FAMILY="armv7-m"
CONFIG_ARCH_CHIP="lpc17xx"
# CONFIG_ARMV7M_USEBASEPRI is not set
CONFIG_ARCH_HAVE_CMNVECTOR=y
# CONFIG_ARMV7M_CMNVECTOR is not set
# CONFIG_ARCH_HAVE_FPU is not set
CONFIG_ARCH_HAVE_MPU=y
# CONFIG_ARMV7M_MPU is not set
@ -92,6 +102,7 @@ CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y
# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set
# CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL is not set
CONFIG_ARMV7M_OABI_TOOLCHAIN=y
# CONFIG_GPIO_IRQ is not set
#
# LPC17xx Configuration Options
@ -132,10 +143,11 @@ CONFIG_LPC17_UART0=y
# CONFIG_LPC17_UART1 is not set
# CONFIG_LPC17_UART2 is not set
# CONFIG_LPC17_UART3 is not set
# CONFIG_LPC17_UART4 is not set
# CONFIG_LPC17_CAN1 is not set
# CONFIG_LPC17_CAN2 is not set
# CONFIG_LPC17_SPI is not set
CONFIG_LPC17_SSP0=y
CONFIG_LPC17_SPI=y
# CONFIG_LPC17_SSP0 is not set
# CONFIG_LPC17_SSP1 is not set
# CONFIG_LPC17_I2C0 is not set
# CONFIG_LPC17_I2C1 is not set
@ -156,24 +168,14 @@ CONFIG_LPC17_SSP0=y
# CONFIG_LPC17_GPDMA is not set
# CONFIG_LPC17_FLASH is not set
#
# External Memory Configuration
#
#
# Serial driver options
#
# CONFIG_SERIAL_TERMIOS is not set
# CONFIG_UART0_FLOWCONTROL is not set
#
# ADC driver options
#
#
# CAN driver options
#
# CONFIG_GPIO_IRQ is not set
#
# I2C driver options
#
#
# Ethernet driver options
@ -187,18 +189,6 @@ CONFIG_NET_PRIORITY=0
# CONFIG_NET_HASH is not set
# CONFIG_NET_MULTICAST is not set
#
# USB device driver options
#
#
# USB host driver options
#
#
# External Memory Configuration
#
#
# Architecture Options
#
@ -212,14 +202,14 @@ CONFIG_ARCH_HAVE_VFORK=y
CONFIG_ARCH_STACKDUMP=y
# CONFIG_ENDIAN_BIG is not set
# CONFIG_ARCH_HAVE_RAMFUNCS is not set
CONFIG_ARCH_HAVE_RAMVECTORS=y
# CONFIG_ARCH_RAMVECTORS is not set
#
# Board Settings
#
CONFIG_BOARD_LOOPSPERMSEC=8079
# CONFIG_ARCH_CALIBRATION is not set
CONFIG_RAM_START=0x10000000
CONFIG_RAM_SIZE=32768
CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
CONFIG_ARCH_INTERRUPTSTACK=0
@ -232,6 +222,12 @@ CONFIG_BOOT_RUNFROMFLASH=y
# CONFIG_BOOT_RUNFROMSDRAM is not set
# CONFIG_BOOT_COPYTORAM is not set
#
# Boot Memory Configuration
#
CONFIG_RAM_START=0x10000000
CONFIG_RAM_SIZE=32768
#
# Board Selection
#
@ -245,6 +241,7 @@ CONFIG_ARCH_BOARD="zkit-arm-1769"
#
# Common Board Options
#
CONFIG_ARCH_HAVE_LEDS=y
CONFIG_ARCH_LEDS=y
CONFIG_NSH_MMCSDMINOR=0
CONFIG_NSH_MMCSDSLOTNO=0
@ -273,7 +270,6 @@ CONFIG_DEV_CONSOLE=y
# CONFIG_FDCLONE_DISABLE is not set
# CONFIG_FDCLONE_STDIO is not set
CONFIG_SDCLONE_DISABLE=y
# CONFIG_SCHED_WORKQUEUE is not set
CONFIG_SCHED_WAITPID=y
# CONFIG_SCHED_STARTHOOK is not set
# CONFIG_SCHED_ATEXIT is not set
@ -333,9 +329,11 @@ CONFIG_SPI=y
# CONFIG_SPI_OWNBUS is not set
# CONFIG_SPI_EXCHANGE is not set
# CONFIG_SPI_CMDDATA is not set
# CONFIG_SPI_BITBANG is not set
# CONFIG_RTC is not set
# CONFIG_WATCHDOG is not set
# CONFIG_ANALOG is not set
# CONFIG_AUDIO_DEVICES is not set
# CONFIG_BCH is not set
# CONFIG_INPUT is not set
# CONFIG_LCD is not set
@ -347,19 +345,43 @@ CONFIG_MMCSD_NSLOTS=1
# CONFIG_MMCSD_HAVECARDDETECT is not set
CONFIG_MMCSD_SPI=y
CONFIG_MMCSD_SPICLOCK=12500000
# CONFIG_MMCSD_SDIO is not set
CONFIG_MMCSD_SPIMODE=0
# CONFIG_ARCH_HAVE_SDIO is not set
# CONFIG_MTD is not set
# CONFIG_NETDEVICES is not set
CONFIG_NETDEVICES=y
# CONFIG_NETDEV_MULTINIC is not set
#
# External Ethernet MAC Device Support
#
# CONFIG_NET_DM90x0 is not set
# CONFIG_ENC28J60 is not set
# CONFIG_ENCX24J600 is not set
# CONFIG_NET_E1000 is not set
# CONFIG_NET_SLIP is not set
# CONFIG_NET_VNET is not set
#
# External Ethernet PHY Device Support
#
# CONFIG_ETH0_PHY_NONE is not set
# CONFIG_ETH0_PHY_KS8721 is not set
# CONFIG_ETH0_PHY_KSZ8051 is not set
CONFIG_ETH0_PHY_DP83848C=y
# CONFIG_ETH0_PHY_LAN8720 is not set
# CONFIG_ETH0_PHY_DM9161 is not set
# CONFIG_PIPES is not set
# CONFIG_PM is not set
# CONFIG_POWER is not set
# CONFIG_SENSORS is not set
# CONFIG_SERCOMM_CONSOLE is not set
CONFIG_SERIAL=y
# CONFIG_DEV_LOWCONSOLE is not set
# CONFIG_16550_UART is not set
CONFIG_ARCH_HAVE_UART0=y
#
# USART Configuration
#
CONFIG_MCU_SERIAL=y
CONFIG_STANDARD_SERIAL=y
CONFIG_UART0_SERIAL_CONSOLE=y
@ -374,6 +396,10 @@ CONFIG_UART0_BAUD=115200
CONFIG_UART0_BITS=8
CONFIG_UART0_PARITY=0
CONFIG_UART0_2STOP=0
# CONFIG_UART0_IFLOWCONTROL is not set
# CONFIG_UART0_OFLOWCONTROL is not set
# CONFIG_SERIAL_IFLOWCONTROL is not set
# CONFIG_SERIAL_OFLOWCONTROL is not set
# CONFIG_USBDEV is not set
# CONFIG_USBHOST is not set
# CONFIG_WIRELESS is not set
@ -392,12 +418,9 @@ CONFIG_UART0_2STOP=0
#
CONFIG_NET=y
CONFIG_ARCH_HAVE_PHY=y
# CONFIG_ETH0_PHY_KS8721 is not set
CONFIG_ETH0_PHY_DP83848C=y
# CONFIG_ETH0_PHY_LAN8720 is not set
# CONFIG_ETH0_PHY_DM9161 is not set
# CONFIG_NET_NOINTS is not set
# CONFIG_NET_MULTIBUFFER is not set
# CONFIG_NET_PROMISCUOUS is not set
# CONFIG_NET_IPv6 is not set
CONFIG_NSOCKET_DESCRIPTORS=8
CONFIG_NET_NACTIVESOCKETS=16
@ -425,6 +448,7 @@ CONFIG_NET_UDP=y
CONFIG_NET_UDP_CHECKSUMS=y
CONFIG_NET_UDP_CONNS=8
# CONFIG_NET_BROADCAST is not set
# CONFIG_NET_RXAVAIL is not set
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_PING=y
# CONFIG_NET_PINGADDRCONF is not set
@ -452,6 +476,7 @@ CONFIG_FAT_MAXFNAME=32
# CONFIG_NFS is not set
# CONFIG_FS_NXFFS is not set
# CONFIG_FS_ROMFS is not set
# CONFIG_FS_SMARTFS is not set
#
# System Logging
@ -467,10 +492,16 @@ CONFIG_FAT_MAXFNAME=32
#
# Memory Management
#
# CONFIG_MM_MULTIHEAP is not set
# CONFIG_MM_SMALL is not set
CONFIG_MM_REGIONS=2
# CONFIG_GRAN is not set
#
# Audio Support
#
# CONFIG_AUDIO is not set
#
# Binary Formats
#
@ -496,6 +527,7 @@ CONFIG_LIB_HOMEDIR="/"
# CONFIG_LIBM is not set
# CONFIG_NOPRINTF_FIELDWIDTH is not set
# CONFIG_LIBC_FLOATINGPOINT is not set
CONFIG_LIB_RAND_ORDER=1
# CONFIG_EOL_IS_CR is not set
# CONFIG_EOL_IS_LF is not set
# CONFIG_EOL_IS_BOTH_CRLF is not set
@ -511,9 +543,11 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512
# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set
#
# Non-standard Helper Functions
# Non-standard Library Support
#
# CONFIG_SCHED_WORKQUEUE is not set
# CONFIG_LIB_KBDCODEC is not set
# CONFIG_LIB_SLCDCODEC is not set
#
# Basic CXX Support
@ -534,6 +568,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512
#
# CONFIG_EXAMPLES_BUTTONS is not set
# CONFIG_EXAMPLES_CAN is not set
# CONFIG_EXAMPLES_CC3000BASIC is not set
# CONFIG_EXAMPLES_COMPOSITE is not set
# CONFIG_EXAMPLES_DHCPD is not set
# CONFIG_EXAMPLES_ELF is not set
@ -547,9 +582,10 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512
# CONFIG_EXAMPLES_IGMP is not set
# CONFIG_EXAMPLES_LCDRW is not set
# CONFIG_EXAMPLES_MM is not set
# CONFIG_EXAMPLES_MOUNT is not set
# CONFIG_EXAMPLES_MODBUS is not set
# CONFIG_EXAMPLES_MOUNT is not set
# CONFIG_EXAMPLES_NETTEST is not set
# CONFIG_EXAMPLES_NRF24L01TERM is not set
CONFIG_EXAMPLES_NSH=y
# CONFIG_EXAMPLES_NULL is not set
# CONFIG_EXAMPLES_NX is not set
@ -570,6 +606,9 @@ CONFIG_EXAMPLES_NSH=y
# CONFIG_EXAMPLES_ROMFS is not set
# CONFIG_EXAMPLES_SENDMAIL is not set
# CONFIG_EXAMPLES_SERLOOP is not set
# CONFIG_EXAMPLES_SLCD is not set
# CONFIG_EXAMPLES_SMART is not set
# CONFIG_EXAMPLES_TCPECHO is not set
# CONFIG_EXAMPLES_TELNETD is not set
# CONFIG_EXAMPLES_THTTPD is not set
# CONFIG_EXAMPLES_TIFF is not set
@ -583,6 +622,11 @@ CONFIG_EXAMPLES_NSH=y
# CONFIG_EXAMPLES_WATCHDOG is not set
# CONFIG_EXAMPLES_WGET is not set
#
# Graphics Support
#
# CONFIG_TIFF is not set
#
# Interpreters
#
@ -632,6 +676,7 @@ CONFIG_NSH_LIBRARY=y
# CONFIG_NSH_DISABLE_CAT is not set
# CONFIG_NSH_DISABLE_CD is not set
# CONFIG_NSH_DISABLE_CP is not set
# CONFIG_NSH_DISABLE_CMP is not set
# CONFIG_NSH_DISABLE_DD is not set
# CONFIG_NSH_DISABLE_ECHO is not set
# CONFIG_NSH_DISABLE_EXEC is not set
@ -668,9 +713,15 @@ CONFIG_NSH_LIBRARY=y
# CONFIG_NSH_DISABLE_USLEEP is not set
# CONFIG_NSH_DISABLE_WGET is not set
# CONFIG_NSH_DISABLE_XD is not set
#
# Configure Command Options
#
# CONFIG_NSH_CMDOPT_DF_H is not set
CONFIG_NSH_CODECS_BUFSIZE=128
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_MAXARGUMENTS=6
CONFIG_NSH_NESTDEPTH=3
# CONFIG_NSH_DISABLESCRIPT is not set
# CONFIG_NSH_DISABLEBG is not set
@ -717,6 +768,15 @@ CONFIG_NSH_MAX_ROUNDTRIP=20
#
# CONFIG_SYSTEM_INSTALL is not set
#
# FLASH Erase-all Command
#
#
# RAM test
#
# CONFIG_SYSTEM_RAMTEST is not set
#
# readline()
#
@ -746,3 +806,8 @@ CONFIG_READLINE_ECHO=y
#
# USB Monitor
#
#
# Zmodem Commands
#
# CONFIG_SYSTEM_ZMODEM is not set

View File

@ -63,7 +63,7 @@
#ifdef CONFIG_ARCH_BOARD_ZKITARM
# define CONFIG_NSH_HAVEUSBDEV 1
# ifdef CONFIG_LPC17_SSP0
# ifdef CONFIG_LPC17_SPI
# define CONFIG_NSH_HAVEMMCSD 1
# else
# undef CONFIG_NSH_HAVEMMCSD
@ -78,7 +78,7 @@
#ifdef CONFIG_NSH_HAVEMMCSD
# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 0
# error "The ZKit-arm MMC/SD is on SSP0"
# error "The ZKit-arm MMC/SD is on SPI port 0"
# undef CONFIG_NSH_MMCSDSPIPORTNO
# define CONFIG_NSH_MMCSDSPIPORTNO 0
# endif
@ -144,33 +144,33 @@
int nsh_archinitialize(void)
{
#ifdef CONFIG_NSH_HAVEMMCSD
FAR struct spi_dev_s *ssp;
FAR struct spi_dev_s *spi;
int ret;
/* Get the SSP port */
/* Get the SPI port */
ssp = lpc17_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!ssp)
spi = lpc17_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi)
{
message("nsh_archinitialize: Failed to initialize SSP port %d\n",
message("nsh_archinitialize: Failed to initialize SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV;
}
message("Successfully initialized SSP port %d\n",
message("Successfully initialized SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SSP port to the slot */
/* Bind the SPI port to the slot */
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, ssp);
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0)
{
message("nsh_archinitialize: Failed to bind SSP port %d to MMC/SD slot %d: %d\n",
message("nsh_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret;
}
message("Successfuly bound SSP port %d to MMC/SD slot %d\n",
message("Successfuly bound SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
#endif
return OK;