1. 20 10月, 2015 3 次提交
  2. 18 9月, 2015 2 次提交
  3. 22 8月, 2015 1 次提交
    • M
      spi: dw: Allow interface drivers to limit data I/O to word sizes · c4fe57f7
      Michael van der Westhuizen 提交于
      The commit dd114443 ("spi: dw-spi: Convert 16bit accesses to 32bit
      accesses") changed all 16bit accesses in the DW_apb_ssi driver to 32bit.
      This, unfortunately, breaks data register access on picoXcell, where the
      DW IP needs data register accesses to be word accesses (all other
      accesses appear to be OK).
      
      This change introduces a new master variable to allow interface drivers
      to specify that 16bit data transfer I/O is required.  This change also
      introduces the ability to set this variable via device tree bindings in
      the MMIO interface driver.  Both the core and the MMIO interface driver
      default to the current 32bit behaviour.
      
      Before this change, on a picoXcell pc3x3:
       spi_master spi32766: interrupt_transfer: fifo overrun/underrun
       m25p80 spi32766.0: error -5 reading 9f
       m25p80: probe of spi32766.0 failed with error -5
      
      After this change:
       m25p80 spi32766.0: m25p40 (512 Kbytes)
      
      Fixes: dd114443 ("spi: dw-spi: Convert 16bit accesses to 32bit accesses")
      Signed-off-by: NMichael van der Westhuizen <michael@smart-africa.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      c4fe57f7
  4. 26 3月, 2015 1 次提交
  5. 17 3月, 2015 1 次提交
    • T
      spi: dw-spi: Convert 16bit accesses to 32bit accesses · dd114443
      Thor Thayer 提交于
      Altera's Arria10 SoC interconnect requires a 32-bit write for APB
      peripherals. The current spi-dw driver uses 16-bit accesses in
      some locations. This patch converts all the 16-bit reads and
      writes to 32-bit reads and writes.
      
      Additional Documentation to Support this Change:
      The DW_apb_ssi databook states:
      "All registers in the DW_apb_ssi are addressed at 32-bit boundaries
      to remain consistent with the AHB bus. Where the physical size of
      any register is less than 32-bits wide, the upper unused bits of
      the 32-bit boundary are reserved. Writing to these bits has no
      effect; reading from these bits returns 0." [1]
      
      [1] Section 6.1 of dw_apb_ssi.pdf (version 3.22a)
      
      Request for test with platforms using the DesignWare SPI IP.
      
      Tested On:
      Altera CycloneV development kit
      Altera Arria10 development kit
      Compile tested for build errors on x86_64 (allyesconfigs)
      Signed-off-by: NThor Thayer <tthayer@opensource.altera.com>
      Reviewed-and-tested-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      dd114443
  6. 10 3月, 2015 5 次提交
  7. 07 3月, 2015 3 次提交
  8. 26 2月, 2015 1 次提交
    • A
      spi: dw: revisit FIFO size detection again · 9d239d35
      Andy Shevchenko 提交于
      The commit d297933c (spi: dw: Fix detecting FIFO depth) tries to fix the
      logic of the FIFO detection based on the description on the comments. However,
      there is a slight difference between numbers in TX Level and TX FIFO size.
      
      So, by specification the FIFO size would be in a range 2-256 bytes. From TX
      Level prospective it means we can set threshold in the range 0-(FIFO size - 1)
      bytes. Hence there are currently two issues:
        a) FIFO size 2 bytes is actually skipped since TX Level is 1 bit and could be
           either 0 or 1 byte;
        b) FIFO size is incorrectly decreased by 1 which already done by meaning of
           TX Level register.
      
      This patch fixes it eventually right.
      
      Fixes: d297933c (spi: dw: Fix detecting FIFO depth)
      Reviewed-by: NAxel Lin <axel.lin@ingics.com>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      9d239d35
  9. 24 2月, 2015 4 次提交
  10. 08 1月, 2015 2 次提交
  11. 06 1月, 2015 1 次提交
    • A
      spi: dw: Fix detecting FIFO depth · d297933c
      Axel Lin 提交于
      Current code tries to find the highest valid fifo depth by checking the value
      it wrote to DW_SPI_TXFLTR. There are a few problems in current code:
      1) There is an off-by-one in dws->fifo_len setting because it assumes the latest
         register write fails so the latest valid value should be fifo - 1.
      2) We know the depth could be from 2 to 256 from HW spec, so it is not necessary
         to test fifo == 257. In the case fifo is 257, it means the latest valid
         setting is fifo = 256. So after the for loop iteration, we should check
         fifo == 2 case instead of fifo == 257 if detecting the FIFO depth fails.
      This patch fixes above issues.
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Reviewed-and-tested-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      d297933c
  12. 07 11月, 2014 1 次提交
    • T
      spi: dw: Fix dynamic speed change. · 0a8727e6
      Thor Thayer 提交于
      An IOCTL call that calls spi_setup() and then dw_spi_setup() will
      overwrite the persisted last transfer speed. On each transfer, the
      SPI speed is compared to the last transfer speed to determine if the
      clock divider registers need to be updated (did the speed change?).
      This bug was observed with the spidev driver using spi-config to
      update the max transfer speed.
      
      This fix: Don't overwrite the persisted last transaction clock speed
      when updating the SPI parameters in dw_spi_setup(). On the next
      transaction, the new speed won't match the persisted last speed
      and the hardware registers will be updated.
      On initialization, the persisted last transaction clock
      speed will be 0 but will be updated after the first SPI
      transaction.
      
      Move zeroed clock divider check into clock change test because
      chip->clk_div is zero on startup and would cause a divide-by-zero
      error. The calculation was wrong as well (can't support odd #).
      Reported-by: NVlastimil Setka <setka@vsis.cz>
      Signed-off-by: NVlastimil Setka <setka@vsis.cz>
      Signed-off-by: NThor Thayer <tthayer@opensource.altera.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      0a8727e6
  13. 09 10月, 2014 1 次提交
  14. 24 9月, 2014 2 次提交
  15. 14 9月, 2014 2 次提交
  16. 04 9月, 2014 1 次提交
    • J
      spi: dw: Fix checkpatch issue · fadcace7
      Jingoo Han 提交于
      Fix the following checkpatch warnings.
      
        WARNING: debugfs_remove_recursive(NULL) is safe this check is probably not required
        WARNING: min() should probably be min_t(u32, rx_left, dw_readw(dws, DW_SPI_RXFLR))
        WARNING: else is not generally useful after a break or return
        WARNING: Missing a blank line after declarations
        WARNING: void function return statements are not generally useful
      Signed-off-by: NJingoo Han <jg1.han@samsung.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      fadcace7
  17. 02 9月, 2014 1 次提交
    • A
      spi: dw: Don't use devm_kzalloc in master->setup callback · a97c883a
      Axel Lin 提交于
      device_add() expects that any memory allocated via devm_* API is only
      done in the device's probe function.
      
      Fix below boot warning:
      WARNING: CPU: 1 PID: 1 at drivers/base/dd.c:286 driver_probe_device+0x2b4/0x2f4()
      Modules linked in:
      CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.16.0-10474-g835c90b-dirty #160
      [<c0016364>] (unwind_backtrace) from [<c001251c>] (show_stack+0x20/0x24)
      [<c001251c>] (show_stack) from [<c04eaefc>] (dump_stack+0x7c/0x98)
      [<c04eaefc>] (dump_stack) from [<c0023d4c>] (warn_slowpath_common+0x78/0x9c)
      [<c0023d4c>] (warn_slowpath_common) from [<c0023d9c>] (warn_slowpath_null+0x2c/0x34)
      [<c0023d9c>] (warn_slowpath_null) from [<c0302c60>] (driver_probe_device+0x2b4/0x2f4)
      [<c0302c60>] (driver_probe_device) from [<c0302d90>] (__device_attach+0x50/0x54)
      [<c0302d90>] (__device_attach) from [<c0300e60>] (bus_for_each_drv+0x54/0x9c)
      [<c0300e60>] (bus_for_each_drv) from [<c0302958>] (device_attach+0x84/0x90)
      [<c0302958>] (device_attach) from [<c0301f10>] (bus_probe_device+0x94/0xb8)
      [<c0301f10>] (bus_probe_device) from [<c03000c0>] (device_add+0x434/0x4fc)
      [<c03000c0>] (device_add) from [<c0342dd4>] (spi_add_device+0x98/0x164)
      [<c0342dd4>] (spi_add_device) from [<c03444a4>] (spi_register_master+0x598/0x768)
      [<c03444a4>] (spi_register_master) from [<c03446b4>] (devm_spi_register_master+0x40/0x80)
      [<c03446b4>] (devm_spi_register_master) from [<c0346214>] (dw_spi_add_host+0x1a8/0x258)
      [<c0346214>] (dw_spi_add_host) from [<c0346920>] (dw_spi_mmio_probe+0x1d4/0x294)
      [<c0346920>] (dw_spi_mmio_probe) from [<c0304560>] (platform_drv_probe+0x3c/0x6c)
      [<c0304560>] (platform_drv_probe) from [<c0302a98>] (driver_probe_device+0xec/0x2f4)
      [<c0302a98>] (driver_probe_device) from [<c0302d3c>] (__driver_attach+0x9c/0xa0)
      [<c0302d3c>] (__driver_attach) from [<c0300f0c>] (bus_for_each_dev+0x64/0x98)
      [<c0300f0c>] (bus_for_each_dev) from [<c0302518>] (driver_attach+0x2c/0x30)
      [<c0302518>] (driver_attach) from [<c0302134>] (bus_add_driver+0xdc/0x1f4)
      [<c0302134>] (bus_add_driver) from [<c03035c8>] (driver_register+0x88/0x104)
      [<c03035c8>] (driver_register) from [<c030445c>] (__platform_driver_register+0x58/0x6c)
      [<c030445c>] (__platform_driver_register) from [<c0700f00>] (dw_spi_mmio_driver_init+0x18/0x20)
      [<c0700f00>] (dw_spi_mmio_driver_init) from [<c0008914>] (do_one_initcall+0x90/0x1d4)
      [<c0008914>] (do_one_initcall) from [<c06d7d90>] (kernel_init_freeable+0x178/0x248)
      [<c06d7d90>] (kernel_init_freeable) from [<c04e687c>] (kernel_init+0x18/0xfc)
      [<c04e687c>] (kernel_init) from [<c000ecd8>] (ret_from_fork+0x14/0x20)
      Reported-by: NThor Thayer <tthayer@opensource.altera.com>
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      a97c883a
  18. 28 8月, 2014 1 次提交
  19. 13 5月, 2014 1 次提交
  20. 25 4月, 2014 2 次提交
  21. 28 3月, 2014 1 次提交
  22. 03 3月, 2014 1 次提交
  23. 23 2月, 2014 1 次提交
  24. 31 12月, 2013 1 次提交