Skip to contentSkip to conversation

OMAP2+ OneNAND driver update

PATCH Superseded Ladislav Michl 7 participants 34 messages Nov 15, 2017 – Jan 11, 2018 3 messages not in the archive

Subsystems (8)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v5 cover OMAP2+ OneNAND driver update

this patch serie updates OMAP2+ OneNAND driver to the present times, making it fully DT configurable, using libgpio and dmaengine apis - those are optional, driver will work without them.

Please note that unlike previous driver version, which basically ignored DT specified timings, this one relies on it, so it is important to get it right in your DT (dumping it from previous kernel version).

In case synchronous timings is requested, it is okay to specify timings for the slowest chip ever used for you board as it is evetually optimized after chip probe.

Original driver used DMA only if user specified INT gpio in platform data, now DMA is used unconditionally and PIO mode is used as fallback.

In case anyone wants to give it a try, few DT related changes are needed:
- onenand node needs 'ti,omap2-onenand' compatible (for mailine boards this is done in patch 2)
- to use INT pin, int-gpios needs to be specified (for n900 and n8x0 this is done in patch 16, however patch lacks pinmux configuration.

Most notable changes from v3:
- added dmaengine patches by Peter Ujfalusi
- added dt bindings documentation
- added cleanup patches
- DMA enabled by default

Most notable changes from v4:
- collected tags
- used INT pin name properly
- hopefully all comments taken into account

Also note that driver will fail probe OneNAND chip after patch 13 and start working again after patch 14.

Testing and benchmarking very welcome.

Depends on "memory: omap-gpmc: Make 'bank-width' property optional"
https://patchwork.kernel.org/patch/10043259/

Ladislav Michl (14):
dt-bindings: mtd: gpmc-onenand: Update properties description
ARM: dts: OMAP2+: Add compatible property to onenand node
ARM: dts: omap3-igep: Update onenand node timings
mtd: onenand: omap2: Remove regulator support
mtd: onenand: omap2: Remove skip initial unlocking support
mtd: onenand: omap2: Remove partitioning support from platform data
mtd: onenand: omap2: Account waiting time as waiting on IO
mtd: onenand: omap2: Unify OMAP2 and OMAP3 DMA implementation
mtd: onenand: omap2: Do not make delay for GPIO OMAP3 specific
mtd: onenand: omap2: Decouple DMA enabling from INT pin availability
memory: omap-gpmc: Refactor OneNAND support
mtd: onenand: omap2: Configure driver from DT
ARM: OMAP2+: Remove gpmc-onenand
ARM: dts: Nokia: Use OneNAND INT pin

Peter Ujfalusi (2):
mtd: onenand: omap2: Simplify the DMA setup for various paths
mtd: onenand: omap2: Convert to use dmaengine for memcpy

 .../devicetree/bindings/mtd/gpmc-onenand.txt       |   6 +-
 arch/arm/boot/dts/omap2420-n8x0-common.dtsi        |   5 +-
 arch/arm/boot/dts/omap3-igep.dtsi                  |  30 +-
 arch/arm/boot/dts/omap3-n900.dts                   |   3 +-
 arch/arm/boot/dts/omap3-n950-n9.dtsi               |   1 +
 arch/arm/boot/dts/omap3430-sdp.dts                 |   1 +
 arch/arm/mach-omap2/Makefile                       |   3 -
 arch/arm/mach-omap2/gpmc-onenand.c                 | 409 ---------------
 drivers/memory/omap-gpmc.c                         | 158 ++++--
 drivers/mtd/onenand/Kconfig                        |   3 +-
 drivers/mtd/onenand/omap2.c                        | 576 ++++++++-------------
 include/linux/omap-gpmc.h                          |  28 +
 include/linux/platform_data/mtd-onenand-omap2.h    |  34 --
 13 files changed, 387 insertions(+), 870 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/gpmc-onenand.c
 delete mode 100644 include/linux/platform_data/mtd-onenand-omap2.h
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#1 lore raw

PATCH v5 1/16 dt-bindings: mtd: gpmc-onenand: Update properties description

Compatible property is required for OMAP2+ mtd driver. Also add INT pin gpio description and delete unused dma-channel property.

---

Changes in v5:
- renamed R/B pin to INT pin

Changes in v4:
- new patch

Changes in v3: None
Changes in v2: None

 Documentation/devicetree/bindings/mtd/gpmc-onenand.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/mtd/gpmc-onenand.txt +4 -2
index b6e8bfd024f4..e9f01a963a0a 100644
@@ -9,13 +9,14 @@ Documentation/devicetree/bindings/memory-controllers/omap-gpmc.txt
 
 Required properties:
 
+ - compatible:		"ti,omap2-onenand"
  - reg:			The CS line the peripheral is connected to
- - gpmc,device-width	Width of the ONENAND device connected to the GPMC
+ - gpmc,device-width:	Width of the ONENAND device connected to the GPMC
 			in bytes. Must be 1 or 2.
 
 Optional properties:
 
- - dma-channel:		DMA Channel index
+ - int-gpios:		GPIO specifier for the INT pin.
 
 For inline partition table parsing (optional):
 
@@ -35,6 +36,7 @@ Example for an OMAP3430 board:
 		#size-cells = <1>;
 
 		onenand@0 {
+			compatible = "ti,omap2-onenand";
 			reg = <0 0 0>; /* CS0, offset 0 */
 			gpmc,device-width = <2>;
 
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#2 lore raw

Re: [PATCH v5 01/16] dt-bindings: mtd: gpmc-onenand: Update properties description

+Rob and the DT ML

Quoted 26 lines · On Wed, 15 Nov 2017 17:24:58 +0100 Ladislav Michl…

Compatible property is required for OMAP2+ mtd driver. Also add INT pin gpio description and delete unused dma-channel property.

---

Changes in v5:
- renamed R/B pin to INT pin

Changes in v4:
- new patch

Changes in v3: None
Changes in v2: None

 Documentation/devicetree/bindings/mtd/gpmc-onenand.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/mtd/gpmc-onenand.txt +0 -0
index b6e8bfd024f4..e9f01a963a0a 100644

Documentation/devicetree/bindings/mtd/gpmc-onenand.txt Documentation/devicetree/bindings/memory-controllers/omap-gpmc.txt · line 12

Quoted 4 lines
Documentation/devicetree/bindings/mtd/gpmc-onenand.txt +1 -0
@@ -9,13 +9,14 @@ Documentation/devicetree/bindings/memory-controllers/omap-gpmc.txt
 
 Required properties:
 
+ - compatible:		"ti,omap2-onenand"

Don't you break backward compat by adding this new requirement?

Quoted 13 lines
Documentation/devicetree/bindings/mtd/gpmc-onenand.txt +2 -2
  - reg:			The CS line the peripheral is connected to
- - gpmc,device-width	Width of the ONENAND device connected to the GPMC
+ - gpmc,device-width:	Width of the ONENAND device connected to the GPMC
 			in bytes. Must be 1 or 2.
 
 Optional properties:
 
- - dma-channel:		DMA Channel index
+ - int-gpios:		GPIO specifier for the INT pin.
 
 For inline partition table parsing (optional):
 

Documentation/devicetree/bindings/mtd/gpmc-onenand.txt Example for an OMAP3430 board: · line 42

Quoted 7 lines
Documentation/devicetree/bindings/mtd/gpmc-onenand.txt +1 -0
@@ -35,6 +36,7 @@ Example for an OMAP3430 board:
 		#size-cells = <1>;
 
 		onenand@0 {
+			compatible = "ti,omap2-onenand";
 			reg = <0 0 0>; /* CS0, offset 0 */
 			gpmc,device-width = <2>;
 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

Re: [PATCH v5 01/16] dt-bindings: mtd: gpmc-onenand: Update properties description

Quoted 32 lines · Boris Brezillon

+Rob and the DT ML

Quoted 27 lines · On Wed, 15 Nov 2017 17:24:58 +0100 Ladislav Michl <[email protected]> wrote:

Compatible property is required for OMAP2+ mtd driver. Also add INT pin gpio description and delete unused dma-channel property.

---

Changes in v5:
- renamed R/B pin to INT pin

Changes in v4:
- new patch

Changes in v3: None
Changes in v2: None

 Documentation/devicetree/bindings/mtd/gpmc-onenand.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/mtd/gpmc-onenand.txt +0 -0
index b6e8bfd024f4..e9f01a963a0a 100644
@@ -9,13 +9,14 @@ Documentation/devicetree/bindings/memory-controllers/omap-gpmc.txt
 
Quoted 5 lines

Documentation/devicetree/bindings/mtd/gpmc-onenand.txt Documentation/devicetree/bindings/memory-controllers/omap-gpmc.txt · line 12

Quoted 3 lines
Documentation/devicetree/bindings/mtd/gpmc-onenand.txt +1 -0
 Required properties:
 
+ - compatible:		"ti,omap2-onenand"

Don't you break backward compat by adding this new requirement?

I was told it is okay in this case as OneNAND conversion to DT is unfinished. There was compat fixup code in earlier versions of patchset and it was dropped later. If others see it opposite way I can add it back.

Quoted 12 lines
Quoted 12 lines
Documentation/devicetree/bindings/mtd/gpmc-onenand.txt +2 -2
  - reg:			The CS line the peripheral is connected to
- - gpmc,device-width	Width of the ONENAND device connected to the GPMC
+ - gpmc,device-width:	Width of the ONENAND device connected to the GPMC
 			in bytes. Must be 1 or 2.
 
 Optional properties:
 
- - dma-channel:		DMA Channel index
+ - int-gpios:		GPIO specifier for the INT pin.
 
 For inline partition table parsing (optional):
 
Quoted 8 lines

Documentation/devicetree/bindings/mtd/gpmc-onenand.txt Example for an OMAP3430 board: · line 42

Quoted 8 lines
Documentation/devicetree/bindings/mtd/gpmc-onenand.txt +1 -0
@@ -35,6 +36,7 @@ Example for an OMAP3430 board:
 		#size-cells = <1>;
 
 		onenand@0 {
+			compatible = "ti,omap2-onenand";
 			reg = <0 0 0>; /* CS0, offset 0 */
 			gpmc,device-width = <2>;
 

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#4 lore raw

Re: [PATCH v5 01/16] dt-bindings: mtd: gpmc-onenand: Update properties description

Ladislav,

Quoted 35 lines · Ladislav Michl
Quoted 34 lines · Boris Brezillon

+Rob and the DT ML

Quoted 29 lines · On Wed, 15 Nov 2017 17:24:58 +0100 Ladislav Michl <[email protected]> wrote:

Compatible property is required for OMAP2+ mtd driver. Also add INT pin gpio description and delete unused dma-channel property.

---

Changes in v5:
- renamed R/B pin to INT pin

Changes in v4:
- new patch

Changes in v3: None
Changes in v2: None

 Documentation/devicetree/bindings/mtd/gpmc-onenand.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/mtd/gpmc-onenand.txt +0 -0
index b6e8bfd024f4..e9f01a963a0a 100644
@@ -9,13 +9,14 @@ Documentation/devicetree/bindings/memory-controllers/omap-gpmc.txt
 
 Required properties:
 
Quoted 8 lines
Quoted 3 lines

Documentation/devicetree/bindings/mtd/gpmc-onenand.txt Documentation/devicetree/bindings/memory-controllers/omap-gpmc.txt · line 12

Quoted 1 line
Documentation/devicetree/bindings/mtd/gpmc-onenand.txt +1 -0
+ - compatible:		"ti,omap2-onenand"

Don't you break backward compat by adding this new requirement?

I was told it is okay in this case as OneNAND conversion to DT is unfinished. There was compat fixup code in earlier versions of patchset and it was dropped later. If others see it opposite way I can add it back.

If it is possible not to break backward compatibility then we shouldn't. Only if things are getting real messy because of the poor way the earlier DT implementation was done we can consider it as an exception.

I thought we rely on GPMC timings entirely from the DT now and so things don't work with older DT nodes?

Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Documentation/devicetree/bindings/mtd/gpmc-onenand.txt +3 -2
  - reg:			The CS line the peripheral is connected to
- - gpmc,device-width	Width of the ONENAND device connected to the GPMC
+ - gpmc,device-width:	Width of the ONENAND device connected to the GPMC
 			in bytes. Must be 1 or 2.
 
 Optional properties:
 
- - dma-channel:		DMA Channel index
+ - int-gpios:		GPIO specifier for the INT pin.
 
 For inline partition table parsing (optional):
 
@@ -35,6 +36,7 @@ Example for an OMAP3430 board:
 		#size-cells = <1>;
 
 		onenand@0 {
+			compatible = "ti,omap2-onenand";
 			reg = <0 0 0>; /* CS0, offset 0 */
 			gpmc,device-width = <2>;
 
Signature · 8 lines
cheers,
-roger

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

A message that is not in the archive (sent off-list or not yet received): 23d7ad3c-e6cd-3ba6-269a-1788371d13c3-l0cyMroinI0@public.gmane.org

#6 lore raw

Re: [PATCH v5 01/16] dt-bindings: mtd: gpmc-onenand: Update properties description

Roger,

Quoted 42 lines · Roger Quadros

Ladislav,

Quoted 39 lines · Ladislav Michl
Quoted 37 lines · Boris Brezillon

+Rob and the DT ML

Quoted 26 lines · On Wed, 15 Nov 2017 17:24:58 +0100 Ladislav Michl…

Compatible property is required for OMAP2+ mtd driver. Also add INT pin gpio description and delete unused dma-channel property.

---

Changes in v5:
- renamed R/B pin to INT pin

Changes in v4:
- new patch

Changes in v3: None
Changes in v2: None

 Documentation/devicetree/bindings/mtd/gpmc-onenand.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/mtd/gpmc-onenand.txt +0 -0
index b6e8bfd024f4..e9f01a963a0a 100644

Documentation/devicetree/bindings/mtd/gpmc-onenand.txt Documentation/devicetree/bindings/memory-controllers/omap-gpmc.txt · line 12

Quoted 4 lines
Documentation/devicetree/bindings/mtd/gpmc-onenand.txt +1 -0
@@ -9,13 +9,14 @@ Documentation/devicetree/bindings/memory-controllers/omap-gpmc.txt
 
 Required properties:
 
+ - compatible:		"ti,omap2-onenand"

Don't you break backward compat by adding this new requirement?

Quoted 8 lines
Quoted 4 lines

I was told it is okay in this case as OneNAND conversion to DT is unfinished. There was compat fixup code in earlier versions of patchset and it was dropped later. If others see it opposite way I can add it back.

If it is possible not to break backward compatibility then we shouldn't. Only if things are getting real messy because of the poor way the earlier DT implementation was done we can consider it as an exception.

Well, it is possible to reintroduce fixup. Based on other posts on linux-omap mailing list, it seems that n900, etc. support is still under heavy development, so people are updating both kernel and dtb. That's why I happily agreed on removing fixup.

Of course I'd like to hear opinion from n8x0 and n900 people and also would be very happy if someone could finally test on OMAP2 device.

Quoted 2 lines

I thought we rely on GPMC timings entirely from the DT now and so things don't work with older DT nodes?

Well, they do work as long as DT contains correct timings. Mainline driver just ignores them a does calculations on its own, so it works even with wrong DT timings as long as bootloader configured something reasonable (otherwise it doe not work at all).

This is no longer the case. Now, driver is expecting reasonable timings, enough good to get device probed. Driver then calculates optimized timings based on actual OneNAND chip ised.

Thank you,
ladis
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw

PATCH v5 2/16 ARM: dts: OMAP2+: Add compatible property to onenand node

In reply to Ladislav Michl

OMAP onenand nodes are missing compatible property, add it.

---

Changes in v5: None
Changes in v4:
- new patch

Changes in v3: None
Changes in v2: None

 arch/arm/boot/dts/omap2420-n8x0-common.dtsi | 1 +
 arch/arm/boot/dts/omap3-n900.dts            | 1 +
 arch/arm/boot/dts/omap3-n950-n9.dtsi        | 1 +
 arch/arm/boot/dts/omap3430-sdp.dts          | 1 +
 4 files changed, 4 insertions(+)
arch/arm/boot/dts/omap2420-n8x0-common.dtsi +1 -0
index 1de80c7886ab..843f6a2f5e29 100644
@@ -48,6 +48,7 @@
 	onenand@0,0 {
 		#address-cells = <1>;
 		#size-cells = <1>;
+		compatible = "ti,omap2-onenand";
 		reg = <0 0 0x20000>;	/* CS0, offset 0, IO size 128K */
 
 		gpmc,sync-read;
arch/arm/boot/dts/omap3-n900.dts +1 -0
index 4acd32a1c4ef..aa5b1a439564 100644
@@ -838,6 +838,7 @@
 	onenand@0,0 {
 		#address-cells = <1>;
 		#size-cells = <1>;
+		compatible = "ti,omap2-onenand";
 		reg = <0 0 0x20000>;	/* CS0, offset 0, IO size 128K */
 
 		gpmc,sync-read;
arch/arm/boot/dts/omap3-n950-n9.dtsi +1 -0
index 1b0bd72945f2..cb3c7b2fce52 100644
@@ -367,6 +367,7 @@
 	onenand@0,0 {
 		#address-cells = <1>;
 		#size-cells = <1>;
+		compatible = "ti,omap2-onenand";
 		reg = <0 0 0x20000>;	/* CS0, offset 0, IO size 128K */
 
 		gpmc,sync-read;
arch/arm/boot/dts/omap3430-sdp.dts +1 -0
index d50a105c9dc6..ed65795ccc62 100644
@@ -155,6 +155,7 @@
 		linux,mtd-name= "samsung,kfm2g16q2m-deb8";
 		#address-cells = <1>;
 		#size-cells = <1>;
+		compatible = "ti,omap2-onenand";
 		reg = <2 0 0x20000>;	/* CS2, offset 0, IO size 4 */
 
 		gpmc,device-width = <2>;
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#8 lore raw

PATCH v5 3/16 ARM: dts: omap3-igep: Update onenand node timings

In reply to Ladislav Michl

Update node timings to be compatible with actual chip used - gpmc_cs_show_timings utilized to dump values.

---

Changes in v5: None
Changes in v4:
- new patch

Changes in v3: None
Changes in v2: None

 arch/arm/boot/dts/omap3-igep.dtsi | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
arch/arm/boot/dts/omap3-igep.dtsi +15 -15
index 4929ba1cb9d3..1e4b8d5c7572 100644
@@ -144,32 +144,32 @@
 		gpmc,sync-read;
 		gpmc,sync-write;
 		gpmc,burst-length = <16>;
-		gpmc,burst-read;
 		gpmc,burst-wrap;
+		gpmc,burst-read;
 		gpmc,burst-write;
 		gpmc,device-width = <2>; /* GPMC_DEVWIDTH_16BIT */
 		gpmc,mux-add-data = <2>; /* GPMC_MUX_AD */
 		gpmc,cs-on-ns = <0>;
-		gpmc,cs-rd-off-ns = <87>;
-		gpmc,cs-wr-off-ns = <87>;
+		gpmc,cs-rd-off-ns = <96>;
+		gpmc,cs-wr-off-ns = <96>;
 		gpmc,adv-on-ns = <0>;
-		gpmc,adv-rd-off-ns = <10>;
-		gpmc,adv-wr-off-ns = <10>;
-		gpmc,oe-on-ns = <15>;
-		gpmc,oe-off-ns = <87>;
+		gpmc,adv-rd-off-ns = <12>;
+		gpmc,adv-wr-off-ns = <12>;
+		gpmc,oe-on-ns = <18>;
+		gpmc,oe-off-ns = <96>;
 		gpmc,we-on-ns = <0>;
-		gpmc,we-off-ns = <87>;
-		gpmc,rd-cycle-ns = <112>;
-		gpmc,wr-cycle-ns = <112>;
-		gpmc,access-ns = <81>;
-		gpmc,page-burst-access-ns = <15>;
+		gpmc,we-off-ns = <96>;
+		gpmc,rd-cycle-ns = <114>;
+		gpmc,wr-cycle-ns = <114>;
+		gpmc,access-ns = <90>;
+		gpmc,page-burst-access-ns = <12>;
 		gpmc,bus-turnaround-ns = <0>;
 		gpmc,cycle2cycle-delay-ns = <0>;
 		gpmc,wait-monitoring-ns = <0>;
-		gpmc,clk-activation-ns = <5>;
+		gpmc,clk-activation-ns = <6>;
 		gpmc,wr-data-mux-bus-ns = <30>;
-		gpmc,wr-access-ns = <81>;
-		gpmc,sync-clk-ps = <15000>;
+		gpmc,wr-access-ns = <90>;
+		gpmc,sync-clk-ps = <12000>;
 
 		#address-cells = <1>;
 		#size-cells = <1>;
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#9 lore raw

PATCH v5 4/16 mtd: onenand: omap2: Remove regulator support

In reply to Ladislav Michl

As no platform data user sets regulator_can_sleep, regulator code is no-op and can be deleted.

---

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
- new patch

 drivers/mtd/onenand/omap2.c | 42 +-----------------------------------------
 1 file changed, 1 insertion(+), 41 deletions(-)
drivers/mtd/onenand/omap2.c +1 -41
index 24a1388d3031..a03e1fe4aa48 100644
@@ -34,7 +34,6 @@
 #include <linux/dma-mapping.h>
 #include <linux/io.h>
 #include <linux/slab.h>
-#include <linux/regulator/consumer.h>
 #include <linux/gpio.h>
 
 #include <asm/mach/flash.h>
@@ -59,7 +58,6 @@ struct omap2_onenand {
 	int dma_channel;
 	int freq;
 	int (*setup)(void __iomem *base, int *freq_ptr);
-	struct regulator *regulator;
 	u8 flags;
 };
 
@@ -583,30 +581,6 @@ static void omap2_onenand_shutdown(struct platform_device *pdev)
 	memset((__force void *)c->onenand.base, 0, ONENAND_BUFRAM_SIZE);
 }
 
-static int omap2_onenand_enable(struct mtd_info *mtd)
-{
-	int ret;
-	struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd);
-
-	ret = regulator_enable(c->regulator);
-	if (ret != 0)
-		dev_err(&c->pdev->dev, "can't enable regulator\n");
-
-	return ret;
-}
-
-static int omap2_onenand_disable(struct mtd_info *mtd)
-{
-	int ret;
-	struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd);
-
-	ret = regulator_disable(c->regulator);
-	if (ret != 0)
-		dev_err(&c->pdev->dev, "can't disable regulator\n");
-
-	return ret;
-}
-
 static int omap2_onenand_probe(struct platform_device *pdev)
 {
 	struct omap_onenand_platform_data *pdata;
@@ -726,22 +700,11 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 		}
 	}
 
-	if (pdata->regulator_can_sleep) {
-		c->regulator = regulator_get(&pdev->dev, "vonenand");
-		if (IS_ERR(c->regulator)) {
-			dev_err(&pdev->dev,  "Failed to get regulator\n");
-			r = PTR_ERR(c->regulator);
-			goto err_release_dma;
-		}
-		c->onenand.enable = omap2_onenand_enable;
-		c->onenand.disable = omap2_onenand_disable;
-	}
-
 	if (pdata->skip_initial_unlocking)
 		this->options |= ONENAND_SKIP_INITIAL_UNLOCKING;
 
 	if ((r = onenand_scan(&c->mtd, 1)) < 0)
-		goto err_release_regulator;
+		goto err_release_dma;
 
 	r = mtd_device_register(&c->mtd, pdata ? pdata->parts : NULL,
 				pdata ? pdata->nr_parts : 0);
@@ -754,8 +717,6 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 
 err_release_onenand:
 	onenand_release(&c->mtd);
-err_release_regulator:
-	regulator_put(c->regulator);
 err_release_dma:
 	if (c->dma_channel != -1)
 		omap_free_dma(c->dma_channel);
@@ -779,7 +740,6 @@ static int omap2_onenand_remove(struct platform_device *pdev)
 	struct omap2_onenand *c = dev_get_drvdata(&pdev->dev);
 
 	onenand_release(&c->mtd);
-	regulator_put(c->regulator);
 	if (c->dma_channel != -1)
 		omap_free_dma(c->dma_channel);
 	omap2_onenand_shutdown(pdev);
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#10 lore raw

PATCH v5 5/16 mtd: onenand: omap2: Remove skip initial unlocking support

In reply to Ladislav Michl

No platform data user sets skip_initial_unlocking, so remove test for this field.

---

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
- new patch

 drivers/mtd/onenand/omap2.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/mtd/onenand/omap2.c +0 -3
index a03e1fe4aa48..93bd94337b35 100644
@@ -700,9 +700,6 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 		}
 	}
 
-	if (pdata->skip_initial_unlocking)
-		this->options |= ONENAND_SKIP_INITIAL_UNLOCKING;
-
 	if ((r = onenand_scan(&c->mtd, 1)) < 0)
 		goto err_release_dma;
 
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#11 lore raw

PATCH v5 6/16 mtd: onenand: omap2: Remove partitioning support from platform data

In reply to Ladislav Michl

No platform data user setups partitioning information, so remove.

---

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
- new patch

 drivers/mtd/onenand/omap2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mtd/onenand/omap2.c +1 -2
index 93bd94337b35..883993bbe40b 100644
@@ -703,8 +703,7 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 	if ((r = onenand_scan(&c->mtd, 1)) < 0)
 		goto err_release_dma;
 
-	r = mtd_device_register(&c->mtd, pdata ? pdata->parts : NULL,
-				pdata ? pdata->nr_parts : 0);
+	r = mtd_device_register(&c->mtd, NULL, 0);
 	if (r)
 		goto err_release_onenand;
 
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#12 lore raw

PATCH v5 7/16 mtd: onenand: omap2: Account waiting time as waiting on IO

In reply to Ladislav Michl

Use wait_for_completion_io_timeout, which has an impact on how the task is accounted in scheduling stats.

---

Changes in v5: None
Changes in v4:
- new patch

Changes in v3: None
Changes in v2: None

 drivers/mtd/onenand/omap2.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mtd/onenand/omap2.c +2 -3
index 883993bbe40b..0e7772e16d75 100644
@@ -170,9 +170,8 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
 		if (result == 0) {
 			int retry_cnt = 0;
 retry:
-			result = wait_for_completion_timeout(&c->irq_done,
-						    msecs_to_jiffies(20));
-			if (result == 0) {
+			if (!wait_for_completion_io_timeout(&c->irq_done,
+						msecs_to_jiffies(20))) {
 				/* Timeout after 20ms */
 				ctrl = read_reg(c, ONENAND_REG_CTRL_STATUS);
 				if (ctrl & ONENAND_CTRL_ONGO &&
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#13 lore raw

PATCH v5 8/16 mtd: onenand: omap2: Simplify the DMA setup for various paths

In reply to Ladislav Michl

From: Peter Ujfalusi <[email protected]>

We have 4 functions containing almost identical DMA setup code. Create one function which can set up the DMA for both read and write and use this in place for the setup code in the driver.
The new function will use wait_for_completion_io_timeout() and it will figure out the best data_type to be used for the transfer instead of hardwiring 32 or 16 bit data.

---

Changes in v5: None
Changes in v4:
- new patch

Changes in v3: None
Changes in v2: None

 drivers/mtd/onenand/omap2.c | 109 ++++++++++++++++++--------------------------
 1 file changed, 45 insertions(+), 64 deletions(-)
drivers/mtd/onenand/omap2.c +45 -64
index 0e7772e16d75..d22163271dc9 100644
@@ -288,6 +288,33 @@ static inline int omap2_onenand_bufferram_offset(struct mtd_info *mtd, int area)
 	return 0;
 }
 
+static inline int omap2_onenand_dma_transfer(struct omap2_onenand *c,
+					     dma_addr_t src, dma_addr_t dst,
+					     size_t count)
+{
+	int data_type = __ffs((src | dst | count));
+
+	if (data_type > OMAP_DMA_DATA_TYPE_S32)
+		data_type = OMAP_DMA_DATA_TYPE_S32;
+
+	omap_set_dma_transfer_params(c->dma_channel, data_type,
+				     count / BIT(data_type), 1, 0, 0, 0);
+	omap_set_dma_src_params(c->dma_channel, 0, OMAP_DMA_AMODE_POST_INC,
+				src, 0, 0);
+	omap_set_dma_dest_params(c->dma_channel, 0, OMAP_DMA_AMODE_POST_INC,
+				 dst, 0, 0);
+
+	reinit_completion(&c->dma_done);
+	omap_start_dma(c->dma_channel);
+	if (!wait_for_completion_io_timeout(&c->dma_done,
+					    msecs_to_jiffies(20))) {
+		omap_stop_dma(c->dma_channel);
+		return -ETIMEDOUT;
+	}
+
+	return 0;
+}
+
 #if defined(CONFIG_ARCH_OMAP3) || defined(MULTI_OMAP2)
 
 static int omap3_onenand_read_bufferram(struct mtd_info *mtd, int area,
@@ -298,10 +325,9 @@ static int omap3_onenand_read_bufferram(struct mtd_info *mtd, int area,
 	struct onenand_chip *this = mtd->priv;
 	dma_addr_t dma_src, dma_dst;
 	int bram_offset;
-	unsigned long timeout;
 	void *buf = (void *)buffer;
 	size_t xtra;
-	volatile unsigned *done;
+	int ret;
 
 	bram_offset = omap2_onenand_bufferram_offset(mtd, area) + area + offset;
 	if (bram_offset & 3 || (size_t)buf & 3 || count < 384)
@@ -338,25 +364,10 @@ static int omap3_onenand_read_bufferram(struct mtd_info *mtd, int area,
 		goto out_copy;
 	}
 
-	omap_set_dma_transfer_params(c->dma_channel, OMAP_DMA_DATA_TYPE_S32,
-				     count >> 2, 1, 0, 0, 0);
-	omap_set_dma_src_params(c->dma_channel, 0, OMAP_DMA_AMODE_POST_INC,
-				dma_src, 0, 0);
-	omap_set_dma_dest_params(c->dma_channel, 0, OMAP_DMA_AMODE_POST_INC,
-				 dma_dst, 0, 0);
-
-	reinit_completion(&c->dma_done);
-	omap_start_dma(c->dma_channel);
-
-	timeout = jiffies + msecs_to_jiffies(20);
-	done = &c->dma_done.done;
-	while (time_before(jiffies, timeout))
-		if (*done)
-			break;
-
+	ret = omap2_onenand_dma_transfer(c, dma_src, dma_dst, count);
 	dma_unmap_single(&c->pdev->dev, dma_dst, count, DMA_FROM_DEVICE);
 
-	if (!*done) {
+	if (ret) {
 		dev_err(&c->pdev->dev, "timeout waiting for DMA\n");
 		goto out_copy;
 	}
@@ -376,9 +387,8 @@ static int omap3_onenand_write_bufferram(struct mtd_info *mtd, int area,
 	struct onenand_chip *this = mtd->priv;
 	dma_addr_t dma_src, dma_dst;
 	int bram_offset;
-	unsigned long timeout;
 	void *buf = (void *)buffer;
-	volatile unsigned *done;
+	int ret;
 
 	bram_offset = omap2_onenand_bufferram_offset(mtd, area) + area + offset;
 	if (bram_offset & 3 || (size_t)buf & 3 || count < 384)
@@ -409,25 +419,10 @@ static int omap3_onenand_write_bufferram(struct mtd_info *mtd, int area,
 		return -1;
 	}
 
-	omap_set_dma_transfer_params(c->dma_channel, OMAP_DMA_DATA_TYPE_S32,
-				     count >> 2, 1, 0, 0, 0);
-	omap_set_dma_src_params(c->dma_channel, 0, OMAP_DMA_AMODE_POST_INC,
-				dma_src, 0, 0);
-	omap_set_dma_dest_params(c->dma_channel, 0, OMAP_DMA_AMODE_POST_INC,
-				 dma_dst, 0, 0);
-
-	reinit_completion(&c->dma_done);
-	omap_start_dma(c->dma_channel);
-
-	timeout = jiffies + msecs_to_jiffies(20);
-	done = &c->dma_done.done;
-	while (time_before(jiffies, timeout))
-		if (*done)
-			break;
-
+	ret = omap2_onenand_dma_transfer(c, dma_src, dma_dst, count);
 	dma_unmap_single(&c->pdev->dev, dma_src, count, DMA_TO_DEVICE);
 
-	if (!*done) {
+	if (ret) {
 		dev_err(&c->pdev->dev, "timeout waiting for DMA\n");
 		goto out_copy;
 	}
@@ -466,7 +461,7 @@ static int omap2_onenand_read_bufferram(struct mtd_info *mtd, int area,
 	struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd);
 	struct onenand_chip *this = mtd->priv;
 	dma_addr_t dma_src, dma_dst;
-	int bram_offset;
+	int bram_offset, ret;
 
 	bram_offset = omap2_onenand_bufferram_offset(mtd, area) + area + offset;
 	/* DMA is not used.  Revisit PM requirements before enabling it. */
@@ -488,20 +483,13 @@ static int omap2_onenand_read_bufferram(struct mtd_info *mtd, int area,
 		return -1;
 	}
 
-	omap_set_dma_transfer_params(c->dma_channel, OMAP_DMA_DATA_TYPE_S32,
-				     count / 4, 1, 0, 0, 0);
-	omap_set_dma_src_params(c->dma_channel, 0, OMAP_DMA_AMODE_POST_INC,
-				dma_src, 0, 0);
-	omap_set_dma_dest_params(c->dma_channel, 0, OMAP_DMA_AMODE_POST_INC,
-				 dma_dst, 0, 0);
-
-	reinit_completion(&c->dma_done);
-	omap_start_dma(c->dma_channel);
-	wait_for_completion(&c->dma_done);
-
+	ret = omap2_onenand_dma_transfer(c, dma_src, dma_dst, count);
 	dma_unmap_single(&c->pdev->dev, dma_dst, count, DMA_FROM_DEVICE);
 
-	return 0;
+	if (ret)
+		dev_err(&c->pdev->dev, "timeout waiting for DMA\n");
+
+	return ret;
 }
 
 static int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area,
@@ -511,7 +499,7 @@ static int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area,
 	struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd);
 	struct onenand_chip *this = mtd->priv;
 	dma_addr_t dma_src, dma_dst;
-	int bram_offset;
+	int bram_offset, ret;
 
 	bram_offset = omap2_onenand_bufferram_offset(mtd, area) + area + offset;
 	/* DMA is not used.  Revisit PM requirements before enabling it. */
@@ -533,20 +521,13 @@ static int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area,
 		return -1;
 	}
 
-	omap_set_dma_transfer_params(c->dma_channel, OMAP_DMA_DATA_TYPE_S16,
-				     count / 2, 1, 0, 0, 0);
-	omap_set_dma_src_params(c->dma_channel, 0, OMAP_DMA_AMODE_POST_INC,
-				dma_src, 0, 0);
-	omap_set_dma_dest_params(c->dma_channel, 0, OMAP_DMA_AMODE_POST_INC,
-				 dma_dst, 0, 0);
-
-	reinit_completion(&c->dma_done);
-	omap_start_dma(c->dma_channel);
-	wait_for_completion(&c->dma_done);
-
+	ret = omap2_onenand_dma_transfer(c, dma_src, dma_dst, count);
 	dma_unmap_single(&c->pdev->dev, dma_src, count, DMA_TO_DEVICE);
 
-	return 0;
+	if (ret)
+		dev_err(&c->pdev->dev, "timeout waiting for DMA\n");
+
+	return ret;
 }
 
 #else
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#14 lore raw

PATCH v5 9/16 mtd: onenand: omap2: Unify OMAP2 and OMAP3 DMA implementation

In reply to Ladislav Michl

Since the very first commit (36cd4fb5d277: "[MTD] [OneNAND] Add OMAP2 / OMAP3 OneNAND driver") DMA is disabled for OMAP2. Later fixes thus went only into OMAP3 specific DMA functions which turned out not to be so OMAP3 specific, so merge those two implementations.

---

Changes in v5: None
Changes in v4:
- rebase on top of Peter's patch

Changes in v3:
- new patch

Changes in v2: None

 drivers/mtd/onenand/omap2.c | 129 ++------------------------------------------
 1 file changed, 4 insertions(+), 125 deletions(-)
drivers/mtd/onenand/omap2.c +4 -125
index d22163271dc9..36314124488d 100644
@@ -315,9 +315,7 @@ static inline int omap2_onenand_dma_transfer(struct omap2_onenand *c,
 	return 0;
 }
 
-#if defined(CONFIG_ARCH_OMAP3) || defined(MULTI_OMAP2)
-
-static int omap3_onenand_read_bufferram(struct mtd_info *mtd, int area,
+static int omap2_onenand_read_bufferram(struct mtd_info *mtd, int area,
 					unsigned char *buffer, int offset,
 					size_t count)
 {
@@ -379,7 +377,7 @@ static int omap3_onenand_read_bufferram(struct mtd_info *mtd, int area,
 	return 0;
 }
 
-static int omap3_onenand_write_bufferram(struct mtd_info *mtd, int area,
+static int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area,
 					 const unsigned char *buffer,
 					 int offset, size_t count)
 {
@@ -434,120 +432,6 @@ static int omap3_onenand_write_bufferram(struct mtd_info *mtd, int area,
 	return 0;
 }
 
-#else
-
-static int omap3_onenand_read_bufferram(struct mtd_info *mtd, int area,
-					unsigned char *buffer, int offset,
-					size_t count)
-{
-	return -ENOSYS;
-}
-
-static int omap3_onenand_write_bufferram(struct mtd_info *mtd, int area,
-					 const unsigned char *buffer,
-					 int offset, size_t count)
-{
-	return -ENOSYS;
-}
-
-#endif
-
-#if defined(CONFIG_ARCH_OMAP2) || defined(MULTI_OMAP2)
-
-static int omap2_onenand_read_bufferram(struct mtd_info *mtd, int area,
-					unsigned char *buffer, int offset,
-					size_t count)
-{
-	struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd);
-	struct onenand_chip *this = mtd->priv;
-	dma_addr_t dma_src, dma_dst;
-	int bram_offset, ret;
-
-	bram_offset = omap2_onenand_bufferram_offset(mtd, area) + area + offset;
-	/* DMA is not used.  Revisit PM requirements before enabling it. */
-	if (1 || (c->dma_channel < 0) ||
-	    ((void *) buffer >= (void *) high_memory) || (bram_offset & 3) ||
-	    (((unsigned int) buffer) & 3) || (count < 1024) || (count & 3)) {
-		memcpy(buffer, (__force void *)(this->base + bram_offset),
-		       count);
-		return 0;
-	}
-
-	dma_src = c->phys_base + bram_offset;
-	dma_dst = dma_map_single(&c->pdev->dev, buffer, count,
-				 DMA_FROM_DEVICE);
-	if (dma_mapping_error(&c->pdev->dev, dma_dst)) {
-		dev_err(&c->pdev->dev,
-			"Couldn't DMA map a %d byte buffer\n",
-			count);
-		return -1;
-	}
-
-	ret = omap2_onenand_dma_transfer(c, dma_src, dma_dst, count);
-	dma_unmap_single(&c->pdev->dev, dma_dst, count, DMA_FROM_DEVICE);
-
-	if (ret)
-		dev_err(&c->pdev->dev, "timeout waiting for DMA\n");
-
-	return ret;
-}
-
-static int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area,
-					 const unsigned char *buffer,
-					 int offset, size_t count)
-{
-	struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd);
-	struct onenand_chip *this = mtd->priv;
-	dma_addr_t dma_src, dma_dst;
-	int bram_offset, ret;
-
-	bram_offset = omap2_onenand_bufferram_offset(mtd, area) + area + offset;
-	/* DMA is not used.  Revisit PM requirements before enabling it. */
-	if (1 || (c->dma_channel < 0) ||
-	    ((void *) buffer >= (void *) high_memory) || (bram_offset & 3) ||
-	    (((unsigned int) buffer) & 3) || (count < 1024) || (count & 3)) {
-		memcpy((__force void *)(this->base + bram_offset), buffer,
-		       count);
-		return 0;
-	}
-
-	dma_src = dma_map_single(&c->pdev->dev, (void *) buffer, count,
-				 DMA_TO_DEVICE);
-	dma_dst = c->phys_base + bram_offset;
-	if (dma_mapping_error(&c->pdev->dev, dma_src)) {
-		dev_err(&c->pdev->dev,
-			"Couldn't DMA map a %d byte buffer\n",
-			count);
-		return -1;
-	}
-
-	ret = omap2_onenand_dma_transfer(c, dma_src, dma_dst, count);
-	dma_unmap_single(&c->pdev->dev, dma_src, count, DMA_TO_DEVICE);
-
-	if (ret)
-		dev_err(&c->pdev->dev, "timeout waiting for DMA\n");
-
-	return ret;
-}
-
-#else
-
-static int omap2_onenand_read_bufferram(struct mtd_info *mtd, int area,
-					unsigned char *buffer, int offset,
-					size_t count)
-{
-	return -ENOSYS;
-}
-
-static int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area,
-					 const unsigned char *buffer,
-					 int offset, size_t count)
-{
-	return -ENOSYS;
-}
-
-#endif
-
 static struct platform_driver omap2_onenand_driver;
 
 static void omap2_onenand_shutdown(struct platform_device *pdev)
@@ -671,13 +555,8 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 	this = &c->onenand;
 	if (c->dma_channel >= 0) {
 		this->wait = omap2_onenand_wait;
-		if (c->flags & ONENAND_IN_OMAP34XX) {
-			this->read_bufferram = omap3_onenand_read_bufferram;
-			this->write_bufferram = omap3_onenand_write_bufferram;
-		} else {
-			this->read_bufferram = omap2_onenand_read_bufferram;
-			this->write_bufferram = omap2_onenand_write_bufferram;
-		}
+		this->read_bufferram = omap2_onenand_read_bufferram;
+		this->write_bufferram = omap2_onenand_write_bufferram;
 	}
 
 	if ((r = onenand_scan(&c->mtd, 1)) < 0)
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#15 lore raw

PATCH v5 10/16 mtd: onenand: omap2: Convert to use dmaengine for memcpy

In reply to Ladislav Michl

From: Peter Ujfalusi <[email protected]>

Do not use the legacy and deprecated omap-dma interface for setting up the memcpy.

---

Changes in v5: None
Changes in v4:
- new patch

Changes in v3: None
Changes in v2: None

 drivers/mtd/onenand/omap2.c | 80 +++++++++++++++++++++------------------------
 1 file changed, 38 insertions(+), 42 deletions(-)
drivers/mtd/onenand/omap2.c +38 -42
index 36314124488d..c9ff67100ef4 100644
@@ -32,6 +32,7 @@
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
+#include <linux/dmaengine.h>
 #include <linux/io.h>
 #include <linux/slab.h>
 #include <linux/gpio.h>
@@ -39,8 +40,6 @@
 #include <asm/mach/flash.h>
 #include <linux/platform_data/mtd-onenand-omap2.h>
 
-#include <linux/omap-dma.h>
-
 #define DRIVER_NAME "omap2-onenand"
 
 #define ONENAND_BUFRAM_SIZE	(1024 * 5)
@@ -55,17 +54,15 @@ struct omap2_onenand {
 	struct onenand_chip onenand;
 	struct completion irq_done;
 	struct completion dma_done;
-	int dma_channel;
+	struct dma_chan *dma_chan;
 	int freq;
 	int (*setup)(void __iomem *base, int *freq_ptr);
 	u8 flags;
 };
 
-static void omap2_onenand_dma_cb(int lch, u16 ch_status, void *data)
+static void omap2_onenand_dma_complete_func(void *completion)
 {
-	struct omap2_onenand *c = data;
-
-	complete(&c->dma_done);
+	complete(completion);
 }
 
 static irqreturn_t omap2_onenand_interrupt(int irq, void *dev_id)
@@ -292,23 +289,31 @@ static inline int omap2_onenand_dma_transfer(struct omap2_onenand *c,
 					     dma_addr_t src, dma_addr_t dst,
 					     size_t count)
 {
-	int data_type = __ffs((src | dst | count));
+	struct dma_async_tx_descriptor *tx;
+	dma_cookie_t cookie;
 
-	if (data_type > OMAP_DMA_DATA_TYPE_S32)
-		data_type = OMAP_DMA_DATA_TYPE_S32;
-
-	omap_set_dma_transfer_params(c->dma_channel, data_type,
-				     count / BIT(data_type), 1, 0, 0, 0);
-	omap_set_dma_src_params(c->dma_channel, 0, OMAP_DMA_AMODE_POST_INC,
-				src, 0, 0);
-	omap_set_dma_dest_params(c->dma_channel, 0, OMAP_DMA_AMODE_POST_INC,
-				 dst, 0, 0);
+	tx = dmaengine_prep_dma_memcpy(c->dma_chan, dst, src, count, 0);
+	if (!tx) {
+		dev_err(&c->pdev->dev, "Failed to prepare DMA memcpy\n");
+		return -EIO;
+	}
 
 	reinit_completion(&c->dma_done);
-	omap_start_dma(c->dma_channel);
+
+	tx->callback = omap2_onenand_dma_complete_func;
+	tx->callback_param = &c->dma_done;
+
+	cookie = tx->tx_submit(tx);
+	if (dma_submit_error(cookie)) {
+		dev_err(&c->pdev->dev, "Failed to do DMA tx_submit\n");
+		return -EIO;
+	}
+
+	dma_async_issue_pending(c->dma_chan);
+
 	if (!wait_for_completion_io_timeout(&c->dma_done,
 					    msecs_to_jiffies(20))) {
-		omap_stop_dma(c->dma_channel);
+		dmaengine_terminate_sync(c->dma_chan);
 		return -ETIMEDOUT;
 	}
 
@@ -468,8 +473,7 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 	c->flags = pdata->flags;
 	c->gpmc_cs = pdata->cs;
 	c->gpio_irq = pdata->gpio_irq;
-	c->dma_channel = pdata->dma_channel;
-	if (c->dma_channel < 0) {
+	if (pdata->dma_channel < 0) {
 		/* if -1, don't use DMA */
 		c->gpio_irq = 0;
 	}
@@ -521,25 +525,17 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 		goto err_release_gpio;
 	}
 
-	if (c->dma_channel >= 0) {
-		r = omap_request_dma(0, pdev->dev.driver->name,
-				     omap2_onenand_dma_cb, (void *) c,
-				     &c->dma_channel);
-		if (r == 0) {
-			omap_set_dma_write_mode(c->dma_channel,
-						OMAP_DMA_WRITE_NON_POSTED);
-			omap_set_dma_src_data_pack(c->dma_channel, 1);
-			omap_set_dma_src_burst_mode(c->dma_channel,
-						    OMAP_DMA_DATA_BURST_8);
-			omap_set_dma_dest_data_pack(c->dma_channel, 1);
-			omap_set_dma_dest_burst_mode(c->dma_channel,
-						     OMAP_DMA_DATA_BURST_8);
-		} else {
+	if (pdata->dma_channel >= 0) {
+		dma_cap_mask_t mask;
+
+		dma_cap_zero(mask);
+		dma_cap_set(DMA_MEMCPY, mask);
+
+		c->dma_chan = dma_request_channel(mask, NULL, NULL);
+		if (!c->dma_chan)
 			dev_info(&pdev->dev,
 				 "failed to allocate DMA for OneNAND, "
 				 "using PIO instead\n");
-			c->dma_channel = -1;
-		}
 	}
 
 	dev_info(&pdev->dev, "initializing on CS%d, phys base 0x%08lx, virtual "
@@ -553,7 +549,7 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 	mtd_set_of_node(&c->mtd, pdata->of_node);
 
 	this = &c->onenand;
-	if (c->dma_channel >= 0) {
+	if (c->dma_chan) {
 		this->wait = omap2_onenand_wait;
 		this->read_bufferram = omap2_onenand_read_bufferram;
 		this->write_bufferram = omap2_onenand_write_bufferram;
@@ -573,8 +569,8 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 err_release_onenand:
 	onenand_release(&c->mtd);
 err_release_dma:
-	if (c->dma_channel != -1)
-		omap_free_dma(c->dma_channel);
+	if (c->dma_chan)
+		dma_release_channel(c->dma_chan);
 	if (c->gpio_irq)
 		free_irq(gpio_to_irq(c->gpio_irq), c);
 err_release_gpio:
@@ -595,8 +591,8 @@ static int omap2_onenand_remove(struct platform_device *pdev)
 	struct omap2_onenand *c = dev_get_drvdata(&pdev->dev);
 
 	onenand_release(&c->mtd);
-	if (c->dma_channel != -1)
-		omap_free_dma(c->dma_channel);
+	if (c->dma_chan)
+		dma_release_channel(c->dma_chan);
 	omap2_onenand_shutdown(pdev);
 	if (c->gpio_irq) {
 		free_irq(gpio_to_irq(c->gpio_irq), c);
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#16 lore raw

PATCH v5 11/16 mtd: onenand: omap2: Do not make delay for GPIO OMAP3 specific

In reply to Ladislav Michl

Second commit in driver history (782b7a367d81: "[MTD] [OneNAND] OMAP3:
add delay for GPIO") added quirk for waiting until GPIO line settle. As DMA was disabled for OMAP2 boards, chances are this problem was not OMAP3 specific and as it is just one register read, previous test for SoC type is approximately as expensive as read itself. Make delay unconditional, which allows removing SoC specific code alltogether.

---

Changes in v5: None
Changes in v4: None
Changes in v3:
- new patch

Changes in v2: None

 drivers/mtd/onenand/omap2.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/mtd/onenand/omap2.c +2 -5
index c9ff67100ef4..e4857a41760d 100644
@@ -57,7 +57,6 @@ struct omap2_onenand {
 	struct dma_chan *dma_chan;
 	int freq;
 	int (*setup)(void __iomem *base, int *freq_ptr);
-	u8 flags;
 };
 
 static void omap2_onenand_dma_complete_func(void *completion)
@@ -148,9 +147,8 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
 		if (!(syscfg & ONENAND_SYS_CFG1_IOBE)) {
 			syscfg |= ONENAND_SYS_CFG1_IOBE;
 			write_reg(c, syscfg, ONENAND_REG_SYS_CFG1);
-			if (c->flags & ONENAND_IN_OMAP34XX)
-				/* Add a delay to let GPIO settle */
-				syscfg = read_reg(c, ONENAND_REG_SYS_CFG1);
+			/* Add a delay to let GPIO settle */
+			syscfg = read_reg(c, ONENAND_REG_SYS_CFG1);
 		}
 
 		reinit_completion(&c->irq_done);
@@ -470,7 +468,6 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 
 	init_completion(&c->irq_done);
 	init_completion(&c->dma_done);
-	c->flags = pdata->flags;
 	c->gpmc_cs = pdata->cs;
 	c->gpio_irq = pdata->gpio_irq;
 	if (pdata->dma_channel < 0) {
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#17 lore raw

PATCH v5 12/16 mtd: onenand: omap2: Decouple DMA enabling from INT pin availability

In reply to Ladislav Michl

INT pin (gpio_irq) is not really needed for DMA but only for notification when a command that needs wait has completed. DMA memcpy can be still used even without gpio_irq available, so enable it unconditionally.

---

Changes in v5:
- rename patch and fix commit message

Changes in v4:
- new patch

Changes in v3: None
Changes in v2: None

 drivers/mtd/onenand/omap2.c | 52 ++++++++++++++++++---------------------------
 1 file changed, 21 insertions(+), 31 deletions(-)
drivers/mtd/onenand/omap2.c +21 -31
index e4857a41760d..1cd78a076759 100644
@@ -152,17 +152,13 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
 		}
 
 		reinit_completion(&c->irq_done);
-		if (c->gpio_irq) {
-			result = gpio_get_value(c->gpio_irq);
-			if (result == -1) {
-				ctrl = read_reg(c, ONENAND_REG_CTRL_STATUS);
-				intr = read_reg(c, ONENAND_REG_INTERRUPT);
-				wait_err("gpio error", state, ctrl, intr);
-				return -EIO;
-			}
-		} else
-			result = 0;
-		if (result == 0) {
+		result = gpio_get_value(c->gpio_irq);
+		if (result < 0) {
+			ctrl = read_reg(c, ONENAND_REG_CTRL_STATUS);
+			intr = read_reg(c, ONENAND_REG_INTERRUPT);
+			wait_err("gpio error", state, ctrl, intr);
+			return -EIO;
+		} else if (result == 0) {
 			int retry_cnt = 0;
 retry:
 			if (!wait_for_completion_io_timeout(&c->irq_done,
@@ -450,6 +446,7 @@ static void omap2_onenand_shutdown(struct platform_device *pdev)
 
 static int omap2_onenand_probe(struct platform_device *pdev)
 {
+	dma_cap_mask_t mask;
 	struct omap_onenand_platform_data *pdata;
 	struct omap2_onenand *c;
 	struct onenand_chip *this;
@@ -513,31 +510,25 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 			dev_err(&pdev->dev,  "Failed to request GPIO%d for "
 				"OneNAND\n", c->gpio_irq);
 			goto err_iounmap;
-	}
-	gpio_direction_input(c->gpio_irq);
+		}
+		gpio_direction_input(c->gpio_irq);
 
-	if ((r = request_irq(gpio_to_irq(c->gpio_irq),
-			     omap2_onenand_interrupt, IRQF_TRIGGER_RISING,
-			     pdev->dev.driver->name, c)) < 0)
-		goto err_release_gpio;
-	}
+		if ((r = request_irq(gpio_to_irq(c->gpio_irq),
+				     omap2_onenand_interrupt, IRQF_TRIGGER_RISING,
+				     pdev->dev.driver->name, c)) < 0)
+			goto err_release_gpio;
 
-	if (pdata->dma_channel >= 0) {
-		dma_cap_mask_t mask;
+		this->wait = omap2_onenand_wait;
+	}
 
-		dma_cap_zero(mask);
-		dma_cap_set(DMA_MEMCPY, mask);
+	dma_cap_zero(mask);
+	dma_cap_set(DMA_MEMCPY, mask);
 
-		c->dma_chan = dma_request_channel(mask, NULL, NULL);
-		if (!c->dma_chan)
-			dev_info(&pdev->dev,
-				 "failed to allocate DMA for OneNAND, "
-				 "using PIO instead\n");
-	}
+	c->dma_chan = dma_request_channel(mask, NULL, NULL);
 
 	dev_info(&pdev->dev, "initializing on CS%d, phys base 0x%08lx, virtual "
-		 "base %p, freq %d MHz\n", c->gpmc_cs, c->phys_base,
-		 c->onenand.base, c->freq);
+		 "base %p, freq %d MHz, %s mode\n", c->gpmc_cs, c->phys_base,
+		 c->onenand.base, c->freq, c->dma_chan ? "DMA" : "PIO");
 
 	c->pdev = pdev;
 	c->mtd.priv = &c->onenand;
@@ -547,7 +538,6 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 
 	this = &c->onenand;
 	if (c->dma_chan) {
-		this->wait = omap2_onenand_wait;
 		this->read_bufferram = omap2_onenand_read_bufferram;
 		this->write_bufferram = omap2_onenand_write_bufferram;
 	}
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#18 lore raw

PATCH v5 13/16 memory: omap-gpmc: Refactor OneNAND support

In reply to Ladislav Michl

Use generic probe function to deal with OneNAND node and remove now useless gpmc_probe_onenand_child function.
Import sync mode timing calculation function from mach-omap2/gpmc-onenand.c and prepare for MTD driver DTfication.

---

Changes in v5:
- make gpmc_omap_onenand_set_timings decsription more descriptive

Changes in v4: None
Changes in v3: None
Changes in v2:
- add gpmc_omap_onenand_set_timings description

 drivers/memory/omap-gpmc.c | 158 +++++++++++++++++++++++++++++++++------------
 include/linux/omap-gpmc.h  |  28 ++++++++
 2 files changed, 145 insertions(+), 41 deletions(-)
drivers/memory/omap-gpmc.c +117 -41
index 0e30ee1c8677..90a66b3f7ae1 100644
@@ -32,7 +32,6 @@
 #include <linux/pm_runtime.h>
 
 #include <linux/platform_data/mtd-nand-omap2.h>
-#include <linux/platform_data/mtd-onenand-omap2.h>
 
 #include <asm/mach-types.h>
 
@@ -1138,6 +1137,112 @@ struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *reg, int cs)
 }
 EXPORT_SYMBOL_GPL(gpmc_omap_get_nand_ops);
 
+static void gpmc_omap_onenand_calc_sync_timings(struct gpmc_timings *t,
+						struct gpmc_settings *s,
+						int freq, int latency)
+{
+	struct gpmc_device_timings dev_t;
+	const int t_cer  = 15;
+	const int t_avdp = 12;
+	const int t_cez  = 20; /* max of t_cez, t_oez */
+	const int t_wpl  = 40;
+	const int t_wph  = 30;
+	int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo;
+
+	switch (freq) {
+	case 104:
+		min_gpmc_clk_period = 9600; /* 104 MHz */
+		t_ces   = 3;
+		t_avds  = 4;
+		t_avdh  = 2;
+		t_ach   = 3;
+		t_aavdh = 6;
+		t_rdyo  = 6;
+		break;
+	case 83:
+		min_gpmc_clk_period = 12000; /* 83 MHz */
+		t_ces   = 5;
+		t_avds  = 4;
+		t_avdh  = 2;
+		t_ach   = 6;
+		t_aavdh = 6;
+		t_rdyo  = 9;
+		break;
+	case 66:
+		min_gpmc_clk_period = 15000; /* 66 MHz */
+		t_ces   = 6;
+		t_avds  = 5;
+		t_avdh  = 2;
+		t_ach   = 6;
+		t_aavdh = 6;
+		t_rdyo  = 11;
+		break;
+	default:
+		min_gpmc_clk_period = 18500; /* 54 MHz */
+		t_ces   = 7;
+		t_avds  = 7;
+		t_avdh  = 7;
+		t_ach   = 9;
+		t_aavdh = 7;
+		t_rdyo  = 15;
+		break;
+	}
+
+	/* Set synchronous read timings */
+	memset(&dev_t, 0, sizeof(dev_t));
+
+	if (!s->sync_write) {
+		dev_t.t_avdp_w = max(t_avdp, t_cer) * 1000;
+		dev_t.t_wpl = t_wpl * 1000;
+		dev_t.t_wph = t_wph * 1000;
+		dev_t.t_aavdh = t_aavdh * 1000;
+	}
+	dev_t.ce_xdelay = true;
+	dev_t.avd_xdelay = true;
+	dev_t.oe_xdelay = true;
+	dev_t.we_xdelay = true;
+	dev_t.clk = min_gpmc_clk_period;
+	dev_t.t_bacc = dev_t.clk;
+	dev_t.t_ces = t_ces * 1000;
+	dev_t.t_avds = t_avds * 1000;
+	dev_t.t_avdh = t_avdh * 1000;
+	dev_t.t_ach = t_ach * 1000;
+	dev_t.cyc_iaa = (latency + 1);
+	dev_t.t_cez_r = t_cez * 1000;
+	dev_t.t_cez_w = dev_t.t_cez_r;
+	dev_t.cyc_aavdh_oe = 1;
+	dev_t.t_rdyo = t_rdyo * 1000 + min_gpmc_clk_period;
+
+	gpmc_calc_timings(t, s, &dev_t);
+}
+
+int gpmc_omap_onenand_set_timings(struct device *dev, int cs, int freq,
+				  int latency,
+				  struct gpmc_onenand_info *info)
+{
+	int ret;
+	struct gpmc_timings gpmc_t;
+	struct gpmc_settings gpmc_s;
+
+	gpmc_read_settings_dt(dev->of_node, &gpmc_s);
+
+	info->sync_read = gpmc_s.sync_read;
+	info->sync_write = gpmc_s.sync_write;
+	info->burst_len = gpmc_s.burst_len;
+
+	if (!gpmc_s.sync_read && !gpmc_s.sync_write)
+		return 0;
+
+	gpmc_omap_onenand_calc_sync_timings(&gpmc_t, &gpmc_s, freq, latency);
+
+	ret = gpmc_cs_program_settings(cs, &gpmc_s);
+	if (ret < 0)
+		return ret;
+
+	return gpmc_cs_set_timings(cs, &gpmc_t, &gpmc_s);
+}
+EXPORT_SYMBOL_GPL(gpmc_omap_onenand_set_timings);
+
 int gpmc_get_client_irq(unsigned irq_config)
 {
 	if (!gpmc_irq_domain) {
@@ -1916,41 +2021,6 @@ static void __maybe_unused gpmc_read_timings_dt(struct device_node *np,
 		of_property_read_bool(np, "gpmc,time-para-granularity");
 }
 
-#if IS_ENABLED(CONFIG_MTD_ONENAND)
-static int gpmc_probe_onenand_child(struct platform_device *pdev,
-				 struct device_node *child)
-{
-	u32 val;
-	struct omap_onenand_platform_data *gpmc_onenand_data;
-
-	if (of_property_read_u32(child, "reg", &val) < 0) {
-		dev_err(&pdev->dev, "%pOF has no 'reg' property\n",
-			child);
-		return -ENODEV;
-	}
-
-	gpmc_onenand_data = devm_kzalloc(&pdev->dev, sizeof(*gpmc_onenand_data),
-					 GFP_KERNEL);
-	if (!gpmc_onenand_data)
-		return -ENOMEM;
-
-	gpmc_onenand_data->cs = val;
-	gpmc_onenand_data->of_node = child;
-	gpmc_onenand_data->dma_channel = -1;
-
-	if (!of_property_read_u32(child, "dma-channel", &val))
-		gpmc_onenand_data->dma_channel = val;
-
-	return gpmc_onenand_init(gpmc_onenand_data);
-}
-#else
-static int gpmc_probe_onenand_child(struct platform_device *pdev,
-				    struct device_node *child)
-{
-	return 0;
-}
-#endif
-
 /**
  * gpmc_probe_generic_child - configures the gpmc for a child device
  * @pdev:	pointer to gpmc platform device
@@ -2053,6 +2123,16 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
 		}
 	}
 
+	if (of_node_cmp(child->name, "onenand") == 0) {
+		/* Warn about older DT blobs with no compatible property */
+		if (!of_property_read_bool(child, "compatible")) {
+			dev_warn(&pdev->dev,
+				 "Incompatible OneNAND node: missing compatible");
+			ret = -EINVAL;
+			goto err;
+		}
+	}
+
 	if (of_device_is_compatible(child, "ti,omap2-nand")) {
 		/* NAND specific setup */
 		val = 8;
@@ -2189,11 +2269,7 @@ static void gpmc_probe_dt_children(struct platform_device *pdev)
 		if (!child->name)
 			continue;
 
-		if (of_node_cmp(child->name, "onenand") == 0)
-			ret = gpmc_probe_onenand_child(pdev, child);
-		else
-			ret = gpmc_probe_generic_child(pdev, child);
-
+		ret = gpmc_probe_generic_child(pdev, child);
 		if (ret) {
 			dev_err(&pdev->dev, "failed to probe DT child '%s': %d\n",
 				child->name, ret);
include/linux/omap-gpmc.h +28 -0
index edfa280c3d56..053feb41510a 100644
@@ -25,15 +25,43 @@ struct gpmc_nand_ops {
 
 struct gpmc_nand_regs;
 
+struct gpmc_onenand_info {
+	bool sync_read;
+	bool sync_write;
+	int burst_len;
+};
+
 #if IS_ENABLED(CONFIG_OMAP_GPMC)
 struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs,
 					     int cs);
+/**
+ * gpmc_omap_onenand_set_timings - set optimized sync timings.
+ * @cs:      Chip Select Region
+ * @freq:    Chip frequency
+ * @latency: Burst latency cycle count
+ * @info:    Structure describing parameters used
+ *
+ * Sets optimized timings for the @cs region based on @freq and @latency.
+ * Updates the @info structure based on the GPMC settings.
+ */
+int gpmc_omap_onenand_set_timings(struct device *dev, int cs, int freq,
+				  int latency,
+				  struct gpmc_onenand_info *info);
+
 #else
 static inline struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs,
 							   int cs)
 {
 	return NULL;
 }
+
+static inline
+int gpmc_omap_onenand_set_timings(struct device *dev, int cs, int freq,
+				  int latency,
+				  struct gpmc_onenand_info *info)
+{
+	return -EINVAL;
+}
 #endif /* CONFIG_OMAP_GPMC */
 
 extern int gpmc_calc_timings(struct gpmc_timings *gpmc_t,
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#19 lore raw

PATCH v5 14/16 mtd: onenand: omap2: Configure driver from DT

In reply to Ladislav Michl

Move away from platform data configuration and use pure DT approach.

---

Changes in v5:
- rename ready_gpiod to int_gpiod
- use int-gpios as property name
- use devm_ioremap_resource
- "onenand" is now requested irq name
- add Kconfig dependencies

Changes in v4: None
Changes in v3:
- remove 'ti,omap3-onenand' compatible as it is not needed anymore

Changes in v2:
- move cleanups into separate patches
- simplify dma setup
- fix checkpatch error
- print info about otimized timings in sync mode only

 drivers/mtd/onenand/Kconfig |   3 +-
 drivers/mtd/onenand/omap2.c | 250 +++++++++++++++++++++++++++-----------------
 2 files changed, 155 insertions(+), 98 deletions(-)
drivers/mtd/onenand/Kconfig +2 -1
index aaeb30458139..9ec5f8757a1e 100644
@@ -25,8 +25,9 @@ config MTD_ONENAND_GENERIC
 config MTD_ONENAND_OMAP2
 	tristate "OneNAND on OMAP2/OMAP3 support"
 	depends on ARCH_OMAP2 || ARCH_OMAP3
+	depends on (OF && GPIOLIB && DMA_ENGINE) || COMPILE_TEST
 	help
-	  Support for a OneNAND flash device connected to an OMAP2/OMAP3 CPU
+	  Support for a OneNAND flash device connected to an OMAP2/OMAP3 SoC
 	  via the GPMC memory controller.
 
 config MTD_ONENAND_SAMSUNG
drivers/mtd/onenand/omap2.c +153 -97

355 lines not on this page · raw message

Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#20 lore raw

PATCH v5 15/16 ARM: OMAP2+: Remove gpmc-onenand

In reply to Ladislav Michl

As OneNAND driver is now using devicetree, gpmc-onenand and its platform data is unused and can be removed.

---

Changes in v5: None
Changes in v4:
- new patch

Changes in v3: None
Changes in v2: None

 arch/arm/mach-omap2/Makefile                    |   3 -
 arch/arm/mach-omap2/gpmc-onenand.c              | 409 ------------------------
 include/linux/platform_data/mtd-onenand-omap2.h |  34 --
 3 files changed, 446 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/gpmc-onenand.c
 delete mode 100644 include/linux/platform_data/mtd-onenand-omap2.h
arch/arm/mach-omap2/Makefile +0 -3
index 38f1748a4500..e0306d3df41a 100644
@@ -235,6 +235,3 @@ obj-y					+= $(omap-hsmmc-m) $(omap-hsmmc-y)
 obj-y					+= omap_phy_internal.o
 
 obj-$(CONFIG_MACH_OMAP2_TUSB6010)	+= usb-tusb6010.o
-
-onenand-$(CONFIG_MTD_ONENAND_OMAP2)	:= gpmc-onenand.o
-obj-y					+= $(onenand-m) $(onenand-y)
arch/arm/mach-omap2/gpmc-onenand.c deleted +0 -409

409 lines not on this page · raw message

include/linux/platform_data/mtd-onenand-omap2.h deleted +0 -34
deleted file mode 100644
index 56ff0e6f5ad1..000000000000
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2006 Nokia Corporation
- * Author: Juha Yrjola
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef	__MTD_ONENAND_OMAP2_H
-#define	__MTD_ONENAND_OMAP2_H
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/partitions.h>
-
-#define ONENAND_SYNC_READ	(1 << 0)
-#define ONENAND_SYNC_READWRITE	(1 << 1)
-#define	ONENAND_IN_OMAP34XX	(1 << 2)
-
-struct omap_onenand_platform_data {
-	int			cs;
-	int			gpio_irq;
-	struct mtd_partition	*parts;
-	int			nr_parts;
-	int			(*onenand_setup)(void __iomem *, int *freq_ptr);
-	int			dma_channel;
-	u8			flags;
-	u8			regulator_can_sleep;
-	u8			skip_initial_unlocking;
-
-	/* for passing the partitions */
-	struct device_node	*of_node;
-};
-#endif
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#21 lore raw

PATCH v5 16/16 ARM: dts: Nokia: Use OneNAND INT pin

In reply to Ladislav Michl

Enable use of INT pin to wait for command completion. This is just experimental placeholder patch as it lacks pinmux settings.

---

Changes in v5:
- pin name is INT

Changes in v4:
- new patch

Changes in v3: None
Changes in v2: None

 arch/arm/boot/dts/omap2420-n8x0-common.dtsi | 4 +---
 arch/arm/boot/dts/omap3-n900.dts            | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)
arch/arm/boot/dts/omap2420-n8x0-common.dtsi +1 -3
index 843f6a2f5e29..7b1983214417 100644
@@ -42,14 +42,12 @@
 
 &gpmc {
 	ranges = <0 0 0x04000000 0x1000000>;	/* CS0: 16MB for OneNAND */
-
-	/* gpio-irq for dma: 26 */
-
 	onenand@0,0 {
 		#address-cells = <1>;
 		#size-cells = <1>;
 		compatible = "ti,omap2-onenand";
 		reg = <0 0 0x20000>;	/* CS0, offset 0, IO size 128K */
+		int-gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>; /* gpio_26 for INT */
 
 		gpmc,sync-read;
 		gpmc,burst-length = <16>;
arch/arm/boot/dts/omap3-n900.dts +1 -1
index aa5b1a439564..4fff3c466e81 100644
@@ -834,12 +834,12 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&gpmc_pins>;
 
-	/* sys_ndmareq1 could be used by the driver, not as gpio65 though */
 	onenand@0,0 {
 		#address-cells = <1>;
 		#size-cells = <1>;
 		compatible = "ti,omap2-onenand";
 		reg = <0 0 0x20000>;	/* CS0, offset 0, IO size 128K */
+		int-gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>; /* gpio_65 for INT */
 
 		gpmc,sync-read;
 		gpmc,sync-write;
Signature · 6 lines
2.11.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#22 lore raw
In reply to Ladislav Michl

Hello Ladislav,

Quoted 27 lines · On Wed, 15 Nov 2017 17:23:06 +0100 Ladislav Michl <[email protected]> wrote:

this patch serie updates OMAP2+ OneNAND driver to the present times, making it fully DT configurable, using libgpio and dmaengine apis - those are optional, driver will work without them.

Please note that unlike previous driver version, which basically ignored DT specified timings, this one relies on it, so it is important to get it right in your DT (dumping it from previous kernel version).

In case synchronous timings is requested, it is okay to specify timings for the slowest chip ever used for you board as it is evetually optimized after chip probe.

Original driver used DMA only if user specified INT gpio in platform data, now DMA is used unconditionally and PIO mode is used as fallback.

In case anyone wants to give it a try, few DT related changes are needed:
- onenand node needs 'ti,omap2-onenand' compatible (for mailine boards this is done in patch 2)
- to use INT pin, int-gpios needs to be specified (for n900 and n8x0 this is done in patch 16, however patch lacks pinmux configuration.

Most notable changes from v3:
- added dmaengine patches by Peter Ujfalusi
- added dt bindings documentation
- added cleanup patches
- DMA enabled by default

Quoted 7 lines

Most notable changes from v4:
- collected tags
- used INT pin name properly
- hopefully all comments taken into account

Also note that driver will fail probe OneNAND chip after patch 13 and start working again after patch 14.

Well, breaking bisectability is never a good thing, this being said, I won't complain if TI maintainers are okay with that.

Quoted 2 lines

Testing and benchmarking very welcome.

Let me know when you think this series is ready to be merged.

Quoted 3 lines

Depends on "memory: omap-gpmc: Make 'bank-width' property optional"
https://patchwork.kernel.org/patch/10043259/

Hm, I see this patch has been applied to the omap tree, so maybe it's simpler if everything goes through this tree. I don't plan to modify onenand related stuff in this release anyway.

Quoted 21 lines

Ladislav Michl (14):
dt-bindings: mtd: gpmc-onenand: Update properties description
ARM: dts: OMAP2+: Add compatible property to onenand node
ARM: dts: omap3-igep: Update onenand node timings
mtd: onenand: omap2: Remove regulator support
mtd: onenand: omap2: Remove skip initial unlocking support
mtd: onenand: omap2: Remove partitioning support from platform data
mtd: onenand: omap2: Account waiting time as waiting on IO
mtd: onenand: omap2: Unify OMAP2 and OMAP3 DMA implementation
mtd: onenand: omap2: Do not make delay for GPIO OMAP3 specific
mtd: onenand: omap2: Decouple DMA enabling from INT pin availability
memory: omap-gpmc: Refactor OneNAND support
mtd: onenand: omap2: Configure driver from DT
ARM: OMAP2+: Remove gpmc-onenand
ARM: dts: Nokia: Use OneNAND INT pin

Peter Ujfalusi (2):
mtd: onenand: omap2: Simplify the DMA setup for various paths
mtd: onenand: omap2: Convert to use dmaengine for memcpy

Quoted 17 lines
 .../devicetree/bindings/mtd/gpmc-onenand.txt       |   6 +-
 arch/arm/boot/dts/omap2420-n8x0-common.dtsi        |   5 +-
 arch/arm/boot/dts/omap3-igep.dtsi                  |  30 +-
 arch/arm/boot/dts/omap3-n900.dts                   |   3 +-
 arch/arm/boot/dts/omap3-n950-n9.dtsi               |   1 +
 arch/arm/boot/dts/omap3430-sdp.dts                 |   1 +
 arch/arm/mach-omap2/Makefile                       |   3 -
 arch/arm/mach-omap2/gpmc-onenand.c                 | 409 ---------------
 drivers/memory/omap-gpmc.c                         | 158 ++++--
 drivers/mtd/onenand/Kconfig                        |   3 +-
 drivers/mtd/onenand/omap2.c                        | 576 ++++++++-------------
 include/linux/omap-gpmc.h                          |  28 +
 include/linux/platform_data/mtd-onenand-omap2.h    |  34 --
 13 files changed, 387 insertions(+), 870 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/gpmc-onenand.c
 delete mode 100644 include/linux/platform_data/mtd-onenand-omap2.h

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#23 lore raw

Hi Boris,

Quoted 37 lines · Boris Brezillon

Hello Ladislav,

Quoted 32 lines · On Wed, 15 Nov 2017 17:23:06 +0100 Ladislav Michl <[email protected]> wrote:

this patch serie updates OMAP2+ OneNAND driver to the present times, making it fully DT configurable, using libgpio and dmaengine apis - those are optional, driver will work without them.

Please note that unlike previous driver version, which basically ignored DT specified timings, this one relies on it, so it is important to get it right in your DT (dumping it from previous kernel version).

In case synchronous timings is requested, it is okay to specify timings for the slowest chip ever used for you board as it is evetually optimized after chip probe.

Original driver used DMA only if user specified INT gpio in platform data, now DMA is used unconditionally and PIO mode is used as fallback.

In case anyone wants to give it a try, few DT related changes are needed:
- onenand node needs 'ti,omap2-onenand' compatible (for mailine boards this is done in patch 2)
- to use INT pin, int-gpios needs to be specified (for n900 and n8x0 this is done in patch 16, however patch lacks pinmux configuration.

Most notable changes from v3:
- added dmaengine patches by Peter Ujfalusi
- added dt bindings documentation
- added cleanup patches
- DMA enabled by default

Most notable changes from v4:
- collected tags
- used INT pin name properly
- hopefully all comments taken into account

Quoted 5 lines
Quoted 2 lines

Also note that driver will fail probe OneNAND chip after patch 13 and start working again after patch 14.

Well, breaking bisectability is never a good thing, this being said, I won't complain if TI maintainers are okay with that.

I agree.

Quoted 3 lines
Quoted 1 line

Testing and benchmarking very welcome.

Let me know when you think this series is ready to be merged.

I'm still waiting for some OMAP2 users to show up. So far it is tested on OMAP3 only (And I'm using this patchset in production).

Quoted 6 lines
Quoted 2 lines

Depends on "memory: omap-gpmc: Make 'bank-width' property optional"
https://patchwork.kernel.org/patch/10043259/

Hm, I see this patch has been applied to the omap tree, so maybe it's simpler if everything goes through this tree. I don't plan to modify onenand related stuff in this release anyway.

It is intended for 4.16, so if Tony is fine with your proposal, I can modify patches not to break bisecting...

Quoted 29 lines
Quoted 29 lines

Ladislav Michl (14):
dt-bindings: mtd: gpmc-onenand: Update properties description
ARM: dts: OMAP2+: Add compatible property to onenand node
ARM: dts: omap3-igep: Update onenand node timings
mtd: onenand: omap2: Remove regulator support
mtd: onenand: omap2: Remove skip initial unlocking support
mtd: onenand: omap2: Remove partitioning support from platform data
mtd: onenand: omap2: Account waiting time as waiting on IO
mtd: onenand: omap2: Unify OMAP2 and OMAP3 DMA implementation
mtd: onenand: omap2: Do not make delay for GPIO OMAP3 specific
mtd: onenand: omap2: Decouple DMA enabling from INT pin availability
memory: omap-gpmc: Refactor OneNAND support
mtd: onenand: omap2: Configure driver from DT
ARM: OMAP2+: Remove gpmc-onenand
ARM: dts: Nokia: Use OneNAND INT pin

Peter Ujfalusi (2):
mtd: onenand: omap2: Simplify the DMA setup for various paths
mtd: onenand: omap2: Convert to use dmaengine for memcpy

 .../devicetree/bindings/mtd/gpmc-onenand.txt       |   6 +-
 arch/arm/boot/dts/omap2420-n8x0-common.dtsi        |   5 +-
 arch/arm/boot/dts/omap3-igep.dtsi                  |  30 +-
 arch/arm/boot/dts/omap3-n900.dts                   |   3 +-
 arch/arm/boot/dts/omap3-n950-n9.dtsi               |   1 +
 arch/arm/boot/dts/omap3430-sdp.dts                 |   1 +
 arch/arm/mach-omap2/Makefile                       |   3 -
 arch/arm/mach-omap2/gpmc-onenand.c                 | 409 ---------------
 drivers/memory/omap-gpmc.c                         | 158 ++++--
Quoted 8 lines
Quoted 8 lines
 drivers/mtd/onenand/Kconfig                        |   3 +-
 drivers/mtd/onenand/omap2.c                        | 576 ++++++++-------------
 include/linux/omap-gpmc.h                          |  28 +
 include/linux/platform_data/mtd-onenand-omap2.h    |  34 --
 13 files changed, 387 insertions(+), 870 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/gpmc-onenand.c
 delete mode 100644 include/linux/platform_data/mtd-onenand-omap2.h

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

maintainer
#24 lore raw
In reply to Boris Brezillon
Quoted 35 lines · Boris Brezillon
Quoted 32 lines · On Wed, 15 Nov 2017 17:23:06 +0100 Ladislav Michl <[email protected]> wrote:

this patch serie updates OMAP2+ OneNAND driver to the present times, making it fully DT configurable, using libgpio and dmaengine apis - those are optional, driver will work without them.

Please note that unlike previous driver version, which basically ignored DT specified timings, this one relies on it, so it is important to get it right in your DT (dumping it from previous kernel version).

In case synchronous timings is requested, it is okay to specify timings for the slowest chip ever used for you board as it is evetually optimized after chip probe.

Original driver used DMA only if user specified INT gpio in platform data, now DMA is used unconditionally and PIO mode is used as fallback.

In case anyone wants to give it a try, few DT related changes are needed:
- onenand node needs 'ti,omap2-onenand' compatible (for mailine boards this is done in patch 2)
- to use INT pin, int-gpios needs to be specified (for n900 and n8x0 this is done in patch 16, however patch lacks pinmux configuration.

Most notable changes from v3:
- added dmaengine patches by Peter Ujfalusi
- added dt bindings documentation
- added cleanup patches
- DMA enabled by default

Most notable changes from v4:
- collected tags
- used INT pin name properly
- hopefully all comments taken into account

Quoted 5 lines
Quoted 2 lines

Also note that driver will fail probe OneNAND chip after patch 13 and start working again after patch 14.

Well, breaking bisectability is never a good thing, this being said, I won't complain if TI maintainers are okay with that.

There should not be any reason to break git bisect for booting at all, what exactly is the issue here?

Quoted 3 lines
Quoted 1 line

Testing and benchmarking very welcome.

Let me know when you think this series is ready to be merged.

Well we need Aaro to test this on n8x0 as my n800 is currently not booting at all.

Quoted 6 lines
Quoted 2 lines

Depends on "memory: omap-gpmc: Make 'bank-width' property optional"
https://patchwork.kernel.org/patch/10043259/

Hm, I see this patch has been applied to the omap tree, so maybe it's simpler if everything goes through this tree. I don't plan to modify onenand related stuff in this release anyway.

Maybe Roger can provide you with an immutable commit with just that patch?

Regards,

Tony

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#25 lore raw
Quoted 55 lines · Tony Lindgren
Quoted 35 lines · Boris Brezillon
Quoted 32 lines · On Wed, 15 Nov 2017 17:23:06 +0100 Ladislav Michl <[email protected]> wrote:

this patch serie updates OMAP2+ OneNAND driver to the present times, making it fully DT configurable, using libgpio and dmaengine apis - those are optional, driver will work without them.

Please note that unlike previous driver version, which basically ignored DT specified timings, this one relies on it, so it is important to get it right in your DT (dumping it from previous kernel version).

In case synchronous timings is requested, it is okay to specify timings for the slowest chip ever used for you board as it is evetually optimized after chip probe.

Original driver used DMA only if user specified INT gpio in platform data, now DMA is used unconditionally and PIO mode is used as fallback.

In case anyone wants to give it a try, few DT related changes are needed:
- onenand node needs 'ti,omap2-onenand' compatible (for mailine boards this is done in patch 2)
- to use INT pin, int-gpios needs to be specified (for n900 and n8x0 this is done in patch 16, however patch lacks pinmux configuration.

Most notable changes from v3:
- added dmaengine patches by Peter Ujfalusi
- added dt bindings documentation
- added cleanup patches
- DMA enabled by default

Most notable changes from v4:
- collected tags
- used INT pin name properly
- hopefully all comments taken into account

Quoted 5 lines
Quoted 2 lines

Also note that driver will fail probe OneNAND chip after patch 13 and start working again after patch 14.

Well, breaking bisectability is never a good thing, this being said, I won't complain if TI maintainers are okay with that.

There should not be any reason to break git bisect for booting at all, what exactly is the issue here?

Quoted 3 lines
Quoted 1 line

Testing and benchmarking very welcome.

Let me know when you think this series is ready to be merged.

Well we need Aaro to test this on n8x0 as my n800 is currently not booting at all.

Quoted 3 lines
Quoted 2 lines

Depends on "memory: omap-gpmc: Make 'bank-width' property optional"
https://patchwork.kernel.org/patch/10043259/

Quoted 6 lines
Quoted 3 lines

Hm, I see this patch has been applied to the omap tree, so maybe it's simpler if everything goes through this tree. I don't plan to modify onenand related stuff in this release anyway.

Maybe Roger can provide you with an immutable commit with just that patch?

Here you go

The following changes since commit 4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323:

Linux 4.15-rc1 (2017-11-26 16:01:47 -0800)

are available in the git repository at:

https://github.com/rogerq/linux.git for-v4.16/gpmc-omap-immutable

for you to fetch changes up to c18a7ac3398d0cef29749f9568666db8321aa4c9:

memory: omap-gpmc: Make 'bank-width' property optional (2017-12-01 15:37:49 +0200)

----------------------------------------------------------------
Ladislav Michl (1):
memory: omap-gpmc: Make 'bank-width' property optional

 drivers/memory/omap-gpmc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 8 lines
cheers,
-roger

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#26 lore raw

Just a very gentle ping, more bellow...

Quoted 56 lines · Roger Quadros
Quoted 55 lines · Tony Lindgren
Quoted 35 lines · Boris Brezillon
Quoted 32 lines · On Wed, 15 Nov 2017 17:23:06 +0100 Ladislav Michl <[email protected]> wrote:

this patch serie updates OMAP2+ OneNAND driver to the present times, making it fully DT configurable, using libgpio and dmaengine apis - those are optional, driver will work without them.

Please note that unlike previous driver version, which basically ignored DT specified timings, this one relies on it, so it is important to get it right in your DT (dumping it from previous kernel version).

In case synchronous timings is requested, it is okay to specify timings for the slowest chip ever used for you board as it is evetually optimized after chip probe.

Original driver used DMA only if user specified INT gpio in platform data, now DMA is used unconditionally and PIO mode is used as fallback.

In case anyone wants to give it a try, few DT related changes are needed:
- onenand node needs 'ti,omap2-onenand' compatible (for mailine boards this is done in patch 2)
- to use INT pin, int-gpios needs to be specified (for n900 and n8x0 this is done in patch 16, however patch lacks pinmux configuration.

Most notable changes from v3:
- added dmaengine patches by Peter Ujfalusi
- added dt bindings documentation
- added cleanup patches
- DMA enabled by default

Most notable changes from v4:
- collected tags
- used INT pin name properly
- hopefully all comments taken into account

Quoted 5 lines
Quoted 2 lines

Also note that driver will fail probe OneNAND chip after patch 13 and start working again after patch 14.

Well, breaking bisectability is never a good thing, this being said, I won't complain if TI maintainers are okay with that.

There should not be any reason to break git bisect for booting at all, what exactly is the issue here?

Quoted 3 lines
Quoted 1 line

Testing and benchmarking very welcome.

Let me know when you think this series is ready to be merged.

Well we need Aaro to test this on n8x0 as my n800 is currently not booting at all.

Quoted 3 lines
Quoted 2 lines

Depends on "memory: omap-gpmc: Make 'bank-width' property optional"
https://patchwork.kernel.org/patch/10043259/

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Hm, I see this patch has been applied to the omap tree, so maybe it's simpler if everything goes through this tree. I don't plan to modify onenand related stuff in this release anyway.

Maybe Roger can provide you with an immutable commit with just that patch?

Here you go

Thank you :)

Merge window is really close now and patches seems still to be untested on n8x0. So unless someone is going to test it soon, I'll pick used N800 on ebay :-/

I would also appreciate final statement which tree will used to merge this patchset. So far everyone seems to agree this patchset will enter via single tree, right? If that is the case I'm proposing to squash patches 13 and 14 into single patch, so we do not break bisecting.

Quoted 10 lines

The following changes since commit 4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323:

Linux 4.15-rc1 (2017-11-26 16:01:47 -0800)

are available in the git repository at:

https://github.com/rogerq/linux.git for-v4.16/gpmc-omap-immutable

for you to fetch changes up to c18a7ac3398d0cef29749f9568666db8321aa4c9:

Quoted 18 lines

memory: omap-gpmc: Make 'bank-width' property optional (2017-12-01 15:37:49 +0200)

----------------------------------------------------------------
Ladislav Michl (1):
memory: omap-gpmc: Make 'bank-width' property optional

 drivers/memory/omap-gpmc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 8 lines
cheers,
-roger

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

maintainer
#27 lore raw

Hi,

Quoted 3 lines · Ladislav Michl

Merge window is really close now and patches seems still to be untested on n8x0. So unless someone is going to test it soon, I'll pick used N800 on ebay :-/

Today I tried to test them on Nokia N810, and I get:

[    0.174804] omap-gpmc 6800a000.gpmc: GPMC revision 2.0
[    0.174865] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.177459] omap-gpmc 6800a000.gpmc: /ocp/gpmc@6800a000/onenand@0,0 has no 'bank-width' property
[    0.177612] omap-gpmc 6800a000.gpmc: failed to probe DT child 'onenand': -22

With plain v4.15-rc7+ it probes fine.

A.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#28 lore raw

Aaro,

Quoted 7 lines · Aaro Koskinen

Hi,

Quoted 3 lines · Ladislav Michl

Merge window is really close now and patches seems still to be untested on n8x0. So unless someone is going to test it soon, I'll pick used N800 on ebay :-/

Quoted 8 lines

Today I tried to test them on Nokia N810, and I get:

[    0.174804] omap-gpmc 6800a000.gpmc: GPMC revision 2.0
[    0.174865] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.177459] omap-gpmc 6800a000.gpmc: /ocp/gpmc@6800a000/onenand@0,0 has no 'bank-width' property
[    0.177612] omap-gpmc 6800a000.gpmc: failed to probe DT child 'onenand': -22

With plain v4.15-rc7+ it probes fine.

Thank you for testing. As stated in cover letter, you need also
https://patchwork.kernel.org/patch/10043259/
which can be also found in Roger's branch
https://github.com/rogerq/linux/commits/for-v4.16/gpmc-omap-immutable
(see previous replies in this thread and also discussion about OneNAND DT node)

Thank you,
ladis

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

maintainer
#29 lore raw

Hi,

Quoted 13 lines · Ladislav Michl
Quoted 12 lines · Aaro Koskinen
Quoted 3 lines · Ladislav Michl

Merge window is really close now and patches seems still to be untested on n8x0. So unless someone is going to test it soon, I'll pick used N800 on ebay :-/

Today I tried to test them on Nokia N810, and I get:

[    0.174804] omap-gpmc 6800a000.gpmc: GPMC revision 2.0
[    0.174865] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.177459] omap-gpmc 6800a000.gpmc: /ocp/gpmc@6800a000/onenand@0,0 has no 'bank-width' property
[    0.177612] omap-gpmc 6800a000.gpmc: failed to probe DT child 'onenand': -22
Quoted 8 lines
Quoted 1 line

With plain v4.15-rc7+ it probes fine.

Thank you for testing. As stated in cover letter, you need also
https://patchwork.kernel.org/patch/10043259/
which can be also found in Roger's branch
https://github.com/rogerq/linux/commits/for-v4.16/gpmc-omap-immutable
(see previous replies in this thread and also discussion about OneNAND DT node)

I applied it, and now get:

[    0.174987] omap-gpmc 6800a000.gpmc: GPMC revision 2.0
[    0.175048] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.177703] omap-gpmc 6800a000.gpmc: Incompatible OneNAND node: missing compatible
[    0.177764] omap-gpmc 6800a000.gpmc: failed to probe DT child 'onenand': -22

A.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

A message that is not in the archive (sent off-list or not yet received): 20180110173519.xyug4egltni4f3qi-4/[email protected]

#31 lore raw

+Rob and the DT ML

Quoted 25 lines · Aaro Koskinen

Hi,

Quoted 13 lines · Ladislav Michl
Quoted 12 lines · Aaro Koskinen
Quoted 3 lines · Ladislav Michl

Merge window is really close now and patches seems still to be untested on n8x0. So unless someone is going to test it soon, I'll pick used N800 on ebay :-/

Today I tried to test them on Nokia N810, and I get:

[    0.174804] omap-gpmc 6800a000.gpmc: GPMC revision 2.0
[    0.174865] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.177459] omap-gpmc 6800a000.gpmc: /ocp/gpmc@6800a000/onenand@0,0 has no 'bank-width' property
[    0.177612] omap-gpmc 6800a000.gpmc: failed to probe DT child 'onenand': -22
Quoted 8 lines
Quoted 1 line

With plain v4.15-rc7+ it probes fine.

Thank you for testing. As stated in cover letter, you need also
https://patchwork.kernel.org/patch/10043259/
which can be also found in Roger's branch
https://github.com/rogerq/linux/commits/for-v4.16/gpmc-omap-immutable
(see previous replies in this thread and also discussion about OneNAND DT node)

Quoted 6 lines

I applied it, and now get:

[    0.174987] omap-gpmc 6800a000.gpmc: GPMC revision 2.0
[    0.175048] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.177703] omap-gpmc 6800a000.gpmc: Incompatible OneNAND node: missing compatible
[    0.177764] omap-gpmc 6800a000.gpmc: failed to probe DT child 'onenand': -22

As expected without reading discussion about OneNAND DT node :)

In short, this version expects "ti,omap2-onenand" compatible.

In earlier version of this patchset there was fixup present, so driver worked even without compatible. Later on (17 Oct 2017 11:46:51 +0300) Roger objected (https://www.spinics.net/lists/linux-omap/msg139576.html):
"I don't want to fixup broken DTs like this as they will go silently without being fixed. Let's instead just error out after the dev_warn(). This will force us to fix all DT nodes."
So fixup was removed. I know N900 support is under heavy development in mainline, but if n8x0 is considered finished and stable, we should reintroduce fixup. Thoughts?

Thank you for your patience,
ladis
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Tested-by
#32 lore raw

Hi,

Quoted 26 lines · Ladislav Michl
Quoted 25 lines · Aaro Koskinen
Quoted 13 lines · Ladislav Michl
Quoted 12 lines · Aaro Koskinen
Quoted 3 lines · Ladislav Michl

Merge window is really close now and patches seems still to be untested on n8x0. So unless someone is going to test it soon, I'll pick used N800 on ebay :-/

Today I tried to test them on Nokia N810, and I get:

[    0.174804] omap-gpmc 6800a000.gpmc: GPMC revision 2.0
[    0.174865] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.177459] omap-gpmc 6800a000.gpmc: /ocp/gpmc@6800a000/onenand@0,0 has no 'bank-width' property
[    0.177612] omap-gpmc 6800a000.gpmc: failed to probe DT child 'onenand': -22
Quoted 8 lines
Quoted 1 line

With plain v4.15-rc7+ it probes fine.

Thank you for testing. As stated in cover letter, you need also
https://patchwork.kernel.org/patch/10043259/
which can be also found in Roger's branch
https://github.com/rogerq/linux/commits/for-v4.16/gpmc-omap-immutable
(see previous replies in this thread and also discussion about OneNAND DT node)

I applied it, and now get:

Quoted 8 lines
Quoted 4 lines
[    0.174987] omap-gpmc 6800a000.gpmc: GPMC revision 2.0
[    0.175048] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.177703] omap-gpmc 6800a000.gpmc: Incompatible OneNAND node: missing compatible
[    0.177764] omap-gpmc 6800a000.gpmc: failed to probe DT child 'onenand': -22

As expected without reading discussion about OneNAND DT node :)

In short, this version expects "ti,omap2-onenand" compatible.

Right. I didn't realize by bootloader was passing the DTB from an old kernel.

So after fixing my boot I got the patches working N800 and N810: I was able to read and write on old JFFS2 file systems without any issues. So you can add for the series:

Quoted 9 lines

In earlier version of this patchset there was fixup present, so driver worked even without compatible. Later on (17 Oct 2017 11:46:51 +0300) Roger objected (https://www.spinics.net/lists/linux-omap/msg139576.html):
"I don't want to fixup broken DTs like this as they will go silently without being fixed. Let's instead just error out after the dev_warn(). This will force us to fix all DT nodes."
So fixup was removed. I know N900 support is under heavy development in mainline, but if n8x0 is considered finished and stable, we should reintroduce fixup. Thoughts?

N8x0 support is also "under development", and we are fine with updating and always using latest in-tree DTs.

A.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

A message that is not in the archive (sent off-list or not yet received): 20180111192931.vwnpvj2wtgrvkhbe-4/[email protected]

#34 lore raw
Quoted 38 lines · Aaro Koskinen

Hi,

Quoted 26 lines · Ladislav Michl
Quoted 25 lines · Aaro Koskinen
Quoted 13 lines · Ladislav Michl
Quoted 12 lines · Aaro Koskinen
Quoted 3 lines · Ladislav Michl

Merge window is really close now and patches seems still to be untested on n8x0. So unless someone is going to test it soon, I'll pick used N800 on ebay :-/

Today I tried to test them on Nokia N810, and I get:

[    0.174804] omap-gpmc 6800a000.gpmc: GPMC revision 2.0
[    0.174865] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.177459] omap-gpmc 6800a000.gpmc: /ocp/gpmc@6800a000/onenand@0,0 has no 'bank-width' property
[    0.177612] omap-gpmc 6800a000.gpmc: failed to probe DT child 'onenand': -22
Quoted 8 lines
Quoted 1 line

With plain v4.15-rc7+ it probes fine.

Thank you for testing. As stated in cover letter, you need also
https://patchwork.kernel.org/patch/10043259/
which can be also found in Roger's branch
https://github.com/rogerq/linux/commits/for-v4.16/gpmc-omap-immutable
(see previous replies in this thread and also discussion about OneNAND DT node)

I applied it, and now get:

Quoted 8 lines
Quoted 4 lines
[    0.174987] omap-gpmc 6800a000.gpmc: GPMC revision 2.0
[    0.175048] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.177703] omap-gpmc 6800a000.gpmc: Incompatible OneNAND node: missing compatible
[    0.177764] omap-gpmc 6800a000.gpmc: failed to probe DT child 'onenand': -22

As expected without reading discussion about OneNAND DT node :)

In short, this version expects "ti,omap2-onenand" compatible.

Quoted 8 lines

Right. I didn't realize by bootloader was passing the DTB from an old kernel.

So after fixing my boot I got the patches working N800 and N810: I was able to read and write on old JFFS2 file systems without any issues. So you can add for the series:

Thank you!

Quoted 10 lines
Quoted 9 lines

In earlier version of this patchset there was fixup present, so driver worked even without compatible. Later on (17 Oct 2017 11:46:51 +0300) Roger objected (https://www.spinics.net/lists/linux-omap/msg139576.html):
"I don't want to fixup broken DTs like this as they will go silently without being fixed. Let's instead just error out after the dev_warn(). This will force us to fix all DT nodes."
So fixup was removed. I know N900 support is under heavy development in mainline, but if n8x0 is considered finished and stable, we should reintroduce fixup. Thoughts?

Quoted 2 lines

N8x0 support is also "under development", and we are fine with updating and always using latest in-tree DTs.

That makes things simpler :) I'll post v6 based on -next with patches 13 and 14 squashed.

Thanks to everyone involved for cooperation,
ladis
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#35 lore raw
In reply to Aaro Koskinen

Hi,

Quoted 23 lines · Aaro Koskinen
Quoted 13 lines · Ladislav Michl
Quoted 12 lines · Aaro Koskinen
Quoted 3 lines · Ladislav Michl

Merge window is really close now and patches seems still to be untested on n8x0. So unless someone is going to test it soon, I'll pick used N800 on ebay :-/

Today I tried to test them on Nokia N810, and I get:

[    0.174804] omap-gpmc 6800a000.gpmc: GPMC revision 2.0
[    0.174865] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.177459] omap-gpmc 6800a000.gpmc: /ocp/gpmc@6800a000/onenand@0,0 has no 'bank-width' property
[    0.177612] omap-gpmc 6800a000.gpmc: failed to probe DT child 'onenand': -22
Quoted 8 lines
Quoted 1 line

With plain v4.15-rc7+ it probes fine.

Thank you for testing. As stated in cover letter, you need also
https://patchwork.kernel.org/patch/10043259/
which can be also found in Roger's branch
https://github.com/rogerq/linux/commits/for-v4.16/gpmc-omap-immutable
(see previous replies in this thread and also discussion about OneNAND DT node)

Quoted 6 lines

I applied it, and now get:

[    0.174987] omap-gpmc 6800a000.gpmc: GPMC revision 2.0
[    0.175048] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.177703] omap-gpmc 6800a000.gpmc: Incompatible OneNAND node: missing compatible
[    0.177764] omap-gpmc 6800a000.gpmc: failed to probe DT child 'onenand': -22

Crap, I think something is wrong in my kexec. It seems to pass the DTB from an old kernel, although the new kernel has a new appended DTB... Need to investigate, sorry for noise.

A.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#36 lore raw
Quoted 33 lines · Aaro Koskinen

Hi,

Quoted 23 lines · Aaro Koskinen
Quoted 13 lines · Ladislav Michl
Quoted 12 lines · Aaro Koskinen
Quoted 3 lines · Ladislav Michl

Merge window is really close now and patches seems still to be untested on n8x0. So unless someone is going to test it soon, I'll pick used N800 on ebay :-/

Today I tried to test them on Nokia N810, and I get:

[    0.174804] omap-gpmc 6800a000.gpmc: GPMC revision 2.0
[    0.174865] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.177459] omap-gpmc 6800a000.gpmc: /ocp/gpmc@6800a000/onenand@0,0 has no 'bank-width' property
[    0.177612] omap-gpmc 6800a000.gpmc: failed to probe DT child 'onenand': -22
Quoted 8 lines
Quoted 1 line

With plain v4.15-rc7+ it probes fine.

Thank you for testing. As stated in cover letter, you need also
https://patchwork.kernel.org/patch/10043259/
which can be also found in Roger's branch
https://github.com/rogerq/linux/commits/for-v4.16/gpmc-omap-immutable
(see previous replies in this thread and also discussion about OneNAND DT node)

Quoted 6 lines

I applied it, and now get:

[    0.174987] omap-gpmc 6800a000.gpmc: GPMC revision 2.0
[    0.175048] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.177703] omap-gpmc 6800a000.gpmc: Incompatible OneNAND node: missing compatible
[    0.177764] omap-gpmc 6800a000.gpmc: failed to probe DT child 'onenand': -22
Quoted 6 lines

Crap, I think something is wrong in my kexec. It seems to pass the DTB from an old kernel, although the new kernel has a new appended DTB... Need to investigate, sorry for noise.

A.

Aaro,

You will still need to add "ti,omap2-onenand" compatible property to the n800/810 onenand node for it to work.

Signature · 8 lines
cheers,
-roger

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/