* psc and spi
@ 2008-01-15 13:53 S. Fricke
2008-01-15 14:51 ` Grant Likely
0 siblings, 1 reply; 4+ messages in thread
From: S. Fricke @ 2008-01-15 13:53 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 709 bytes --]
Hello friends,
I have on the psc3 the spi-interface of a fpga connected.
psc3-0 - MOSI
psc3-1 - MISO
psc3-2 - CLK
psc3-3 - SlaveSelect
psc3-4 - CS-FPGA
psc3-5 - CS Another device
psc3-6 - SPI-SEL0
psc3-7 - SPI-SEL1
psc3-8/9 - Not connected
Can I use the mpc52xx_psc_spi-driver? And if yes, how I have to use this
driver? Or must I write a own spi-master/slave thing? Can anyone point me
to a good start-position?
Best regards,
Silvio Fricke
--
-- S. Fricke ----------------------------- MAILTO:silvio.fricke@gmail.com --
Diplom-Informatiker (FH)
Linux-Entwicklung
----------------------------------------------------------------------------
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: psc and spi
2008-01-15 13:53 psc and spi S. Fricke
@ 2008-01-15 14:51 ` Grant Likely
2008-01-17 7:36 ` S. Fricke
2008-04-02 13:06 ` S. Fricke
0 siblings, 2 replies; 4+ messages in thread
From: Grant Likely @ 2008-01-15 14:51 UTC (permalink / raw)
To: S. Fricke; +Cc: linuxppc-dev
On 1/15/08, S. Fricke <silvio.fricke@googlemail.com> wrote:
> Hello friends,
>
> I have on the psc3 the spi-interface of a fpga connected.
>
> psc3-0 - MOSI
> psc3-1 - MISO
> psc3-2 - CLK
> psc3-3 - SlaveSelect
> psc3-4 - CS-FPGA
> psc3-5 - CS Another device
> psc3-6 - SPI-SEL0
> psc3-7 - SPI-SEL1
> psc3-8/9 - Not connected
>
> Can I use the mpc52xx_psc_spi-driver? And if yes, how I have to use this
> driver? Or must I write a own spi-master/slave thing? Can anyone point me
> to a good start-position?
Yes, you should be able to use the mpc52xx_psc_spi driver. You'' need
to add the activate_cs and deactivate_cs hooks in your platform code
to activate your SPI CS lines. You'll also need to set port_config to
have the PSC3 pins in "CODEC3" mode.
Cheers,
g.
>
> Best regards,
> Silvio Fricke
>
> --
> -- S. Fricke ----------------------------- MAILTO:silvio.fricke@gmail.com --
> Diplom-Informatiker (FH)
> Linux-Entwicklung
> ----------------------------------------------------------------------------
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: psc and spi
2008-01-15 14:51 ` Grant Likely
@ 2008-01-17 7:36 ` S. Fricke
2008-04-02 13:06 ` S. Fricke
1 sibling, 0 replies; 4+ messages in thread
From: S. Fricke @ 2008-01-17 7:36 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1049 bytes --]
HeHo,
> > I have on the psc3 the spi-interface of a fpga connected.
> >
> > [...]
> >
> > Can I use the mpc52xx_psc_spi-driver? And if yes, how I have to use this
> > driver? Or must I write a own spi-master/slave thing? Can anyone point me
> > to a good start-position?
>
> Yes, you should be able to use the mpc52xx_psc_spi driver. You'' need
> to add the activate_cs and deactivate_cs hooks in your platform code
> to activate your SPI CS lines. You'll also need to set port_config to
> have the PSC3 pins in "CODEC3" mode.
What is the mostly used way for that?
I think, firstly I must define a "fsl_spi_platform_data"-structure, for use
in a "platform_device"-structure. And now I register this "device" with
"platform_device_register".
Or what is the appropriate way?
Best Regards,
Silvio Fricke
--
-- S. Fricke ----------------------------- MAILTO:silvio.fricke@gmail.com --
Diplom-Informatiker (FH)
Linux-Entwicklung
----------------------------------------------------------------------------
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: psc and spi
2008-01-15 14:51 ` Grant Likely
2008-01-17 7:36 ` S. Fricke
@ 2008-04-02 13:06 ` S. Fricke
1 sibling, 0 replies; 4+ messages in thread
From: S. Fricke @ 2008-04-02 13:06 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 2369 bytes --]
Hello,
> On 1/15/08, S. Fricke <silvio.fricke@googlemail.com> wrote:
> > Hello friends,
> >
> > I have on the psc3 the spi-interface of a fpga connected.
> >
> > psc3-0 - MOSI
> > psc3-1 - MISO
> > psc3-2 - CLK
> > psc3-3 - SlaveSelect
> > psc3-4 - CS-FPGA
> > psc3-5 - CS Another device
> > psc3-6 - SPI-SEL0
> > psc3-7 - SPI-SEL1
> > psc3-8/9 - Not connected
> >
> > Can I use the mpc52xx_psc_spi-driver? And if yes, how I have to use this
> > driver? Or must I write a own spi-master/slave thing? Can anyone point me
> > to a good start-position?
>
> Yes, you should be able to use the mpc52xx_psc_spi driver. You'' need
> to add the activate_cs and deactivate_cs hooks in your platform code
> to activate your SPI CS lines. You'll also need to set port_config to
> have the PSC3 pins in "CODEC3" mode.
OK, I defined a "fsl_spi_platform_data" for my "activate_cs" and
"deactivate_cs". This structure I have insert in a "spi_board_info" with
all other mandatory Informations.
When I load "mpc52xx_psc_spi", then I get a "mpc52xx-psc-spi f0002400.spi:
probe called without platform data, no (de)activate_cs function will be
called"
What is wrong in my setup or did I have forget something?
static void activate_cs(u8 cs, u8 polarity) {/* ... */ }
static void deactivate_cs(u8 cs, u8 polarity) {/* ...*/}
static struct fsl_spi_platform_data my_spi_p_data = {
.bus_num = 0x2400,
.max_chipselect = 3,
.activate_cs = activate_cs,
.deactivate_cs = deactivate_cs,
};
static struct spi_board_info my_spi_boardinfo = {
.bus_num = 0x2400,
.chip_select = 0,
.max_speed_hz = 1000,
.modalias = "my-spi-device",
.platform_data = &my_spi_p_data,
};
static int __init ipek01_spi_init(void) {
int ret;
return fsl_spi_init(&my_spi_boardinfo, 1, activate_cs, deactivate_cs);
}
device_initcall(ipek01_spi_init);
best regards,
Silvio Fricke
--
-- S. Fricke ------------------------------------ silvio.fricke@gmail.com --
Diplom-Informatiker (FH) TEL: (+49)8330-911278
Linux-Entwicklung JABBER: silvio@conversation.port1024.net
----------------------------------------------------------------------------
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-04-02 13:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-15 13:53 psc and spi S. Fricke
2008-01-15 14:51 ` Grant Likely
2008-01-17 7:36 ` S. Fricke
2008-04-02 13:06 ` S. Fricke
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).