linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* No Clock on SPI
@ 2006-08-15 16:45 GSM909
  2006-08-16 13:22 ` *** PROBABLY SPAM *** " Laurent Pinchart
  0 siblings, 1 reply; 2+ messages in thread
From: GSM909 @ 2006-08-15 16:45 UTC (permalink / raw)
  To: linuxppc-embedded

Hi

I´m writing a Driver for SPI. That is not working now.
I have a MPC8260 using Linux 2.6.14 (rheap patch).

Did someone else write a driver for SPI on this µC or an other driver? So I can see what i did wrong?

My SPCOM[STR] flag isn´t cleared automatically after one clock cycle.
What here going wrong ? ( I know this register is write only)
There is also no Clock on my SPICLK.

How I have to allocate the Memory for the BD´s and the buffer for the BD´s?

Is there something special when I allocate Memory for my Parameter Ram?

Is something wrong with the 2.6 Kernel so i have to use the 2.4 Kernel ?

I hope somebody could help. Thx

Regards
Fred

-- 


"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

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

* Re: *** PROBABLY SPAM *** No Clock on SPI
  2006-08-15 16:45 No Clock on SPI GSM909
@ 2006-08-16 13:22 ` Laurent Pinchart
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2006-08-16 13:22 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: GSM909

Hi Fred,

> I=C2=B4m writing a Driver for SPI. That is not working now.
> I have a MPC8260 using Linux 2.6.14 (rheap patch).
>
> Did someone else write a driver for SPI on this =C2=B5C or an other drive=
r? So I
> can see what i did wrong?

I'm working on an SPI driver for the MPC8248. I'll try to send a patch in a=
=20
few days.

> My SPCOM[STR] flag isn=C2=B4t cleared automatically after one clock cycle.
> What here going wrong ? ( I know this register is write only)
> There is also no Clock on my SPICLK.

Make sure you programmed the SPMODE register correctly.

> How I have to allocate the Memory for the BD=C2=B4s and the buffer for th=
e BD=C2=B4s?

The buffer descriptors should be allocated from CPM DPRAM using cpm_dpalloc=
().=20
The buffers can be allocated from any DMA-able memory (all system memory).

> Is there something special when I allocate Memory for my Parameter Ram?

You don't need to allocate memory for the parameter RAM. I declared PROFF_S=
PI=20
equal to 192 (I2C parameter RAM is at 128) in include/asm-ppc/cpm2.h:

#define PROFF_SMC1      (0)
#define PROFF_SMC2      (64)
#define PROFF_I2C       (128)
#define PROFF_SPI       (192)

Don't forget to set CPM_DATAONLY_BASE to 256 instead of 128 in the same fil=
e.

Then, set

*(u16 *)(&immap->im_dprambase[PROFF_SPI_BASE]) =3D PROFF_SPI;

in your driver code, and set the SPI pram resource to

=2Ename   =3D "pram",
=2Estart  =3D 0x00c0,
=2Eend    =3D 0x00ff,
=2Eflags  =3D IORESOURCE_MEM,

in arch/ppc/syslib/pq2_devices.c

> Is something wrong with the 2.6 Kernel so i have to use the 2.4 Kernel ?

You should not use 2.4. 2.6 is the way to go.

Laurent Pinchart

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

end of thread, other threads:[~2006-08-16 13:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-15 16:45 No Clock on SPI GSM909
2006-08-16 13:22 ` *** PROBABLY SPAM *** " Laurent Pinchart

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).