2009-02-16  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/spi_at91.c (cyg_spi_at91_bus_init): Partially revert change of
	2009-02-11. Define an empty CYGBLD_ATTRIB_C_INIT_PRI and rely on
	spi_at91_init.cxx to call, in case the compiler does not supply
	that macro (e.g. if too old).
	* cdl/spi_at91.cdl: Revert change of 2009-02-11.
	* src/spi_at91_init.cxx: Revive. Set priority to CYG_INIT_BUS_SPI.
	Conditionalise on CYGBLD_ATTRIB_C_INIT_PRI.

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

	* cdl/spi_at91.cdl: Add a requires for CYGPKG_ERROR.

2009-02-11  Bart Veer  <bartv@ecoscentric.com>

	* src/spi_at91.c (cyg_spi_at91_bus_init): turn into a prioritized
	constructor, make it a static and rename.

	* cdl/spi_at91.cdl: remove src/spi_at91_init.cxx
	
	* src/spi_at91_init.cxx: removed, no longer needed.

2008-10-19  Igor B. Poretsky <poretsky@mlbox.ru>
	
	* src/spi_at91.c: Typo fixes from var_io.h.

2006-09-27  Andrew Lunn  <andrew.lunn@ascom.ch>

	* src/spi_at91.c (spi_at91_transaction_begin): Don't use #ifdef
	inside a macro invocation. The compiler throws a wobbly.

2006-09-07  John Eigelaar <jeigelaar@mweb.co.za>

	* src/spi_at91.c: Fixed the chip select functions.
	Changed the Mode Register setup as to disable the Mode Failure
	Detaction for variants that support it. The Mode Failure Detection
	breaks because NPCS0 is not connected, we are using GPIO, and is 
	thus floating. 

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

	* cdl/spi_at91.cdl: get_config/set_config use error codes, so require
	CYGPKG_ERROR.

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

	* src/spi_at91.c (spi_at91_transfer): Make sure dumped SPI rx data
	at end is really the data rxed!

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

	* src/spi_at91.c (SPI_AT91_DELAY_US): Define new macro so
	we can call the appropriate delay function depending on whether
	virtual vectors are enabled or not. Use it throughout.

2007-10-29  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/spi_at91.c (spi_at91_transfer_polled): Give name to
	diag macro, so we can conditionalise some vars, to silence
	warnings.

2007-10-10  Nick Garnett  <nickg@ecoscentric.com>

	* src/spi_at91.c (spi_at91_calc_scbr): Add call to macros
	CYGHWR_AT91_SPI_SCBR_ADJUST() if it is defined to allow platform
	to modify SCBR value.
	(spi_at91_transfer): Widen scope of DSR lock avoiding a race
	between this code and the ISR/DSR.
	(spi_at91_transfer, spi_at91_transfer_polled): Only report
	received buffer if it is non-zero.

	* cdl/spi_at91.cdl: Add SAM9 to supported variants requirement.

2007-10-04  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/spi_at91.c (spi_at91_calc_scbr): Ensure SCBR is rounded up
	so the SPI bus clock runs at most as fast as the device description
	indicated.
	(spi_at91_transfer): Work around potential AT91 silicon bug when using
	PDC immediately after polled mode access. This mode of operation
	happens in the dataflash driver. Fixes bug #10000466.

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

	* src/spi_at91.c (spi_at91_transaction_tick): There must be FFs on the
	bus during a tick, not zeroes. Fixes MMC card problems.

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

	* src/spi_at91.c (spi_at91_calc_scbr): Remove unwanted times two
	divisor.

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

	* src/spi_at91.c (spi_at91_transfer): Unmask the appropriate interrupt,
	not just that for bus 0.

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

	* src/spi_at91.c: Ensure bus 1 has bus_num 1.

2006-11-02  Nick Garnett  <nickg@ecoscentric.com>

	* src/spi_at91.c: Fixed various problems resulting from last change.

2006-10-05  Nick Garnett  <nickg@ecoscentric.com>

	* src/spi_at91.c: 
	* include/spi_at91.h: Added support for	multiple busses.

	* cdl/spi_at91.cdl: Removed CYGHWR_DEVS_SPI_ARM_AT91_PCSDEC since
	it is no longer used.

2006-08-10  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/spi_at91.c (spi_at91_transfer): Interrupts must be disabled while
	doing a sync/invalidate.
	(spi_at91_transfer_polled): Add some default commented-out diag.

2005-11-07  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/spi_at91.c: Reference init object	that exists in
	spi_at91_init.cxx from each of the exported functions, so init is
	guaranteed.
	(cyg_spi_at91_bus_init): Move pin configuration to...
	(spi_at91_transaction_begin): ...here, so the pins are only configured
	when used.

	* src/spi_at91_init.cxx: Make init helper object global so it can
	be referenced as above.
	* cdl/spi_at91.cdl: spi_at91_init.cxx no longer needs to be built
	into extras.o (libextras.a).

2005-08-18  Nick Garnett  <nickg@ecoscentric.com>

	* src/spi_at91.c: Adapted to work with AT91RM9200 based systems as
	well as ARM7 AT91 systems.
	Added some debugging messages.

	* include/spi_at91.h: Added definitions of various macros that are
	defined by the AT91RM9200 HAL but not the AT91 HAL.

	* cdl/spi_at91.cdl: Expand HAL requirement to AT91RM9200 based
	systems. Revert change to CYGHWR_DEVS_SPI_ARM_AT91_PCSDEC.

2005-08-16  John Dallaway  <jld@ecoscentric.com>

	* cdl/spi_at91.cdl: Enable CYGHWR_DEVS_SPI_ARM_AT91_PCSDEC by
	default.

2005-08-04  Nick Garnett  <nickg@ecoscentric.com>

	* cdl/spi_at91.cdl:
	* include/spi_at91.h:
	* src/spi_at91.c:
	* src/spi_at91_init.cxx:
	Initial import into eCosCentric repository.

2004-11-11  Sebastian Block <sebastianblock@gmx.net>

	* src/spi_at91.c: Fixed negation of the chip select signal when
	not using a 4 to 16 decoder

2004-10-13  Savin Zlobec  <savin@elatec.si> 

	* src/spi_at91.c: Fixed a typo in spi_at91_transfer reported by
	Nicolas Brouard.

2004-08-31  Savin Zlobec  <savin@elatec.si> 

	* include/spi_at91.h:
	* src/spi_at91.c:
	Moved SPI registers and bits defines to HAL headers, added support 
	for 4 to 16 decoder of chip select signals, support for transfers 
	larger than 2^16 and per device configurable delay between two 
	transfers.  
	* cdl/spi_at91.cdl: 
	Added option to enable support for 4 to 16 decoder of chip select 
	signals.  

2004-08-27  Savin Zlobec  <savin@elatec.si> 

	* cdl/spi_at91.cdl:
	* include/spi_at91.h:
	* src/spi_at91.c:
	* src/spi_at91_init.cxx:
	Atmel AT91 SPI bus driver implementation.   	 



//===========================================================================
// ####GPLCOPYRIGHTBEGIN####                                                
// -------------------------------------------                              
// This file is part of eCos, the Embedded Configurable Operating System.   
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
// Copyright (C) 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####                                                  
//===========================================================================
