28 Jan, 2020

2 commits


15 Dec, 2019

1 commit


03 Nov, 2019

1 commit

  • On x86 platforms the SPI flash can be mapped into memory so that the
    contents can be read with normal memory accesses.

    Add a new SPI method to find the location of the SPI flash in memory. This
    differs from the existing device-tree "memory-map" mechanism in that the
    location can be discovered at run-time.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass
     

25 Oct, 2019

1 commit

  • We need distinguish the following two situations in various SPI APIs:

    - given chip select num is invalid
    - given chip select num is valid, but no device is attached

    Currently -ENODEV is returned for both cases.

    For the first case, it's more reasonable to return -EINVAL instead of
    -ENODEV for invalid chip select numbers.

    Signed-off-by: Bin Meng
    Tested-by: Jagan Teki # SoPine
    Reviewed-by: Jagan Teki

    Bin Meng
     

16 Sep, 2019

1 commit

  • Add support for SPI synchronous write followed by read,
    this is common interface call from spi-nor to spi drivers.

    Reviewed-by: Simon Glass
    Signed-off-by: Jagan Teki
    Tested-by: Adam Ford #da850-evm

    Jagan Teki
     

12 Apr, 2019

1 commit

  • This patch update the behavior introduced by
    commit 96907c0fe50a ("dm: spi: Read default speed and mode values from DT")

    In case of DT boot, don't read default speed and mode for SPI from
    CONFIG_* but instead read from DT node. This will make sure that boards
    with multiple SPI/QSPI controllers can be probed at different
    bus frequencies and SPI modes.

    Remove also use in boards of the value speed=0 (no more supported)
    for ENV in SPI by using CONFIG_ENV_SPI_MAX_HZ=0.

    DT values will be always used when available (full DM support of
    SPI slave with available DT node) even if speed and mode are requested;
    for example in splash screen support (in splash_sf_read_raw)
    or in SPL boot (in spl_spi_load_image).
    The caller of spi_get_bus_and_cs() no more need to force speed=0.

    But the current behavior don't change if the SPI slave is not
    present (device with generic driver is created automatically)
    or if platdata is used (CONFIG_OF_PLATDATA).

    Signed-off-by: Patrick Delaunay
    Acked-by: Jagan Teki

    Patrick Delaunay
     

27 Nov, 2018

1 commit


20 Sep, 2018

1 commit

  • 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
    Signed-off-by: Miquel Raynal
    Acked-by: Jagan Teki

    Boris Brezillon
     

07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

24 Jan, 2018

4 commits

  • A previous patch removed the spi_flash_probe_fdt function, which
    contained the last call of the spi_setup_slave_fdt function, which is
    now equally obsolete.

    This patch removes the function.

    Reviewed-by: Simon Glass
    Reviewed-by: Jagan Teki
    Signed-off-by: Mario Six

    Mario Six
     
  • 0efc024 ("spi_flash: Add spi_flash_probe_fdt() to locate SPI by FDT
    node") added a helper function spi_base_setup_slave_fdt to to set up a
    SPI slave from a given FDT blob. The only user was the exynos SPI
    driver.

    But commit 73186c9 ("dm: exynos: Convert SPI to driver model") removed
    the use of this function, hence rendering it obsolete.

    Remove this function, as well as the CONFIG_OF_SPI option, which guarded
    only this function.

    Reviewed-by: Simon Glass
    Reviewed-by: Jagan Teki
    Signed-off-by: Mario Six

    Mario Six
     
  • Command bytes are part of the written bytes and they should be taken into
    account when sending a spi transfer.

    Signed-off-by: Álvaro Fernández Rojas
    Reviewed-by: Simon Glass
    Reviewed-by: Daniel Schwierzeck
    Reviewed-by: Jagan Teki

    Álvaro Fernández Rojas
     
  • For some SPI controllers it's not possible to keep the CS active between
    transfers and they are limited to a known number of bytes.
    This splits spi_flash reads into different iterations in order to respect
    the SPI controller limits.

    Signed-off-by: Álvaro Fernández Rojas
    Reviewed-by: Simon Glass
    Reviewed-by: Daniel Schwierzeck
    Reviewed-by: Jagan Teki

    Álvaro Fernández Rojas
     

21 Nov, 2017

1 commit


01 Jun, 2017

1 commit


19 Nov, 2016

1 commit

  • Dual flash code in spi are usually take the spi controller
    to work with dual connected flash devices. Usually these
    dual connection operation's are referred to flash controller
    protocol rather with spi controller protocol, these are still
    present in flash side for the usage of spi-nor controllers.

    So, this patch remove the dual_flash options or flags in sf
    which are triggered from spi controller side.

    Cc: Bin Meng
    Cc: York Sun
    Cc: Vignesh R
    Cc: Mugunthan V N
    Cc: Michal Simek
    Cc: Siva Durga Prasad Paladugu
    Signed-off-by: Jagan Teki
    Reviewed-by: Simon Glass
    Reviewed-by: Jagan Teki

    Jagan Teki
     

22 Sep, 2016

2 commits

  • Removed SPI_RX_FAST since default read for spi slaves
    are always 1-wire fast read.

    Cc: Simon Glass
    Cc: Bin Meng
    Cc: Michal Simek
    Cc: Siva Durga Prasad Paladugu
    Cc: Vignesh R
    Cc: Mugunthan V N
    Signed-off-by: Jagan Teki

    Jagan Teki
     
  • Make rx mode flags as generic to spi, earlier mode_rx is
    maintained separately because of some flash specific code.

    Cc: Simon Glass
    Cc: Bin Meng
    Cc: Michal Simek
    Cc: Siva Durga Prasad Paladugu
    Cc: Vignesh R
    Cc: Mugunthan V N
    Signed-off-by: Jagan Teki

    Jagan Teki
     

17 May, 2016

1 commit

  • Introduce dm_spi_claim_bus, dm_spi_release_bus and dm_spi_xfer
    Convert spi_claim_bus, spi_release_bus and spi_xfer to use
    the new API.

    Signed-off-by: Peng Fan
    Cc: Simon Glass
    Cc: Jagan Teki
    Acked-by: Simon Glass

    Peng Fan
     

13 Jan, 2016

14 commits

  • spi bus can support dual and quad wire data transfers for tx and
    rx. So defining dual and quad modes for both tx and rx. Also add
    support to parse bus width used for spi tx and rx transfers.

    Signed-off-by: Mugunthan V N
    Reviewed-by: Jagan Teki
    Signed-off-by: Jagan Teki

    Mugunthan V N
     
  • Added SPI_TX_DUAL mode flag.

    Cc: Bin Meng
    Cc: Mugunthan V N
    Tested-by: Jagan Teki
    Signed-off-by: Jagan Teki

    Jagan Teki
     
  • SLOW, FAST, DUAL, DUAL_IO, QUAD, QUAD_IO changed order to
    SLOW, FAST, DUAL, QUAD, DUAL_IO, QUAD_IO

    Cc: Simon Glass
    Cc: Michal Simek
    Cc: Siva Durga Prasad Paladugu
    Tested-by: Jagan Teki
    Reviewed-by: Bin Meng
    Signed-off-by: Jagan Teki

    Jagan Teki
     
  • - Add comments on mode_rx
    - Tab space's

    Cc: Simon Glass
    Cc: Michal Simek
    Cc: Siva Durga Prasad Paladugu
    Tested-by: Mugunthan V N
    Tested-by: Bin Meng
    Tested-by: Jagan Teki
    Reviewed-by: Bin Meng
    Signed-off-by: Jagan Teki

    Jagan Teki
     
  • Used BIT macro like 1 << nr as BIT(nr) where nr is 0...n

    Cc: Simon Glass
    Cc: Michal Simek
    Cc: Siva Durga Prasad Paladugu
    Tested-by: Mugunthan V N
    Tested-by: Bin Meng
    Tested-by: Jagan Teki
    Reviewed-by: Bin Meng
    Signed-off-by: Jagan Teki

    Jagan Teki
     
  • Fixed bit assignment with flags members on spi_slave{}

    Cc: Simon Glass
    Cc: Michal Simek
    Cc: Siva Durga Prasad Paladugu
    Tested-by: Mugunthan V N
    Tested-by: Bin Meng
    Tested-by: Jagan Teki
    Reviewed-by: Bin Meng
    Signed-off-by: Jagan Teki

    Jagan Teki
     
  • This patch moves flags macro's to respective member
    position on spi_slave{}, for better readabilty and
    finding the respective member macro's easily.

    Cc: Simon Glass
    Cc: Bin Meng
    Cc: Michal Simek
    Cc: Siva Durga Prasad Paladugu
    Tested-by: Mugunthan V N
    Tested-by: Jagan Teki
    Signed-off-by: Jagan Teki

    Jagan Teki
     
  • Since spi rx mode macro's are renamed to simple and
    meaninfull, this patch will rename the respective
    structure members.

    Cc: Simon Glass
    Cc: Bin Meng
    Cc: Michal Simek
    Cc: Siva Durga Prasad Paladugu
    Tested-by: Mugunthan V N
    Tested-by: Jagan Teki
    Signed-off-by: Jagan Teki

    Jagan Teki
     
  • SPI_OPM_RX_AS - SPI_RX_SLOW
    SPI_OPM_RX_AF - SPI_RX_FAST
    SPI_OPM_RX_DOUT - SPI_RX_DUAL
    SPI_OPM_RX_QOF - SPI_RX_QUAD

    Cc: Simon Glass
    Cc: Michal Simek
    Cc: Siva Durga Prasad Paladugu
    Tested-by: Mugunthan V N
    Tested-by: Bin Meng
    Tested-by: Jagan Teki
    Reviewed-by: Bin Meng
    Signed-off-by: Jagan Teki

    Jagan Teki
     
  • SPI_OPM_RX_DIO and SPI_OPM_RX_QIOF are rx IO
    commands/opmodes for dual and quad. Usually IO
    operation's are referred to flash protocol rather
    with spi controller protocol, these are still present
    in flash side for the usage of spi-nor controllers.

    Cc: Simon Glass
    Cc: Michal Simek
    Cc: Siva Durga Prasad Paladugu
    Tested-by: Mugunthan V N
    Tested-by: Bin Meng
    Tested-by: Jagan Teki
    Reviewed-by: Bin Meng
    Signed-off-by: Jagan Teki

    Jagan Teki
     
  • SPI_OPM_RX_EXTN is a combination of all rx opmode's
    and spi driver shall use any one of the rx mode at
    a time not the combination and it is true in case of
    flash where spi_flash_table mention combination of
    supported read opmodes so-that the required one
    will pick based on the rx mode from spi driver.

    Cc: Simon Glass
    Cc: Michal Simek
    Cc: Siva Durga Prasad Paladugu
    Tested-by: Mugunthan V N
    Tested-by: Bin Meng
    Tested-by: Jagan Teki
    Reviewed-by: Bin Meng
    Signed-off-by: Jagan Teki

    Jagan Teki
     
  • Since SPI_TX_* are spi_slave{} members so use spi protocol
    notation instead spi flash programming, like

    SPI_TX_BP => SPI_TX_BYTE
    SPI_TX_QPP => SPI_TX_QUAD

    Cc: Simon Glass
    Tested-by: Jagan Teki
    Tested-by: Bin Meng
    Reviewed-by: Bin Meng
    Signed-off-by: Jagan Teki

    Jagan Teki
     
  • Used mode member from spi_slave{} instead of op_mode_tx.

    Cc: Simon Glass
    Tested-by: Jagan Teki
    Tested-by: Bin Meng
    Reviewed-by: Bin Meng
    Signed-off-by: Jagan Teki

    Jagan Teki
     
  • Couldn't find the exact reason to define 'mode' for dm,
    probably it is not using in non-dm drivers but it need
    to visible both dm and non-dm as mode data is getting
    dereferred in spi flash core ie common to both.

    Cc: Simon Glass
    Tested-by: Jagan Teki
    Tested-by: Bin Meng
    Reviewed-by: Bin Meng
    Signed-off-by: Jagan Teki

    Jagan Teki
     

23 Oct, 2015

1 commit


18 Aug, 2015

1 commit

  • When doing a memory mapped copy we may have DMA available and thus need
    to have this copy abstracted so that the driver can do it, rather than a
    simple memcpy.

    Signed-off-by: Tom Rini
    Signed-off-by: Vignesh R
    Reviewed-by: Jagan Teki

    Tom Rini
     

01 Jul, 2015

1 commit


06 May, 2015

2 commits


23 Apr, 2015

1 commit

  • 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
    Signed-off-by: Simon Glass
    Tested-by: Peng Fan
    Reviewed-by: Jagannadha Sutradharudu Teki

    Simon Glass