From patchwork Mon Dec 10 13:23:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Mitchell X-Patchwork-Id: 1858021 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8A482DFB79 for ; Mon, 10 Dec 2012 13:20:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751377Ab2LJNUw (ORCPT ); Mon, 10 Dec 2012 08:20:52 -0500 Received: from eumx.net ([91.82.101.43]:42012 "EHLO eumx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751046Ab2LJNUw (ORCPT ); Mon, 10 Dec 2012 08:20:52 -0500 X-Greylist: delayed 332 seconds by postgrey-1.27 at vger.kernel.org; Mon, 10 Dec 2012 08:20:51 EST Received: from localhost ([127.0.0.1]:48888 helo=eumx.net) by eumx.net with esmtp (Exim 4.72) (envelope-from ) id 1Ti3Hv-0007mA-0V for linux-omap@vger.kernel.org; Mon, 10 Dec 2012 13:20:51 +0000 Received: from [195.171.99.130] (port=22302 helo=[192.168.0.54]) by eumx.net with esmtpa (Exim 4.72) (envelope-from ) id 1Ti3Hu-0007m6-PF for linux-omap@vger.kernel.org; Mon, 10 Dec 2012 13:20:50 +0000 Message-ID: <50C5E23D.5040605@communistcode.co.uk> Date: Mon, 10 Dec 2012 13:23:09 +0000 From: Jack Mitchell Reply-To: ml@communistcode.co.uk User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: linux-omap@vger.kernel.org Subject: AM335x BeagleBone SPI Issues Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Hi, I am currently having issues with the SPI driver on the beaglebone using the 3.7-rc8 kernel[1]. I have probed the SPI pins and I have found that writing works however reading doesn't. When using DMA the program seems to lock hard and no data is sent on the bus. I am testing the bus using spidev and the spidev_test[2] application, however I first came across spi issues with a custom spi driver which stopped working when I transitioned from 3.2-psp to 3.7-rc8. The current output I am seeing from the spidev_test program is just a series of 0x00 data, which looks to me like no data is getting in at all. The spidev_test program is not using DMA as the buffer size is too low, so I forced the dma on when buffer size is > 1 and the program hangs hard with the system still responding to other commands.I have briged the pins 18 and 21 on the BeagleBone P9 header. Has anyone seen issues like this, or if not if someone could please test the latest 3.7-rc8 from [1] and let me know if it works for them and the issue is at my end. To get spidev working with devicetree I applied the patch from [3] and changed the dtb as in the patch pasted below. [1] https://github.com/beagleboard/kernel/tree/3.7 [2] http://lxr.linux.no/#linux+v3.6.9/Documentation/spi/spidev_test.c [3] http://www.mail-archive.com/spi-devel-general@lists.sourceforge.net/msg09958.html diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi index 543365d..8fff665 100644 --- a/arch/arm/boot/dts/am335x-bone-common.dtsi +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi @@ -440,10 +440,19 @@ }; &spi0 { + status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&spi0_pins>; + + spidev: spidev@0 { + compatible = "linux,spidev"; + reg = <0>; + spi-max-frequency = <24000000>; + }; + }; + &spi1 { pinctrl-names = "default"; pinctrl-0 = <&spi1_pins>;