* [U-Boot] SPI and spi_cs_activate
@ 2010-01-29 15:59 Wolfgang Wegner
2010-01-29 16:11 ` Mike Frysinger
0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Wegner @ 2010-01-29 15:59 UTC (permalink / raw)
To: u-boot
Hi list,
I am trying to get the spi_mmc driver by Robert Selberg and Hans Eklund
to run on my new Coldfire board. (The driver was posted as a patch some
time ago, clearly marked as not ready for mainline. I just did not figure
out the correct search term to give the message ID.)
Now I am running into problems because the driver uses spi_cs_[de]activate,
which is rather useless on coldfire which does automatic cs.
Looking through other drivers' code it seems to me that spi_cs_[de]activate
was never meant to be called from anybody else but some special SPI
drivers that can not aotumatically control cs lines or for systems
where SPI is done in software and so setting the appropriate GPIOs
is handed over to special board-dependent code.
Is this correct, or am I missing something?
Regards,
Wolfgang
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] SPI and spi_cs_activate
2010-01-29 15:59 [U-Boot] SPI and spi_cs_activate Wolfgang Wegner
@ 2010-01-29 16:11 ` Mike Frysinger
2010-01-29 16:18 ` Wolfgang Wegner
0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2010-01-29 16:11 UTC (permalink / raw)
To: u-boot
On Friday 29 January 2010 10:59:28 Wolfgang Wegner wrote:
> I am trying to get the spi_mmc driver by Robert Selberg and Hans Eklund
> to run on my new Coldfire board. (The driver was posted as a patch some
> time ago, clearly marked as not ready for mainline. I just did not figure
> out the correct search term to give the message ID.)
>
> Now I am running into problems because the driver uses spi_cs_[de]activate,
> which is rather useless on coldfire which does automatic cs.
>
> Looking through other drivers' code it seems to me that spi_cs_[de]activate
> was never meant to be called from anybody else but some special SPI
> drivers that can not aotumatically control cs lines or for systems
> where SPI is done in software and so setting the appropriate GPIOs
> is handed over to special board-dependent code.
there are plenty of SPI controllers which allow the CS to be manually
controlled. this isnt a "special" driver.
the MMC/SPI driver was written on a Blackfin system. it working on any other
system is coincidental as a result of leveraging the common frameworks. feel
free to submit fixes.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100129/3f571dfb/attachment.pgp
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] SPI and spi_cs_activate
2010-01-29 16:11 ` Mike Frysinger
@ 2010-01-29 16:18 ` Wolfgang Wegner
2010-01-29 16:27 ` Mike Frysinger
0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Wegner @ 2010-01-29 16:18 UTC (permalink / raw)
To: u-boot
Hi Mike,
On Fri, Jan 29, 2010 at 11:11:36AM -0500, Mike Frysinger wrote:
> On Friday 29 January 2010 10:59:28 Wolfgang Wegner wrote:
> > I am trying to get the spi_mmc driver by Robert Selberg and Hans Eklund
> > to run on my new Coldfire board. (The driver was posted as a patch some
> > time ago, clearly marked as not ready for mainline. I just did not figure
> > out the correct search term to give the message ID.)
> >
> > Now I am running into problems because the driver uses spi_cs_[de]activate,
> > which is rather useless on coldfire which does automatic cs.
> >
> > Looking through other drivers' code it seems to me that spi_cs_[de]activate
> > was never meant to be called from anybody else but some special SPI
> > drivers that can not aotumatically control cs lines or for systems
> > where SPI is done in software and so setting the appropriate GPIOs
> > is handed over to special board-dependent code.
>
> there are plenty of SPI controllers which allow the CS to be manually
> controlled. this isnt a "special" driver.
OK, of course controlling CS manually is possible on most systems (via
GPIO). What I meant is that most systems do not care to control it
automatically (mostly for complexity reasons or because of real
HW limitations, as far as I understand).
> the MMC/SPI driver was written on a Blackfin system. it working on any other
> system is coincidental as a result of leveraging the common frameworks. feel
> free to submit fixes.
This is my intention in case I understand in which direction I have
to fix. (And in case I then get it to work in such a way, of course.)
So, maybe a more clear question:
Are all SPI drivers supposed to supply functions to manually control
the CS lines? If so, what means shall be provided to disable automatic
control?
Regards,
Wolfgang
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] SPI and spi_cs_activate
2010-01-29 16:18 ` Wolfgang Wegner
@ 2010-01-29 16:27 ` Mike Frysinger
0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2010-01-29 16:27 UTC (permalink / raw)
To: u-boot
On Friday 29 January 2010 11:18:10 Wolfgang Wegner wrote:
> On Fri, Jan 29, 2010 at 11:11:36AM -0500, Mike Frysinger wrote:
> > On Friday 29 January 2010 10:59:28 Wolfgang Wegner wrote:
> > > I am trying to get the spi_mmc driver by Robert Selberg and Hans Eklund
> > > to run on my new Coldfire board. (The driver was posted as a patch some
> > > time ago, clearly marked as not ready for mainline. I just did not
> > > figure out the correct search term to give the message ID.)
> > >
> > > Now I am running into problems because the driver uses
> > > spi_cs_[de]activate, which is rather useless on coldfire which does
> > > automatic cs.
> > >
> > > Looking through other drivers' code it seems to me that
> > > spi_cs_[de]activate was never meant to be called from anybody else but
> > > some special SPI drivers that can not aotumatically control cs lines or
> > > for systems where SPI is done in software and so setting the
> > > appropriate GPIOs is handed over to special board-dependent code.
> >
> > there are plenty of SPI controllers which allow the CS to be manually
> > controlled. this isnt a "special" driver.
>
> OK, of course controlling CS manually is possible on most systems (via
> GPIO). What I meant is that most systems do not care to control it
> automatically (mostly for complexity reasons or because of real
> HW limitations, as far as I understand).
i'm not talking about GPIOs. i'm talking about dedicated CS pins that are
connected to the controller.
> > the MMC/SPI driver was written on a Blackfin system. it working on any
> > other system is coincidental as a result of leveraging the common
> > frameworks. feel free to submit fixes.
>
> This is my intention in case I understand in which direction I have
> to fix. (And in case I then get it to work in such a way, of course.)
see how the linux mmc/spi driver does it. i dont think linux provides a
dedicate cs function for SPI drivers to use, but the linux mmc/spi doesnt seem
to have a problem.
> Are all SPI drivers supposed to supply functions to manually control
> the CS lines?
*shrug*
> If so, what means shall be provided to disable automatic control?
i dont understand the question. implement the two functions that are part of
the SPI API.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100129/850c0515/attachment.pgp
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-29 16:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-29 15:59 [U-Boot] SPI and spi_cs_activate Wolfgang Wegner
2010-01-29 16:11 ` Mike Frysinger
2010-01-29 16:18 ` Wolfgang Wegner
2010-01-29 16:27 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox