summaryrefslogtreecommitdiffstats
path: root/drivers/spi
Commit message (Collapse)AuthorAgeFilesLines
* fdt: armv8: Fix build warnings on armv8Haikun Wang2015-07-201-2/+2
| | | | | | | | | | | | | | | | | | | Fix below build warnings on armv8, drivers/spi/fsl_dspi.c: In function ‘fsl_dspi_ofdata_to_platdata’: drivers/spi/fsl_dspi.c:667:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘fdt_addr_t’ [-Wformat=] debug("DSPI: regs=0x%x, max-frequency=%d, endianess=%s, num-cs=%d\n", ^ lib/fdtdec.c: In function ‘fdtdec_get_addr_size’: lib/fdtdec.c:105:4: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘fdt_size_t’ [-Wformat=] debug("addr=%08lx, size=%08lx\n", ^ Signed-off-by: Haikun Wang <haikun.wang@freescale.com> Acked-by: Simon Glass <sjg@chromium.org>
* Merge git://git.denx.de/u-boot-x86Tom Rini2015-07-151-9/+11
|\
| * dm: spi: Correct BIOS protection logic for ICH9Simon Glass2015-07-141-5/+4
| | | | | | | | | | | | | | | | | | The logic is incorrect and currently has no effect. Fix it so that we can write to SPI flash, since by default it is write-protected. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Andrew Bradford <andrew.bradford@kodakalaris.com>
| * dm: spi: Correct status register access widthSimon Glass2015-07-141-1/+5
| | | | | | | | | | | | | | | | | | The status register on ICH9 is a single byte, so use byte access when writing to it, to avoid updating the control register also. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Jagan Teki <jteki@openedev.com>
| * dm: spi: Correct minor nits in ICH driverSimon Glass2015-07-141-3/+2
| | | | | | | | | | | | | | | | Tidy up three minor problems in this file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Jagan Teki <jteki@openedev.com>
* | spi: cadence_qspi: support FIFO width other than 4 bytesVikas Manocha2015-07-031-23/+23
| | | | | | | | | | | | | | | | | | This patch makes the code compatible with FIFO depths other than 4 bytes. It also simplify read/write FIFO loops. Signed-off-by: Vikas Manocha <vikas.manocha@st.com> Tested-by: Stefan Roese <sr@denx.de> Reviewed-by: Jagannadh Teki <jteki@openedev.com>
* | spi: cadence_qspi: get sram size from device treeVikas Manocha2015-07-033-5/+3
| | | | | | | | | | | | | | | | | | sram size could be different on different socs, e.g. on stv0991 it is 256 while on altera platform it is 128. It is better to receive it from device tree. Signed-off-by: Vikas Manocha <vikas.manocha@st.com> Tested-by: Stefan Roese <sr@denx.de> Reviewed-by: Jagannadh Teki <jteki@openedev.com>
* | spi: cadence_qspi: move the sram partition in initVikas Manocha2015-07-031-11/+5
|/ | | | | | | | | | There is no need to re-configure sram partition for every read/write for better full use of sram for read or write. This patch divides the half sram for read & half for write once at initialization. Signed-off-by: Vikas Manocha <vikas.manocha@st.com> Tested-by: Stefan Roese <sr@denx.de> Reviewed-by: Jagannadh Teki <jteki@openedev.com>
* spi: cf_qspi: fix clamp macro type check compilation warningsAngelo Dureghello2015-07-011-2/+1
| | | | | | | | Fix compilation warnings for redefined 'clamp' macro and non-uniform clamp macro types. Signed-off-by: Angelo Dureghello <angelo@sysam.it> Reviewed-by: Jagannadh Teki <jteki@openedev.com>
* spi: Kconfig: Add TEGRA20_SLINK entryJagan Teki2015-07-011-0/+7
| | | | | | | | | Added TEGRA20_SLINK entry on Kconfig with help description. Signed-off-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Tom Warren <twarren@nvidia.com> Cc: Stephen Warren <swarren@nvidia.com>
* spi: Kconfig: Add TEGRA20_SFLASH entryJagan Teki2015-07-011-0/+7
| | | | | | | | | Added TEGRA20_SFLASH entry on Kconfig with help description. Signed-off-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Tom Warren <twarren@nvidia.com> Cc: Stephen Warren <swarren@nvidia.com>
* spi: Kconfig: Add TEGRA114_SPI entryJagan Teki2015-07-011-0/+10
| | | | | | | | | Added TEGRA114_SPI entry on Kconfig with help description. Signed-off-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Tom Warren <twarren@nvidia.com> Cc: Stephen Warren <swarren@nvidia.com>
* spi: Kconfig: Add ICH_SPI entryJagan Teki2015-07-011-0/+7
| | | | | | | | Added ICH_SPI entry on Kconfig with help description. Signed-off-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* spi: Kconfig: Add EXYNOS_SPI entryJagan Teki2015-07-011-0/+7
| | | | | | | Added EXYNOS_SPI entry on Kconfig with help description. Signed-off-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* spi: Kconfig: Add FSL_QSPI entryJagan Teki2015-07-011-0/+7
| | | | | | | | Added FSL_QSPI entry on Kconfig with help description. Signed-off-by: Jagan Teki <jteki@openedev.com> Cc: Peng Fan <Peng.Fan@freescale.com> Cc: Haikun Wang <haikun.wang@freescale.com>
* spi: Kconfig: Add FSL_ESPI entryJagan Teki2015-07-011-0/+7
| | | | | | | Added FSL_ESPI entry on Kconfig with help description. Signed-off-by: Jagan Teki <jteki@openedev.com> Cc: Haikun Wang <haikun.wang@freescale.com>
* spi: Kconfig: Add FSL_DSPI entryJagan Teki2015-07-011-0/+8
| | | | | | | Added FSL_DSPI entry on Kconfig with help description. Signed-off-by: Jagan Teki <jteki@openedev.com> Cc: Haikun Wang <haikun.wang@freescale.com>
* spi: Kconfig: Show dm-spi drivers if DM_SPI setJagan Teki2015-07-011-25/+26
| | | | | | | | | | DM supported spi drivers are enbled only when DM_SPI enabled, so added DM_SPI if condition in Kconfig to show thoese only when it enabled. Also re-order the config items as incresing alphabetic order. Signed-off-by: Jagan Teki <jteki@openedev.com>
* spi: Makefile: Use object file alphabetic orderJagan Teki2015-07-011-5/+5
| | | | | | | Use object files as incresing alphabetic order, so-that it's easy for readability. Signed-off-by: Jagan Teki <jteki@openedev.com>
* spi: Kconfig: Add TI_QSPI entryJagan Teki2015-07-011-0/+6
| | | | | | | Added TI_QSPI entry on Kconfig with help description. Signed-off-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* spi: Kconfig: Add XILINX_SPI entryJagan Teki2015-07-011-0/+9
| | | | | | | Added XILINX_SPI entry on Kconfig with help description. Signed-off-by: Jagan Teki <jteki@openedev.com> Cc: Michal Simek <michal.simek@xilinx.com>
* spi: Add Kconfig menu entryJagan Teki2015-07-011-0/+4
| | | | | | Added Kconfig menu ... endmenu enties for spi support. Signed-off-by: Jagan Teki <jteki@openedev.com>
* spi: Kconfig: Add Zynq SPI controller entryJagan Teki2015-07-011-0/+8
| | | | | | | | | | Add Zynq SPI controller Kconfig entry. Signed-off-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Marek Vasut <marex@denx.de> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
* spi: xilinx_spi: Add asm/io.h include fileJagan Teki2015-07-011-0/+1
| | | | | | | | | | | | | This patch includes asm/io.h for readl and writel calls. build errors: drivers/spi/xilinx_spi.c: In function 'xilinx_spi_probe': drivers/spi/xilinx_spi.c:119:2: warning: implicit declaration of function 'writel' [-Wimplicit-function-declaration] drivers/spi/xilinx_spi.c: In function 'xilinx_spi_xfer': drivers/spi/xilinx_spi.c:193:2: warning: implicit declaration of function 'readl' [-Wimplicit-function-declaration] Signed-off-by: Jagan Teki <jteki@openedev.com> Cc: Michal Simek <michal.simek@xilinx.com>
* dm: spi: xilinx_spi: Convert to driver modelJagan Teki2015-07-011-88/+112
| | | | | | | | This converts the xilinx spi driver to use the driver model. Signed-off-by: Jagan Teki <jteki@openedev.com> Acked-by: Simon Glass <sjg@chromium.org> Cc: Michal Simek <michal.simek@xilinx.com>
* spi: zynq_spi: Add fdt support in driverJagan Teki2015-07-011-10/+13
| | | | | | | | | | | | | | | | | Now zynq spi driver platform data is controlled by devicetree, enable the status by saying "okay" on respective board dts to use the devicetree generated platdata. Ex: &spi1 { status = "okay"; }; Signed-off-by: Jagan Teki <jteki@openedev.com> Acked-by: Simon Glass <sjg@chromium.org> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Tested-by: Jagan Teki <jteki@openedev.com>
* dm: spi: zynq_spi: Convert to driver modelJagan Teki2015-07-011-124/+169
| | | | | | | | | | | | | | | | This converts the zynq spi driver to use the driver model. Minimal functional changes like using meaningful name on structure members wrt mainlined dm spi drivers. - input_hz -> frequency - req_hz -> freq - base -> regs Signed-off-by: Jagan Teki <jteki@openedev.com> Acked-by: Simon Glass <sjg@chromium.org> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Tested-by: Jagan Teki <jteki@openedev.com>
* spi: davinci_spi: Driver cleanupJagan Teki2015-07-011-170/+173
| | | | | | | | | | Arrange driver code in more readable format[1] for easy accessing and readable. [1] http://patchwork.ozlabs.org/patch/265683/ Signed-off-by: Jagan Teki <jteki@openedev.com> Cc: Rex Chang <rchang@ti.com> Cc: Murali Karicheri <m-karicheri2@ti.com>
* spi: davinci_spi: Move header code to driverJagan Teki2015-07-012-122/+109
| | | | | | | | | Move the header code into driver for more readable and easy to access it. Signed-off-by: Jagan Teki <jteki@openedev.com> Cc: Rex Chang <rchang@ti.com> Cc: Murali Karicheri <m-karicheri2@ti.com>
* spi: xilinx_spi: Driver clean-upJagan Teki2015-07-011-107/+57
| | | | | | | | | | | | | | - Zap unneeded macros - Re-arrange the code - Removed __attribute__((weak)) - Replace __func__ macro with func names to save macro transition. - Re-arranged comment lines. - Arrange driver code in more readable format[1] [1] http://patchwork.ozlabs.org/patch/265683/ Signed-off-by: Jagan Teki <jteki@openedev.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
* spi: xilinx_spi: Move header code to driverJagan Teki2015-07-012-139/+112
| | | | | | | | Move the header code into driver for more readable and easy to access it. Signed-off-by: Jagan Teki <jteki@openedev.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
* spi: Zap oc_tiny_spi driverJagan Teki2015-07-012-246/+0
| | | | | | | | Zap oc_tiny_spi driver since the boards used this driver is no longer been active. Signed-off-by: Jagan Teki <jteki@openedev.com> Cc: Thomas Chou <thomas@wytron.com.tw>
* spi: Zap ftssp010_spi driverJagan Teki2015-07-012-499/+0
| | | | | | | | | Zap ftssp010_spi driver since the boards used this driver is no longer been active. Signed-off-by: Jagan Teki <jteki@openedev.com> Cc: Kuo-Jung Su <dantesu@faraday-tech.com> Cc: Axel Lin <axel.lin@ingics.com>
* spi: Zap andes_spi driverJagan Teki2015-07-013-400/+0
| | | | | | | | Zap andes_spi driver since the boards used this driver is no longer been active. Signed-off-by: Jagan Teki <jteki@openedev.com> Cc: Macpaul Lin <macpaul@andestech.com>
* tegra: spi: Support slow SPI ratesSimon Glass2015-06-091-3/+15
| | | | | | | | | Use the oscillator as the source clock when we cannot achieve a low-enough speed with the peripheral clock. This happens when we request 3MHz on a SPI clock, for example. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
* tegra: spi: Drop the claim_bus() method to correct delaysSimon Glass2015-06-091-17/+9
| | | | | | | | | | | | | | | | At present the driver does not properly honour the requested SPI CS deactivation delay since the SPI bus is changed in the claim_bus() method. Everything the claim_bus() method does can be done when the device is probed (setting the speed and mode) and at the start of a new transfer (where the fifo_status is already cleared). So drop this method. Also, until the delay is complete, we should not touch the bus, so make sure that spi_cs_activate() is called before other things are done in the xfer() method. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
* dm: spi: Avoid setting the speed with every transferSimon Glass2015-05-051-3/+6
| | | | | | | | Only set the speed if it has changed from last time. Since the speed will be 0 when the device is probed it will always be changed on the first transfer after the device is probed. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of git://www.denx.de/git/u-boot-socfpgaTom Rini2015-04-281-0/+16
|\
| * spi: Add Cadence QSPI controller Kconfig entryMarek Vasut2015-04-211-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Cadence QSPI controller Kconfig entry. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <clsee@opensource.altera.com> Cc: Dinh Nguyen <dinguyen@opensource.altera.com> Cc: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com> Acked-by: Pavel Machek <pavel@denx.de> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Stefan Roese <sr@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Vince Bridgers <vbridger@opensource.altera.com>
| * spi: Add Designware SPI controller Kconfig entryMarek Vasut2015-04-211-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add DWC SPI controller Kconfig entry. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <clsee@opensource.altera.com> Cc: Dinh Nguyen <dinguyen@opensource.altera.com> Cc: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com> Acked-by: Pavel Machek <pavel@denx.de> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Stefan Roese <sr@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Vince Bridgers <vbridger@opensource.altera.com>
* | spi: omap3: Fix timeout handlingDavid Dueck2015-04-271-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The timeout value is never reset during the transfer. This means that when transferring more data we eventually trigger the timeout. This was reported on the mailing list: "Spansion SPI flash read timeout with AM335x" Signed-off-by: David Dueck <davidcdueck@googlemail.com> CC: Tom Rini <trini@konsulko.com> CC: Stefan Roese <sr@denx.de> CC: Andy Pont <andy.pont@sdcsystems.com> Tested-by: David Dueck <davidcdueck@googlemail.com> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
* | dm: spi: Correct SPI claim/release_bus() methodsSimon Glass2015-04-235-7/+12
| | | | | | | | | | | | | | | | | | | | | | These methods should be passed a slave device, not a bus. This matches the old SPI interface. It is important to know which device is claiming the bus so passing a bus is not that useful. Reported-by: Haikun Wang <haikun.wang@freescale.com> Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Peng Fan <Peng.Fan@freescale.com> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
* | zynq: spi: Remove unnecessary error conditionSiva Durga Prasad Paladugu2015-04-221-3/+0
|/ | | | | | | | | | Removed the unnecessary error check from spi_xfer as the bitlen zero is possible now to deassert the chip select for which no data is required to be transfered. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
* sandbox: Move CONFIG_SANDBOX_SPI to KconfigSimon Glass2015-04-181-0/+25
| | | | | | Move this over to Kconfig and tidy up. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: spi: Convert Freescale QSPI driver to driver modelHaikun.Wang@freescale.com2015-04-181-329/+656
| | | | | | | | | Move the Freescale QSPI driver over to driver model. Signed-off-by: Haikun Wang <Haikun.Wang@freescale.com> Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Tested-by: Peng Fan <Peng.Fan@freescale.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: spi: Convert Freescale DSPI driver to driver modelHaikun.Wang@freescale.com2015-04-182-0/+738
| | | | | | | Move the Freescale DSPI driver over to driver model. Signed-off-by: Haikun Wang <Haikun.Wang@freescale.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: x86: spi: Convert ICH SPI driver to driver modelSimon Glass2015-04-181-254/+265
| | | | | | | | | | | | Convert this driver over to use driver model. Since all x86 platforms use it, move x86 to use driver model for SPI and SPI flash. Adjust all dependent code and remove the old x86 spi_init() function. Note that this does not make full use of the new PCI uclass as yet. We still scan the bus looking for the device. It should move to finding its details in the device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Add dev_get_uclass_priv() to access uclass private dataSimon Glass2015-04-161-2/+2
| | | | | | | | Add a convenience function to access the private data that a uclass stores for each of its devices. Convert over most existing uses for consistency and to provide an example for others. Signed-off-by: Simon Glass <sjg@chromium.org>
* x86: spi: Add support for lynxpointSimon Glass2015-04-161-1/+2
| | | | | | | Add Lynxpoint to the driver so that the Asus Chromebox can be supported. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
* lpc32xx: add LPC32xx SSP support (SPI mode)Albert ARIBAUD \(3ADEV\)2015-04-102-0/+145
| | | | | Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com> Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
OpenPOWER on IntegriCloud