From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: IMX SPI - 17-24 bit bug and >32 bit support.
Date: Wed, 15 Dec 2010 22:55:55 +0100 [thread overview]
Message-ID: <20101215215555.GF29833@pengutronix.de> (raw)
In-Reply-To: <BLU0-SMTP23E8D9768DB476BFCE7B23B8140@phx.gbl>
On Wed, Dec 15, 2010 at 04:33:54PM -0500, Bill Pringlemeir wrote:
>
> Attach is an example patch to the spi_imx.c file. The iMX spi doesn't
> handle 17-24bit values properly. At least in sound/soc, the 24 bit
> values are being passed with three data bytes per unit. Also the SPI
> count is being filled with '3' as a length. Such data passed to the
> current iMX spi driver will cause it to loop forever as it decrements
> the unsigned length by '4' and eventually accesses invalid memory.
>
> I believe that the reset of the kernel believes that the SPI layer
> should use three bytes per transfer/receive item if the SPI word
> length is 17 to 24 bits.
I remember soneone mentioned this already. Patches for this are welcome.
>
> The other issue is that the current driver does not support SPI
> transfers of greater than 32bits (called 'BURST LENGTH' in iMX
> documentation).
The support for transfers > 32 bit is arguably broken at least on the
older cspi cores. That's why the we have the following comment next to
the spi platform data:
/*
* struct spi_imx_master - device.platform_data for SPI controller devices.
* @chipselect: Array of chipselects for this master. Numbers >= 0 mean gpio
* pins, numbers < 0 mean internal CSPI chipselects according
* to MXC_SPI_CS(). Normally you want to use gpio based chip
* selects as the CSPI module tries to be intelligent about
* when to assert the chipselect: The CSPI module deasserts the
* chipselect once it runs out of input data. The other problem
* is that it is not possible to mix between high active and low
* active chipselects on one single bus using the internal
* chipselects. Unfortunately Freescale decided to put some
* chipselects on dedicated pins which are not usable as gpios,
* so we have to support the internal chipselects.
* @num_chipselect: ARRAY_SIZE(chipselect)
*/
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2010-12-15 21:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-15 21:33 IMX SPI - 17-24 bit bug and >32 bit support Bill Pringlemeir
2010-12-15 21:55 ` Sascha Hauer [this message]
[not found] <878vzq3em5.fsf@sympatico.ca>
2010-12-15 21:39 ` Bill Pringlemeir
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=20101215215555.GF29833@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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).