2009-10-02  Nick Garnett  <nickg@ecoscentric.com>

	* src/mmcsd_bus.c (mmcsd_bus_initialise_card): Increase delay in
	SDv2 detection loop from 1 to 10 ms. Some newer cards, especially
	those marked as class 2, take much longer to initialize and the
	driver can time out before they are ready. 10ms seems the minimum
	we can get away with for these cards, but this value may need
	increasing further for future cards.

2009-06-03  Nick Garnett  <nickg@ecoscentric.com>

	* src/cardconfig.c (cyg_mmcsd_parse_csd): Add detection of MMC 1.2
	CSD version.

	* include/mmcsd_bus.h (cyg_mmcsd_card): Move csd_version to after
	registers. GCC 4.x makes this enum a single byte, which would
	misalign reg_scr in its original position. Older GCCs represent
	this enum with a whole word, so this didn't happen before. reg_scr
	needs to be word aligned since it can be the destination of a word
	copy in the hardware driver.

2008-12-19  Jonathan Larmour  <jifl@eCosCentric.com>

	* cdl/devs_disk_mmc.cdl: Add doc link for configuration tool.

2008-12-17  Jonathan Larmour  <jifl@eCosCentric.com>

	* doc/disk_mmc.sgml: Update doc with SPI device name change of
	2008-08-19.
	src/mmc_spi.c (mmc_spi_check_for_disk): Declare more constant
	arrays as const.

2008-11-13  Jonathan Larmour  <jifl@eCosCentric.com>

	* include/mmcsd_bus.h (MMCSD_REPLY_ERROR_ANY): Take extra param of
	card.
	(struct cyg_mmcsd_card): Add flag if illegal command is anticipated
	due to past probing during initialisation.
	(cyg_mmcsd_check_transfer_ok): Take extra param of card.
	* src/mmcsd_bus.c (cyg_mmcsd_check_tansfer_ok): Take extra card
	param and use it with updated use of MMCSD_REPLY_ERROR_ANY.
	Retry immediately on CRC error.
	Fix formatting of some debug params.
	(mmcsd_bus_select_card): Update use of MMCSD_REPLY_ERROR_ANY.
	(mmcsd_bus_initialise_card): Ditto.
	Also set/clear new illegal_cmd_expected card flag to allow ignoring
	errors due to past probing.
	(mmcsd_bus_disk_read): Update use of cyg_mmcsd_check_transfer_ok and
	MMCSD_REPLY_ERROR_ANY with card param.
	(mmcsd_bus_disk_write): Ditto.
	* src/mmcsd_bus_drvif.c (cyg_mmcsd_send_app_command): Update use of
	MMCSD_REPLY_ERROR_ANY.
	(cyg_mmcsd_read_register): Ditto.
	(cyg_mmcsd_send_command): Remove 2008-11-12 workaround for errors
	with SEND_OP_COND - now replaced by use of illegal_cmd_expected card
	flag.

2008-11-12  Jonathan Larmour  <jifl@eCosCentric.com>

	* cdl/devs_disk_mmc.cdl (CYGDBG_DEVS_DISK_MMCSD_BUS_DEBUG):
	Increase the allowed debug verbosity.
	* src/mmcsd_bus_drvif.c (DEBUG3): New macro for more verbose debug.
	(cyg_mmcsd_send_command): Output first 32-bits of response at
	debug level 3.	

	* src/mmcsd_bus_drvif.c (cyg_mmcsd_send_command): Workaround for
	issue #1000625. Ignore errors for SD SEND_OP_COND - if this is an
	older (SDv1?) card, then we may see an illegal command in response
	from a preceding SEND_IF_COND.

2008-10-23  Jonathan Larmour  <jifl@eCosCentric.com>

	* cdl/devs_disk_mmc.cdl: MMC/SPI driver should default to off if
	MMC/SD card bus driver is enabled.

2008-08-19  Andrew Lunn  <andrew.lunn@ascom.ch>

	* cdl/devs_disk_mmc.cdl: Renamed the device to /dev/mmcdiskX so
	that it is unique with respect to other disk drivers.

2008-06-14  Jonathan Larmour  <jifl@eCosCentric.com>

	* include/mmcsd_bus.h: Remove last_op_write cardflag. No longer
	relevant.
	* src/mmcsd_bus.c: Increase MMCSD_DATA_READY_RETRIES a lot - it's now
	only used for non-kernel configs.
	(mmcsd_bus_initialise_card): Remove last_op_write cardflag.
	(mmcsd_bus_disk_read): When in a kernel config, check the write
	timeout against the current time. For non-kernel configs, keep
	on with the dumb retry count.
	(mccsd_bus_disk_write): Ditto.

2007-05-30  Hajime Ishitani <pigmon@mail.snd.co.jp>

	* src/mmc_spi.c: Revise debug information with addition.
	Add idle to operational retry wait.
	* cdl/devs_disk_mmc.cdl: Add idle to operational retry wait parameter.

2008-05-08  Jonathan Larmour  <jifl@eCosCentric.com>

	* include/mmcsd_bus.h (struct cyg_mmcsd_card): Add timestamp
	and timeout to allow proper determination of when card should
	be ready after writes.
	Declare cyg_mmcsd_bus_ticks_per_1024ms and cyg_mmcsd_bus_us_per_tick
	globals to aid time-related calculations.
	Change cyg_mmcsd_check_transfer_ok declaration so that
	delay is in milliseconds, rather than a bool.
	* src/cardconfig.c (cyg_mmcsd_parse_csd): calculate card's
	write_timeout_ticks field.
	* src/mmcsd_bus.c: Rework delays in terms of above new
	globals.
	(mmcsd_bus_disk_init): Init these new globals.
	(cyg_mmcsd_check_transfer_ok): Update as per declaration.
	Adjust all calls to it in file accordingly.
	(mmcsd_bus_disk_read): Clear last_op_write flag.
	(mmcsd_bus_disk_write): Ditto.
	Check for timeout getting into transfer state.
	Set write_timestamp and set last_op_write flag.
	Work still remains to act on timestamp - this is unfinished.

2008-04-25  Jonathan Larmour  <jifl@eCosCentric.com>

	* cdl/devs_disk_mmc.cdl: Change doc link for new doc filename.
	* doc/disk_mmc.sgml: Document card bus and SD support.

2008-04-24  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/mmc_bus.c: Renamed to....
	* src/mmcsd_bus.c: New file. Comprehensive revision of driver,
	including addition of SD and SDHC support, and improved driver
	abstractions. Far too many changes to detail.
	* include/mmc_bus.h: Renamed to....
	* include/mmcsd_bus.h: New file. Incorporates some aspects
	which used to be in mmc_protocol.h which is no longer used by
	the MMC bus support. Again too many changes to detail.	
	* src/mmcsd_bus_drvif.c: New file to separate out many driver
	interactions.
	* src/cardconfig.c: New file to separate out card configuration
	parsing and debug.
	* include/mmcsd_cardconfig.h: New file, containing card config
	definitions.
	* cdl/devs_disk_mmc.cdl: Rework for SD changes. Build new
	source files. Add card detection and removeable media configuration.

2007-09-20  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/mmc_spi.c (mmc_spi_check_for_disk): Silence format mismatch
	warning on debug output.
	* src/mmc_bus.c (mmc_bus_check_for_disk): Ditto.

2007-06-27  Nick Garnett  <nickg@ecoscentric.com>

	* src/mmc_bus.c (mmc_bus_disk_lookup): 
	* src/mmc_spi.c (mmc_spi_disk_lookup): Initialize ident.sector_size.

2006-09-27  Sergei Gavrikov  <sg@sgs.gomel.by>

	* src/mmc_spi.c: (mmc_spi_disk_lookup): just fixed a missed
	semicolon.

2006-09-20  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/mmc_bus.c: DISK_FUNS, DISK_CHANNEL and DISK_CONTROLLER are now
	implicitly static.
	Update DISK_CHANNEL for new io/disk macro definition.

2006-04-05  John Dallaway  <jld@ecoscentric.com>

	* cdl/devs_disk_mmc.cdl: Add reference to package documentation.

2006-03-20  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/mmc_bus.c (mmc_bus_check_for_disk): Replace
	CYGSEM_DEVS_DISK_MMC_BUS_DETECT_FAT_BOOT with more general 
	CYGSEM_IO_DISK_DETECT_FAT_BOOT.
	* cdl/devs_disk_mmc.cdl: Remove
	CYGSEM_DEVS_DISK_MMC_BUS_DETECT_FAT_BOOT.
	But implement CYGINT_IO_DISK_DETECT_FAT_BOOT_DEFAULT so that
	general disk layer chooses an appropriate default.

2006-03-17  Jonathan Larmour  <jifl@eCosCentric.com>

	* include/mmc_bus.h (struct cyg_mmc_bus_device): Store underlying
	medium's read/write block length.
	* src/mmc_bus.c (mmc_bus_check_for_disk): Store underlying medium's
	read/write block length.
	API now requires sector reads to be with length of sectors not bytes.
	(mmc_bus_disk_lookup): Report medium block size to disk layer.
	(mmc_bus_disk_read): API now requires sector reads to be with length
	of sectors not bytes.
	(mmc_bus_disk_write): Ditto.
	* src/mmc_spi.c (struct cyg_mmc_spi_disk_info_t): Store underlying
	medium's read/write block length.
	(mmc_spi_check_for_disk): Store underlying medium's
	read/write block length.
	(mmc_spi_disk_lookup): Report medium block size to disk layer.
	(mmc_spi_disk_read): API now requires sector reads to be with length
	of sectors not bytes.
	(mmc_spi_disk_write): Ditto.

2005-12-21  Jonathan Larmour  <jifl@eCosCentric.com>

	* cdl/devs_disk_mmc.cdl: Add new option
	CYGSEM_DEVS_DISK_MMC_BUS_DETECT_FAT_BOOT to allow detection of FAT
	boot sectors in case disk is not partitioned (Windows can do this
	sometimes).
	* src/mmc_bus.c (mmc_bus_check_for_disk): Implement
	CYGSEM_DEVS_DISK_MMC_BUS_DETECT_FAT_BOOT behaviour by detecting FAT
	boot sector.
	(mmc_bus_disk_init): Only check error if init function called.
	(mmc_bus_disk_lookup): Determine number of cylinders correctly,
	just in case higher layer code needs it correct.

2005-12-12  Jonathan Larmour  <jifl@eCosCentric.com>

	* include/mmc_bus.h (cyg_mmc_bus): Now records currently selected
	device.
	(cyg_mmc_bus_funs): mmc_send_command method now takes bus argument
	as well, to allow for commands that operate on the bus, not a
	particular device.
	* include/mmc_protocol.h: Document commands with bit 7 set being
	device specific.
	* src/mmc_bus.c: Reduce GO_IDLE_RETRIES.
	(mmc_bus_select_card): New function. Allows sharing of common code.
	(mmc_bus_check_for_disk): Many trivial/cosmetic/comment changes.
	Remember to record CSD in card structure!
	Fix broken assert.
	Pretend card is connected when reading partition table.
	(mmc_bus_disk_changed): Use mmc_bus_select_card().
	Automatically loop if SEND_CID fails.
	(mmc_bus_disk_init): Init selected_device field.
	(mmc_bus_disk_lookup): If card gone, we return the error if
	disconnection failed.
	(mmc_bus_disk_lookup): Return error if disk connection
	callback fails.
	(mmc_bus_disk_read): Use mmc_bus_select_card().
	If card isn't ready to give data, we poll until it is. This should
	really really be in a separate thread.
	(mmc_bus_disk_write): Same changes mutatis mutandis as
	mmc_bus_disk_read().
	(mmc_bus_disk_get_config): deselect card if unmounted.

2005-10-28  Jonathan Larmour  <jifl@eCosCentric.com>

	* include/mmc_protocol.h: Move from src/ to here.
	* src/mmc_spi.c: Reflect above move.
	* include/mmc_bus.h: New file, with definitions of MMC card access
	via MMC bus.
	* src/mmc_bus.c: New file, implementing MMC card access by MMC
	bus.
	* cdl/devs_disk_mmc.cdl: CDL support for MMC card access via
	MMC bus.

2004-08-30  Bart Veer  <bartv@ecoscentric.com>

	* src/mmc_spi.c (mmc_spi_write_disk_block): disable background
	writes. Some MMC cards don't seem to implement this correctly so
	if you are trying to talking to another SPI device the MMC card
	still replies.

2004-07-03  Bart Veer  <bartv@ecoscentric.com>

	* src/mmc_spi.c (MMC_SPI_READ_DATA_TOKEN_RETRIES): increase the
	number of iterations. With some cards a read can occasionally take
	50* longer than normal.

2004-07-01  Bart Veer  <bartv@ecoscentric.com>

	* src/mmc_spi.c: reorganize write code, to work around problems
	with some cards.

2004-06-29  Bart Veer  <bartv@ecoscentric.com>

	* src/mmc_spi.c: some cards require an extra delay during a mount
	sequence, when doing the first read of a data block. Also added
	some recovery code to the mount code in case a previous session
	left the card still sending data.

2004-06-15  Bart Veer  <bartv@ecoscentric.com>

	* src/mmc_spi.c (mmc_spi_check_for_disk): allow platform HALs to
	customize the mount sequence.

	* doc/disk_mmc.sgml: document the above change.
	
2004-04-25  Bart Veer  <bartv@ecoscentric.com>

	* MMC package created

// ####GPLCOPYRIGHTBEGIN####                                                
// -------------------------------------------                              
// This file is part of eCos, the Embedded Configurable Operating System.   
// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
// Copyright (C) 2004, 2005, 2006, 2007, 2008 eCosCentric Limited           
//
// This program is free software; you can redistribute it and/or modify     
// it under the terms of the GNU General Public License as published by     
// the Free Software Foundation; either version 2 or (at your option) any   
// later version.                                                           
//
// This program is distributed in the hope that it will be useful, but      
// WITHOUT ANY WARRANTY; without even the implied warranty of               
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        
// General Public License for more details.                                 
//
// You should have received a copy of the GNU General Public License        
// along with this program; if not, write to the                            
// Free Software Foundation, Inc., 51 Franklin Street,                      
// Fifth Floor, Boston, MA  02110-1301, USA.                                
// -------------------------------------------                              
// ####GPLCOPYRIGHTEND####                                                  
