1. 24 9月, 2011 1 次提交
  2. 06 7月, 2011 1 次提交
    • H
      spi/fsl_spi: fix CPM spi driver · fb644095
      Holger Brunck 提交于
      This patch fixes the freescale spi driver for CPM. Without this
      patch SPI on CPM failed because cpm_muram_alloc_fixed tries to
      allocate muram in an preserved area. The error reported was:
      
      mpc8xxx_spi f0011a80.spi: can't allocate spi parameter ram
      mpc8xxx_spi: probe of f0011a80.spi failed with error -12
      
      Now the driver uses of_iomap to get access to this area
      similar to i2c driver driver in the i2c-cpm.c which has a
      similar device tree node. This is tested on a MPC8247 with CPM2.
      Signed-off-by: NHolger Brunck <holger.brunck@keymile.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      fb644095
  3. 06 6月, 2011 1 次提交
  4. 01 3月, 2011 1 次提交
  5. 13 10月, 2010 2 次提交
  6. 17 9月, 2010 1 次提交
  7. 06 8月, 2010 1 次提交
  8. 30 7月, 2010 1 次提交
  9. 12 7月, 2010 1 次提交
  10. 25 5月, 2010 2 次提交
  11. 22 5月, 2010 2 次提交
  12. 19 5月, 2010 1 次提交
  13. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  14. 16 3月, 2010 1 次提交
  15. 17 2月, 2010 1 次提交
    • E
      spi: Correct SPI clock frequency setting in spi_mpc8xxx · 4f4517c4
      Ernst Schwab 提交于
      Correct SPI clock frequency division factor rounding, preventing clock rates
      higher than the maximum specified clock frequency being used.
      
      When specifying spi-max-frequency = <10000000> in the device tree,
      the resulting frequency was 11.1 MHz, with spibrg being 133333332.
      
      According to the freescale data sheet [1], the spi clock rate is
      spiclk = spibrg / (4 * (pm+1))
      
      The existing code calculated
        pm = mpc8xxx_spi->spibrg / (hz * 4); pm--;
        resulting in pm = (int) (3.3333) - 1 = 2,
        resulting in spiclk = 133333332/(4*(2+1)) = 11111111
      
        With the fix,
         pm = (mpc8xxx_spi->spibrg - 1) / (hz * 4) + 1; pm--;
         resulting in pm = (int) (4.3333) - 1 = 3,
         resulting in spiclk = 133333332/(4*(3+1)) = 8333333
      
         Without the fix, for every desired SPI frequency that
         is not exactly derivable from spibrg, pm will be too
         small due to rounding down, resulting in a too high SPI clock,
         so we need a pm which is one higher.
      
         For values that are exactly derivable, spibrg will
         be dividable by (hz*4) without remainder, and
         (int) ((spibrg-1)/(hz*4)) will be one lower than
         (int) (spibrg)/(hz*4), which is compensated by adding 1.
         For these values, the fixed version calculates the same pm
         as the unfixed version.
      
         For all values that are not exactly derivable,
         spibrg will be not dividable by (hz*4) without
         remainder, and (int) ((spibrg-1)/(hz*4)) will be
         the same as (int) (spibrg)/(hz*4), and the calculated pm will
         be one higher than calculated by the unfixed version.
      
      References:
      [1] http://www.freescale.com/files/32bit/doc/ref_manual/MPC8315ERM.pdf,
         page 22-10 -> 1398
      Signed-off-by: NErnst Schwab <eschwab@online.de>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      4f4517c4
  16. 21 1月, 2010 1 次提交
  17. 18 12月, 2009 1 次提交
  18. 09 12月, 2009 1 次提交
  19. 24 11月, 2009 1 次提交
  20. 12 11月, 2009 4 次提交
  21. 20 6月, 2009 7 次提交
  22. 19 6月, 2009 2 次提交
  23. 17 6月, 2009 1 次提交
  24. 01 4月, 2009 3 次提交
    • A
      spi_mpc83xx: add OF platform driver bindings · 35b4b3c0
      Anton Vorontsov 提交于
      Implement full support for OF SPI bindings.  Now the driver can manage its
      own chip selects without any help from the board files and/or fsl_soc
      constructors.
      
      The "legacy" code is well isolated and could be removed as time goes by.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Kumar Gala <galak@gate.crashing.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      35b4b3c0
    • A
      spi_mpc83xx: rework chip selects handling · 364fdbc0
      Anton Vorontsov 提交于
      The main purpose of this patch is to pass 'struct spi_device' to the chip
      select handling routines.  This is needed so that we could implement
      full-fledged OpenFirmware support for this driver.
      
      While at it, also:
      - Replace two {de,activate}_cs routines by single cs_contol().
      - Don't duplicate platform data callbacks in mpc83xx_spi struct.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Kumar Gala <galak@gate.crashing.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      364fdbc0
    • A
      spi_mpc83xx: fix sparse warnings · 34c8a20c
      Anton Vorontsov 提交于
      The patch fixes following sparse warnings:
      
        CHECK   spi_mpc83xx.c
      spi_mpc83xx.c:145:1: warning: symbol 'mpc83xx_spi_rx_buf_u8' was not declared. Should it be static?
      spi_mpc83xx.c:146:1: warning: symbol 'mpc83xx_spi_rx_buf_u16' was not declared. Should it be static?
      spi_mpc83xx.c:147:1: warning: symbol 'mpc83xx_spi_rx_buf_u32' was not declared. Should it be static?
      spi_mpc83xx.c:148:1: warning: symbol 'mpc83xx_spi_tx_buf_u8' was not declared. Should it be static?
      spi_mpc83xx.c:149:1: warning: symbol 'mpc83xx_spi_tx_buf_u16' was not declared. Should it be static?
      spi_mpc83xx.c:150:1: warning: symbol 'mpc83xx_spi_tx_buf_u32' was not declared. Should it be static?
      spi_mpc83xx.c:175:32: warning: incorrect type in initializer (different address spaces)
      spi_mpc83xx.c:175:32:    expected void *tmp_ptr
      spi_mpc83xx.c:175:32:    got unsigned int [noderef] <asn:2>*<noident>
      spi_mpc83xx.c:183:26: warning: incorrect type in argument 1 (different address spaces)
      spi_mpc83xx.c:183:26:    expected unsigned int [noderef] [usertype] <asn:2>*reg
      spi_mpc83xx.c:183:26:    got void *tmp_ptr
      spi_mpc83xx.c:184:26: warning: incorrect type in argument 1 (different address spaces)
      spi_mpc83xx.c:184:26:    expected unsigned int [noderef] [usertype] <asn:2>*reg
      spi_mpc83xx.c:184:26:    got void *tmp_ptr
      spi_mpc83xx.c:287:31: warning: incorrect type in initializer (different address spaces)
      spi_mpc83xx.c:287:31:    expected void *tmp_ptr
      spi_mpc83xx.c:287:31:    got unsigned int [noderef] <asn:2>*<noident>
      spi_mpc83xx.c:295:25: warning: incorrect type in argument 1 (different address spaces)
      spi_mpc83xx.c:295:25:    expected unsigned int [noderef] [usertype] <asn:2>*reg
      spi_mpc83xx.c:295:25:    got void *tmp_ptr
      spi_mpc83xx.c:296:25: warning: incorrect type in argument 1 (different address spaces)
      spi_mpc83xx.c:296:25:    expected unsigned int [noderef] [usertype] <asn:2>*reg
      spi_mpc83xx.c:296:25:    got void *tmp_ptr
      spi_mpc83xx.c:486:13: warning: symbol 'mpc83xx_spi_irq' was not declared. Should it be static?
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Kumar Gala <galak@gate.crashing.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      34c8a20c
  25. 25 3月, 2009 1 次提交