summaryrefslogtreecommitdiffstats
path: root/drivers/spi
Commit message (Collapse)AuthorAgeFilesLines
* arm64: versal: Add support for new Xilinx Versal ACAPsMichal Simek2018-10-161-2/+2
| | | | | | | | | | | | | | | | | | Xilinx is introducing Versal, an adaptive compute acceleration platform (ACAP), built on 7nm FinFET process technology. Versal ACAPs combine Scalar Processing Engines, Adaptable Hardware Engines, and Intelligent Engines with leading-edge memory and interfacing technologies to deliver powerful heterogeneous acceleration for any application. The Versal AI Core series has five devices, offering 128 to 400 AI Engines. The series includes dual-core Arm Cortex™-A72 application processors, dual-core Arm Cortex-R5 real-time processors, 256KB of on-chip memory with ECC, more than 1,900 DSP engines optimized for high-precision floating point with low latency. The patch is adding necessary infrastructure in place without enabling platform which is done in separate patch. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini2018-10-121-19/+28
|\
| * spi: davinci: Add platdata supportJagan Teki2018-10-101-19/+28
| | | | | | | | | | | | | | | | | | Davanci spi driver has DM support already, this patch add support for platdata so-that SPL can use it for low foot-print. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Tested-by: Adam Ford <aford173@gmail.com>
* | dm: spi: Add logging of some return valuesSimon Glass2018-10-091-3/+3
| | | | | | | | | | | | | | | | When SPI flash operations fail it is helpful to be able to see the error codes and where they are generated. Add logging to capture this information for read operations. Signed-off-by: Simon Glass <sjg@chromium.org>
* | sandbox: spi: Add more loggingSimon Glass2018-10-091-29/+9
|/ | | | | | | Add logging to aid debugging features in these drivers. Also drop some code in sandbox_spi_xfer() which is not used. Signed-off-by: Simon Glass <sjg@chromium.org>
* spi: Add SPI driver for MT76xx SoCsStefan Roese2018-10-043-0/+321
| | | | | | | | | | | | | | | | | | This patch adds the SPI driver for the MediaTek MT7688 SoC (and derivates). Its been tested on the LinkIt Smart 7688 and the Gardena Smart Gateway with and SPI NOR on CS0 and on the Gardena Smart Gateway additionally with an SPI NAND on CS1. Note that the SPI controller only supports a max transfer size of 32 bytes. This driver implementes a workaround to enable bigger xfer sizes to speed up the transfer especially for the SPI NAND support. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Jagan Teki <jagan@openedev.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Piotr Dymacz <pepe2k@gmail.com> Reviewed-by: Jagan Teki <jagan@openedev.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
* Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini2018-10-026-203/+702
|\ | | | | | | | | | | | | This is the PR for SPI-NAND changes along with few spi changes. [trini: Re-sync changes for ls1012afrwy_qspi*_defconfig] Signed-off-by: Tom Rini <trini@konsulko.com>
| * spi: sh_qspi: Add DM support to SH QSPI driverMarek Vasut2018-10-021-65/+150
| | | | | | | | | | | | | | | | | | | | | | Add DM support to the SH QSPI driver while retaining non-DM support. The later is required as this driver is used in SPL which has a size limitation of 16 kiB. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> [jagan: use proper commit head] Reviewed-by: Jagan Teki <jagan@openedev.com>
| * driver/spi: fsl_qspi: Remove non-DM stuffAshish Kumar2018-10-021-138/+0
| | | | | | | | | | | | | | | | | | Convert fsl_qspi.c to complete DM mode. Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com> Tested-by: Rajat Srivastava <rajat.srivastava@nxp.com> Tested-by: Ye Li <ye.li@nxp.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * spi: designware_spi: Add reset ctrl to driverLey Foon Tan2018-10-021-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add code to reset all reset signals as in SPI DT node. A reset property is an optional feature, so only print out a warning and do not fail if a reset property is not present. If a reset property is discovered, then use it to deassert, thus bringing the IP out of reset. Release reset when _remove(). Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * spi: Extend the core to ease integration of SPI memory controllersBoris Brezillon2018-09-203-0/+509
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some controllers are exposing high-level interfaces to access various kind of SPI memories. Unfortunately they do not fit in the current spi_controller model and usually have drivers placed in drivers/mtd/spi-nor which are only supporting SPI NORs and not SPI memories in general. This is an attempt at defining a SPI memory interface which works for all kinds of SPI memories (NORs, NANDs, SRAMs). Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Jagan Teki <jagan@openedev.com>
* | spi: add support for ARM PL022 SPI controllerQuentin Schulz2018-09-253-0/+347
|/ | | | | | | | | | | | This adds support for the ARM PL022 SPI controller for the standard variant (0x00041022) which has a 16bit wide and 8 locations deep TX/RX FIFO. A few parts were borrowed from the Linux kernel driver. Cc: Armando Visconti <armando.visconti@st.com> Cc: Vipin Kumar <vipin.kumar@st.com> Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
* arm: sunxi: Allwinner A10 SPI driverStefan Mavrodiev2018-08-033-0/+462
| | | | | | | | Add spi driver for sun4i, sun5i and sun7i SoCs. The driver is adapted from mailine kernel. Signed-off-by: Stefan Mavrodiev <stefan@olimex.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
* spi: kirkwood: add orion-spi compatible stringChris Packham2018-08-031-0/+8
| | | | | | | | | | This matches the compatible string used by the Linux kernel. This will allow u-boot to use the same device tree files. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Jagan Teki <jagan@openedev.com> [jagan: use armada instead of orion on .data] Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
* spi: kirkwood: Get drvdata in .ofdata_to_platdataJagan Teki2018-08-031-3/+5
| | | | | | | | Get the is_errata_50mhz_ac in .ofdata_to_platdata, and reuse it in .set_mode this can eventually initialized dt code at once and adding room to add platdata. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
* spi: stm32_qspi: rework mode managementChristophe Kerello2018-07-231-14/+14
| | | | | | | This patch solves quad read issue with Macronix/Micron spi nor. Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* spi: stm32_qspi: assign functional operation mode in _stm32_qspi_gen_ccrChristophe Kerello2018-07-231-9/+8
| | | | | | | | This patch assigns the functional operation mode in _stm32_qspi_gen_ccr function. Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* spi: zynqmp_gqspi: Add support for ZynqMP qspi driverSiva Durga Prasad Paladugu2018-07-163-0/+737
| | | | | | | | | | This patch adds qspi driver support for ZynqMP SoC. This driver is responsible for communicating with qspi flash devices. Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> [jagan: removed GQSPI_MIO_NUM_ macros] Reviewed-by: Jagan Teki <jagan@openedev.com>
* spi: xilinx_spi: convert to livetreeVipul Kumar2018-07-161-3/+2
| | | | | | | Update the xilinx spi driver to support a live tree. Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
* spi: xilinx_spi: Added support to read JEDEC-id twice at the boot timeVipul Kumar2018-07-161-0/+41
| | | | | | | | | | | | This patch is for the startup block issue in the spi controller. SPI clock is passing through STARTUP block to FLASH. STARTUP block don't provide clock as soon as QSPI provides command. So, first command fails. This patch added support to read JEDEC id in xilinx_spi_xfer (). Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
* spi: xilinx_spi: Modify transfer logic xilinx_spi_xfer() functionVipul Kumar2018-07-161-35/+68
| | | | | | | | | | | | This patch modify xilinx_spi_xfer() function and add rxfifo() and txfifo() functions to add the modularity so that these functions can be used by other functions within the same file. This patch also added support to read fifo_size from dts. Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com> Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
* spi: xilinx: Read reg base address from DTS fileMichal Simek2018-07-161-6/+1
| | | | | | | | This patch added support to read register base address from DTS file. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
* spi: cadence_qspi: Fix warning cast from pointer to integer of different sizeLey Foon Tan2018-07-121-2/+2
| | | | | | | | | | | | | | | Use "%p" to print cmdbuf. Compilation warning as below: CC spl/drivers/spi/cadence_qspi_apb.o LD spl/lib/built-in.o drivers/spi/cadence_qspi_apb.c: In function ‘cadence_qspi_apb_indirect_write_setup’: drivers/spi/cadence_qspi_apb.c:696:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] cmdlen, (unsigned int)cmdbuf); Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com> Acked-by: Marek Vasut <marex@denx.de>
* spi: cadence_qspi: Fix compilation warningLey Foon Tan2018-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Use "%zu" for size_t data type. Compilation warning as below: In file included from include/linux/bug.h:7:0, from include/common.h:26, from drivers/spi/cadence_qspi.c:8: drivers/spi/cadence_qspi.c: In function ‘cadence_spi_xfer’: drivers/spi/cadence_qspi.c:211:8: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=] debug("%s: len=%d [bytes]\n", __func__, data_bytes); ^ include/linux/printk.h:37:21: note: in definition of macro ‘pr_fmt’ #define pr_fmt(fmt) fmt ^~~ include/log.h:142:2: note: in expansion of macro ‘debug_cond’ debug_cond(_DEBUG, fmt, ##args) ^~~~~~~~~~ drivers/spi/cadence_qspi.c:211:2: note: in expansion of macro ‘debug’ debug("%s: len=%d [bytes]\n", __func__, data_bytes); Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com> Acked-by: Marek Vasut <marex@denx.de>
* board: arm: Add support for Broadcom BCM7445Thomas Fitzsimmons2018-07-104-1/+448
| | | | | | | | | | | | Add support for loading U-Boot on the Broadcom 7445 SoC. This port assumes Broadcom's BOLT bootloader is acting as the second stage bootloader, and U-Boot is acting as the third stage bootloader, loaded as an ELF program by BOLT. Signed-off-by: Thomas Fitzsimmons <fitzsim@fitzsim.org> Cc: Stefan Roese <sr@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Florian Fainelli <f.fainelli@gmail.com>
* spi: omap3: fix claim/release bus within DMHannes Schmelzer2018-06-281-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | The claim/release bus function must not reset the whole SPI core because settings regarding wordlen, clock-frequency and so on made by set_wordlen, set_mode, set_speed get lost with this action. Resulting in a non-functional SPI. Without DM the failure didn't came up since after the spi_reset within claim bus all the setup (wordlen, mode, ...) was called, in DM they are called by the spi uclass. We change now the things as following for having a working SPI instance in DM: - move the spi_reset(...) to the probe call in DM for having a known hardware state after probe. Without DM we don't have a probe call, so we issue the reset as before during the claim_bus call. - in release bus we just reset the modulctrl to the reset-value (spi- slave) Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at> Reviewed-by: Jagan Teki <jagan@openedev.com>
* spi: omap3: fix set_speed and set_mode dm callbacksHannes Schmelzer2018-06-251-10/+6
| | | | | | | | | | | | | | | | | | | | | commit 84807922874e03895bbf15c4472a2dcee8fbbd03 ("spi: omap3: Skip set_mode, set_speed from claim") did break SPI support on my AM335x board. The named commit: - ignored the responsible arguments (speed, mode) The set speed/mode function must use the supplied function arguments to work properly. With this commit we take those arguments and transfer them to the priv-data. - used wrong udevice pointer for getting priv data the udevice-pointer within function argument is already the spi-bus device, so it is wrong looking here for some parent (ocp-bus in this case) and getting priv-pointer from there. Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at> Reviewed-by: Jagan Teki <jagan@openedev.com>
* spi: omap3: pre-initialize bus-speed with max. slave-speedHannes Schmelzer2018-06-251-0/+2
| | | | | | | | Otherwise the frequency is zero and the clock divider cannot be setup by 'omap3_spi_set_speed' function. Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at> Reviewed-by: Jagan Teki <jagan@openedev.com>
* spi: mxc_spi: Fix chipselect on DM_SPI driver uclassMichael Trimarchi2018-06-251-3/+3
| | | | | | | | | CS GPIO activation low/high is determinated by the device tree so we don't need to take in accoung in cs_activate and cs_deactivate Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
* spi: mxc: Fix compilation problem of DM_SPI class driverMichael Trimarchi2018-06-251-1/+1
| | | | | | | | | | drivers/spi/mxc_spi.c:507: undefined reference to `dev_get_addr' linux-ld.bfd: BFD (GNU Binutils) 2.29.1 assertion fail elf32-arm.c:9509 Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
* spi: zynq_qspi: Fixed incorrect return value errorVipul Kumar2018-06-251-1/+1
| | | | | | | | | | This patch replaced "return 0" with "return status" to fix the incorrect return value error reported by the coverity. Reviewed-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com> [jagan: rebased on master] Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
* spi: cadence_qspi: Change to use devfdt_get_addr_index()Ley Foon Tan2018-06-041-11/+2
| | | | | | | | | | | | | | | | | Change to use devfdt_get_addr_index() function to get fdt address. Original code has compilation warning below: drivers/spi/cadence_qspi.c: In function ‘cadence_spi_ofdata_to_platdata’: drivers/spi/cadence_qspi.c:297:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] plat->regbase = (void *)data[0]; ^ drivers/spi/cadence_qspi.c:298:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] plat->ahbbase = (void *)data[2]; ^ Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Jagan Teki <jagan@openedev.com>
* Merge branch 'master' of git://git.denx.de/u-boot-mipsTom Rini2018-06-012-18/+6
|\
| * spi: bcm63xx_hsspi: convert to use live dtÁlvaro Fernández Rojas2018-06-011-9/+3
| | | | | | | | | | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
| * spi: bcm63xx_spi: convert to use live dtÁlvaro Fernández Rojas2018-06-011-9/+3
| | | | | | | | | | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
* | Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini2018-05-304-35/+66
|\ \ | | | | | | | | | | | | | | | | | | - Fix a conflict in drivers/spi/atcspi200_spi.c related to the riscv tree fixing a warning. Signed-off-by: Tom Rini <trini@konsulko.com>
| * | spi: fsl_qspi: remove superfluous assignmentHeinrich Schuchardt2018-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In void *rx_addr = NULL; rx_add = A; the first assignment has no effect. Remove it. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * | spi: lpc32xx: simplify logical expressionHeinrich Schuchardt2018-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | A & A & B == A & B Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * | spi: atcspi200: avoid NULL dereferenceHeinrich Schuchardt2018-05-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For SPI_XFER_BEGIN | SPI_XFER_END the code sets data_out = NULL. In the debug statement we should not dereference this value. As we do not transfer any data the debug statement is not needed in this case anyway. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * | spi: stm32_qspi: Add reset supportPatrice Chotard2018-05-161-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | In some situation, QSPI controller is already configured by an early boot stage, adding reset support will insure that QSPI controller is started from a pristine state. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * | spi: stm32_qspi: Use dev_read_xxx APIPatrice Chotard2018-05-161-11/+6
| | | | | | | | | | | | | | | | | | | | | Use dev_read_xxx() instead of old manner fdt_xxx() API Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * | spi: stm32_qspi: Add chip select managementChristophe Kerello2018-05-161-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | Quad-SPI interface is able to manage 2 spi nor devices. FSEL bit selects the flash memory to be addressed in single flash mode. Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * | spi: stm32_qspi: Add st, stm32f469-qspi compatible stringChristophe Kerello2018-05-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add "st,stm32f469-qspi" compatible which is used on kernel side. This will be necessary when DT will be synchronised from kernel. Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * | spi: stm32_qspi: Align reg-names with kernel 4.12 RC1Christophe Kerello2018-05-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Align qspi bindings following kernel dt-bindings Documentation/devicetree/bindings/mtd/stm32-quadspi.txt from kernel v4.12-rc1. Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * | spi: stm32_qspi: Sort include files alphabeticallyPatrice Chotard2018-05-161-3/+3
| | | | | | | | | | | | | | | | | | | | | Sort include files by alphabetical order Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * | spi: stm32_qspi: Solve issue detected by checkpatchPatrick Delaunay2018-05-161-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix parameters function alingemnt Fix variable declaration Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * | spi: stm32_qspi: Remove CONFIG_CLK flagPatrice Chotard2018-05-161-4/+2
| |/ | | | | | | | | | | | | | | As all platforms which uses this driver have CONFIG_CLK flag enable in their defconfig, we can remove it from driver code. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
* / spi: atcspi200: Fix compiler warningRick Chen2018-05-291-3/+3
|/ | | | | | | | | | | | Fix warning as below when compile in 64-bit. warning: format '%u' expects argument of type 'unsigned int', but argument 6 has type 'size_t {aka long unsigned int} Signed-off-by: Rick Chen <rick@andestech.com> Signed-off-by: Rick Chen <rickchen36@gmail.com> Cc: Greentime Hu <green.hu@gmail.com>
* spi: mvebu_a3700_spi: Use Armada 37xx clk driver for SPI clock frequencyMarek Behún2018-05-142-24/+29
| | | | | | | | | | | | Since now we have driver for clocks on Armada 37xx, use it to determine SQF clock frequency for the SPI driver. Also change the default config files for Armada 37xx devices so that the clock driver is enabled by default, otherwise the SPI driver cannot be enabled. Signed-off-by: Marek Behun <marek.behun@nic.cz> Signed-off-by: Stefan Roese <sr@denx.de>
* spi: fsl_qspi: Introduce is_controller_busy functionRajat Srivastava2018-05-091-10/+21
| | | | | | | | | | Some SoCs have different endianness of QSPI IP if compared to endianness of core. The function is_controller_busy() checks if the QSPI controller is busy or not, considering the endianness of the QSPI IP. Signed-off-by: Rajat Srivastava <rajat.srivastava@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>