All of lore.kernel.org
 help / color / mirror / Atom feed
* need help getting SPI controller working on 405EX
@ 2009-08-06 16:08 Nathan French
  0 siblings, 0 replies; 6+ messages in thread
From: Nathan French @ 2009-08-06 16:08 UTC (permalink / raw)
  To: linuxppc-dev

Hi, I am trying to add support for the 405EX's SPI controller on a Kilauea board.  I've added the below to the device tree (under plb/opb/):

[nfrench@nfrench-laptop linux-2.6-denx]$ diff -C2 arch/powerpc/boot/dts/kilauea.dts spi.dts
*** arch/powerpc/boot/dts/kilauea.dts	2009-05-05 15:56:16.000000000 -0700
--- spi.dts	2009-08-06 08:42:19.000000000 -0700
***************
*** 207,210 ****
--- 207,221 ----
  				#size-cells = <0>;
  			};
+             
+             SPI0: spi@ef600600 {
+                 cell-index = <0>;
+                 compatible = "ibm,spi-405ex", "ibm,spi";
+                 reg = <ef600600 6>;
+                 interrupts = <8 4>;
+                 interrupt-parent = <&UIC0>;
+                 mode = "cpu";
+             };
  
  			RGMII0: emac-rgmii@ef600b00 {

I've also compiled my kernel with the following enabled:

        CONFIG_SPI=y
        CONFIG_SPI_MASTER=y
        CONFIG_SPI_SPIDEV=y

I see this make it into the device tree after boot:

        [root@10.2.3.28 /]$ find /proc/device-tree/ | grep spi
        /proc/device-tree/plb/opb/spi@ef600600
        /proc/device-tree/plb/opb/spi@ef600600/name
        /proc/device-tree/plb/opb/spi@ef600600/mode
        /proc/device-tree/plb/opb/spi@ef600600/interrupt-parent
        /proc/device-tree/plb/opb/spi@ef600600/interrupts
        /proc/device-tree/plb/opb/spi@ef600600/reg
        /proc/device-tree/plb/opb/spi@ef600600/compatible
        /proc/device-tree/plb/opb/spi@ef600600/cell-index

But I don't see any /dev/spidev* devices created or any mention of SPI
at boot time.  I'm starting to suspect that I don't have the kernel
configured right, otherwise I would see at least the SPI driver
complaining about something, right?

Thanks,

Nathan French

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: need help getting SPI controller working on 405EX
  2009-08-11 15:59       ` Nathan French
@ 2009-08-11 16:11         ` Stefan Roese
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Roese @ 2009-08-11 16:11 UTC (permalink / raw)
  To: Nathan French; +Cc: linuxppc-dev, linuxppc-dev, Lorenz Kolb

On Tuesday 11 August 2009 17:59:26 Nathan French wrote:
> This is good news.  Can you point me towards the patch for that?

Sure. Latest version is: "[PATCH v8] spi: Add PPC4xx SPI driver":

http://article.gmane.org/gmane.linux.ports.ppc64.devel/57940

Best regards,
Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: need help getting SPI controller working on 405EX
  2009-08-11  5:44     ` Stefan Roese
@ 2009-08-11 15:59       ` Nathan French
  2009-08-11 16:11         ` Stefan Roese
  0 siblings, 1 reply; 6+ messages in thread
From: Nathan French @ 2009-08-11 15:59 UTC (permalink / raw)
  To: Stefan Roese; +Cc: linuxppc-dev, linuxppc-dev, Lorenz Kolb

This is good news.  Can you point me towards the patch for that?

Nathan

On Tue, 2009-08-11 at 01:44 -0400, Stefan Roese wrote:
> On Monday 10 August 2009 18:07:15 Nathan French wrote:
> > > At least something similar worked for me some months ago (before we
> > > switched to a "real" driver for some custom peripheral).
> >
> > Did this work on a 4xx PowerPC platform?  Or something else?  I've been
> > told that there is no SPI driver for 4xx.  If you have done this on 4xx
> > then I'm very interested.
> 
> The 4xx SPI driver is (finally) queued for 2.6.32. So you either need to 
> manually apply it now or wait a while.
> 
> Best regards,
> Stefan
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: need help getting SPI controller working on 405EX
  2009-08-10 16:07   ` Nathan French
@ 2009-08-11  5:44     ` Stefan Roese
  2009-08-11 15:59       ` Nathan French
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Roese @ 2009-08-11  5:44 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linuxppc-dev, Nathan French, Lorenz Kolb

On Monday 10 August 2009 18:07:15 Nathan French wrote:
> > At least something similar worked for me some months ago (before we
> > switched to a "real" driver for some custom peripheral).
>
> Did this work on a 4xx PowerPC platform?  Or something else?  I've been
> told that there is no SPI driver for 4xx.  If you have done this on 4xx
> then I'm very interested.

The 4xx SPI driver is (finally) queued for 2.6.32. So you either need to 
manually apply it now or wait a while.

Best regards,
Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: need help getting SPI controller working on 405EX
  2009-08-09 13:38 ` Lorenz Kolb
@ 2009-08-10 16:07   ` Nathan French
  2009-08-11  5:44     ` Stefan Roese
  0 siblings, 1 reply; 6+ messages in thread
From: Nathan French @ 2009-08-10 16:07 UTC (permalink / raw)
  To: Lorenz Kolb; +Cc: linuxppc-dev

Lorenz, thanks for the reply.

> For getting spidev devices you have to add entries for an spidev device 
> to your newly created spi-"bus". So what you are currently missing are 
> the spidev child-nodes in the device tree.
> As I'm currently cut off from some device to test, no guaranty that it 
> will work, but your dts entry should look something like:
> 
>               SPI0: spi@ef600600 {
>                   cell-index = <0>;
>                   compatible = "ibm,spi-405ex", "ibm,spi";
>                   reg = <ef600600 6>;
>                   interrupts = <8 4>;
>                   interrupt-parent = <&UIC0>;
>                   mode = "cpu";
> 
>                   yourdevice@0 {
>                       compatible = "spidev";
>                       spi-max-frequency = <1000000>; /* what ever your 
> max-freq. is */
>                       reg = <0>; /* Chipselect-address */
>                   };
>               };

This did not appear to have any effect.

> At least something similar worked for me some months ago (before we 
> switched to a "real" driver for some custom peripheral).

Did this work on a 4xx PowerPC platform?  Or something else?  I've been
told that there is no SPI driver for 4xx.  If you have done this on 4xx
then I'm very interested.

Thanks,

Nathan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: need help getting SPI controller working on 405EX
       [not found] <1249574886.3747.2650.camel__48649.694157257$1249575290$gmane$org@localhost.localdomain>
@ 2009-08-09 13:38 ` Lorenz Kolb
  2009-08-10 16:07   ` Nathan French
  0 siblings, 1 reply; 6+ messages in thread
From: Lorenz Kolb @ 2009-08-09 13:38 UTC (permalink / raw)
  To: linuxppc-dev

Nathan French wrote:
> Hi, I am trying to add support for the 405EX's SPI controller on a Kilauea board.  I've added the below to the device tree (under plb/opb/):
> 
> [nfrench@nfrench-laptop linux-2.6-denx]$ diff -C2 arch/powerpc/boot/dts/kilauea.dts spi.dts
> *** arch/powerpc/boot/dts/kilauea.dts	2009-05-05 15:56:16.000000000 -0700
> --- spi.dts	2009-08-06 08:42:19.000000000 -0700
> ***************
> *** 207,210 ****
> --- 207,221 ----
>   				#size-cells = <0>;
>   			};
> +             
> +             SPI0: spi@ef600600 {
> +                 cell-index = <0>;
> +                 compatible = "ibm,spi-405ex", "ibm,spi";
> +                 reg = <ef600600 6>;
> +                 interrupts = <8 4>;
> +                 interrupt-parent = <&UIC0>;
> +                 mode = "cpu";
> +             };
>   
>   			RGMII0: emac-rgmii@ef600b00 {
> 

That entry within the device tree will generally make the spi-"bus" 
known to Linux, that's ok so far.

> I've also compiled my kernel with the following enabled:
> 
>         CONFIG_SPI=y
>         CONFIG_SPI_MASTER=y
>         CONFIG_SPI_SPIDEV=y
> 
> I see this make it into the device tree after boot:
> 
>         [root@10.2.3.28 /]$ find /proc/device-tree/ | grep spi
>         /proc/device-tree/plb/opb/spi@ef600600
>         /proc/device-tree/plb/opb/spi@ef600600/name
>         /proc/device-tree/plb/opb/spi@ef600600/mode
>         /proc/device-tree/plb/opb/spi@ef600600/interrupt-parent
>         /proc/device-tree/plb/opb/spi@ef600600/interrupts
>         /proc/device-tree/plb/opb/spi@ef600600/reg
>         /proc/device-tree/plb/opb/spi@ef600600/compatible
>         /proc/device-tree/plb/opb/spi@ef600600/cell-index
> 
> But I don't see any /dev/spidev* devices created or any mention of SPI
> at boot time.  I'm starting to suspect that I don't have the kernel
> configured right, otherwise I would see at least the SPI driver
> complaining about something, right?

For getting spidev devices you have to add entries for an spidev device 
to your newly created spi-"bus". So what you are currently missing are 
the spidev child-nodes in the device tree.
As I'm currently cut off from some device to test, no guaranty that it 
will work, but your dts entry should look something like:

              SPI0: spi@ef600600 {
                  cell-index = <0>;
                  compatible = "ibm,spi-405ex", "ibm,spi";
                  reg = <ef600600 6>;
                  interrupts = <8 4>;
                  interrupt-parent = <&UIC0>;
                  mode = "cpu";

                  yourdevice@0 {
                      compatible = "spidev";
                      spi-max-frequency = <1000000>; /* what ever your 
max-freq. is */
                      reg = <0>; /* Chipselect-address */
                  };
              };

> 
> Thanks,
> 
> Nathan French

At least something similar worked for me some months ago (before we 
switched to a "real" driver for some custom peripheral).

Regards,

Lorenz

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-08-11 16:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-06 16:08 need help getting SPI controller working on 405EX Nathan French
     [not found] <1249574886.3747.2650.camel__48649.694157257$1249575290$gmane$org@localhost.localdomain>
2009-08-09 13:38 ` Lorenz Kolb
2009-08-10 16:07   ` Nathan French
2009-08-11  5:44     ` Stefan Roese
2009-08-11 15:59       ` Nathan French
2009-08-11 16:11         ` Stefan Roese

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.