From: Felipe Balbi <balbi@ti.com>
To: Felipe Balbi <balbi@ti.com>
Cc: Jack Mitchell <ml@communistcode.co.uk>,
linux-omap@vger.kernel.org,
Shubhrajyoti Datta <omaplinuxkernel@gmail.com>
Subject: Re: AM335x BeagleBone SPI Issues
Date: Tue, 11 Dec 2012 16:27:26 +0200 [thread overview]
Message-ID: <20121211142725.GA17708@arwen.pp.htv.fi> (raw)
In-Reply-To: <20121211114810.GH19367@arwen.pp.htv.fi>
[-- Attachment #1: Type: text/plain, Size: 3425 bytes --]
Hi again,
On Tue, Dec 11, 2012 at 01:48:10PM +0200, Felipe Balbi wrote:
> On Tue, Dec 11, 2012 at 10:38:58AM +0000, Jack Mitchell wrote:
> > On 11/12/12 10:20, Felipe Balbi wrote:
> > >Hi,
> > >
> > >On Tue, Dec 11, 2012 at 10:17:42AM +0000, Jack Mitchell wrote:
> > >
> > ><big snip>
> > >
> > >>Shubhro, Felipe,
> > >>
> > >>Thank you, the reordering dma patch fixed the dma issue I was having!
> > >>However, the bad news, I now get the same results for the dma and
> > >>non-dma spidev test. While the scope shows the SPI clk and data is
> > >>fine, the reading from the program still shows 0x00 for all words.
> > ><removed spidev_test output>
> > >
> > >>dmesg shows nothing of interest apart from the spi bus setting up.
> > >>Any ideas?
> > >>
> > >>To iterate for my own sanity; I have bridged pins 18 and 21 on the P9
> > >>header which should be the d0 and d1 spi data pins for spi0. This
> > >>result of 0x00 usually comes from a result of not joining the pins,
> > >>but I can assure you they are joined!
> > >>
> > >>Thank you for the help so far.
> > >according to the schematics [1], those pins are muxed as UART2_TXD and
> > >I2C1_SDA, have you remuxed them properly ? Can you try with pins 29 and
> > >30 on the same header ? That's SPI1, so you will have to add DT data for
> > >spidev on that bus too.
> > >
> > >[1] http://beagleboard.org/static/beaglebone/latest/Docs/Hardware/BONE_SCH.pdf
> > >
> >
> > No change unfortunately:
> >
> > root@beaglebone:~# ./spidev
> > spi mode: 0
> > bits per word: 16
> > max speed: 24000000 Hz (24000 KHz)
> >
> > 00 00 00 00 00 00
> > 00 00 00 00 00 00
> > 00 00 00 00 00 00
> > 00 00 00 00 00 00
> > 00 00 00 00 00 00
> > 00 00 00 00 00 00
> > 00 00
> >
> > root@beaglebone:~# ./spidev -D /dev/s
> > shm/ spidev1.0 spidev2.0 stderr stdin stdout
> > root@beaglebone:~# ./spidev -D /dev/spidev2.0
one thing caught my attention, shouldn't you be passing '-l' argument
here for loopback testing ? That would mean you need to make sure your
"spi->mode" has SPI_LOOP flag set. Currently there is no way to do that
via DeviceTree (AFAICT), so please apply ths patch to your tree and set
spi-loopback; property for your spidev entry:
diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt
index 296015e..1949586 100644
--- a/Documentation/devicetree/bindings/spi/spi-bus.txt
+++ b/Documentation/devicetree/bindings/spi/spi-bus.txt
@@ -55,6 +55,8 @@ contain the following properties.
chip select active high
- spi-3wire - (optional) Empty property indicating device requires
3-wire mode.
+- spi-loopback - (optional) Empty property indicating device requires
+ loopback mode.
If a gpio chipselect is used for the SPI slave the gpio number will be passed
via the cs_gpio
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 3f1b9ee..6bcdc03 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -868,6 +868,8 @@ static void of_register_spi_devices(struct spi_master *master)
spi->mode |= SPI_CS_HIGH;
if (of_find_property(nc, "spi-3wire", NULL))
spi->mode |= SPI_3WIRE;
+ if (of_find_property(nc, "spi-loopback", NULL))
+ spi->mode |= SPI_LOOP;
/* Device speed */
prop = of_get_property(nc, "spi-max-frequency", &len);
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-12-11 14:34 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-10 13:23 AM335x BeagleBone SPI Issues Jack Mitchell
2012-12-10 13:53 ` Felipe Balbi
2012-12-10 14:50 ` Jack Mitchell
2012-12-10 14:59 ` Felipe Balbi
2012-12-10 15:19 ` Jack Mitchell
2012-12-10 15:26 ` Shubhrajyoti Datta
2012-12-10 16:18 ` Jack Mitchell
2012-12-10 18:35 ` Felipe Balbi
2012-12-11 6:39 ` Shubhrajyoti Datta
2012-12-11 10:17 ` Jack Mitchell
2012-12-11 10:20 ` Felipe Balbi
2012-12-11 10:38 ` Jack Mitchell
2012-12-11 11:48 ` Felipe Balbi
2012-12-11 14:27 ` Felipe Balbi [this message]
2012-12-11 15:23 ` Jack Mitchell
2012-12-11 16:15 ` Felipe Balbi
2012-12-11 15:22 ` Ben Gamari
2012-12-11 16:24 ` Jack Mitchell
2012-12-11 16:36 ` Jack Mitchell
2012-12-11 17:02 ` Jack Mitchell
2013-01-04 14:46 ` Jan Lübbe
2013-01-04 16:21 ` Jack Mitchell
2013-01-04 16:36 ` Jack Mitchell
2012-12-11 17:03 ` Felipe Balbi
2012-12-11 17:52 ` Felipe Balbi
2012-12-12 8:07 ` Felipe Balbi
-- strict thread matches above, loose matches on Subject: below --
2012-12-10 13:17 Jack Mitchell
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=20121211142725.GA17708@arwen.pp.htv.fi \
--to=balbi@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=ml@communistcode.co.uk \
--cc=omaplinuxkernel@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.