summaryrefslogtreecommitdiff
path: root/drivers/spi
AgeCommit message (Collapse)Author
2011-02-08SPI: Fix of warnings and cleanup.Markus Helgesson
Fixed coverity and compiler warning in drivers/spi/u8500_spi.c. Also removed a variable which is no longer needed after the GPIO-handling was removed from the driver. ST-Ericsson ID: None ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Iea067014c2c2ea4bd4367eccbe1cde36c69e01da Signed-off-by: Markus Helgesson <markus.helgesson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13763 Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com> Reviewed-by: QATOOLS Reviewed-by: Joakim AXELSSON <joakim.axelsson@stericsson.com>
2010-12-08db8500: New GPIO driver and config, from Linux kernelJoakim Axelsson
Copied the GPIO configurator written for the Linux kernel. The Nomadik db8500 GPIO driver. Purpose is to be able to just cut-n-paste the GPIO config from Linux to U-boot. Also at the same time remove the obsolete and old gpio_alt_funcenable/disable methods. Now all is configured using a table in u8500.c. Now drivers doesn't have to worry about setting up the GPIO pins. Actually no driver today uses GPIO pins directly, only via hardware blocks within db8500. Functions are still added to be able to interact directly with a GPIO pin. This also cleaned up a lot of driver by not having to bit manipulate GPIO registers them self. The new driver is called db8500_gpio and placed in driver/gpio/. Functions are in include/db8500_gpio.h: void db8500_gpio_set_pull(unsigned gpio, enum db8500_gpio_pull pull); void db8500_gpio_make_input(unsigned gpio); int db8500_gpio_get_input(unsigned gpio); void db8500_gpio_make_output(unsigned gpio, int val); void db8500_gpio_set_output(unsigned gpio, int val); And for the configurator in include/db8500_pincfg.h: void db8500_gpio_config_pins(pin_cfg_t *cfgs, size_t num); All in all the final binary size has decreased. This is only done for db8500 nomadik GPIO. The code for gpio expanders has not been touched. All references to Nomadik has been removed in this driver. Only db8500 is left. ST-Ericsson ID: None Signed-off-by: Joakim Axelsson <joakim.axelsson@stericsson.com> Change-Id: I90aa1d46c813ffb5a777c3492b5751f5054f71cf Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/9904 Reviewed-by: QATOOLS Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com>
2010-12-08db8500: Move all clock code from board to SoCJoakim Axelsson
Moved clock code from board/st/u8500/u8500.c to cpu/arm_cortexa9/db8500/clock.c. Remove code to simulate Maja clocks. ST-Ericsson ID: None Signed-off-by: Joakim Axelsson <joakim.axelsson@stericsson.com> Change-Id: Ibbb21d53091ceaddcc01e1a195e129039f986696 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/7114 Reviewed-by: QATOOLS Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com> Tested-by: Michael BRANDT <michael.brandt@stericsson.com>
2010-11-04U8500: Add support for SPIMarkus Helgesson
Added SPI support for U8500 ST-Ericsson ID: 269867 ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-10121 Change-Id: Ied17dd39aa1ebc0ee95818c59c7f211ce655b8bf Signed-off-by: Markus Helgesson <markus.helgesson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/7569 Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com>
2009-11-23Add support for CS2 dataflash for Atmel-SPI.Remy Bohmer
The only missing chipselect line support is CS2, and I need it on CS2... Signed-off-by: Remy Bohmer <linux@bohmer.net>
2009-07-14Coldfire: Consolidate DSPI driverTsiChung Liew
Unify both MCF5227x and MCF5445x DSPI driver in CPU to driver/spi folder for common use. Signed-off-by: TsiChung Liew <tsicliew@gmail.com>
2009-07-07Merge branch 'master' of git://git.denx.de/u-boot-armWolfgang Denk
Conflicts: drivers/spi/Makefile Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-06-26spi: Add Marvell Kirkwood SPI driverPrafulla Wadaskar
This patch adds a SPI driver for the Marvell Kirkwood SoC's. Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
2009-06-14mpc52xx: Add SPI driver.Grzegorz Bernacki
Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
2009-05-29Blackfin: spi: fix pin handling of SPI0 SSEL4Mike Frysinger
CS4 on SPI0 has a dedicated PH8 pin which needs to be enabled as a peripheral in order to work. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-04-16at91sam9/at91cap: improve clock frameworkJean-Christophe PLAGNIOL-VILLARD
calculate dynamically the clock rate and pllb setting for usb Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-04-06Blackfin: spi: make cs deassert function deterministicTodor I Mollov
Blackfin SPI driver was not driving the SPI chip-select high before putting the chip-select signals into tri-state mode. This is probably something that slipped by unnoticed in most designs. If the signals are put directly into a tri-state mode, then the board is relying on the pull-up resistors to pull up the chip-select before the next transaction. Most of the time this is fine, except when you have two transactions that follow each other very closely, such as the flash erase and read status register commands. In this case I was seeing a 500ns separation between the transactions. In my setup, with a 10kOhm pull-up, it would meet timing spec about half the time and resulted in intermittent errors. (A stronger pull up would fix this, but our design is targeted for low power consumption and a 3.3kOhm @ 3.3v is 3.3mW of needless power consumption.) I modified the spi_cs_deactivate() function in bfin_spi.c to drive the chip-selects high before putting them into tri-state. For me, this resulted in a rise time of 5ns instead of the previous rise time of about 1us, and fully satisfied the timing spec of the chip. Signed-off-by: Todor I Mollov <tmollov@ucsd.edu> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-04-04at91: move dataflash spi driver to drivers/spiJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-04-02Blackfin: add BF538/BF539 SPI portmux handlingMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-03-23Blackfin: spi: there is no PORTJ_FER MMR on BF537Sonic Zhang
Since the PORTJ on the BF537 is peripheral-only (no GPIO functionality), then there is no PORTJ_FER register for us to worry about. Signed-off-by: Sonic Zhang <Sonic.Zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-24i.MX31: support GPIO as a chip-select in the mxc_spi driverGuennadi Liakhovetski
Some SPI devices have special requirements on chip-select handling. With this patch we can use a GPIO as a chip-select and strictly follow the SPI_XFER_BEGIN and SPI_XFER_END flags. Signed-off-by: Guennadi Liakhovetski <lg@denx.de> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-02-24i.MX31: fix SPI driver for shorter than 32 bitGuennadi Liakhovetski
Fix setting the SPI Control register, 8 and 16-bit transfers and a wrong pointer in the free routine in the mxc_spi driver. Signed-off-by: Guennadi Liakhovetski <lg@denx.de> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-02-02Blackfin: add driver for on-chip SPI controllerMike Frysinger
This fills out the SPI backend for the Blackfin on-chip SPI peripheral. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-10-18rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-08-29soft_spi: move to drivers/spiJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-07-01Move conditional compilation of MPC8XXX SPI driver to MakefileBen Warren
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2008-06-03atmel_spi: Driver for the Atmel SPI controllerHans-Christian Egtvedt
This adds a driver for the SPI controller found on most AT91 and AVR32 chips, implementing the new SPI API. Changed in v4: - Update to new API - Handle zero-length transfers appropriately. The user may send a zero-length SPI transfer with SPI_XFER_END set in order to deactivate the chip select after a series of transfers with chip select active. This is useful e.g. when polling the status register of DataFlash. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-06-03SPI API improvementsHaavard Skinnemoen
This patch gets rid of the spi_chipsel table and adds a handful of new functions that makes the SPI layer cleaner and more flexible. Instead of the spi_chipsel table, each board that wants to use SPI gets to implement three hooks: * spi_cs_activate(): Activates the chipselect for a given slave * spi_cs_deactivate(): Deactivates the chipselect for a given slave * spi_cs_is_valid(): Determines if the given bus/chipselect combination can be activated. Not all drivers may need those extra functions however. If that's the case, the board code may just leave them out (assuming they know what the driver needs) or rely on the linker to strip them out (assuming --gc-sections is being used.) To set up communication parameters for a given slave, the driver needs to call spi_setup_slave(). This returns a pointer to an opaque spi_slave struct which must be passed as a parameter to subsequent SPI calls. This struct can be freed by calling spi_free_slave(), but most driver probably don't want to do this. Before starting one or more SPI transfers, the driver must call spi_claim_bus() to gain exclusive access to the SPI bus and initialize the hardware. When all transfers are done, the driver must call spi_release_bus() to make the bus available to others, and possibly shut down the SPI controller hardware. spi_xfer() behaves mostly the same as before, but it now takes a spi_slave parameter instead of a spi_chipsel function pointer. It also got a new parameter, flags, which is used to specify chip select behaviour. This may be extended with other flags in the future. This patch has been build-tested on all powerpc and arm boards involved. I have not tested NIOS since I don't have a toolchain for it installed, so I expect some breakage there even though I've tried fixing up everything I could find by visual inspection. I have run-time tested this on AVR32 ATNGW100 using the atmel_spi and DataFlash drivers posted as a follow-up. I'd like some help testing other boards that use the existing SPI API. But most of all, I'd like some comments on the new API. Is this stuff usable for everyone? If not, why? Changed in v4: - Build fixes for various boards, drivers and commands - Provide common struct spi_slave definition that can be extended by drivers - Pass a struct spi_slave * to spi_cs_activate and spi_cs_deactivate - Make default bus and mode build-time configurable - Override default SPI bus ID and mode on mx32ads and imx31_litekit. Changed in v3: - Add opaque struct spi_slave for controller-specific data associated with a slave. - Add spi_claim_bus() and spi_release_bus() - Add spi_free_slave() - spi_setup() is now called spi_setup_slave() and returns a struct spi_slave - soft_spi now supports four SPI modes (CPOL|CPHA) - Add bus parameter to spi_setup_slave() - Convert the new i.MX32 SPI driver - Convert the new MC13783 RTC driver Changed in v2: - Convert the mpc8xxx_spi driver and the mpc8349emds board to the new API. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Tested-by: Guennadi Liakhovetski <lg@denx.de>
2008-05-21Big white-space cleanup.Wolfgang Denk
This commit gets rid of a huge amount of silly white-space issues. Especially, all sequences of SPACEs followed by TAB characters get removed (unless they appear in print statements). Also remove all embedded "vim:" and "vi:" statements which hide indentation problems. Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-04-18New i.MX31 SPI driverGuennadi Liakhovetski
This is an SPI driver for i.MX and MXC based SoCs from Freescale. So far only implemented and tested on i.MX31, can with a modified register layout and definitions be used for i.MX27, I think, MXC CPUs have similar SPI controllers too. Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
2008-01-29Fix conditional compilation of mpx8xxx_spi driverBen Warren
This driver should only compile if CONFIG_MPC8XXX_SPI is set Signed-off-by: Ben Warren <biggerbadderben@gmail.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2008-01-17codingstyle cleanup for spi driverKim Phillips
..and rm unused CONFIG_FSL_SPI define Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2008-01-17Add support for a Freescale non-CPM SPI controllerBen Warren
This patch adds support for the SPI controller found on Freescale PowerPC processors such as the MCP834x family. Additionally, a new config option, CONFIG_HARD_SPI, is added for general purpose SPI controller use. Signed-off-by: Ben Warren <biggerbadderben@gmail.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>