diff mbox

[PATCHv3,2/2] spi: imx: document use of native chip-selects in devicetree

Message ID 1499746932-14850-3-git-send-email-gerg@linux-m68k.org (mailing list archive)
State New, archived
Headers show

Commit Message

Greg Ungerer July 11, 2017, 4:22 a.m. UTC
Document the "<0>" notation for specifying use of a native chip-select
in the "cs-gpios" tag of an SPI device in devicetree. This isn't unique
to the spi-imx driver, but this clearly spells out that you can use it
with this driver.

Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
 Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Vladimir Zapolskiy July 19, 2017, 12:32 a.m. UTC | #1
Hello Greg,

On 07/11/2017 07:22 AM, Greg Ungerer wrote:
> Document the "<0>" notation for specifying use of a native chip-select
> in the "cs-gpios" tag of an SPI device in devicetree. This isn't unique
> to the spi-imx driver, but this clearly spells out that you can use it
> with this driver.
> 
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
> ---
>  Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt
> index 31b5b21..cf616ea 100644
> --- a/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt
> +++ b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt
> @@ -12,6 +12,7 @@ Required properties:
>  - reg : Offset and length of the register set for the device
>  - interrupts : Should contain CSPI/eCSPI interrupt
>  - cs-gpios : Specifies the gpio pins to be used for chipselects.
> +	Specify use of native chipselects with "<0>" in place of a gpio.
>  - clocks : Clock specifiers for both ipg and per clocks.
>  - clock-names : Clock names should include both "ipg" and "per"
>  See the clock consumer binding,
> @@ -38,7 +39,8 @@ ecspi@70010000 {
>  	reg = <0x70010000 0x4000>;
>  	interrupts = <36>;
>  	cs-gpios = <&gpio3 24 0>, /* GPIO3_24 */
> -		   <&gpio3 25 0>; /* GPIO3_25 */
> +		   <&gpio3 25 0>, /* GPIO3_25 */
> +		   <0>;           /* Native chip select */
>  	dmas = <&sdma 3 7 1>, <&sdma 4 7 2>;
>  	dma-names = "rx", "tx";
>  	fsl,spi-rdy-drctl = <1>;
> 

Adding Rob to Cc.

Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>

Rob, if you find the change acceptable, can you ack it?

--
With best wishes,
Vladimir
--
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
Fabio Estevam July 19, 2017, 12:37 a.m. UTC | #2
Hi Greg,

On Tue, Jul 11, 2017 at 1:22 AM, Greg Ungerer <gerg@linux-m68k.org> wrote:
> Document the "<0>" notation for specifying use of a native chip-select
> in the "cs-gpios" tag of an SPI device in devicetree. This isn't unique
> to the spi-imx driver, but this clearly spells out that you can use it
> with this driver.
>
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

Whic SoC did you use to test the native chip-select?

I remember that some old SoCs (mx27/mx31) used to have issues with
native chip-select.
--
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
Vladimir Zapolskiy July 19, 2017, 12:39 a.m. UTC | #3
Hi Fabio,

On 07/19/2017 03:37 AM, Fabio Estevam wrote:
> Hi Greg,
> 
> On Tue, Jul 11, 2017 at 1:22 AM, Greg Ungerer <gerg@linux-m68k.org> wrote:
>> Document the "<0>" notation for specifying use of a native chip-select
>> in the "cs-gpios" tag of an SPI device in devicetree. This isn't unique
>> to the spi-imx driver, but this clearly spells out that you can use it
>> with this driver.
>>
>> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
> 
> Whic SoC did you use to test the native chip-select?
> 
> I remember that some old SoCs (mx27/mx31) used to have issues with
> native chip-select.

FWIW I tested on DT-only i.MX31, the change works acceptable.

--
With best wishes,
Vladimir
--
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
Fabio Estevam July 19, 2017, 12:42 a.m. UTC | #4
Hi Vladimir,

On Tue, Jul 18, 2017 at 9:39 PM, Vladimir Zapolskiy <vz@mleia.com> wrote:

> FWIW I tested on DT-only i.MX31, the change works acceptable.

MX31 has an issue with native chip select as far as I remember. Please
check DSPhl22960 from the chip errata:
http://www.nxp.com/docs/en/errata/MCIMX31CE.pdf
--
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
Greg Ungerer July 19, 2017, 1:05 a.m. UTC | #5
Hi Fabio,

On 19/07/17 10:37, Fabio Estevam wrote:
> Hi Greg,
> 
> On Tue, Jul 11, 2017 at 1:22 AM, Greg Ungerer <gerg@linux-m68k.org> wrote:
>> Document the "<0>" notation for specifying use of a native chip-select
>> in the "cs-gpios" tag of an SPI device in devicetree. This isn't unique
>> to the spi-imx driver, but this clearly spells out that you can use it
>> with this driver.
>>
>> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
> 
> Whic SoC did you use to test the native chip-select?
> 
> I remember that some old SoCs (mx27/mx31) used to have issues with
> native chip-select.

I tested on an iMX253. I have a board with a Silicon Labs 32260 SLIC
hooked up to an SPI interface on the 253 and I need the native chip
select timing for it.

Regards
Greg



--
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
Vladimir Zapolskiy July 19, 2017, 1:07 a.m. UTC | #6
On 07/19/2017 03:42 AM, Fabio Estevam wrote:
> Hi Vladimir,
> 
> On Tue, Jul 18, 2017 at 9:39 PM, Vladimir Zapolskiy <vz@mleia.com> wrote:
> 
>> FWIW I tested on DT-only i.MX31, the change works acceptable.
> 
> MX31 has an issue with native chip select as far as I remember. Please
> check DSPhl22960 from the chip errata:
> http://www.nxp.com/docs/en/errata/MCIMX31CE.pdf

Oh, it's unpleasant, I didn't know or experience the issue, thank you
for information.

I can definitely tell that

a) my hardware (Logitech i.MX31 Litekit) does not allow to use GPIOs
instead of native chip selects for two SPI devices on board:
  Atmel AT93C66A EEPROM on CSPI1 pads selected by CS2,
  Freescale MC13783 PMIC on CSPI2 pads selected by CS0.

There is no option to mux CSPI1_SS2 or CSPI2_SS0 pad to GPIOs, so some
kind of native chip select support is needed for legacy hardware, even
if it is exposed to the errata item,

b) MC13783 PMIC on CS0 works fine with Greg's change,

c) actually there is no AT93C66A driver for better testing, but I do
experience issues with the native CS2, however as I said in another
email it is not related to Greg's change.

By the way I'm going to unrestrict DMA support on i.MX31, due to my
loose tests (only to/from MC13783) DMA transfers seem to work properly.

--
With best wishes,
Vladimir
--
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/fsl-imx-cspi.txt b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt
index 31b5b21..cf616ea 100644
--- a/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt
+++ b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt
@@ -12,6 +12,7 @@  Required properties:
 - reg : Offset and length of the register set for the device
 - interrupts : Should contain CSPI/eCSPI interrupt
 - cs-gpios : Specifies the gpio pins to be used for chipselects.
+	Specify use of native chipselects with "<0>" in place of a gpio.
 - clocks : Clock specifiers for both ipg and per clocks.
 - clock-names : Clock names should include both "ipg" and "per"
 See the clock consumer binding,
@@ -38,7 +39,8 @@  ecspi@70010000 {
 	reg = <0x70010000 0x4000>;
 	interrupts = <36>;
 	cs-gpios = <&gpio3 24 0>, /* GPIO3_24 */
-		   <&gpio3 25 0>; /* GPIO3_25 */
+		   <&gpio3 25 0>, /* GPIO3_25 */
+		   <0>;           /* Native chip select */
 	dmas = <&sdma 3 7 1>, <&sdma 4 7 2>;
 	dma-names = "rx", "tx";
 	fsl,spi-rdy-drctl = <1>;