diff mbox

[RFC] spi: sh-msiof: Configure MSIOF sync signal timing in device tree

Message ID 5477EFD7.50307@renesas.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yoshihiro Shimoda Nov. 28, 2014, 3:45 a.m. UTC
The MSIOF controller has DTDL and SYNCDL in SITMDR1 and SIRMDR1
registers. So, this patch adds new properties like the following
commit:
  d0fb47a5237d8b9576113568bacfd27892308b62
  (spi: fsl-espi: Configure FSL eSPI CSBEF and CSAFT)

The DTDL is the chip select (SYNC) setup time.
 b'000: No bit delay
 b'001: 1-clock-cycle delay
 b'010: 2-clock-cycle delay
 b'101: 0.5-clock-cycle delay
 b'110: 1.5-clock-cycle delay

The SYNCDL is the chip select (SYNC) hold time.
 b'000: No bit delay
 b'001: 1-clock-cycle delay
 b'010: 2-clock-cycle delay
 b'011: 3-clock-cycle delay
 b'101: 0.5-clock-cycle delay
 b'110: 1.5-clock-cycle delay

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---

 I would like to add new properties for sh-msiof driver to adjust
the SYNC siginal timing using DTDL and SYNCDL. In the current driver,
these parameters are hardcoded to 0. And then, I checked other spi
drivers, and I found the following commit:
  d0fb47a5237d8b9576113568bacfd27892308b62
  (spi: fsl-espi: Configure FSL eSPI CSBEF and CSAFT)

If this patch is reasonable, I will modify the sh-msiof driver.
Or, should we add a new function for this timing adjusting in the
spi framework?

 Documentation/devicetree/bindings/spi/sh-msiof.txt |    8 ++++++++
 drivers/spi/spi-sh-msiof.c                         |    2 ++
 2 files changed, 10 insertions(+)

Comments

Laurent Pinchart Nov. 30, 2014, 8:23 p.m. UTC | #1
Hi Shimoda-san,

Thank you for the patch.

On Friday 28 November 2014 12:45:27 Yoshihiro Shimoda wrote:
> The MSIOF controller has DTDL and SYNCDL in SITMDR1 and SIRMDR1
> registers. So, this patch adds new properties like the following
> commit:
>   d0fb47a5237d8b9576113568bacfd27892308b62
>   (spi: fsl-espi: Configure FSL eSPI CSBEF and CSAFT)
> 
> The DTDL is the chip select (SYNC) setup time.
>  b'000: No bit delay
>  b'001: 1-clock-cycle delay
>  b'010: 2-clock-cycle delay
>  b'101: 0.5-clock-cycle delay
>  b'110: 1.5-clock-cycle delay
> 
> The SYNCDL is the chip select (SYNC) hold time.
>  b'000: No bit delay
>  b'001: 1-clock-cycle delay
>  b'010: 2-clock-cycle delay
>  b'011: 3-clock-cycle delay
>  b'101: 0.5-clock-cycle delay
>  b'110: 1.5-clock-cycle delay
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
> 
>  I would like to add new properties for sh-msiof driver to adjust
> the SYNC siginal timing using DTDL and SYNCDL. In the current driver,
> these parameters are hardcoded to 0. And then, I checked other spi
> drivers, and I found the following commit:
>   d0fb47a5237d8b9576113568bacfd27892308b62
>   (spi: fsl-espi: Configure FSL eSPI CSBEF and CSAFT)
> 
> If this patch is reasonable, I will modify the sh-msiof driver.
> Or, should we add a new function for this timing adjusting in the
> spi framework?
> 
>  Documentation/devicetree/bindings/spi/sh-msiof.txt |    8 ++++++++
>  drivers/spi/spi-sh-msiof.c                         |    2 ++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/spi/sh-msiof.txt
> b/Documentation/devicetree/bindings/spi/sh-msiof.txt index d11c372..5fe8ffd
> 100644
> --- a/Documentation/devicetree/bindings/spi/sh-msiof.txt
> +++ b/Documentation/devicetree/bindings/spi/sh-msiof.txt
> @@ -30,6 +30,14 @@ Optional properties:
>  			 specifiers, one for transmission, and one for
>  			 reception.
>  - dma-names            : Must contain a list of two DMA names, "tx" and
> "rx".
> +- renesas,tdmr-dtdl    : delay sync signal (setup) in transmit mode
> +			 (default is 0, we can set it to 0, 1, 2, 5, or 6)
> +- renesas,tdmr-syncdl  : delay sync signal (hold) in transmit mode
> +			 (default is 0, we can set it to 0, 1, 2, 3, 5, or 6)
> +- renesas,rdmr-dtdl    : delay sync signal (setup) in receive mode
> +			 (default is 0, we can set it to 0, 1, 2, 5, or 6)
> +- renesas,rdmr-syncdl  : delay sync signal (hold) in receive mode
> +			 (default is 0, we can set it to 0, 1, 2, 3, 5, or 6)

Was it really the intent of this patch to add DT properties without providing 
an implementation in the sh-msiof driver ?

>  Optional properties, deprecated for soctype-specific bindings:
>  - renesas,tx-fifo-size : Overrides the default tx fifo size given in words
> diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
> index 3f36540..09e0c38 100644
> --- a/drivers/spi/spi-sh-msiof.c
> +++ b/drivers/spi/spi-sh-msiof.c
> @@ -296,11 +296,13 @@ static void sh_msiof_spi_set_pin_regs(struct
> sh_msiof_spi_priv *p, tmp = MDR1_SYNCMD_SPI | 1 << MDR1_FLD_SHIFT |
> MDR1_XXSTP;
>  	tmp |= !cs_high << MDR1_SYNCAC_SHIFT;
>  	tmp |= lsb_first << MDR1_BITLSB_SHIFT;
> +printk("%s: TMDR1 = %x\n", __func__, tmp | MDR1_TRMD | TMDR1_PCON);
>  	sh_msiof_write(p, TMDR1, tmp | MDR1_TRMD | TMDR1_PCON);
>  	if (p->chipdata->master_flags & SPI_MASTER_MUST_TX) {
>  		/* These bits are reserved if RX needs TX */
>  		tmp &= ~0x0000ffff;
>  	}
> +printk("%s: RMDR1 = %x\n", __func__, tmp);

I suppose these printk are debugging leftovers.

>  	sh_msiof_write(p, RMDR1, tmp);
> 
>  	tmp = 0;
Geert Uytterhoeven Dec. 1, 2014, 8:26 a.m. UTC | #2
Hi Shimoda-san, Laurent,

On Sun, Nov 30, 2014 at 9:23 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Friday 28 November 2014 12:45:27 Yoshihiro Shimoda wrote:
>> The MSIOF controller has DTDL and SYNCDL in SITMDR1 and SIRMDR1
>> registers. So, this patch adds new properties like the following
>> commit:
>>   d0fb47a5237d8b9576113568bacfd27892308b62
>>   (spi: fsl-espi: Configure FSL eSPI CSBEF and CSAFT)
>>
>> The DTDL is the chip select (SYNC) setup time.
>>  b'000: No bit delay
>>  b'001: 1-clock-cycle delay
>>  b'010: 2-clock-cycle delay
>>  b'101: 0.5-clock-cycle delay
>>  b'110: 1.5-clock-cycle delay
>>
>> The SYNCDL is the chip select (SYNC) hold time.
>>  b'000: No bit delay
>>  b'001: 1-clock-cycle delay
>>  b'010: 2-clock-cycle delay
>>  b'011: 3-clock-cycle delay
>>  b'101: 0.5-clock-cycle delay
>>  b'110: 1.5-clock-cycle delay

You forgot to quote the last line from the DTDL and SYNCDL paragraphs:

| In case of SPI mode, only 000 is allowed to set to this field.

And the spi-sh-msiof driver is using the MSIOF in SPI mode???

>> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
>> ---
>>
>>  I would like to add new properties for sh-msiof driver to adjust
>> the SYNC siginal timing using DTDL and SYNCDL. In the current driver,
>> these parameters are hardcoded to 0. And then, I checked other spi
>> drivers, and I found the following commit:
>>   d0fb47a5237d8b9576113568bacfd27892308b62
>>   (spi: fsl-espi: Configure FSL eSPI CSBEF and CSAFT)
>>
>> If this patch is reasonable, I will modify the sh-msiof driver.
>> Or, should we add a new function for this timing adjusting in the
>> spi framework?
>>
>>  Documentation/devicetree/bindings/spi/sh-msiof.txt |    8 ++++++++
>>  drivers/spi/spi-sh-msiof.c                         |    2 ++
>>  2 files changed, 10 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/spi/sh-msiof.txt
>> b/Documentation/devicetree/bindings/spi/sh-msiof.txt index d11c372..5fe8ffd
>> 100644
>> --- a/Documentation/devicetree/bindings/spi/sh-msiof.txt
>> +++ b/Documentation/devicetree/bindings/spi/sh-msiof.txt
>> @@ -30,6 +30,14 @@ Optional properties:
>>                        specifiers, one for transmission, and one for
>>                        reception.
>>  - dma-names            : Must contain a list of two DMA names, "tx" and
>> "rx".
>> +- renesas,tdmr-dtdl    : delay sync signal (setup) in transmit mode
>> +                      (default is 0, we can set it to 0, 1, 2, 5, or 6)
>> +- renesas,tdmr-syncdl  : delay sync signal (hold) in transmit mode
>> +                      (default is 0, we can set it to 0, 1, 2, 3, 5, or 6)
>> +- renesas,rdmr-dtdl    : delay sync signal (setup) in receive mode
>> +                      (default is 0, we can set it to 0, 1, 2, 5, or 6)
>> +- renesas,rdmr-syncdl  : delay sync signal (hold) in receive mode
>> +                      (default is 0, we can set it to 0, 1, 2, 3, 5, or 6)

In general, it's frowned upon the specify actual register values in DT.
So I think it's better to specify the delay values instead of the
bitfield values,
and drop the "tdmr" and "rdmr" from the names.
As DT supports integers only, that should become a fixed point value.
E.g. delay in deci-clocks (0, 5, 10, 15, 20)?
Or as a percentage of the clock cycle (0, 50, 100, 150, 200)?

Do you really need two sets of values, for both transmit and receive?
I.e. do you need different values for transmit and receive for your use case?
SPI does both transmit and receive using the same clock and chip select.
I know some MSIOF implementations can handle both indepedently.

And to answer your last question: if several drivers need this, it makes sense
to make this general, and add support in the SPI core. Mark?

> Was it really the intent of this patch to add DT properties without providing
> an implementation in the sh-msiof driver ?

Given the sentence "If this patch is reasonable, I will modify the sh-msiof
driver." in the introduction, I think so.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yoshihiro Shimoda Dec. 2, 2014, 7:40 a.m. UTC | #3
Hi Geert-san, Laurent-san,

Thank you very much for your comments!

> On Sun, Nov 30, 2014 at 9:23 PM, Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote:

> > On Friday 28 November 2014 12:45:27 Yoshihiro Shimoda wrote:

> >> The MSIOF controller has DTDL and SYNCDL in SITMDR1 and SIRMDR1

> >> registers. So, this patch adds new properties like the following

> >> commit:

> >>   d0fb47a5237d8b9576113568bacfd27892308b62

> >>   (spi: fsl-espi: Configure FSL eSPI CSBEF and CSAFT)

> >>

> >> The DTDL is the chip select (SYNC) setup time.

> >>  b'000: No bit delay

> >>  b'001: 1-clock-cycle delay

> >>  b'010: 2-clock-cycle delay

> >>  b'101: 0.5-clock-cycle delay

> >>  b'110: 1.5-clock-cycle delay

> >>

> >> The SYNCDL is the chip select (SYNC) hold time.

> >>  b'000: No bit delay

> >>  b'001: 1-clock-cycle delay

> >>  b'010: 2-clock-cycle delay

> >>  b'011: 3-clock-cycle delay

> >>  b'101: 0.5-clock-cycle delay

> >>  b'110: 1.5-clock-cycle delay

> 

> You forgot to quote the last line from the DTDL and SYNCDL paragraphs:

> 

> | In case of SPI mode, only 000 is allowed to set to this field.


Thank you for the point!
I asked HW team about the paragraphs. And then, the paragraphs are correct.

> And the spi-sh-msiof driver is using the MSIOF in SPI mode???


Yes, the driver is using the MSIOF in SPI mode.
So, we have no chance to set the DTDL and SYNCDL to 0 in SPI mode.

I should have looked into the datasheet more before I sent this RFC.

< snip >
> > Was it really the intent of this patch to add DT properties without

> > providing an implementation in the sh-msiof driver ?

> 

> Given the sentence "If this patch is reasonable, I will modify the sh-msiof driver." in the introduction, I think so.


Yes, I meant that.

Best regards,
Yoshihiro Shimoda

> Gr{oetje,eeting}s,

> 

>                         Geert

> 

> --

> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

> 

> In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say

> "programmer" or something like that.

>                                 -- Linus Torvalds

> --

> To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org

> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yoshihiro Shimoda Dec. 15, 2014, 1:52 a.m. UTC | #4
SGkgR2VlcnQtc2FuLA0KDQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IGRl
dmljZXRyZWUtb3duZXJAdmdlci5rZXJuZWwub3JnIFttYWlsdG86ZGV2aWNldHJlZS1vd25lck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RoIHRlY2huaWNhbCBwZW9wbGUsIEkgY2FsbCBteXNl
bGYgYSBoYWNrZXIuIEJ1dA0KPiB3aGVuIEknbSB0YWxraW5nIHRvIGpvdXJuYWxpc3RzIEkganVz
dCBzYXkgInByb2dyYW1tZXIiIG9yIHNvbWV0aGluZyBsaWtlIHRoYXQuDQo+ICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgLS0gTGludXMgVG9ydmFsZHMNCj4gLS0NCj4gVG8gdW5zdWJz
Y3JpYmUgZnJvbSB0aGlzIGxpc3Q6IHNlbmQgdGhlIGxpbmUgInVuc3Vic2NyaWJlIGRldmljZXRy
ZWUiIGluDQo+IHRoZSBib2R5IG9mIGEgbWVzc2FnZSB0byBtYWpvcmRvbW9Admdlci5rZXJuZWwu
b3JnDQo+IE1vcmUgbWFqb3Jkb21vIGluZm8gYXQgIGh0dHA6Ly92Z2VyLmtlcm5lbC5vcmcvbWFq
b3Jkb21vLWluZm8uaHRtbA0K
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/spi/sh-msiof.txt b/Documentation/devicetree/bindings/spi/sh-msiof.txt
index d11c372..5fe8ffd 100644
--- a/Documentation/devicetree/bindings/spi/sh-msiof.txt
+++ b/Documentation/devicetree/bindings/spi/sh-msiof.txt
@@ -30,6 +30,14 @@  Optional properties:
 			 specifiers, one for transmission, and one for
 			 reception.
 - dma-names            : Must contain a list of two DMA names, "tx" and "rx".
+- renesas,tdmr-dtdl    : delay sync signal (setup) in transmit mode
+			 (default is 0, we can set it to 0, 1, 2, 5, or 6)
+- renesas,tdmr-syncdl  : delay sync signal (hold) in transmit mode
+			 (default is 0, we can set it to 0, 1, 2, 3, 5, or 6)
+- renesas,rdmr-dtdl    : delay sync signal (setup) in receive mode
+			 (default is 0, we can set it to 0, 1, 2, 5, or 6)
+- renesas,rdmr-syncdl  : delay sync signal (hold) in receive mode
+			 (default is 0, we can set it to 0, 1, 2, 3, 5, or 6)

 Optional properties, deprecated for soctype-specific bindings:
 - renesas,tx-fifo-size : Overrides the default tx fifo size given in words
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index 3f36540..09e0c38 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -296,11 +296,13 @@  static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p,
 	tmp = MDR1_SYNCMD_SPI | 1 << MDR1_FLD_SHIFT | MDR1_XXSTP;
 	tmp |= !cs_high << MDR1_SYNCAC_SHIFT;
 	tmp |= lsb_first << MDR1_BITLSB_SHIFT;
+printk("%s: TMDR1 = %x\n", __func__, tmp | MDR1_TRMD | TMDR1_PCON);
 	sh_msiof_write(p, TMDR1, tmp | MDR1_TRMD | TMDR1_PCON);
 	if (p->chipdata->master_flags & SPI_MASTER_MUST_TX) {
 		/* These bits are reserved if RX needs TX */
 		tmp &= ~0x0000ffff;
 	}
+printk("%s: RMDR1 = %x\n", __func__, tmp);
 	sh_msiof_write(p, RMDR1, tmp);

 	tmp = 0;