From: Mark Underwood <basicmark@yahoo.com>
To: dmitry pervushin <dpervushin@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] spi
Date: Mon, 8 Aug 2005 19:51:11 +0100 (BST) [thread overview]
Message-ID: <20050808185111.37559.qmail@web30312.mail.mud.yahoo.com> (raw)
In-Reply-To: <1123519315.4762.111.camel@diimka.dev.rtsoft.ru>
--- dmitry pervushin <dpervushin@gmail.com> wrote:
>
> > Surely this should be locked with bus lock?
> Why not ? Until the transfer on device is not
> finished, the bus will be
> locked. Otherwise, the another device (on the same
> bus) might want to
> transfer something...
OK. My confusion was that we are also working on a SPI
subsystem which works in a different way.
Our SPI subsystem works much like the USB subsystem in
that drivers can queue up transfers and they will get
a callback when the transfer is complete.
Actually I think we have 4 modes of operation which
also allows transfers to be done in interrupt context,
with callback, wait for completion or high priority
(used to transfer high priority messages by bypassing
the transfer queue). I'll see if I can submit a patch
to the mailing list as I know its not only ideas but
code that counts ;-).
> >
> > -= snip =-
> >
> > Some other comments:
> > 1) I think you need to fix some of your comments
> > especially those describing how the interfaces
> work.
> > 2) I take it spi adaptor drivers now use
> > spi_bus_register/spi_bus_unregister?
> > 3) Different clients on one bus will want to run
> at
> > different speeds, how will you handle this?
> > 3) This subsystem can only handle small transfers
> like
> > I2C. SPI peripherals like SPI Ethernet devices
> will
> > have to do lots of large transfers and with your
> > current subsystem the device will be forced to
> wait
> > until its transfer has finished (as well as other
> > clients) when it might have other important work
> to
> > do.
> Hmm.. In the sample (it needs some polishing!), the
> bus initiates the
> DMA transfers and waits for completion on it. Do you
> want to have
> something like state machine (the function that will
> be called upon the
> end of transfer ?)
Yes, please see above.
>
>
> Kconfig | 12 +
> Makefile | 7
> pnxalloc.c | 70 ++++++
> pnxalloc.h | 9
> spi-pnx010x_atmel.c | 91 ++++++++
> spipnx-resources.h | 138 ++++++++++++
> spipnx.c | 581
> ++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> spipnx.h | 309
> +++++++++++++++++++++++++++
> 8 files changed, 1455 insertions(+)
>
> Index: linux-2.6.10/drivers/spi/spipnx-resources.h
>
===================================================================
> --- /dev/null
> +++ linux-2.6.10/drivers/spi/spipnx-resources.h
> @@ -0,0 +1,138 @@
> +#ifdef CONFIG_MACH_PNX0106_GH450
> +struct resource spipnx_010x_resources_0[] =
> +{
> + {
> + .start = BLAS_SPI0_BASE,
> + .end = BLAS_SPI0_BASE + SZ_4K,
> + .flags = IORESOURCE_MEM,
> + }, {
> + .start = SPI0_FIFO_DMA_SLAVE_NR,
> + .flags = IORESOURCE_DMA,
> + },
> + /*
> + * Note that the clocks are shutdown in this order
> and resumed
> + * in the opposite order.
> + */
> + {
> + .start = CGU_SWITCHBOX_BLAS_SPI0_PCLK_ID,
> + .flags = IORESOURCE_CLOCK_ID,
> + }, {
> + .start = CGU_SWITCHBOX_BLAS_SPI0_PCLK_GAT_ID,
> + .flags = IORESOURCE_CLOCK_ID,
> + }, {
> + .start = CGU_SWITCHBOX_BLAS_SPI0_FIFO_PCLK_ID,
> + .flags = IORESOURCE_CLOCK_ID,
> + }, {
> + .start =
> CGU_SWITCHBOX_BLAS_SPI0_DUMMY_VPBCLK_ID,
> + .flags = IORESOURCE_CLOCK_ID,
> + }, {
> + .start = VH_INTC_INT_NUM_BLAS_SPI0_INT,
> + .flags = IORESOURCE_IRQ,
> + }, {
> + .flags = 0,
> + }
> +};
> +
> +struct resource spipnx_010x_resources_1[] =
> +{
> + {
> + .start = BLAS_SPI1_BASE,
> + .end = BLAS_SPI1_BASE + SZ_4K,
> + .flags = IORESOURCE_MEM,
> + }, {
> + .start = SPI1_FIFO_DMA_SLAVE_NR,
> + .flags = IORESOURCE_DMA,
> + },
> + /*
> + * Note that the clocks are shutdown in this order
> and resumed
> + * in the opposite order.
> + */
> + {
> + .start = CGU_SWITCHBOX_BLAS_SPI1_PCLK_ID,
> + .flags = IORESOURCE_CLOCK_ID,
> + }, {
> + .start = CGU_SWITCHBOX_BLAS_SPI1_PCLK_GAT_ID,
> + .flags = IORESOURCE_CLOCK_ID,
> + }, {
> + .start = CGU_SWITCHBOX_BLAS_SPI1_FIFO_PCLK_ID,
> + .flags = IORESOURCE_CLOCK_ID,
> + }, {
> + .start =
> CGU_SWITCHBOX_BLAS_SPI1_DUMMY_VPBCLK_ID,
> + .flags = IORESOURCE_CLOCK_ID,
> + }, {
> + .start = VH_INTC_INT_NUM_BLAS_SPI1_INT,
> + .flags = IORESOURCE_IRQ,
> + }, {
> + .flags = 0,
> + }
> +};
> +#endif
> +
> +#ifdef CONFIG_MACH_PNX0105_GH448
> +struct resource spipnx_010x_resources[] =
> +{
> + {
> + .start = BLAS_SPI_BASE,
> + .end = BLAS_SPI_BASE + SZ_4K,
> + .flags = IORESOURCE_MEM,
> + }, {
> + .start = BLAS_SPI_DMA_SLAVE_NR,
> + .flags = IORESOURCE_DMA,
> + },
> + /*
> + * Note that the clocks are shutdown in this order
> and resumed
> + * in the opposite order.
> + */
> + {
> + .start = CGU_SWITCHBOX_BLAS_SPI_PCLK_ID,
> + .flags = IORESOURCE_CLOCK_ID,
> + }, {
> + .start = CGU_SWITCHBOX_BLAS_SPI_PCLK_GAT_ID,
> + .flags = IORESOURCE_CLOCK_ID,
> + }, {
> + .start = CGU_SWITCHBOX_BLAS_SPI_FIFO_PCLK_ID,
> + .flags = IORESOURCE_CLOCK_ID,
> + }, {
> + .start = VH_INTC_INT_NUM_BLAS_SPI_INT,
> + .flags = IORESOURCE_IRQ,
> + }, {
> + .flags = 0,
> + }
> +};
> +#endif
> +
> +#ifdef CONFIG_ARCH_PNX4008
> +struct resource spipnx_4008_resources_0[] =
> +{
> + {
> + .start = PNX4008_SPI1_BASE,
> + .end = PNX4008_SPI1_BASE + SZ_4K,
> + .flags = IORESOURCE_MEM,
> + }, {
> + .start = 11 /* SPI1_DMA_PERIPHERAL_ID */,
> + .flags = IORESOURCE_DMA,
> + }, {
> + .start = SPI1_INT,
> + .flags = IORESOURCE_IRQ,
> + }, {
> + .flags = 0,
> + }
> +};
> +
> +struct resource spipnx_4008_resources_1[] =
> +{
> + {
> + .start = PNX4008_SPI2_BASE,
> + .end = PNX4008_SPI2_BASE + SZ_4K,
> + .flags = IORESOURCE_MEM,
> + }, {
> + .start = 12 /* SPI2_DMA_PERIPHERAL_ID */,
> + .flags = IORESOURCE_DMA,
> + }, {
> + .start = SPI2_INT,
> + .flags = IORESOURCE_IRQ,
> + }, {
> + .flags = 0,
> + }
> +};
> +#endif
> Index: linux-2.6.10/drivers/spi/spipnx.c
>
=== message truncated ===
___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
next prev parent reply other threads:[~2005-08-08 18:51 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-10 20:01 [PATCH 3/3] kconfig: linux.pot for all arch Egry Gábor
2005-08-08 9:12 ` [PATCH] spi dmitry pervushin
2005-08-08 10:41 ` Jiri Slaby
2005-08-08 13:16 ` Mark Underwood
2005-08-08 16:41 ` dmitry pervushin
2005-08-08 18:51 ` Mark Underwood [this message]
2005-08-08 14:55 ` Greg KH
2005-08-08 17:35 ` Marcel Holtmann
2005-08-08 17:47 ` Marc Singer
2005-08-09 17:54 ` Andy Isaacson
2005-08-09 19:05 ` Marc Singer
2005-08-09 19:29 ` Andy Isaacson
2005-08-15 7:51 ` Denis Vlasenko
2005-08-08 22:58 ` Andrew Morton
2005-08-10 13:10 ` Pavel Machek
2005-08-08 23:07 david-b
2005-08-09 9:38 ` Mark Underwood
2005-09-26 11:12 SPI dmitry pervushin
2005-09-27 12:43 ` SPI Greg KH
2005-09-27 14:27 ` [spi-devel-general] SPI dmitry pervushin
2005-09-27 14:35 ` Greg KH
2005-09-27 14:49 ` dmitry pervushin
2005-09-27 14:54 ` Greg KH
2005-09-28 13:14 ` [PATCH] SPI dmitry pervushin
2005-09-30 17:59 David Brownell
2005-09-30 18:30 ` Vitaly Wool
2005-09-30 19:20 ` dpervushin
2005-10-03 4:56 David Brownell
2005-10-03 5:01 David Brownell
2005-10-03 6:20 ` Vitaly Wool
2005-10-03 16:26 David Brownell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050808185111.37559.qmail@web30312.mail.mud.yahoo.com \
--to=basicmark@yahoo.com \
--cc=dpervushin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®