All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: img-spfi: same edge bit set to double spfi speeds
@ 2015-02-03 17:46 Sifan Naeem
  2015-02-04  6:10   ` Andrew Bresticker
  0 siblings, 1 reply; 3+ messages in thread
From: Sifan Naeem @ 2015-02-03 17:46 UTC (permalink / raw)
  To: broonie, abrestic; +Cc: linux-spi, linux-kernel, Sifan Naeem

Setting the same edge bit is required for operating at full bitrate
programmed into the SPFI control register. Without this bit set the
max operating bitrate supported would be half the maximum bitrate
supported by the img-spfi block.
It's safe to set this bit for all transactions.

Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>
---
 drivers/spi/spi-img-spfi.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c
index c01567d..e6f77b8 100644
--- a/drivers/spi/spi-img-spfi.c
+++ b/drivers/spi/spi-img-spfi.c
@@ -39,6 +39,7 @@
 #define SPFI_CONTROL_SOFT_RESET			BIT(11)
 #define SPFI_CONTROL_SEND_DMA			BIT(10)
 #define SPFI_CONTROL_GET_DMA			BIT(9)
+#define SPFI_CONTROL_SE			BIT(8)
 #define SPFI_CONTROL_TMODE_SHIFT		5
 #define SPFI_CONTROL_TMODE_MASK			0x7
 #define SPFI_CONTROL_TMODE_SINGLE		0
@@ -435,6 +436,9 @@ static void img_spfi_config(struct spi_master *master, struct spi_device *spi,
 		val |= SPFI_CONTROL_CONTINUE;
 	spfi_writel(spfi, val, SPFI_CONTROL);
 
+	/* Double the transfer speed by setting Same Edge. */
+	val |= SPFI_CONTROL_SE;
+
 	val = spfi_readl(spfi, SPFI_PORT_STATE);
 	if (spi->mode & SPI_CPHA)
 		val |= SPFI_PORT_STATE_CK_PHASE(spi->chip_select);
-- 
1.7.9.5


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

* Re: [PATCH] spi: img-spfi: same edge bit set to double spfi speeds
@ 2015-02-04  6:10   ` Andrew Bresticker
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Bresticker @ 2015-02-04  6:10 UTC (permalink / raw)
  To: Sifan Naeem; +Cc: broonie, linux-spi, linux-kernel

Hi Sifan,

On Tue, Feb 3, 2015 at 9:46 AM, Sifan Naeem <sifan.naeem@imgtec.com> wrote:
> Setting the same edge bit is required for operating at full bitrate
> programmed into the SPFI control register. Without this bit set the
> max operating bitrate supported would be half the maximum bitrate
> supported by the img-spfi block.
> It's safe to set this bit for all transactions.
>
> Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>

> @@ -435,6 +436,9 @@ static void img_spfi_config(struct spi_master *master, struct spi_device *spi,
>                 val |= SPFI_CONTROL_CONTINUE;
>         spfi_writel(spfi, val, SPFI_CONTROL);
>
> +       /* Double the transfer speed by setting Same Edge. */

I'm not sure a comment here is totally necessary, but if you do want
one, I don't think "Double the transfer speed" is the best way to put
this.  Something explaining what the SE bit does and that failing to
set it results in us operating at half the specified bitrate would be
more useful.

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

* Re: [PATCH] spi: img-spfi: same edge bit set to double spfi speeds
@ 2015-02-04  6:10   ` Andrew Bresticker
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Bresticker @ 2015-02-04  6:10 UTC (permalink / raw)
  To: Sifan Naeem
  Cc: broonie-DgEjT+Ai2ygdnm+yROfE0A, linux-spi-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Hi Sifan,

On Tue, Feb 3, 2015 at 9:46 AM, Sifan Naeem <sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org> wrote:
> Setting the same edge bit is required for operating at full bitrate
> programmed into the SPFI control register. Without this bit set the
> max operating bitrate supported would be half the maximum bitrate
> supported by the img-spfi block.
> It's safe to set this bit for all transactions.
>
> Signed-off-by: Sifan Naeem <sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>

> @@ -435,6 +436,9 @@ static void img_spfi_config(struct spi_master *master, struct spi_device *spi,
>                 val |= SPFI_CONTROL_CONTINUE;
>         spfi_writel(spfi, val, SPFI_CONTROL);
>
> +       /* Double the transfer speed by setting Same Edge. */

I'm not sure a comment here is totally necessary, but if you do want
one, I don't think "Double the transfer speed" is the best way to put
this.  Something explaining what the SE bit does and that failing to
set it results in us operating at half the specified bitrate would be
more useful.
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2015-02-04  6:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-03 17:46 [PATCH] spi: img-spfi: same edge bit set to double spfi speeds Sifan Naeem
2015-02-04  6:10 ` Andrew Bresticker
2015-02-04  6:10   ` Andrew Bresticker

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.