Prep for 0.4.7 release

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1837 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2009-05-29 15:36:48 +00:00
parent 88e63abfe1
commit 10784ad522
15 changed files with 89 additions and 151 deletions
+4 -3
View File
@@ -722,7 +722,7 @@
* sched/: pthread_create() must return a (non-negated) errno value on failure. * sched/: pthread_create() must return a (non-negated) errno value on failure.
* configs/eagle100/nsh: Add a NuttShell (NSH) configuration for the Eagle-100 * configs/eagle100/nsh: Add a NuttShell (NSH) configuration for the Eagle-100
0.4.7 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> 0.4.7 2009-05-29 Gregory Nutt <spudmonkey@racsa.co.cr>
* arch/arm/src/lm3s: Added an Ethernet driver for the LM3S6918 * arch/arm/src/lm3s: Added an Ethernet driver for the LM3S6918
* configs/eagle100/nettest: Added an examples/nettest configuration for the * configs/eagle100/nettest: Added an examples/nettest configuration for the
@@ -747,9 +747,10 @@
it possible to build NuttX for the Eagle100 using CodeSourcery 2009q1 toolchain it possible to build NuttX for the Eagle100 using CodeSourcery 2009q1 toolchain
and the devkitARM GNU toolchain. and the devkitARM GNU toolchain.
* configs/mcu123-lpc214x/src: Corrected some logic in the LPC2148 SPI receive block * configs/mcu123-lpc214x/src: Corrected some logic in the LPC2148 SPI receive block
logic. Re-verified SDC ver1.x support with 1Gb Toshiba SDC, 1Gb PNY SDC, 2Gb SanDisk SDC, logic. Re-verified SDC ver1.x support with 1Gb Toshiba SDC, 1Gb PNY SDC, and
and 4Gb Kingston SDHC. 4Gb Kingston SDHC. There are CMD0 issues with the 2Gb SanDisk SDC on this board.
* fs/fs_mount.c: Corrected error handling that could cause a deadlock on certain * fs/fs_mount.c: Corrected error handling that could cause a deadlock on certain
mount() failures. mount() failures.
0.4.8 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
+50 -72
View File
@@ -401,7 +401,7 @@
<td><br></td> <td><br></td>
<td> <td>
<p> <p>
<li>Generic driver for SPI-based MMC/SD cards.</li> <li>Generic driver for SPI-based MMC/SD/SDH cards.</li>
</p> </p>
</tr> </tr>
<tr> <tr>
@@ -687,8 +687,8 @@
</tr> </tr>
</table> </table>
<p><b>nuttx-0.4.6</b>. <p><b>nuttx-0.4.7</b>.
The 38<sup>th</sup> release of NuttX (nuttx-0.4.6) is available for download The 39<sup>th</sup> release of NuttX (nuttx-0.4.7) was made on May 29, 2009 and is available for download
from the <a href="http://sourceforge.net/project/showfiles.php?group_id=189573">SourceForge</a> from the <a href="http://sourceforge.net/project/showfiles.php?group_id=189573">SourceForge</a>
website. website.
The change log associated with the release is available <a href="#currentrelease">here</a>. The change log associated with the release is available <a href="#currentrelease">here</a>.
@@ -696,20 +696,22 @@
These unreleased changes are listed <a href="#pendingchanges">here</a>. These unreleased changes are listed <a href="#pendingchanges">here</a>.
</p> </p>
<p> <p>
The release features support for the <a href=" http://www.micromint.com/">Micromint</a> This release focuses on cleaning up and extending the Eagle100/LM3S6918 port released
Eagle-100 development board. in nuttx-0.4.6 and on improved MMC/SD support. New features include:
This board is based around, the Luminary LM3S6918 MCU. <ul>
This is the first ARM Cortex-M3 architecture supported by Nuttx. <li>
This initial, basic port includes timer and serial console with configurations to execute the NuttX OS test and to run the <a href="NuttShell.html">NuttShell (NSH)</a>. Improved reliably and additional drivers for the Eagle-100 board (LM3S6918
Work is still underway on this port and current plans are to have I2C, SSI, MMC/SD, and and Ethernet driver in the 0.4.7 release. ARM Cortex-M3). Additional drivers include Ethernet, SSI, and support for
the on-board LEDs and microSD cards.
</li>
<li>
The SPI-based MMC/SD driver was extended to support SDHC Version 2.xx cards.
</li>
</ul>
</p> </p>
<p> <p>
Additional work was done on the MXADS i.MX1 port, however, that work has been set aside In addition, this release includes several important bugfixes for the LM3S6918, the LPC2148,
until I complete work on the Eagle-100 (I also need to come up with a 3V power supply). the SPI-based MMC/SD driver, and to FAT32. See the ChangeLog for details of these bugfixes.
</p>
<p>
Other changes in this release include: Extensions to the SPI interface definition in order to handle 9-bit interfaces to displays.
Several bugs were fixed (see the <a href="#currentrelease">ChangeLog</a> for a complete list of changes).
</p> </p>
<table width ="100%"> <table width ="100%">
@@ -866,11 +868,10 @@
</p> </p>
<p> <p>
<b>STATUS:</b> <b>STATUS:</b>
This initial, basic release of this port has been verifed and included in NuttX The initial, release of this port was included in NuttX version 0.4.6.
version 0.4.6. The basic port includes timer and serial console with configurations The current port includes timer, serial console, Ethernet, SSI, and microSD support.
to execute the NuttX OS test and to run the <a href="NuttShell.html">NuttShell (NSH)</a>. There are working configurations the NuttX OS test, to run the <a href="NuttShell.html">NuttShell
Work is still underway on this port and current plans are to have I2C, SSI, MMC/SD, and (NSH)</a>, the NuttX networking test, and the uIP web server.
and Ethernet driver in the 0.4.7 release.
</p> </p>
</td> </td>
</tr> </tr>
@@ -1358,30 +1359,35 @@ Other memory:
</table> </table>
<pre><ul> <pre><ul>
nuttx-0.4.6 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt; nuttx-0.4.7 2009-05-29 Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
* Change SPI interface so that is can accomodate interfaces where the * arch/arm/src/lm3s: Added an Ethernet driver for the LM3S6918
number of bits per word is greater an 8 (such as with many 9-bit display * configs/eagle100/nettest: Added an examples/nettest configuration for the
interfaces). -- this might have broken a few things which will need to Micromint Eagle100 board.
be retested! * Documentation/NuttxPortingGuide.html: Added a section on NuttX device drivers.
* arch/arm/src/imx: Added i.MX SPI driver * configs/eagle100/httpd: Added an examples/uip configuration for the
* SPI: Add a method to set the number of bits per word. Also add an Micromint Eagle100 board.
alternative interface for so that (eventually) I can phase the sndblock * arch/arm/src/lm3s: Added an SSI driver for the LM3S6918
and recvblock methods and replace them with a single exchange method * examples/nsh: Added MMC/SD support for the LM3S6918
* Build: objcopy fails with toolchains that use newer GCC and binutils. The * arch/arm/src/lm3s: Fix logic for setting and clearing output GPIOs (critical
following arguments need to be included in the objcopy command line "-R .note fix!).
-R .note.gnu.build-id -R .comment" This has bin fixed in arch/arm/src/Makefile, * drivers/mmcsd: Found numerous errors in current MMC/SD SPI driver. Bad frequency
but other architectures may have the same problem. Thanks to Dave Marples calculation based on CSD settings, inappropriate timeouts, odd code that looks like
for verifying this. a bad search and replace. Also needs support for SDHC ver 2.x. New MMC/SD is
* configs/eagle100/ostest: Added support for the MicroMint Eagle100 board. largely redesigned and probably non-functional in the first check-in.
This board has a Luminary LM3S6918 Cortex-M3. Added a configuration to build * drivers/mmcsd: Changes verified on 4Gb Kingston microSHDC card and on a 2Gb
examples/ostest. SanDisk microSDC card on the Eagle100 platform.
* arch/arm/src/lpc214x: Add configuration option to enable fast GPIO (vs. * fs/fat: With the 4Gb card, the first tests of FAT32 were (finally) performed.
legacy, "slow" GPIO) for LPC214x. Found and corrected a problem that prevented use of FAT32: It was not updating
* arch/arm: Restructured the arch/arm directory structure to better suppor ARM the sector cache before checking the FAT32 FSINFO sector.
and Cortex-M3. * configs/eagle100/*/Make.defs: Added configuration options that should make
* sched/: pthread_create() must return a (non-negated) errno value on failure. it possible to build NuttX for the Eagle100 using CodeSourcery 2009q1 toolchain
* configs/eagle100/nsh: Add a NuttShell (NSH) configuration for the Eagle-100 and the devkitARM GNU toolchain.
* configs/mcu123-lpc214x/src: Corrected some logic in the LPC2148 SPI receive block
logic. Re-verified SDC ver1.x support with 1Gb Toshiba SDC, 1Gb PNY SDC, and
4Gb Kingston SDHC. There are CMD0 issues with the 2Gb SanDisk SDC on this board.
* fs/fs_mount.c: Corrected error handling that could cause a deadlock on certain
mount() failures.
pascal-0.1.2 2008-02-10 Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt; pascal-0.1.2 2008-02-10 Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
@@ -1412,35 +1418,7 @@ buildroot-0.1.5 2009-04-25 &lt;spudmonkey@racsa.co.cr&gt;
</table> </table>
<pre><ul> <pre><ul>
nuttx-0.4.7 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt; nuttx-0.4.8 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
* arch/arm/src/lm3s: Added an Ethernet driver for the LM3S6918
* configs/eagle100/nettest: Added an examples/nettest configuration for the
Micromint Eagle100 board.
* Documentation/NuttxPortingGuide.html: Added a section on NuttX device drivers.
* configs/eagle100/httpd: Added an examples/uip configuration for the
Micromint Eagle100 board.
* arch/arm/src/lm3s: Added an SSI driver for the LM3S6918
* examples/nsh: Added MMC/SD support for the LM3S6918
* arch/arm/src/lm3s: Fix logic for setting and clearing output GPIOs (critical
fix!).
* drivers/mmcsd: Found numerous errors in current MMC/SD SPI driver. Bad frequency
calculation based on CSD settings, inappropriate timeouts, odd code that looks like
a bad search and replace. Also needs support for SDHC ver 2.x. New MMC/SD is
largely redesigned and probably non-functional in the first check-in.
* drivers/mmcsd: Changes verified on 4Gb Kingston microSHDC card and on a 2Gb
SanDisk microSDC card on the Eagle100 platform.
* fs/fat: With the 4Gb card, the first tests of FAT32 were (finally) performed.
Found and corrected a problem that prevented use of FAT32: It was not updating
the sector cache before checking the FAT32 FSINFO sector.
* configs/eagle100/*/Make.defs: Added configuration options that should make
it possible to build NuttX for the Eagle100 using CodeSourcery 2009q1 toolchain
and the devkitARM GNU toolchain.
* configs/mcu123-lpc214x/src: Corrected some logic in the LPC2148 SPI receive block
logic. Re-verified SDC ver1.x support with 1Gb Toshiba SDC, 1Gb PNY SDC, 2Gb SanDisk SDC,
and 4Gb Kingston SDHC.
* fs/fs_mount.c: Corrected error handling that could cause a deadlock on certain
mount() failures.
pascal-0.1.3 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt; pascal-0.1.3 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
-3
View File
@@ -2183,9 +2183,6 @@ extern void up_ledoff(int led);
<li> <li>
<code>CONFIG_MMCSD_SPICLOCK</code>: Maximum SPI clock to drive MMC/SD card. Default is 20MHz. <code>CONFIG_MMCSD_SPICLOCK</code>: Maximum SPI clock to drive MMC/SD card. Default is 20MHz.
</li> </li>
<li>
<code>CONFIG_MMCSD_SYNCHRONIZE</code>: Special synchronization logic needed
</li>
</ul> </ul>
<h2>Network Support</h2> <h2>Network Support</h2>
+26
View File
@@ -884,3 +884,29 @@ in order to handle 9-bit interfaces to displays. Several bugs were fixed (see t
ChangeLog for a complete list of changes). ChangeLog for a complete list of changes).
This tarball contains a complete CVS snapshot from May 19, 2009. This tarball contains a complete CVS snapshot from May 19, 2009.
nuttx-0.4.7
^^^^^^^^^^^
This is the 39th release of NuttX. This release focuses on cleaning up and
extending the Eagle100/LM3S6918 port released in nuttx-0.4.6 and on improved
MMC/SD support. New features include:
o Improved reliably and additional drivers for the Eagle-100 board (LM3S6918
ARM Cortex-M3). Additional drivers include Ethernet, SSI, and support for
the on-board LEDs and microSD cards.
o The SPI-based MMC/SD driver was extended to support SDHC Version 2.xx cards.
In addition, this release includes several important bugfixes for the LM3S6918,
the LPC2148, the SPI-based MMC/SD driver, and to FAT32. See the ChangeLog for
details of these bugfixes.
This tarball contains a complete CVS snapshot from May 19, 2009.
+7 -1
View File
@@ -22,7 +22,7 @@ NuttX TODO List (Last updated April 12, 2009)
(1) ARM/C5471 (arch/arm/src/c5471/) (1) ARM/C5471 (arch/arm/src/c5471/)
(3) ARM/DM320 (arch/arm/src/dm320/) (3) ARM/DM320 (arch/arm/src/dm320/)
(2) ARM/i.MX (arch/arm/src/imx/) (2) ARM/i.MX (arch/arm/src/imx/)
(3) ARM/LPC214x (arch/arm/src/lpc214x/) (8) ARM/LPC214x (arch/arm/src/lpc214x/)
(4) ARM/STR71x (arch/arm/src/str71x/) (4) ARM/STR71x (arch/arm/src/str71x/)
(1) ARM/LM3S6918 (arch/arm/src/lm3s/) (1) ARM/LM3S6918 (arch/arm/src/lm3s/)
(4) pjrc-8052 / MCS51 (arch/pjrc-8051/) (4) pjrc-8052 / MCS51 (arch/pjrc-8051/)
@@ -511,6 +511,12 @@ o ARM/LPC214x (arch/arm/src/lpc214x/)
Status: Open Status: Open
Priority: Medium Priority: Medium
Desription: I am unable to initialize a 2Gb SanDisk microSD card (in adaptor) on the
the mcu123 board. The card fails to accept CMD0. Doesn't seem like a software
issue, but if anyone else sees the problem, I'd like to know.
Status: Open
Priority: Uncertain
o ARM/STR71x (arch/arm/src/str71x/) o ARM/STR71x (arch/arm/src/str71x/)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-1
View File
@@ -287,7 +287,6 @@ defconfig -- This is a configuration file similar to the Linux
Read/Write Read/Write
CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card. CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card.
Default is 20MHz. Default is 20MHz.
CONFIG_MMCSD_SYNCHRONIZE - Special synchronization logic needed
TCP/IP and UDP support via uIP TCP/IP and UDP support via uIP
CONFIG_NET - Enable or disable all network features CONFIG_NET - Enable or disable all network features
-3
View File
@@ -359,13 +359,10 @@ CONFIG_FS_ROMFS=n
# Provide read-only access (default is read/write) # Provide read-only access (default is read/write)
# CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card. # CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card.
# Default is 20MHz. # Default is 20MHz.
# CONFIG_MMCSD_SYNCHRONIZE
# Special synchronization logic needed
# #
CONFIG_MMCSD_NSLOTS=1 CONFIG_MMCSD_NSLOTS=1
CONFIG_MMCSD_READONLY=n CONFIG_MMCSD_READONLY=n
CONFIG_MMCSD_SPICLOCK=12500000 CONFIG_MMCSD_SPICLOCK=12500000
CONFIG_MMCSD_SYNCHRONIZE=n
# #
# TCP/IP and UDP support via uIP # TCP/IP and UDP support via uIP
-3
View File
@@ -359,13 +359,10 @@ CONFIG_FS_ROMFS=n
# Provide read-only access (default is read/write) # Provide read-only access (default is read/write)
# CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card. # CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card.
# Default is 20MHz. # Default is 20MHz.
# CONFIG_MMCSD_SYNCHRONIZE
# Special synchronization logic needed
# #
CONFIG_MMCSD_NSLOTS=1 CONFIG_MMCSD_NSLOTS=1
CONFIG_MMCSD_READONLY=n CONFIG_MMCSD_READONLY=n
CONFIG_MMCSD_SPICLOCK=12500000 CONFIG_MMCSD_SPICLOCK=12500000
CONFIG_MMCSD_SYNCHRONIZE=n
# #
# TCP/IP and UDP support via uIP # TCP/IP and UDP support via uIP
-3
View File
@@ -358,13 +358,10 @@ CONFIG_FS_ROMFS=n
# Provide read-only access (default is read/write) # Provide read-only access (default is read/write)
# CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card. # CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card.
# Default is 20MHz. # Default is 20MHz.
# CONFIG_MMCSD_SYNCHRONIZE
# Special synchronization logic needed
# #
CONFIG_MMCSD_NSLOTS=1 CONFIG_MMCSD_NSLOTS=1
CONFIG_MMCSD_READONLY=n CONFIG_MMCSD_READONLY=n
CONFIG_MMCSD_SPICLOCK=12500000 CONFIG_MMCSD_SPICLOCK=12500000
CONFIG_MMCSD_SYNCHRONIZE=n
# #
# TCP/IP and UDP support via uIP # TCP/IP and UDP support via uIP
-3
View File
@@ -358,13 +358,10 @@ CONFIG_FS_ROMFS=n
# Provide read-only access (default is read/write) # Provide read-only access (default is read/write)
# CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card. # CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card.
# Default is 20MHz. # Default is 20MHz.
# CONFIG_MMCSD_SYNCHRONIZE
# Special synchronization logic needed
# #
CONFIG_MMCSD_NSLOTS=1 CONFIG_MMCSD_NSLOTS=1
CONFIG_MMCSD_READONLY=n CONFIG_MMCSD_READONLY=n
CONFIG_MMCSD_SPICLOCK=12500000 CONFIG_MMCSD_SPICLOCK=12500000
CONFIG_MMCSD_SYNCHRONIZE=n
# #
# TCP/IP and UDP support via uIP # TCP/IP and UDP support via uIP
-3
View File
@@ -309,13 +309,10 @@ CONFIG_FS_ROMFS=n
# Provide read-only access (default is read/write) # Provide read-only access (default is read/write)
# CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card. # CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card.
# Default is 20MHz. # Default is 20MHz.
# CONFIG_MMCSD_SYNCHRONIZE
# Special synchronization logic needed
# #
CONFIG_MMCSD_NSLOTS=1 CONFIG_MMCSD_NSLOTS=1
CONFIG_MMCSD_READONLY=n CONFIG_MMCSD_READONLY=n
#CONFIG_MMCSD_SPICLOCK=20000000 #CONFIG_MMCSD_SPICLOCK=20000000
CONFIG_MMCSD_SYNCHRONIZE=y
# #
# SPI-based MMC/SD driver # SPI-based MMC/SD driver
-3
View File
@@ -305,13 +305,10 @@ CONFIG_FS_ROMFS=n
# Provide read-only access (default is read/write) # Provide read-only access (default is read/write)
# CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card. # CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card.
# Default is 20MHz. # Default is 20MHz.
# CONFIG_MMCSD_SYNCHRONIZE
# Special synchronization logic needed
# #
CONFIG_MMCSD_NSLOTS=1 CONFIG_MMCSD_NSLOTS=1
CONFIG_MMCSD_READONLY=n CONFIG_MMCSD_READONLY=n
#CONFIG_MMCSD_SPICLOCK=20000000 #CONFIG_MMCSD_SPICLOCK=20000000
CONFIG_MMCSD_SYNCHRONIZE=y
# #
# TCP/IP and UDP support via uIP # TCP/IP and UDP support via uIP
@@ -310,13 +310,10 @@ CONFIG_FS_ROMFS=n
# Provide read-only access (default is read/write) # Provide read-only access (default is read/write)
# CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card. # CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card.
# Default is 20MHz. # Default is 20MHz.
# CONFIG_MMCSD_SYNCHRONIZE
# Special synchronization logic needed
# #
CONFIG_MMCSD_NSLOTS=1 CONFIG_MMCSD_NSLOTS=1
CONFIG_MMCSD_READONLY=n CONFIG_MMCSD_READONLY=n
#CONFIG_MMCSD_SPICLOCK=20000000 #CONFIG_MMCSD_SPICLOCK=20000000
CONFIG_MMCSD_SYNCHRONIZE=y
# #
# TCP/IP and UDP support via uIP # TCP/IP and UDP support via uIP
@@ -310,13 +310,10 @@ CONFIG_FS_ROMFS=n
# Provide read-only access (default is read/write) # Provide read-only access (default is read/write)
# CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card. # CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card.
# Default is 20MHz. # Default is 20MHz.
# CONFIG_MMCSD_SYNCHRONIZE
# Special synchronization logic needed
# #
CONFIG_MMCSD_NSLOTS=1 CONFIG_MMCSD_NSLOTS=1
CONFIG_MMCSD_READONLY=n CONFIG_MMCSD_READONLY=n
#CONFIG_MMCSD_SPICLOCK=20000000 #CONFIG_MMCSD_SPICLOCK=20000000
CONFIG_MMCSD_SYNCHRONIZE=y
# #
# TCP/IP and UDP support via uIP # TCP/IP and UDP support via uIP
+2 -47
View File
@@ -168,9 +168,6 @@ static void mmcsd_semtake(sem_t *sem);
/* Card SPI interface *******************************************************/ /* Card SPI interface *******************************************************/
#ifdef CONFIG_MMCSD_SYNCHRONIZE
static inline void mmcsd_synchronize(FAR struct mmcsd_slot_s *slot);
#endif
static int mmcsd_waitready(FAR struct mmcsd_slot_s *slot); static int mmcsd_waitready(FAR struct mmcsd_slot_s *slot);
static uint32 mmcsd_sendcmd(FAR struct mmcsd_slot_s *slot, static uint32 mmcsd_sendcmd(FAR struct mmcsd_slot_s *slot,
const struct mmcsd_cmdinfo_s *cmd, uint32 arg); const struct mmcsd_cmdinfo_s *cmd, uint32 arg);
@@ -346,38 +343,6 @@ static void mmcsd_semtake(sem_t *sem)
#define mmcsd_semgive(sem) sem_post(sem) #define mmcsd_semgive(sem) sem_post(sem)
/****************************************************************************
* Name: mmcsd_synchronize
*
* Description:
* Wait until the the card is no longer busy
*
* Assumptions:
* MMC/SD card already selected
*
****************************************************************************/
#ifdef CONFIG_MMCSD_SYNCHRONIZE
static inline void mmcsd_synchronize(FAR struct mmcsd_slot_s *slot)
{
FAR struct spi_dev_s *spi = slot->spi;
/* De-select the MMCSD card */
SPI_SELECT(spi, SPIDEV_MMCSD, FALSE);
/* Wait a bit */
SPI_SEND(spi, 0xff);
/* Reselect the card */
SPI_SELECT(spi, SPIDEV_MMCSD, TRUE);
}
#else
# define mmcsd_synchronize(slot) /* No synchronization needed */
#endif
/**************************************************************************** /****************************************************************************
* Name: mmcsd_waitready * Name: mmcsd_waitready
* *
@@ -848,7 +813,6 @@ static int mmcsd_getcardinfo(FAR struct mmcsd_slot_s *slot, ubyte *buffer,
/* Send the CMD9 or CMD10 */ /* Send the CMD9 or CMD10 */
mmcsd_synchronize(slot);
result = mmcsd_sendcmd(slot, cmd, 0); result = mmcsd_sendcmd(slot, cmd, 0);
if (result != MMCSD_SPIR1_OK) if (result != MMCSD_SPIR1_OK)
{ {
@@ -1141,11 +1105,10 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer,
fvdbg("nbytes=%d byte offset=%d\n", nbytes, offset); fvdbg("nbytes=%d byte offset=%d\n", nbytes, offset);
} }
/* Select the slave and synchronize */ /* Select the slave */
mmcsd_semtake(&slot->sem); mmcsd_semtake(&slot->sem);
SPI_SELECT(spi, SPIDEV_MMCSD, TRUE); SPI_SELECT(spi, SPIDEV_MMCSD, TRUE);
mmcsd_synchronize(slot);
/* Single or multiple block read? */ /* Single or multiple block read? */
@@ -1303,11 +1266,10 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer,
} }
mmcsd_dumpbuffer(buffer, nbytes); mmcsd_dumpbuffer(buffer, nbytes);
/* Select the slave and synchronize */ /* Select the slave */
mmcsd_semtake(&slot->sem); mmcsd_semtake(&slot->sem);
SPI_SELECT(spi, SPIDEV_MMCSD, TRUE); SPI_SELECT(spi, SPIDEV_MMCSD, TRUE);
mmcsd_synchronize(slot);
/* Single or multiple block transfer? */ /* Single or multiple block transfer? */
@@ -1597,11 +1559,9 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot)
do do
{ {
fvdbg("%d. Send CMD55/ACMD41\n", elapsed); fvdbg("%d. Send CMD55/ACMD41\n", elapsed);
mmcsd_synchronize(slot);
result = mmcsd_sendcmd(slot, &g_cmd55, 0); result = mmcsd_sendcmd(slot, &g_cmd55, 0);
if (result == MMCSD_SPIR1_IDLESTATE || result == MMCSD_SPIR1_OK) if (result == MMCSD_SPIR1_IDLESTATE || result == MMCSD_SPIR1_OK)
{ {
mmcsd_synchronize(slot);
result = mmcsd_sendcmd(slot, &g_acmd41, 1 << 30); result = mmcsd_sendcmd(slot, &g_acmd41, 1 << 30);
if (result == MMCSD_SPIR1_OK) if (result == MMCSD_SPIR1_OK)
{ {
@@ -1644,13 +1604,11 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot)
/* Both the MMC card and the SD card support CMD55 */ /* Both the MMC card and the SD card support CMD55 */
fvdbg("Send CMD55/ACMD41\n"); fvdbg("Send CMD55/ACMD41\n");
mmcsd_synchronize(slot);
result = mmcsd_sendcmd(slot, &g_cmd55, 0); result = mmcsd_sendcmd(slot, &g_cmd55, 0);
if (result == MMCSD_SPIR1_IDLESTATE || result == MMCSD_SPIR1_OK) if (result == MMCSD_SPIR1_IDLESTATE || result == MMCSD_SPIR1_OK)
{ {
/* But ACMD41 is supported only on SD */ /* But ACMD41 is supported only on SD */
mmcsd_synchronize(slot);
result = mmcsd_sendcmd(slot, &g_acmd41, 0); result = mmcsd_sendcmd(slot, &g_acmd41, 0);
if (result == MMCSD_SPIR1_IDLESTATE || result == MMCSD_SPIR1_OK) if (result == MMCSD_SPIR1_IDLESTATE || result == MMCSD_SPIR1_OK)
{ {
@@ -1668,11 +1626,9 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot)
if (IS_SD(slot->type)) if (IS_SD(slot->type))
{ {
fvdbg("%d. Send CMD55/ACMD41\n", elapsed); fvdbg("%d. Send CMD55/ACMD41\n", elapsed);
mmcsd_synchronize(slot);
result = mmcsd_sendcmd(slot, &g_cmd55, 0); result = mmcsd_sendcmd(slot, &g_cmd55, 0);
if (result == MMCSD_SPIR1_IDLESTATE || result == MMCSD_SPIR1_OK) if (result == MMCSD_SPIR1_IDLESTATE || result == MMCSD_SPIR1_OK)
{ {
mmcsd_synchronize(slot);
result = mmcsd_sendcmd(slot, &g_acmd41, 0); result = mmcsd_sendcmd(slot, &g_acmd41, 0);
if (result == MMCSD_SPIR1_OK) if (result == MMCSD_SPIR1_OK)
{ {
@@ -1683,7 +1639,6 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot)
else else
{ {
fvdbg("%d. Send CMD1\n", i); fvdbg("%d. Send CMD1\n", i);
mmcsd_synchronize(slot);
result = mmcsd_sendcmd(slot, &g_cmd1, 0); result = mmcsd_sendcmd(slot, &g_cmd1, 0);
if (result == MMCSD_SPIR1_OK) if (result == MMCSD_SPIR1_OK)
{ {