linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Larsson <andreas@gaisler.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	spi-devel-general@lists.sourceforge.net,
	Mingkai Hu <Mingkai.hu@freescale.com>,
	Anton Vorontsov <anton.vorontsov@linaro.org>,
	Joakim Tjernlund <Joakim.Tjernlund@transmode.se>,
	Kumar Gala <galak@kernel.crashing.org>,
	Peter Korsgaard <jacmet@sunsite.dk>,
	linux-kernel@vger.kernel.org, software@gaisler.com
Subject: [PATCH v2 0/7] spi: spi-fsl-spi: Make spi-fsl-spi usable in cpu mode outside of FSL SOC environments and add a grlib variant normally running on sparc
Date: Thu,  7 Feb 2013 14:12:04 +0100	[thread overview]
Message-ID: <1360242731-13700-1-git-send-email-andreas@gaisler.com> (raw)

This makes the cpu mode of the driver available outside of an FSL SOC
and even powerpc environment. Furthermore, this adds support for the
mostly register-compatible SPICTRL core from the GRLIB VHDL IP core
library normally running on SPARC.

This effort is split up in several patches for clarity of what is being
changed. Patches 3-5 prepares for the introduction of the GRLIB SPICTRL
functionality in patch 6. 

To use what is introduced right away they could eventually be merged:
  Patch A: patch 1
  Patch B: patch 2
  Patch C: patches 3-6 merged
  Patch D: patch 7

Patch 1 makes the driver compileable and presumably useable outside of
FSL SOC and powerpc environments (SPARC in particular)

Patch 2 fixes a bug that can happen when a device uses SPI_CS_HIGH

Patches 3-6 makes the driver working for GRLIB SPICTRL cores that has
the built in slave select register and that uses that exclusively for
chipselects.

Patch 7 introduces gpio support for GRLIB SPICTRL cores. That patch (and
that patch only) relies upon the "of, of_gpio, of_spi: Fix and improve
of_parse_phandle_with_args, of_gpio_named_count and
of_spi_register_master" patchset - https://lkml.org/lkml/2013/1/29/308

The GRLIB type has been tested under sparc. The FSL type has been
compile tested in powerpc, arm and x86 environments. It would be great
if someone with an FSL board could test this out.

One could argue that it would be better to add the GRLIB variant as a
mode flag in of_mpc8xxx_spi_probe instead of using a new type field, but
that would require to add a flag for this core in
include/linux/fsl_devices.h which does not feel right given that this
core is not part of an FSL device.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>

Andreas Larsson (7):
  spi: spi-fsl-spi: Make driver usable in CPU mode outside of an
    FSL_SOC environment
  spi: spi-fsl-spi: Make sure in spi_fsl_setup that chipselect becomes
    inactive
  spi: spi-fsl-spi: Move setting non-zero tx and rx shifts to a
    function accessed by a function pointer
  spi: spi-fsl-spi: Introduce a type for the driver
  spi: spi-fsl-spi: Add support for setting a maximum number of bits
    per word
  spi: spi-fsl-spi: Add support for Aeroflex Gaisler GRLIB cores
    normally running on SPARC
  spi: spi-fsl-spi: Add support for gpio chipselects for GRLIB type
    cores

 Documentation/devicetree/bindings/spi/fsl-spi.txt  |    3 +-
 .../devicetree/bindings/vendor-prefixes.txt        |    1 +
 drivers/spi/Kconfig                                |   11 +-
 drivers/spi/Makefile                               |    1 +
 drivers/spi/spi-fsl-cpm.c                          |  387 +++++++++++++
 drivers/spi/spi-fsl-cpm.h                          |   43 ++
 drivers/spi/spi-fsl-lib.c                          |    8 +
 drivers/spi/spi-fsl-lib.h                          |   15 +-
 drivers/spi/spi-fsl-spi.c                          |  610 ++++++--------------
 drivers/spi/spi-fsl-spi.h                          |   72 +++
 10 files changed, 725 insertions(+), 426 deletions(-)
 create mode 100644 drivers/spi/spi-fsl-cpm.c
 create mode 100644 drivers/spi/spi-fsl-cpm.h
 create mode 100644 drivers/spi/spi-fsl-spi.h

             reply	other threads:[~2013-02-07 13:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-07 13:12 Andreas Larsson [this message]
2013-02-07 13:12 ` [PATCH v2 3/7] spi: spi-fsl-spi: Move setting non-zero tx and rx shifts to a function accessed by a function pointer Andreas Larsson
     [not found] ` <1360242731-13700-1-git-send-email-andreas-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>
2013-02-07 13:12   ` [PATCH v2 1/7] spi: spi-fsl-spi: Make driver usable in CPU mode outside of an FSL_SOC environment Andreas Larsson
2013-02-07 13:12   ` [PATCH v2 2/7] spi: spi-fsl-spi: Make sure in spi_fsl_setup that chipselect becomes inactive Andreas Larsson
2013-02-07 13:12   ` [PATCH v2 4/7] spi: spi-fsl-spi: Introduce a type for the driver Andreas Larsson
2013-02-07 13:12   ` [PATCH v2 5/7] spi: spi-fsl-spi: Add support for setting a maximum number of bits per word Andreas Larsson
2013-02-07 13:12   ` [PATCH v2 6/7] spi: spi-fsl-spi: Add support for Aeroflex Gaisler GRLIB cores normally running on SPARC Andreas Larsson
2013-02-07 13:12   ` [PATCH v2 7/7] spi: spi-fsl-spi: Add support for gpio chipselects for GRLIB type cores Andreas Larsson
2013-02-07 16:08     ` Anton Vorontsov
     [not found]       ` <20130207160821.GA22224-1CZZkhFgUWNRmOO2HpYVOJIbA5emDH3N@public.gmane.org>
2013-02-08  7:46         ` Andreas Larsson
2013-03-02 21:34         ` Grant Likely
2013-02-07 13:38   ` [PATCH v2 4/7 RESEND] spi: spi-fsl-spi: Introduce a type for the driver Andreas Larsson
2013-02-07 16:08 ` [PATCH v2 0/7] spi: spi-fsl-spi: Make spi-fsl-spi usable in cpu mode outside of FSL SOC environments and add a grlib variant normally running on sparc Anton Vorontsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360242731-13700-1-git-send-email-andreas@gaisler.com \
    --to=andreas@gaisler.com \
    --cc=Joakim.Tjernlund@transmode.se \
    --cc=Mingkai.hu@freescale.com \
    --cc=anton.vorontsov@linaro.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=galak@kernel.crashing.org \
    --cc=grant.likely@secretlab.ca \
    --cc=jacmet@sunsite.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=software@gaisler.com \
    --cc=spi-devel-general@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).