Skip to contentSkip to conversation

spi:fsl-dspi:add dspi tcfq mode transfer support

PATCH New Chao Fu 3 participants 6 messages Sep 25, 2014 – Sep 28, 2014

Subsystems (3)
lore
Share & tools
lore

Chao Fu

author
#0 lore raw

PATCH 1/3 spi:fsl-dspi:add dspi tcfq mode transfer support

From: Chao Fu <[email protected]>

TCFQ is interrupt of Transfer Complete Flag in DSPI module.
EOQ is interrupt of End of Queue Flag in DSPI module.
For adopting of different platform, either of them is a way of DSPI transfer data. This patch add TCF support for DSPI module in other platform.

The software will be changed in two transfer methods as followwing:

		 EOQ			TCFQ
transfer data: dspi_eoq_write	  dspi_tcfq_write
receive data:  dspi_eoq_read	  dspi_tcfq_read

Using which method will decided by paltform soc dtsi file.

Remove bitbang:
Add tcf funtions, DSPI module need get cs change information in a spi transfer. According cs change, DSPI will give last data the right flag. Bitbang provide cs change behind the last data in a transfer. So DSPI can not deal the last data in every transfer properly, so remove the bitbang in the driver.

Merge duplicate code:
dspi_data_from_popr
dspi_data_to_pushr

Remove clk reference in regmap I/O:
Set the clk parament is NULL in devm_regmap_init_mmio_clk, it will avoid clk handle in every register read/write, and advance tranferring efficiency.

---
 drivers/spi/Kconfig        |   1 -
 drivers/spi/spi-fsl-dspi.c | 321 ++++++++++++++++++++++++++++-----------------
 2 files changed, 198 insertions(+), 124 deletions(-)
drivers/spi/Kconfig +0 -1
index dc10453..214683a 100644
@@ -283,7 +283,6 @@ config SPI_FSL_SPI
 
 config SPI_FSL_DSPI
 	tristate "Freescale DSPI controller"
-	select SPI_BITBANG
 	select REGMAP_MMIO
 	depends on SOC_VF610 || COMPILE_TEST
 	help
drivers/spi/spi-fsl-dspi.c +198 -123

459 lines not on this page · raw message

Signature · 1 line
1.8.4
author
#1 lore raw

PATCH 2/3 arm:dts:vf-610:add vybrid DSPI TCF transfer support

From: Chao Fu <[email protected]>

DSPI can transfer data in EOQ mode or TCF mode. Add the bool value as the ajudgement of using which method will be read from dtb.

---
 arch/arm/boot/dts/vf610.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/vf610.dtsi +1 -0
index 4d2ec32..4339a19 100644
@@ -174,6 +174,7 @@
 				clocks = <&clks VF610_CLK_DSPI0>;
 				clock-names = "dspi";
 				spi-num-chipselects = <5>;
+				tcfq-mode;
 				status = "disabled";
 			};
 
Signature · 1 line
1.8.4
author
#2 lore raw

PATCH 3/3 Documentation:spi:fsl-dspi:add DSPI tcf transfer support

In reply to Chao Fu

From: Chao Fu <[email protected]>

Add bool value tcfq-mode or eoq-mode.
The bool will determine DSPI transfer data mode (tcfq or eoq) in a platform.

---
 Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt +3 -0
index cbbe16e..635387c 100644
@@ -10,6 +10,8 @@ Required properties:
 - pinctrl-names: must contain a "default" entry.
 - spi-num-chipselects : the number of the chipselect signals.
 - bus-num : the slave chip chipselect signal number.
+- eoq-mode/tcfq-mode: enable EOQ/TCFQ interrupt to receive data
+	according to different platform.
 
 Optional property:
 - big-endian: If present the dspi device's registers are implemented
@@ -28,6 +30,7 @@ dspi0 at 4002c000 {
 	clock-names = "dspi";
 	spi-num-chipselects = <5>;
 	bus-num = <0>;
+	eoq-mode;
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_dspi0_1>;
 	big-endian;
Signature · 1 line
1.8.4
#3 lore raw

PATCH 3/3 Documentation:spi:fsl-dspi:add DSPI tcf transfer support

Quoted 16 lines · Chao Fu

From: Chao Fu <[email protected]>

Add bool value tcfq-mode or eoq-mode.
The bool will determine DSPI transfer data mode (tcfq or eoq) in a platform.

---
 Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt +0 -0
index cbbe16e..635387c 100644

Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt Required properties: · line 14

Quoted 5 lines
Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt +2 -0
@@ -10,6 +10,8 @@ Required properties:
 - pinctrl-names: must contain a "default" entry.
 - spi-num-chipselects : the number of the chipselect signals.
 - bus-num : the slave chip chipselect signal number.
+- eoq-mode/tcfq-mode: enable EOQ/TCFQ interrupt to receive data
+	according to different platform.

Does the "platform" mean board or SoC? Since I see you specify the property in SoC level dtsi file, I assume you mean it as SoC. So here comes to the question - is it a DSPI property decided by SoC design? IOW, for given SoC like vf610, which mode should be chosen is decided at vf610 SoC design time?

You specify eoq-mode in vf610.dtsi. Does that mean tcfq-mode will not work on VF610?

Shawn

Quoted 14 lines
Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt +1 -0
 Optional property:
 - big-endian: If present the dspi device's registers are implemented
@@ -28,6 +30,7 @@ dspi0 at 4002c000 {
 	clock-names = "dspi";
 	spi-num-chipselects = <5>;
 	bus-num = <0>;
+	eoq-mode;
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_dspi0_1>;
 	big-endian;
Signature · 1 line
1.8.4
#4 lore raw

PATCH 1/3 spi:fsl-dspi:add dspi tcfq mode transfer support

In reply to Chao Fu
Quoted 24 lines · Chao Fu

From: Chao Fu <[email protected]>

TCFQ is interrupt of Transfer Complete Flag in DSPI module.
EOQ is interrupt of End of Queue Flag in DSPI module.
For adopting of different platform, either of them is a way of DSPI transfer data. This patch add TCF support for DSPI module in other platform.

The software will be changed in two transfer methods as followwing:

		 EOQ			TCFQ
transfer data: dspi_eoq_write	  dspi_tcfq_write
receive data:  dspi_eoq_read	  dspi_tcfq_read

Using which method will decided by paltform soc dtsi file.

Remove bitbang:
Add tcf funtions, DSPI module need get cs change information in a spi transfer. According cs change, DSPI will give last data the right flag. Bitbang provide cs change behind the last data in a transfer. So DSPI can not deal the last data in every transfer properly, so remove the bitbang in the driver.

Merge duplicate code:
dspi_data_from_popr
dspi_data_to_pushr

Quoted 5 lines

Remove clk reference in regmap I/O:
Set the clk parament is NULL in devm_regmap_init_mmio_clk, it will avoid clk handle in every register read/write, and advance tranferring efficiency.

It looks you are doing too many things in a single patch. You should probably split into several patches to make the review process a little easier.

Shawn

maintainer
#5 lore raw

PATCH 1/3 spi:fsl-dspi:add dspi tcfq mode transfer support

In reply to Chao Fu
Quoted 6 lines · Chao Fu

Remove bitbang:
Add tcf funtions, DSPI module need get cs change information in a spi transfer. According cs change, DSPI will give last data the right flag. Bitbang provide cs change behind the last data in a transfer. So DSPI can not deal the last data in every transfer properly, so remove the bitbang in the driver.

Quoted 7 lines

Merge duplicate code:
dspi_data_from_popr
dspi_data_to_pushr

Remove clk reference in regmap I/O:
Set the clk parament is NULL in devm_regmap_init_mmio_clk, it will avoid clk handle in every register read/write, and advance tranferring efficiency.

Like Shawn says this is three separate changes so should be three
separate patchess.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140928/cbf23951/attachment.sig>