Skip to content
Snippets Groups Projects
  1. Jul 31, 2013
  2. Jul 24, 2013
  3. Jun 26, 2013
    • Dirk Behme's avatar
      spi: mxc_spi: Update pre and post divider algorithm · 9a30903b
      Dirk Behme authored
      
      The spi clock divisor is of the form x * (2**y),  or  x  << y, where x is
      1 to 16, and y is 0 to 15. Note the similarity with floating point numbers.
      Convert the desired divisor to the smallest number which is >= desired divisor,
      and can be represented in this form. The previous algorithm chose a divisor
      which could be almost twice as large as needed.
      
      Signed-off-by: default avatarTroy Kisky <troy.kisky@boundarydevices.com>
      Signed-off-by: default avatarDirk Behme <dirk.behme@gmail.com>
      9a30903b
    • Dirk Behme's avatar
      spi: mxc_spi: Fix pre and post divider calculation · 8d4c4ffb
      Dirk Behme authored
      
      Fix two issues with the calculation of pre_div and post_div:
      
      1. pre_div: While the calculation of pre_div looks correct, to set the
      CONREG[15-12] bits pre_div needs to be decremented by 1:
      
      The i.MX 6Dual/6Quad Applications Processor Reference Manual (IMX6DQRM
      Rev. 0, 11/2012) states:
      
      CONREG[15-12]: PRE_DIVIDER
      0000 Divide by 1
      0001 Divide by 2
      0010 Divide by 3
      ...
      1101 Divide by 14
      1110 Divide by 15
      1111 Divide by 16
      
      I.e. if we want to divide by 2, we have to write 1 to CONREG[15-12].
      
      2. In case the post divider becomes necessary, pre_div will be divided by
      16. So set pre_div to 16, too. And not 15.
      
      Both issues above are tested using the following examples:
      
      clk_src = 60000000 (60MHz, default i.MX6 ECSPI clock)
      
      a) max_hz == 23000000 (23MHz, max i.MX6 ECSPI read clock)
      
      -> pre_div =  3 (divide by 3 => CONREG[15-12] == 2)
      -> post_div = 0 (divide by 1 => CONREG[11- 8] == 0)
                     => 60MHz / 3 = 20MHz SPI clock
      
      b) max_hz == 2000000 (2MHz)
      
      -> pre_div =  16 (divide by 16 => CONREG[15-12] == 15)
      -> post_div = 1  (divide by  2 => CONREG[11- 8] == 1)
                     => 60MHz / 32 = 1.875MHz SPI clock
      
      c) max_hz == 1000000 (1MHz)
      
      -> pre_div =  16 (divide by 16 => CONREG[15-12] == 15)
      -> post_div = 2  (divide by  4 => CONREG[11- 8] == 2)
                     => 60MHz / 64 = 937.5kHz SPI clock
      
      d) max_hz == 500000 (500kHz)
      
      -> pre_div =  16 (divide by 16 => CONREG[15-12] == 15)
      -> post_div = 3  (divide by  8 => CONREG[11- 8] == 3)
                     => 60MHz / 128 = 468.75kHz SPI clock
      
      Signed-off-by: default avatarDirk Behme <dirk.behme@gmail.com>
      8d4c4ffb
    • Hung-ying Tyan's avatar
      cros: exynos: add SPI support for cros_ec · f3424c55
      Hung-ying Tyan authored
      
      This patch adds SPI support for carrying out the cros_ec protocol.
      
      Signed-off-by: default avatarHung-ying Tyan <tyanh@chromium.org>
      Signed-off-by: default avatarRandall Spangler <rspangler@chromium.org>
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      Acked-by: default avatarSimon Glass <sjg@chromium.org>
      f3424c55
  4. Jun 22, 2013
  5. Jun 13, 2013
  6. Jun 02, 2013
  7. May 13, 2013
  8. May 12, 2013
  9. Apr 22, 2013
    • Stefan Roese's avatar
      imx: Move some header files from arch-mxs to imx-common · 0499218d
      Stefan Roese authored
      
      The following headers are moved to a i.MX common location:
      
      - regs-common.h
      - regs-apbh.h
      - regs-bch.h
      - regs-gpmi.h
      - dma.h
      
      This way this header can be re-used also by other i.MX platforms.
      For example the i.MX6 which will need it for the upcoming NAND
      support.
      
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      Cc: Stefano Babic <sbabic@denx.de>
      Cc: Marek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      0499218d
  10. Apr 13, 2013
    • Fabio Estevam's avatar
      spi: mxc_spi: Set master mode for all channels · 0f1411bc
      Fabio Estevam authored
      
      The glitch in the SPI clock line, which commit 3cea335c (spi: mxc_spi: Fix spi
      clock glitch durant reset) solved, is back now and itwas re-introduced by
      commit d36b39bf (spi: mxc_spi: Fix ECSPI reset handling).
      
      Actually the glitch is happening due to always toggling between slave mode
      and master mode by configuring the CHANNEL_MODE bits in this reset function.
      
      Since the spi driver only supports master mode, set the mode for all channels
      always to master mode in order to have a stable, "glitch-free" SPI clock line.
      
      Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
      0f1411bc
  11. Apr 04, 2013
    • Dirk Behme's avatar
      spi: mxc_spi: Fix ECSPI reset handling · d36b39bf
      Dirk Behme authored
      
      Reviewing the ECSPI reset handling shows two issues:
      
      1. For the enable/reset bit (MXC_CSPICTRL_EN) in the control reg
         (ECSPIx_CONGREG) the i.MX6 technical reference manual states:
      
         -- cut --
         ECSPIx_CONREG[0]: EN: Writing zero to this bit disables the block
         and resets the internal logic with the exception of the ECSPI_CONREG.
         -- cut --
      
         Note the exception mentioned: The CONREG itself isn't reset.
      
         Fix this by manually writing the reset value 0 to the whole register.
         This sets the EN bit to zero, too (i.e. includes the old
         ~MXC_CSPICTRL_EN).
      
      2. We want to reset the whole SPI block here. So it makes no sense
         to first read the old value of the CONREG and write it back, later.
         This will give us the old (historic/random) value of the CONREG back.
         And doesn't reset the CONREG.
      
         To get a clean CONREG after the reset of the block, too, don't use
         the old (historic/random) value of the CONREG while doing the reset.
         And read the clean CONREG after the reset.
      
      This was found while working on a SPI boot device where the i.MX6 boot
      ROM has already initialized the SPI block. The initialization by the
      boot ROM might be different to what the U-Boot driver wants to configure.
      I.e. we need a clean reset of SPI block, including the CONREG.
      
      Signed-off-by: default avatarDirk Behme <dirk.behme@de.bosch.com>
      CC: Stefano Babic <sbabic@denx.de>
      CC: Fabio Estevam <fabio.estevam@freescale.com>
      d36b39bf
  12. Apr 01, 2013
    • York Sun's avatar
      Consolidate bool type · 472d5460
      York Sun authored
      
      'bool' is defined in random places. This patch consolidates them into a
      single header file include/linux/types.h, using stdbool.h introduced in C99.
      
      All other #define, typedef and enum are removed. They are all consistent with
      true = 1, false = 0.
      
      Replace FALSE, False with false. Replace TRUE, True with true.
      Skip *.py, *.php, lib/* files.
      
      Signed-off-by: default avatarYork Sun <yorksun@freescale.com>
      472d5460
  13. Mar 29, 2013
  14. Mar 25, 2013
  15. Mar 19, 2013
  16. Mar 07, 2013
    • Marek Vasut's avatar
      mxs: spi: Remove CONFIG_MXS_SPI_DMA_ENABLE · d3f26a27
      Marek Vasut authored
      
      The CONFIG_MXS_SPI_DMA_ENABLE is no longer relevant as the SPI DMA
      has proven to work correctly. Remove this configuration option.
      
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      d3f26a27
    • Marek Vasut's avatar
      mxs: spi: Fix the MXS SPI for mx23 · c96e78cc
      Marek Vasut authored
      
      The MX23 has slightly different register layout. Adjust the SPI
      driver to match the layout, both the PIO and DMA part.
      
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      c96e78cc
    • Marek Vasut's avatar
      mxs: mmc: spi: dma: Better wrap the MXS differences · 3430e0bd
      Marek Vasut authored
      
      This patch streamlines the differences between the MX23 and MX28 by
      implementing a few helper functions to handle different DMA channel
      mapping, different clock domain for SSP block and fixes a few minor
      bugs.
      
      First of all, the DMA channel mapping is now fixed in dma.h by defining
      the actual channel map for both MX23 and MX28. Thus, MX23 now does no
      longer use MX28 channel map which was wrong. Also, there is a fix for
      MX28 DMA channel map, where the last four channels were incorrect.
      
      Next, because correct DMA channel map is in place, the mxs_dma_init_channel()
      call now bases the channel ID starting from SSP port #0. This removes the
      need for DMA channel offset being added and cleans up the code. For the
      same reason, the SSP0 offset can now be used in mxs_dma_desc_append(), thus
      no need to adjust dma channel number in the driver either.
      
      Lastly, the SSP clock ID is now retrieved by calling mxs_ssp_clock_by_bus()
      which handles the fact that MX23 has shared SSP clock for both ports, while
      MX28 has per-port SSP clock.
      
      Finally, the mxs_ssp_bus_id_valid() pulls out two implementations of the
      same functionality from MMC and SPI driver into common code.
      
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      3430e0bd
  17. Mar 04, 2013
  18. Feb 11, 2013
    • Allen Martin's avatar
      tegra: add SPI SLINK driver · b19f5749
      Allen Martin authored
      
      Add driver for tegra SPI "SLINK" style driver.  This controller is
      similar to the tegra20 SPI "SFLASH" controller.  The difference is
      that the SLINK controller is a genernal purpose SPI controller and the
      SFLASH controller is special purpose and can only talk to FLASH
      devices.  In addition there are potentially many instances of an SLINK
      controller on tegra and only a single instance of SFLASH.  Tegra20 is
      currently ths only version of tegra that instantiates an SFLASH
      controller.
      
      This driver supports basic PIO mode of operation and is configurable
      (CONFIG_OF_CONTROL) to be driven off devicetree bindings.  Up to 4
      devices per controller may be attached, although typically only a
      single chip select line is exposed from tegra per controller so in
      reality this is usually limited to 1.
      
      To enable this driver, use CONFIG_TEGRA_SLINK
      
      Signed-off-by: default avatarAllen Martin <amartin@nvidia.com>
      Signed-off-by: default avatarTom Warren <twarren@nvidia.com>
      b19f5749
    • Allen Martin's avatar
      tegra: spi: add fdt support to tegra SPI SFLASH driver · 8f1b46b1
      Allen Martin authored
      
      Add support for configuring tegra SPI driver from devicetree.
      Support is keyed off CONFIG_OF_CONTROL.  Add entry in seaboard dts
      file for spi controller to describe seaboard spi.
      
      Signed-off-by: default avatarAllen Martin <amartin@nvidia.com>
      Signed-off-by: default avatarTom Warren <twarren@nvidia.com>
      8f1b46b1
  19. Feb 04, 2013
  20. Jan 21, 2013
  21. Jan 08, 2013
Loading