All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek
@ 2013-01-23 12:47 ` Josh Wu
  0 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-01-23 12:47 UTC (permalink / raw)
  To: linux-mtd, linux-arm-kernel, dedekind1; +Cc: nicolas.ferre, plagnioj, Josh Wu

Those patches will enable PMECC in dt parameters for at91sam9x5ek and 
at91sam9n12ek.

The PMECC driver will check minimum required ecc on ONFI parameter from NAND 
flash.

If pmecc-cap, pmecc-sector-size in dts file is specified, use those two.
otherwise, set those according to NAND flash ONFI parameters.

If the pmecc-cap, pmecc-sector-size in dts are different with ecc requirement
in ONFI, print out a warning.


For the following compile error:
  ERROR (phandle_references): Reference to non-existent node or label "pinctrl_ssc0_tx"

  ERROR: Input tree has errors, aborting (use -f to force output)
  make[2]: *** [arch/arm/boot/dts/at91sam9g20ek.dtb] Error 2

the fixes are already merged in Linux mainline in v3.8-rc4.
you can find in: 
 544ae6b2e676c3c37fb8c93ef9327932fc2e5bc2 (ARM: at91/dts: add pinctrl support for SSC peripheral)
 ea03c81521bde526570e1dec96eaa21fe5ac84a2 (ASoC: atmel-ssc: add pinctrl selection to driver) 


Change logs:
v2: rebase to v3.8-rc3. And wrapped the commit message.

v3: big chages:
  1. reduce the PMECC lookup table mapping. Just the lookup table not whole
     ROM code according to J.C's suggestion.
  2. use simpler strategy to handle pmecc-cap, pmecc-sector-size:
     * make pmecc-cap, pmecc-sector-size optional.
     * If pmecc-cap, pmecc-sector-size are not set, use ONFI ecc parameters.
       otherwise, use those in DTS file.
     * print out a warning if PMECC use different ecc bits or sector size 
       from ONFI ecc parameters.

Josh Wu (5):
  MTD: atmel_nand: avoid to report an error when lookup table offset is
    0.
  ARM: at91: at91sam9x5: add DT parameters to enable PMECC
  ARM: at91: at91sam9n12: add DT parameters to enable PMECC
  MTD: atmel_nand: make pmecc-cap, pmecc-sector-size in dts is
    optional.
  MTD: at91: atmel_nand: for PMECC, add code to check the ONFI
    parameter ECC requirement.

 arch/arm/boot/dts/at91sam9n12.dtsi  |    3 +-
 arch/arm/boot/dts/at91sam9n12ek.dts |    5 +-
 arch/arm/boot/dts/at91sam9x5.dtsi   |    4 +
 arch/arm/boot/dts/at91sam9x5cm.dtsi |    5 +-
 drivers/mtd/nand/atmel_nand.c       |  141 +++++++++++++++++++++++++++++------
 5 files changed, 131 insertions(+), 27 deletions(-)

-- 
1.7.9.5

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

* [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek
@ 2013-01-23 12:47 ` Josh Wu
  0 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-01-23 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

Those patches will enable PMECC in dt parameters for at91sam9x5ek and 
at91sam9n12ek.

The PMECC driver will check minimum required ecc on ONFI parameter from NAND 
flash.

If pmecc-cap, pmecc-sector-size in dts file is specified, use those two.
otherwise, set those according to NAND flash ONFI parameters.

If the pmecc-cap, pmecc-sector-size in dts are different with ecc requirement
in ONFI, print out a warning.


For the following compile error:
  ERROR (phandle_references): Reference to non-existent node or label "pinctrl_ssc0_tx"

  ERROR: Input tree has errors, aborting (use -f to force output)
  make[2]: *** [arch/arm/boot/dts/at91sam9g20ek.dtb] Error 2

the fixes are already merged in Linux mainline in v3.8-rc4.
you can find in: 
 544ae6b2e676c3c37fb8c93ef9327932fc2e5bc2 (ARM: at91/dts: add pinctrl support for SSC peripheral)
 ea03c81521bde526570e1dec96eaa21fe5ac84a2 (ASoC: atmel-ssc: add pinctrl selection to driver) 


Change logs:
v2: rebase to v3.8-rc3. And wrapped the commit message.

v3: big chages:
  1. reduce the PMECC lookup table mapping. Just the lookup table not whole
     ROM code according to J.C's suggestion.
  2. use simpler strategy to handle pmecc-cap, pmecc-sector-size:
     * make pmecc-cap, pmecc-sector-size optional.
     * If pmecc-cap, pmecc-sector-size are not set, use ONFI ecc parameters.
       otherwise, use those in DTS file.
     * print out a warning if PMECC use different ecc bits or sector size 
       from ONFI ecc parameters.

Josh Wu (5):
  MTD: atmel_nand: avoid to report an error when lookup table offset is
    0.
  ARM: at91: at91sam9x5: add DT parameters to enable PMECC
  ARM: at91: at91sam9n12: add DT parameters to enable PMECC
  MTD: atmel_nand: make pmecc-cap, pmecc-sector-size in dts is
    optional.
  MTD: at91: atmel_nand: for PMECC, add code to check the ONFI
    parameter ECC requirement.

 arch/arm/boot/dts/at91sam9n12.dtsi  |    3 +-
 arch/arm/boot/dts/at91sam9n12ek.dts |    5 +-
 arch/arm/boot/dts/at91sam9x5.dtsi   |    4 +
 arch/arm/boot/dts/at91sam9x5cm.dtsi |    5 +-
 drivers/mtd/nand/atmel_nand.c       |  141 +++++++++++++++++++++++++++++------
 5 files changed, 131 insertions(+), 27 deletions(-)

-- 
1.7.9.5

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

* [PATCH 1/5] MTD: atmel_nand: avoid to report an error when lookup table offset is 0.
  2013-01-23 12:47 ` Josh Wu
@ 2013-01-23 12:47   ` Josh Wu
  -1 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-01-23 12:47 UTC (permalink / raw)
  To: linux-mtd, linux-arm-kernel, dedekind1; +Cc: nicolas.ferre, plagnioj, Josh Wu

Before this patch, we assume the whole ROM code are mapping to memory. So
it is wrong if the lookup table offset is 0.

After this patch, we can map only the lookup table of ROM code to memory
intead of the whole ROM code (about 1M). In this case, one lookup table
offset can be 0.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
 drivers/mtd/nand/atmel_nand.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index c516a94..1d989db 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -1215,7 +1215,7 @@ static void atmel_nand_hwctl(struct mtd_info *mtd, int mode)
 static int atmel_of_init_port(struct atmel_nand_host *host,
 			      struct device_node *np)
 {
-	u32 val, table_offset;
+	u32 val;
 	u32 offset[2];
 	int ecc_mode;
 	struct atmel_nand_data *board = &host->board;
@@ -1288,13 +1288,12 @@ static int atmel_of_init_port(struct atmel_nand_host *host,
 		dev_err(host->dev, "Cannot get PMECC lookup table offset\n");
 		return -EINVAL;
 	}
-	table_offset = host->pmecc_sector_size == 512 ? offset[0] : offset[1];
-
-	if (!table_offset) {
+	if (!offset[0] && !offset[1]) {
 		dev_err(host->dev, "Invalid PMECC lookup table offset\n");
 		return -EINVAL;
 	}
-	host->pmecc_lookup_table_offset = table_offset;
+	host->pmecc_lookup_table_offset =
+		(host->pmecc_sector_size == 512) ? offset[0] : offset[1];
 
 	return 0;
 }
-- 
1.7.9.5

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

* [PATCH 1/5] MTD: atmel_nand: avoid to report an error when lookup table offset is 0.
@ 2013-01-23 12:47   ` Josh Wu
  0 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-01-23 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

Before this patch, we assume the whole ROM code are mapping to memory. So
it is wrong if the lookup table offset is 0.

After this patch, we can map only the lookup table of ROM code to memory
intead of the whole ROM code (about 1M). In this case, one lookup table
offset can be 0.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
 drivers/mtd/nand/atmel_nand.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index c516a94..1d989db 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -1215,7 +1215,7 @@ static void atmel_nand_hwctl(struct mtd_info *mtd, int mode)
 static int atmel_of_init_port(struct atmel_nand_host *host,
 			      struct device_node *np)
 {
-	u32 val, table_offset;
+	u32 val;
 	u32 offset[2];
 	int ecc_mode;
 	struct atmel_nand_data *board = &host->board;
@@ -1288,13 +1288,12 @@ static int atmel_of_init_port(struct atmel_nand_host *host,
 		dev_err(host->dev, "Cannot get PMECC lookup table offset\n");
 		return -EINVAL;
 	}
-	table_offset = host->pmecc_sector_size == 512 ? offset[0] : offset[1];
-
-	if (!table_offset) {
+	if (!offset[0] && !offset[1]) {
 		dev_err(host->dev, "Invalid PMECC lookup table offset\n");
 		return -EINVAL;
 	}
-	host->pmecc_lookup_table_offset = table_offset;
+	host->pmecc_lookup_table_offset =
+		(host->pmecc_sector_size == 512) ? offset[0] : offset[1];
 
 	return 0;
 }
-- 
1.7.9.5

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

* [PATCH 2/5] ARM: at91: at91sam9x5: add DT parameters to enable PMECC
  2013-01-23 12:47 ` Josh Wu
@ 2013-01-23 12:47   ` Josh Wu
  -1 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-01-23 12:47 UTC (permalink / raw)
  To: linux-mtd, linux-arm-kernel, dedekind1; +Cc: nicolas.ferre, plagnioj, Josh Wu

Default ecc correctable setting is 2bits in 512 bytes.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
 arch/arm/boot/dts/at91sam9x5.dtsi   |    4 ++++
 arch/arm/boot/dts/at91sam9x5cm.dtsi |    5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index 3a47cf9..ecfafcf 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -498,7 +498,11 @@
 			#address-cells = <1>;
 			#size-cells = <1>;
 			reg = <0x40000000 0x10000000
+			       0xffffe000 0x600		/* PMECC Registers */
+			       0xffffe600 0x200		/* PMECC Error Location Registers */
+			       0x00108000 0x18000	/* PMECC looup table in ROM code  */
 			      >;
+			atmel,pmecc-lookup-table-offset = <0x0 0x8000>;
 			atmel,nand-addr-offset = <21>;
 			atmel,nand-cmd-offset = <22>;
 			pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/at91sam9x5cm.dtsi b/arch/arm/boot/dts/at91sam9x5cm.dtsi
index 31e7be2..4027ac7 100644
--- a/arch/arm/boot/dts/at91sam9x5cm.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5cm.dtsi
@@ -26,7 +26,10 @@
 	ahb {
 		nand0: nand@40000000 {
 			nand-bus-width = <8>;
-			nand-ecc-mode = "soft";
+			nand-ecc-mode = "hw";
+			atmel,has-pmecc;	/* Enable PMECC */
+			atmel,pmecc-cap = <2>;
+			atmel,pmecc-sector-size = <512>;
 			nand-on-flash-bbt;
 			status = "okay";
 
-- 
1.7.9.5

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

* [PATCH 2/5] ARM: at91: at91sam9x5: add DT parameters to enable PMECC
@ 2013-01-23 12:47   ` Josh Wu
  0 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-01-23 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

Default ecc correctable setting is 2bits in 512 bytes.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
 arch/arm/boot/dts/at91sam9x5.dtsi   |    4 ++++
 arch/arm/boot/dts/at91sam9x5cm.dtsi |    5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index 3a47cf9..ecfafcf 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -498,7 +498,11 @@
 			#address-cells = <1>;
 			#size-cells = <1>;
 			reg = <0x40000000 0x10000000
+			       0xffffe000 0x600		/* PMECC Registers */
+			       0xffffe600 0x200		/* PMECC Error Location Registers */
+			       0x00108000 0x18000	/* PMECC looup table in ROM code  */
 			      >;
+			atmel,pmecc-lookup-table-offset = <0x0 0x8000>;
 			atmel,nand-addr-offset = <21>;
 			atmel,nand-cmd-offset = <22>;
 			pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/at91sam9x5cm.dtsi b/arch/arm/boot/dts/at91sam9x5cm.dtsi
index 31e7be2..4027ac7 100644
--- a/arch/arm/boot/dts/at91sam9x5cm.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5cm.dtsi
@@ -26,7 +26,10 @@
 	ahb {
 		nand0: nand at 40000000 {
 			nand-bus-width = <8>;
-			nand-ecc-mode = "soft";
+			nand-ecc-mode = "hw";
+			atmel,has-pmecc;	/* Enable PMECC */
+			atmel,pmecc-cap = <2>;
+			atmel,pmecc-sector-size = <512>;
 			nand-on-flash-bbt;
 			status = "okay";
 
-- 
1.7.9.5

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

* [PATCH 3/5] ARM: at91: at91sam9n12: add DT parameters to enable PMECC
  2013-01-23 12:47 ` Josh Wu
@ 2013-01-23 12:47   ` Josh Wu
  -1 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-01-23 12:47 UTC (permalink / raw)
  To: linux-mtd, linux-arm-kernel, dedekind1; +Cc: nicolas.ferre, plagnioj, Josh Wu

Default ecc correctable setting is 2bits in 512 bytes.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
 arch/arm/boot/dts/at91sam9n12.dtsi  |    3 ++-
 arch/arm/boot/dts/at91sam9n12ek.dts |    5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index 80e29c6..a3a3fdb 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -390,8 +390,9 @@
 			reg = < 0x40000000 0x10000000
 				0xffffe000 0x00000600
 				0xffffe600 0x00000200
-				0x00100000 0x00100000
+				0x00108000 0x00018000
 			       >;
+			atmel,pmecc-lookup-table-offset = <0x0 0x8000>;
 			atmel,nand-addr-offset = <21>;
 			atmel,nand-cmd-offset = <22>;
 			pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts
index 0376bf4..d400f8d 100644
--- a/arch/arm/boot/dts/at91sam9n12ek.dts
+++ b/arch/arm/boot/dts/at91sam9n12ek.dts
@@ -71,7 +71,10 @@
 
 		nand0: nand@40000000 {
 			nand-bus-width = <8>;
-			nand-ecc-mode = "soft";
+			nand-ecc-mode = "hw";
+			atmel,has-pmecc;
+			atmel,pmecc-cap = <2>;
+			atmel,pmecc-sector-size = <512>;
 			nand-on-flash-bbt;
 			status = "okay";
 		};
-- 
1.7.9.5

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

* [PATCH 3/5] ARM: at91: at91sam9n12: add DT parameters to enable PMECC
@ 2013-01-23 12:47   ` Josh Wu
  0 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-01-23 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

Default ecc correctable setting is 2bits in 512 bytes.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
 arch/arm/boot/dts/at91sam9n12.dtsi  |    3 ++-
 arch/arm/boot/dts/at91sam9n12ek.dts |    5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index 80e29c6..a3a3fdb 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -390,8 +390,9 @@
 			reg = < 0x40000000 0x10000000
 				0xffffe000 0x00000600
 				0xffffe600 0x00000200
-				0x00100000 0x00100000
+				0x00108000 0x00018000
 			       >;
+			atmel,pmecc-lookup-table-offset = <0x0 0x8000>;
 			atmel,nand-addr-offset = <21>;
 			atmel,nand-cmd-offset = <22>;
 			pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts
index 0376bf4..d400f8d 100644
--- a/arch/arm/boot/dts/at91sam9n12ek.dts
+++ b/arch/arm/boot/dts/at91sam9n12ek.dts
@@ -71,7 +71,10 @@
 
 		nand0: nand at 40000000 {
 			nand-bus-width = <8>;
-			nand-ecc-mode = "soft";
+			nand-ecc-mode = "hw";
+			atmel,has-pmecc;
+			atmel,pmecc-cap = <2>;
+			atmel,pmecc-sector-size = <512>;
 			nand-on-flash-bbt;
 			status = "okay";
 		};
-- 
1.7.9.5

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

* [PATCH 4/5] MTD: atmel_nand: make pmecc-cap, pmecc-sector-size in dts is optional.
  2013-01-23 12:47 ` Josh Wu
@ 2013-01-23 12:47   ` Josh Wu
  -1 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-01-23 12:47 UTC (permalink / raw)
  To: linux-mtd, linux-arm-kernel, dedekind1; +Cc: nicolas.ferre, plagnioj, Josh Wu

If those two are not specified in dts file, driver will report an error.

TODO: in this case, driver will find ecc requirement in NAND ONFI parameters.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
 drivers/mtd/nand/atmel_nand.c |   52 ++++++++++++++++++++++++-----------------
 1 file changed, 31 insertions(+), 21 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 1d989db..f186a37 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -101,6 +101,8 @@ struct atmel_nand_host {
 	u8			pmecc_corr_cap;
 	u16			pmecc_sector_size;
 	u32			pmecc_lookup_table_offset;
+	u32			pmecc_lookup_table_offset_512;
+	u32			pmecc_lookup_table_offset_1024;
 
 	int			pmecc_bytes_per_sector;
 	int			pmecc_sector_number;
@@ -916,8 +918,16 @@ static int __init atmel_pmecc_nand_init_params(struct platform_device *pdev,
 	struct resource *regs, *regs_pmerr, *regs_rom;
 	int cap, sector_size, err_no;
 
+	if (host->pmecc_corr_cap == 0 || host->pmecc_sector_size == 0)
+		/* TODO: Should use ONFI ecc parameters. */
+		return -EINVAL;
+
 	cap = host->pmecc_corr_cap;
 	sector_size = host->pmecc_sector_size;
+	host->pmecc_lookup_table_offset = (sector_size == 512) ?
+			host->pmecc_lookup_table_offset_512 :
+			host->pmecc_lookup_table_offset_1024;
+
 	dev_info(host->dev, "Initialize PMECC params, cap: %d, sector: %d\n",
 		 cap, sector_size);
 
@@ -1259,29 +1269,29 @@ static int atmel_of_init_port(struct atmel_nand_host *host,
 
 	/* use PMECC, get correction capability, sector size and lookup
 	 * table offset.
+	 * If correction bits and sector size are not specified, then find
+	 * them from NAND ONFI parameters.
 	 */
-	if (of_property_read_u32(np, "atmel,pmecc-cap", &val) != 0) {
-		dev_err(host->dev, "Cannot decide PMECC Capability\n");
-		return -EINVAL;
-	} else if ((val != 2) && (val != 4) && (val != 8) && (val != 12) &&
-	    (val != 24)) {
-		dev_err(host->dev,
-			"Unsupported PMECC correction capability: %d; should be 2, 4, 8, 12 or 24\n",
-			val);
-		return -EINVAL;
+	if (of_property_read_u32(np, "atmel,pmecc-cap", &val) == 0) {
+		if ((val != 2) && (val != 4) && (val != 8) && (val != 12) &&
+				(val != 24)) {
+			dev_err(host->dev,
+				"Unsupported PMECC correction capability: %d; should be 2, 4, 8, 12 or 24\n",
+				val);
+			return -EINVAL;
+		}
+		host->pmecc_corr_cap = (u8)val;
 	}
-	host->pmecc_corr_cap = (u8)val;
 
-	if (of_property_read_u32(np, "atmel,pmecc-sector-size", &val) != 0) {
-		dev_err(host->dev, "Cannot decide PMECC Sector Size\n");
-		return -EINVAL;
-	} else if ((val != 512) && (val != 1024)) {
-		dev_err(host->dev,
-			"Unsupported PMECC sector size: %d; should be 512 or 1024 bytes\n",
-			val);
-		return -EINVAL;
+	if (of_property_read_u32(np, "atmel,pmecc-sector-size", &val) == 0) {
+		if ((val != 512) && (val != 1024)) {
+			dev_err(host->dev,
+				"Unsupported PMECC sector size: %d; should be 512 or 1024 bytes\n",
+				val);
+			return -EINVAL;
+		}
+		host->pmecc_sector_size = (u16)val;
 	}
-	host->pmecc_sector_size = (u16)val;
 
 	if (of_property_read_u32_array(np, "atmel,pmecc-lookup-table-offset",
 			offset, 2) != 0) {
@@ -1292,8 +1302,8 @@ static int atmel_of_init_port(struct atmel_nand_host *host,
 		dev_err(host->dev, "Invalid PMECC lookup table offset\n");
 		return -EINVAL;
 	}
-	host->pmecc_lookup_table_offset =
-		(host->pmecc_sector_size == 512) ? offset[0] : offset[1];
+	host->pmecc_lookup_table_offset_512 = offset[0];
+	host->pmecc_lookup_table_offset_1024 = offset[1];
 
 	return 0;
 }
-- 
1.7.9.5

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

* [PATCH 4/5] MTD: atmel_nand: make pmecc-cap, pmecc-sector-size in dts is optional.
@ 2013-01-23 12:47   ` Josh Wu
  0 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-01-23 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

If those two are not specified in dts file, driver will report an error.

TODO: in this case, driver will find ecc requirement in NAND ONFI parameters.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
 drivers/mtd/nand/atmel_nand.c |   52 ++++++++++++++++++++++++-----------------
 1 file changed, 31 insertions(+), 21 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 1d989db..f186a37 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -101,6 +101,8 @@ struct atmel_nand_host {
 	u8			pmecc_corr_cap;
 	u16			pmecc_sector_size;
 	u32			pmecc_lookup_table_offset;
+	u32			pmecc_lookup_table_offset_512;
+	u32			pmecc_lookup_table_offset_1024;
 
 	int			pmecc_bytes_per_sector;
 	int			pmecc_sector_number;
@@ -916,8 +918,16 @@ static int __init atmel_pmecc_nand_init_params(struct platform_device *pdev,
 	struct resource *regs, *regs_pmerr, *regs_rom;
 	int cap, sector_size, err_no;
 
+	if (host->pmecc_corr_cap == 0 || host->pmecc_sector_size == 0)
+		/* TODO: Should use ONFI ecc parameters. */
+		return -EINVAL;
+
 	cap = host->pmecc_corr_cap;
 	sector_size = host->pmecc_sector_size;
+	host->pmecc_lookup_table_offset = (sector_size == 512) ?
+			host->pmecc_lookup_table_offset_512 :
+			host->pmecc_lookup_table_offset_1024;
+
 	dev_info(host->dev, "Initialize PMECC params, cap: %d, sector: %d\n",
 		 cap, sector_size);
 
@@ -1259,29 +1269,29 @@ static int atmel_of_init_port(struct atmel_nand_host *host,
 
 	/* use PMECC, get correction capability, sector size and lookup
 	 * table offset.
+	 * If correction bits and sector size are not specified, then find
+	 * them from NAND ONFI parameters.
 	 */
-	if (of_property_read_u32(np, "atmel,pmecc-cap", &val) != 0) {
-		dev_err(host->dev, "Cannot decide PMECC Capability\n");
-		return -EINVAL;
-	} else if ((val != 2) && (val != 4) && (val != 8) && (val != 12) &&
-	    (val != 24)) {
-		dev_err(host->dev,
-			"Unsupported PMECC correction capability: %d; should be 2, 4, 8, 12 or 24\n",
-			val);
-		return -EINVAL;
+	if (of_property_read_u32(np, "atmel,pmecc-cap", &val) == 0) {
+		if ((val != 2) && (val != 4) && (val != 8) && (val != 12) &&
+				(val != 24)) {
+			dev_err(host->dev,
+				"Unsupported PMECC correction capability: %d; should be 2, 4, 8, 12 or 24\n",
+				val);
+			return -EINVAL;
+		}
+		host->pmecc_corr_cap = (u8)val;
 	}
-	host->pmecc_corr_cap = (u8)val;
 
-	if (of_property_read_u32(np, "atmel,pmecc-sector-size", &val) != 0) {
-		dev_err(host->dev, "Cannot decide PMECC Sector Size\n");
-		return -EINVAL;
-	} else if ((val != 512) && (val != 1024)) {
-		dev_err(host->dev,
-			"Unsupported PMECC sector size: %d; should be 512 or 1024 bytes\n",
-			val);
-		return -EINVAL;
+	if (of_property_read_u32(np, "atmel,pmecc-sector-size", &val) == 0) {
+		if ((val != 512) && (val != 1024)) {
+			dev_err(host->dev,
+				"Unsupported PMECC sector size: %d; should be 512 or 1024 bytes\n",
+				val);
+			return -EINVAL;
+		}
+		host->pmecc_sector_size = (u16)val;
 	}
-	host->pmecc_sector_size = (u16)val;
 
 	if (of_property_read_u32_array(np, "atmel,pmecc-lookup-table-offset",
 			offset, 2) != 0) {
@@ -1292,8 +1302,8 @@ static int atmel_of_init_port(struct atmel_nand_host *host,
 		dev_err(host->dev, "Invalid PMECC lookup table offset\n");
 		return -EINVAL;
 	}
-	host->pmecc_lookup_table_offset =
-		(host->pmecc_sector_size == 512) ? offset[0] : offset[1];
+	host->pmecc_lookup_table_offset_512 = offset[0];
+	host->pmecc_lookup_table_offset_1024 = offset[1];
 
 	return 0;
 }
-- 
1.7.9.5

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

* [PATCH 5/5] MTD: at91: atmel_nand: for PMECC, add code to check the ONFI parameter ECC requirement.
  2013-01-23 12:47 ` Josh Wu
@ 2013-01-23 12:47   ` Josh Wu
  -1 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-01-23 12:47 UTC (permalink / raw)
  To: linux-mtd, linux-arm-kernel, dedekind1; +Cc: nicolas.ferre, plagnioj, Josh Wu

This patch will check NAND flash's ecc minimum requirement in ONFI parameter.

1. if pmecc-cap, pmecc-sector-size is set in dts. then use it. Driver will
   print out a WARNING if the values are different from ONFI parameters.
2. if pmecc-cap, pmecc-sector-size is not set in dts, then use the value
   from ONFI parameters.
    * If ONFI ECC parameters are in ONFI extended parameter page, since we are
      not support it, so assume the minimum ecc requirement is 2 bits in 512
      bytes.
    * For non-ONFI support nand flash, also assume the minimum ecc requirement is
      2 bits in 512 bytes.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
 drivers/mtd/nand/atmel_nand.c |   90 +++++++++++++++++++++++++++++++++++++++--
 1 file changed, 87 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index f186a37..ffcbcca 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -910,6 +910,84 @@ static void atmel_pmecc_core_init(struct mtd_info *mtd)
 	pmecc_writel(host->ecc, CTRL, PMECC_CTRL_ENABLE);
 }
 
+/*
+ * Get ECC requirement in ONFI parameters, returns -1 if ONFI
+ * parameters is not supported.
+ * return 0 if success to get the ECC requirement.
+ */
+static int get_onfi_ecc_param(struct nand_chip *chip,
+		int *ecc_bits, int *sector_size)
+{
+	*ecc_bits = *sector_size = 0;
+
+	if (chip->onfi_params.ecc_bits == 0xff)
+		/* TODO: the sector_size and ecc_bits need to be find in
+		 * extended ecc parameter, currently we don't support it.
+		 */
+		return -1;
+
+	*ecc_bits = chip->onfi_params.ecc_bits;
+
+	/* The default sector size (ecc codeword size) is 512 */
+	*sector_size = 512;
+
+	return 0;
+}
+
+/*
+ * Get ecc requirement from ONFI parameters ecc requirement.
+ * If pmecc-cap, pmecc-sector-size in DTS are not specified, this function
+ * will set them according to ONFI ecc requirement. Otherwise, use the
+ * value in DTS file.
+ * return 0 if success. otherwise return error code.
+ */
+static int pmecc_choose_ecc(struct atmel_nand_host *host,
+		int *cap, int *sector_size)
+{
+	/* Get ECC requirement from ONFI parameters */
+	*cap = *sector_size = 0;
+	if (host->nand_chip.onfi_version) {
+		if (!get_onfi_ecc_param(&host->nand_chip, cap, sector_size))
+			dev_info(host->dev, "ONFI params, minimum required ECC: %d bits in %d bytes\n",
+				*cap, *sector_size);
+		else
+			dev_info(host->dev, "NAND chip ECC reqirement is in Extended ONFI parameter, we don't support yet.\n");
+	} else {
+		dev_info(host->dev, "NAND chip is not ONFI compliant, assume ecc_bits is 2 in 512 bytes");
+	}
+	if (*cap == 0 && *sector_size == 0) {
+		*cap = 2;
+		*sector_size = 512;
+	}
+
+	/* If dts file doesn't specify then use the one in ONFI parameters */
+	if (host->pmecc_corr_cap == 0) {
+		/* use the most fitable ecc bits (the near bigger one ) */
+		if (*cap <= 2)
+			host->pmecc_corr_cap = 2;
+		else if (*cap <= 4)
+			host->pmecc_corr_cap = 4;
+		else if (*cap < 8)
+			host->pmecc_corr_cap = 8;
+		else if (*cap < 12)
+			host->pmecc_corr_cap = 12;
+		else if (*cap < 24)
+			host->pmecc_corr_cap = 24;
+		else
+			return -EINVAL;
+	}
+	if (host->pmecc_sector_size == 0) {
+		/* use the most fitable sector size (the near smaller one ) */
+		if (*sector_size >= 1024)
+			host->pmecc_sector_size = 1024;
+		else if (*sector_size >= 512)
+			host->pmecc_sector_size = 512;
+		else
+			return -EINVAL;
+	}
+	return 0;
+}
+
 static int __init atmel_pmecc_nand_init_params(struct platform_device *pdev,
 					 struct atmel_nand_host *host)
 {
@@ -918,9 +996,15 @@ static int __init atmel_pmecc_nand_init_params(struct platform_device *pdev,
 	struct resource *regs, *regs_pmerr, *regs_rom;
 	int cap, sector_size, err_no;
 
-	if (host->pmecc_corr_cap == 0 || host->pmecc_sector_size == 0)
-		/* TODO: Should use ONFI ecc parameters. */
-		return -EINVAL;
+	err_no = pmecc_choose_ecc(host, &cap, &sector_size);
+	if (err_no) {
+		dev_err(host->dev, "The NAND flash's ECC requirement are not support!");
+		return err_no;
+	}
+
+	if (cap != host->pmecc_corr_cap ||
+			sector_size != host->pmecc_sector_size)
+		dev_info(host->dev, "WARNING: Be Caution! Using different PMECC parameters from Nand ONFI ECC reqirement.\n");
 
 	cap = host->pmecc_corr_cap;
 	sector_size = host->pmecc_sector_size;
-- 
1.7.9.5

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

* [PATCH 5/5] MTD: at91: atmel_nand: for PMECC, add code to check the ONFI parameter ECC requirement.
@ 2013-01-23 12:47   ` Josh Wu
  0 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-01-23 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

This patch will check NAND flash's ecc minimum requirement in ONFI parameter.

1. if pmecc-cap, pmecc-sector-size is set in dts. then use it. Driver will
   print out a WARNING if the values are different from ONFI parameters.
2. if pmecc-cap, pmecc-sector-size is not set in dts, then use the value
   from ONFI parameters.
    * If ONFI ECC parameters are in ONFI extended parameter page, since we are
      not support it, so assume the minimum ecc requirement is 2 bits in 512
      bytes.
    * For non-ONFI support nand flash, also assume the minimum ecc requirement is
      2 bits in 512 bytes.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
 drivers/mtd/nand/atmel_nand.c |   90 +++++++++++++++++++++++++++++++++++++++--
 1 file changed, 87 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index f186a37..ffcbcca 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -910,6 +910,84 @@ static void atmel_pmecc_core_init(struct mtd_info *mtd)
 	pmecc_writel(host->ecc, CTRL, PMECC_CTRL_ENABLE);
 }
 
+/*
+ * Get ECC requirement in ONFI parameters, returns -1 if ONFI
+ * parameters is not supported.
+ * return 0 if success to get the ECC requirement.
+ */
+static int get_onfi_ecc_param(struct nand_chip *chip,
+		int *ecc_bits, int *sector_size)
+{
+	*ecc_bits = *sector_size = 0;
+
+	if (chip->onfi_params.ecc_bits == 0xff)
+		/* TODO: the sector_size and ecc_bits need to be find in
+		 * extended ecc parameter, currently we don't support it.
+		 */
+		return -1;
+
+	*ecc_bits = chip->onfi_params.ecc_bits;
+
+	/* The default sector size (ecc codeword size) is 512 */
+	*sector_size = 512;
+
+	return 0;
+}
+
+/*
+ * Get ecc requirement from ONFI parameters ecc requirement.
+ * If pmecc-cap, pmecc-sector-size in DTS are not specified, this function
+ * will set them according to ONFI ecc requirement. Otherwise, use the
+ * value in DTS file.
+ * return 0 if success. otherwise return error code.
+ */
+static int pmecc_choose_ecc(struct atmel_nand_host *host,
+		int *cap, int *sector_size)
+{
+	/* Get ECC requirement from ONFI parameters */
+	*cap = *sector_size = 0;
+	if (host->nand_chip.onfi_version) {
+		if (!get_onfi_ecc_param(&host->nand_chip, cap, sector_size))
+			dev_info(host->dev, "ONFI params, minimum required ECC: %d bits in %d bytes\n",
+				*cap, *sector_size);
+		else
+			dev_info(host->dev, "NAND chip ECC reqirement is in Extended ONFI parameter, we don't support yet.\n");
+	} else {
+		dev_info(host->dev, "NAND chip is not ONFI compliant, assume ecc_bits is 2 in 512 bytes");
+	}
+	if (*cap == 0 && *sector_size == 0) {
+		*cap = 2;
+		*sector_size = 512;
+	}
+
+	/* If dts file doesn't specify then use the one in ONFI parameters */
+	if (host->pmecc_corr_cap == 0) {
+		/* use the most fitable ecc bits (the near bigger one ) */
+		if (*cap <= 2)
+			host->pmecc_corr_cap = 2;
+		else if (*cap <= 4)
+			host->pmecc_corr_cap = 4;
+		else if (*cap < 8)
+			host->pmecc_corr_cap = 8;
+		else if (*cap < 12)
+			host->pmecc_corr_cap = 12;
+		else if (*cap < 24)
+			host->pmecc_corr_cap = 24;
+		else
+			return -EINVAL;
+	}
+	if (host->pmecc_sector_size == 0) {
+		/* use the most fitable sector size (the near smaller one ) */
+		if (*sector_size >= 1024)
+			host->pmecc_sector_size = 1024;
+		else if (*sector_size >= 512)
+			host->pmecc_sector_size = 512;
+		else
+			return -EINVAL;
+	}
+	return 0;
+}
+
 static int __init atmel_pmecc_nand_init_params(struct platform_device *pdev,
 					 struct atmel_nand_host *host)
 {
@@ -918,9 +996,15 @@ static int __init atmel_pmecc_nand_init_params(struct platform_device *pdev,
 	struct resource *regs, *regs_pmerr, *regs_rom;
 	int cap, sector_size, err_no;
 
-	if (host->pmecc_corr_cap == 0 || host->pmecc_sector_size == 0)
-		/* TODO: Should use ONFI ecc parameters. */
-		return -EINVAL;
+	err_no = pmecc_choose_ecc(host, &cap, &sector_size);
+	if (err_no) {
+		dev_err(host->dev, "The NAND flash's ECC requirement are not support!");
+		return err_no;
+	}
+
+	if (cap != host->pmecc_corr_cap ||
+			sector_size != host->pmecc_sector_size)
+		dev_info(host->dev, "WARNING: Be Caution! Using different PMECC parameters from Nand ONFI ECC reqirement.\n");
 
 	cap = host->pmecc_corr_cap;
 	sector_size = host->pmecc_sector_size;
-- 
1.7.9.5

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

* Re: [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek
  2013-01-23 12:47 ` Josh Wu
@ 2013-02-07  3:04   ` Josh Wu
  -1 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-02-07  3:04 UTC (permalink / raw)
  To: Josh Wu; +Cc: nicolas.ferre, plagnioj, linux-mtd, linux-arm-kernel, dedekind1

Hi,

Just a ping. Any feedback for this v3 patch?

Best Regards,
Josh Wu

On 1/23/2013 8:47 PM, Josh Wu wrote:
> Those patches will enable PMECC in dt parameters for at91sam9x5ek and
> at91sam9n12ek.
>
> The PMECC driver will check minimum required ecc on ONFI parameter from NAND
> flash.
>
> If pmecc-cap, pmecc-sector-size in dts file is specified, use those two.
> otherwise, set those according to NAND flash ONFI parameters.
>
> If the pmecc-cap, pmecc-sector-size in dts are different with ecc requirement
> in ONFI, print out a warning.
>
>
> For the following compile error:
>    ERROR (phandle_references): Reference to non-existent node or label "pinctrl_ssc0_tx"
>
>    ERROR: Input tree has errors, aborting (use -f to force output)
>    make[2]: *** [arch/arm/boot/dts/at91sam9g20ek.dtb] Error 2
>
> the fixes are already merged in Linux mainline in v3.8-rc4.
> you can find in:
>   544ae6b2e676c3c37fb8c93ef9327932fc2e5bc2 (ARM: at91/dts: add pinctrl support for SSC peripheral)
>   ea03c81521bde526570e1dec96eaa21fe5ac84a2 (ASoC: atmel-ssc: add pinctrl selection to driver)
>
>
> Change logs:
> v2: rebase to v3.8-rc3. And wrapped the commit message.
>
> v3: big chages:
>    1. reduce the PMECC lookup table mapping. Just the lookup table not whole
>       ROM code according to J.C's suggestion.
>    2. use simpler strategy to handle pmecc-cap, pmecc-sector-size:
>       * make pmecc-cap, pmecc-sector-size optional.
>       * If pmecc-cap, pmecc-sector-size are not set, use ONFI ecc parameters.
>         otherwise, use those in DTS file.
>       * print out a warning if PMECC use different ecc bits or sector size
>         from ONFI ecc parameters.
>
> Josh Wu (5):
>    MTD: atmel_nand: avoid to report an error when lookup table offset is
>      0.
>    ARM: at91: at91sam9x5: add DT parameters to enable PMECC
>    ARM: at91: at91sam9n12: add DT parameters to enable PMECC
>    MTD: atmel_nand: make pmecc-cap, pmecc-sector-size in dts is
>      optional.
>    MTD: at91: atmel_nand: for PMECC, add code to check the ONFI
>      parameter ECC requirement.
>
>   arch/arm/boot/dts/at91sam9n12.dtsi  |    3 +-
>   arch/arm/boot/dts/at91sam9n12ek.dts |    5 +-
>   arch/arm/boot/dts/at91sam9x5.dtsi   |    4 +
>   arch/arm/boot/dts/at91sam9x5cm.dtsi |    5 +-
>   drivers/mtd/nand/atmel_nand.c       |  141 +++++++++++++++++++++++++++++------
>   5 files changed, 131 insertions(+), 27 deletions(-)
>

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

* [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek
@ 2013-02-07  3:04   ` Josh Wu
  0 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-02-07  3:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Just a ping. Any feedback for this v3 patch?

Best Regards,
Josh Wu

On 1/23/2013 8:47 PM, Josh Wu wrote:
> Those patches will enable PMECC in dt parameters for at91sam9x5ek and
> at91sam9n12ek.
>
> The PMECC driver will check minimum required ecc on ONFI parameter from NAND
> flash.
>
> If pmecc-cap, pmecc-sector-size in dts file is specified, use those two.
> otherwise, set those according to NAND flash ONFI parameters.
>
> If the pmecc-cap, pmecc-sector-size in dts are different with ecc requirement
> in ONFI, print out a warning.
>
>
> For the following compile error:
>    ERROR (phandle_references): Reference to non-existent node or label "pinctrl_ssc0_tx"
>
>    ERROR: Input tree has errors, aborting (use -f to force output)
>    make[2]: *** [arch/arm/boot/dts/at91sam9g20ek.dtb] Error 2
>
> the fixes are already merged in Linux mainline in v3.8-rc4.
> you can find in:
>   544ae6b2e676c3c37fb8c93ef9327932fc2e5bc2 (ARM: at91/dts: add pinctrl support for SSC peripheral)
>   ea03c81521bde526570e1dec96eaa21fe5ac84a2 (ASoC: atmel-ssc: add pinctrl selection to driver)
>
>
> Change logs:
> v2: rebase to v3.8-rc3. And wrapped the commit message.
>
> v3: big chages:
>    1. reduce the PMECC lookup table mapping. Just the lookup table not whole
>       ROM code according to J.C's suggestion.
>    2. use simpler strategy to handle pmecc-cap, pmecc-sector-size:
>       * make pmecc-cap, pmecc-sector-size optional.
>       * If pmecc-cap, pmecc-sector-size are not set, use ONFI ecc parameters.
>         otherwise, use those in DTS file.
>       * print out a warning if PMECC use different ecc bits or sector size
>         from ONFI ecc parameters.
>
> Josh Wu (5):
>    MTD: atmel_nand: avoid to report an error when lookup table offset is
>      0.
>    ARM: at91: at91sam9x5: add DT parameters to enable PMECC
>    ARM: at91: at91sam9n12: add DT parameters to enable PMECC
>    MTD: atmel_nand: make pmecc-cap, pmecc-sector-size in dts is
>      optional.
>    MTD: at91: atmel_nand: for PMECC, add code to check the ONFI
>      parameter ECC requirement.
>
>   arch/arm/boot/dts/at91sam9n12.dtsi  |    3 +-
>   arch/arm/boot/dts/at91sam9n12ek.dts |    5 +-
>   arch/arm/boot/dts/at91sam9x5.dtsi   |    4 +
>   arch/arm/boot/dts/at91sam9x5cm.dtsi |    5 +-
>   drivers/mtd/nand/atmel_nand.c       |  141 +++++++++++++++++++++++++++++------
>   5 files changed, 131 insertions(+), 27 deletions(-)
>

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

* Re: [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek
  2013-01-23 12:47 ` Josh Wu
@ 2013-02-07 16:16   ` Nicolas Ferre
  -1 siblings, 0 replies; 24+ messages in thread
From: Nicolas Ferre @ 2013-02-07 16:16 UTC (permalink / raw)
  To: Josh Wu, linux-mtd, linux-arm-kernel, Artem Bityutskiy
  Cc: Olof Johansson, plagnioj, Arnd Bergmann

On 01/23/2013 01:47 PM, Josh Wu :
> Those patches will enable PMECC in dt parameters for at91sam9x5ek and 
> at91sam9n12ek.
> 
> The PMECC driver will check minimum required ecc on ONFI parameter from NAND 
> flash.
> 
> If pmecc-cap, pmecc-sector-size in dts file is specified, use those two.
> otherwise, set those according to NAND flash ONFI parameters.
> 
> If the pmecc-cap, pmecc-sector-size in dts are different with ecc requirement
> in ONFI, print out a warning.
> 
> 
> For the following compile error:
>   ERROR (phandle_references): Reference to non-existent node or label "pinctrl_ssc0_tx"
> 
>   ERROR: Input tree has errors, aborting (use -f to force output)
>   make[2]: *** [arch/arm/boot/dts/at91sam9g20ek.dtb] Error 2
> 
> the fixes are already merged in Linux mainline in v3.8-rc4.
> you can find in: 
>  544ae6b2e676c3c37fb8c93ef9327932fc2e5bc2 (ARM: at91/dts: add pinctrl support for SSC peripheral)
>  ea03c81521bde526570e1dec96eaa21fe5ac84a2 (ASoC: atmel-ssc: add pinctrl selection to driver) 

Artem,

I propose to take patches 2 and 3/5 of this series via arm-soc git tree.
I will specify to merge them at the end of the merge-window so that the
Device Tree properties will not be out-of-sync with driver modifications
(may not cause big issues anyway).

If it is needed, you can add my:

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

On the whole patch series.

Tell me if I have to rebase it for removing the 2nd and 3rd patches or
if you can deal with this yourself.

Thanks for your help. best regards,


> Change logs:
> v2: rebase to v3.8-rc3. And wrapped the commit message.
> 
> v3: big chages:
>   1. reduce the PMECC lookup table mapping. Just the lookup table not whole
>      ROM code according to J.C's suggestion.
>   2. use simpler strategy to handle pmecc-cap, pmecc-sector-size:
>      * make pmecc-cap, pmecc-sector-size optional.
>      * If pmecc-cap, pmecc-sector-size are not set, use ONFI ecc parameters.
>        otherwise, use those in DTS file.
>      * print out a warning if PMECC use different ecc bits or sector size 
>        from ONFI ecc parameters.
> 
> Josh Wu (5):
>   MTD: atmel_nand: avoid to report an error when lookup table offset is
>     0.
>   ARM: at91: at91sam9x5: add DT parameters to enable PMECC
>   ARM: at91: at91sam9n12: add DT parameters to enable PMECC
>   MTD: atmel_nand: make pmecc-cap, pmecc-sector-size in dts is
>     optional.
>   MTD: at91: atmel_nand: for PMECC, add code to check the ONFI
>     parameter ECC requirement.
> 
>  arch/arm/boot/dts/at91sam9n12.dtsi  |    3 +-
>  arch/arm/boot/dts/at91sam9n12ek.dts |    5 +-
>  arch/arm/boot/dts/at91sam9x5.dtsi   |    4 +
>  arch/arm/boot/dts/at91sam9x5cm.dtsi |    5 +-
>  drivers/mtd/nand/atmel_nand.c       |  141 +++++++++++++++++++++++++++++------
>  5 files changed, 131 insertions(+), 27 deletions(-)
> 


-- 
Nicolas Ferre

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

* [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek
@ 2013-02-07 16:16   ` Nicolas Ferre
  0 siblings, 0 replies; 24+ messages in thread
From: Nicolas Ferre @ 2013-02-07 16:16 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/23/2013 01:47 PM, Josh Wu :
> Those patches will enable PMECC in dt parameters for at91sam9x5ek and 
> at91sam9n12ek.
> 
> The PMECC driver will check minimum required ecc on ONFI parameter from NAND 
> flash.
> 
> If pmecc-cap, pmecc-sector-size in dts file is specified, use those two.
> otherwise, set those according to NAND flash ONFI parameters.
> 
> If the pmecc-cap, pmecc-sector-size in dts are different with ecc requirement
> in ONFI, print out a warning.
> 
> 
> For the following compile error:
>   ERROR (phandle_references): Reference to non-existent node or label "pinctrl_ssc0_tx"
> 
>   ERROR: Input tree has errors, aborting (use -f to force output)
>   make[2]: *** [arch/arm/boot/dts/at91sam9g20ek.dtb] Error 2
> 
> the fixes are already merged in Linux mainline in v3.8-rc4.
> you can find in: 
>  544ae6b2e676c3c37fb8c93ef9327932fc2e5bc2 (ARM: at91/dts: add pinctrl support for SSC peripheral)
>  ea03c81521bde526570e1dec96eaa21fe5ac84a2 (ASoC: atmel-ssc: add pinctrl selection to driver) 

Artem,

I propose to take patches 2 and 3/5 of this series via arm-soc git tree.
I will specify to merge them at the end of the merge-window so that the
Device Tree properties will not be out-of-sync with driver modifications
(may not cause big issues anyway).

If it is needed, you can add my:

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

On the whole patch series.

Tell me if I have to rebase it for removing the 2nd and 3rd patches or
if you can deal with this yourself.

Thanks for your help. best regards,


> Change logs:
> v2: rebase to v3.8-rc3. And wrapped the commit message.
> 
> v3: big chages:
>   1. reduce the PMECC lookup table mapping. Just the lookup table not whole
>      ROM code according to J.C's suggestion.
>   2. use simpler strategy to handle pmecc-cap, pmecc-sector-size:
>      * make pmecc-cap, pmecc-sector-size optional.
>      * If pmecc-cap, pmecc-sector-size are not set, use ONFI ecc parameters.
>        otherwise, use those in DTS file.
>      * print out a warning if PMECC use different ecc bits or sector size 
>        from ONFI ecc parameters.
> 
> Josh Wu (5):
>   MTD: atmel_nand: avoid to report an error when lookup table offset is
>     0.
>   ARM: at91: at91sam9x5: add DT parameters to enable PMECC
>   ARM: at91: at91sam9n12: add DT parameters to enable PMECC
>   MTD: atmel_nand: make pmecc-cap, pmecc-sector-size in dts is
>     optional.
>   MTD: at91: atmel_nand: for PMECC, add code to check the ONFI
>     parameter ECC requirement.
> 
>  arch/arm/boot/dts/at91sam9n12.dtsi  |    3 +-
>  arch/arm/boot/dts/at91sam9n12ek.dts |    5 +-
>  arch/arm/boot/dts/at91sam9x5.dtsi   |    4 +
>  arch/arm/boot/dts/at91sam9x5cm.dtsi |    5 +-
>  drivers/mtd/nand/atmel_nand.c       |  141 +++++++++++++++++++++++++++++------
>  5 files changed, 131 insertions(+), 27 deletions(-)
> 


-- 
Nicolas Ferre

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

* Re: [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek
  2013-02-07 16:16   ` Nicolas Ferre
@ 2013-02-08 16:57     ` Jean-Christophe PLAGNIOL-VILLARD
  -1 siblings, 0 replies; 24+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-02-08 16:57 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Arnd Bergmann, Artem Bityutskiy, Josh Wu, linux-mtd,
	Olof Johansson, linux-arm-kernel

On 17:16 Thu 07 Feb     , Nicolas Ferre wrote:
> On 01/23/2013 01:47 PM, Josh Wu :
> > Those patches will enable PMECC in dt parameters for at91sam9x5ek and 
> > at91sam9n12ek.
> > 
> > The PMECC driver will check minimum required ecc on ONFI parameter from NAND 
> > flash.
> > 
> > If pmecc-cap, pmecc-sector-size in dts file is specified, use those two.
> > otherwise, set those according to NAND flash ONFI parameters.
> > 
> > If the pmecc-cap, pmecc-sector-size in dts are different with ecc requirement
> > in ONFI, print out a warning.
> > 
> > 
> > For the following compile error:
> >   ERROR (phandle_references): Reference to non-existent node or label "pinctrl_ssc0_tx"
> > 
> >   ERROR: Input tree has errors, aborting (use -f to force output)
> >   make[2]: *** [arch/arm/boot/dts/at91sam9g20ek.dtb] Error 2
> > 
> > the fixes are already merged in Linux mainline in v3.8-rc4.
> > you can find in: 
> >  544ae6b2e676c3c37fb8c93ef9327932fc2e5bc2 (ARM: at91/dts: add pinctrl support for SSC peripheral)
> >  ea03c81521bde526570e1dec96eaa21fe5ac84a2 (ASoC: atmel-ssc: add pinctrl selection to driver) 
> 
> Artem,
> 
> I propose to take patches 2 and 3/5 of this series via arm-soc git tree.
> I will specify to merge them at the end of the merge-window so that the
> Device Tree properties will not be out-of-sync with driver modifications
> (may not cause big issues anyway).
> 
> If it is needed, you can add my:
> 
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

too
> 
> On the whole patch series.
> 
> Tell me if I have to rebase it for removing the 2nd and 3rd patches or
> if you can deal with this yourself.
> 
> Thanks for your help. best regards,
> 
> 
> > Change logs:
> > v2: rebase to v3.8-rc3. And wrapped the commit message.
> > 
> > v3: big chages:
> >   1. reduce the PMECC lookup table mapping. Just the lookup table not whole
> >      ROM code according to J.C's suggestion.
> >   2. use simpler strategy to handle pmecc-cap, pmecc-sector-size:
> >      * make pmecc-cap, pmecc-sector-size optional.
> >      * If pmecc-cap, pmecc-sector-size are not set, use ONFI ecc parameters.
> >        otherwise, use those in DTS file.
> >      * print out a warning if PMECC use different ecc bits or sector size 
> >        from ONFI ecc parameters.
> > 
> > Josh Wu (5):
> >   MTD: atmel_nand: avoid to report an error when lookup table offset is
> >     0.
> >   ARM: at91: at91sam9x5: add DT parameters to enable PMECC
> >   ARM: at91: at91sam9n12: add DT parameters to enable PMECC
> >   MTD: atmel_nand: make pmecc-cap, pmecc-sector-size in dts is
> >     optional.
> >   MTD: at91: atmel_nand: for PMECC, add code to check the ONFI
> >     parameter ECC requirement.
> > 
> >  arch/arm/boot/dts/at91sam9n12.dtsi  |    3 +-
> >  arch/arm/boot/dts/at91sam9n12ek.dts |    5 +-
> >  arch/arm/boot/dts/at91sam9x5.dtsi   |    4 +
> >  arch/arm/boot/dts/at91sam9x5cm.dtsi |    5 +-
> >  drivers/mtd/nand/atmel_nand.c       |  141 +++++++++++++++++++++++++++++------
> >  5 files changed, 131 insertions(+), 27 deletions(-)
> > 
> 
> 
> -- 
> Nicolas Ferre

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

* [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek
@ 2013-02-08 16:57     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 24+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-02-08 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

On 17:16 Thu 07 Feb     , Nicolas Ferre wrote:
> On 01/23/2013 01:47 PM, Josh Wu :
> > Those patches will enable PMECC in dt parameters for at91sam9x5ek and 
> > at91sam9n12ek.
> > 
> > The PMECC driver will check minimum required ecc on ONFI parameter from NAND 
> > flash.
> > 
> > If pmecc-cap, pmecc-sector-size in dts file is specified, use those two.
> > otherwise, set those according to NAND flash ONFI parameters.
> > 
> > If the pmecc-cap, pmecc-sector-size in dts are different with ecc requirement
> > in ONFI, print out a warning.
> > 
> > 
> > For the following compile error:
> >   ERROR (phandle_references): Reference to non-existent node or label "pinctrl_ssc0_tx"
> > 
> >   ERROR: Input tree has errors, aborting (use -f to force output)
> >   make[2]: *** [arch/arm/boot/dts/at91sam9g20ek.dtb] Error 2
> > 
> > the fixes are already merged in Linux mainline in v3.8-rc4.
> > you can find in: 
> >  544ae6b2e676c3c37fb8c93ef9327932fc2e5bc2 (ARM: at91/dts: add pinctrl support for SSC peripheral)
> >  ea03c81521bde526570e1dec96eaa21fe5ac84a2 (ASoC: atmel-ssc: add pinctrl selection to driver) 
> 
> Artem,
> 
> I propose to take patches 2 and 3/5 of this series via arm-soc git tree.
> I will specify to merge them at the end of the merge-window so that the
> Device Tree properties will not be out-of-sync with driver modifications
> (may not cause big issues anyway).
> 
> If it is needed, you can add my:
> 
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

too
> 
> On the whole patch series.
> 
> Tell me if I have to rebase it for removing the 2nd and 3rd patches or
> if you can deal with this yourself.
> 
> Thanks for your help. best regards,
> 
> 
> > Change logs:
> > v2: rebase to v3.8-rc3. And wrapped the commit message.
> > 
> > v3: big chages:
> >   1. reduce the PMECC lookup table mapping. Just the lookup table not whole
> >      ROM code according to J.C's suggestion.
> >   2. use simpler strategy to handle pmecc-cap, pmecc-sector-size:
> >      * make pmecc-cap, pmecc-sector-size optional.
> >      * If pmecc-cap, pmecc-sector-size are not set, use ONFI ecc parameters.
> >        otherwise, use those in DTS file.
> >      * print out a warning if PMECC use different ecc bits or sector size 
> >        from ONFI ecc parameters.
> > 
> > Josh Wu (5):
> >   MTD: atmel_nand: avoid to report an error when lookup table offset is
> >     0.
> >   ARM: at91: at91sam9x5: add DT parameters to enable PMECC
> >   ARM: at91: at91sam9n12: add DT parameters to enable PMECC
> >   MTD: atmel_nand: make pmecc-cap, pmecc-sector-size in dts is
> >     optional.
> >   MTD: at91: atmel_nand: for PMECC, add code to check the ONFI
> >     parameter ECC requirement.
> > 
> >  arch/arm/boot/dts/at91sam9n12.dtsi  |    3 +-
> >  arch/arm/boot/dts/at91sam9n12ek.dts |    5 +-
> >  arch/arm/boot/dts/at91sam9x5.dtsi   |    4 +
> >  arch/arm/boot/dts/at91sam9x5cm.dtsi |    5 +-
> >  drivers/mtd/nand/atmel_nand.c       |  141 +++++++++++++++++++++++++++++------
> >  5 files changed, 131 insertions(+), 27 deletions(-)
> > 
> 
> 
> -- 
> Nicolas Ferre

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

* Re: [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek
  2013-02-07 16:16   ` Nicolas Ferre
@ 2013-02-10  0:40     ` Olof Johansson
  -1 siblings, 0 replies; 24+ messages in thread
From: Olof Johansson @ 2013-02-10  0:40 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Arnd Bergmann, Artem Bityutskiy, Josh Wu, linux-mtd, plagnioj,
	linux-arm-kernel

On Thu, Feb 07, 2013 at 05:16:07PM +0100, Nicolas Ferre wrote:
> On 01/23/2013 01:47 PM, Josh Wu :
> > Those patches will enable PMECC in dt parameters for at91sam9x5ek and 
> > at91sam9n12ek.
> > 
> > The PMECC driver will check minimum required ecc on ONFI parameter from NAND 
> > flash.
> > 
> > If pmecc-cap, pmecc-sector-size in dts file is specified, use those two.
> > otherwise, set those according to NAND flash ONFI parameters.
> > 
> > If the pmecc-cap, pmecc-sector-size in dts are different with ecc requirement
> > in ONFI, print out a warning.
> > 
> > 
> > For the following compile error:
> >   ERROR (phandle_references): Reference to non-existent node or label "pinctrl_ssc0_tx"
> > 
> >   ERROR: Input tree has errors, aborting (use -f to force output)
> >   make[2]: *** [arch/arm/boot/dts/at91sam9g20ek.dtb] Error 2
> > 
> > the fixes are already merged in Linux mainline in v3.8-rc4.
> > you can find in: 
> >  544ae6b2e676c3c37fb8c93ef9327932fc2e5bc2 (ARM: at91/dts: add pinctrl support for SSC peripheral)
> >  ea03c81521bde526570e1dec96eaa21fe5ac84a2 (ASoC: atmel-ssc: add pinctrl selection to driver) 
> 
> Artem,
> 
> I propose to take patches 2 and 3/5 of this series via arm-soc git tree.
> I will specify to merge them at the end of the merge-window so that the
> Device Tree properties will not be out-of-sync with driver modifications
> (may not cause big issues anyway).

I'm not cc:d on the patches, but if it's just new properties then there's
no reason to hold off to "late in the merge window". There's actually no
way for you to hold that off yourself, since we won't accept new patches
to arm-soc that late.

I don't see any cc to devicetree-discuss of the device tree bindings
though, and no update of Documentation/device-tree/bindings/, so the
patches are not ready to go in yet.


-Olof

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

* [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek
@ 2013-02-10  0:40     ` Olof Johansson
  0 siblings, 0 replies; 24+ messages in thread
From: Olof Johansson @ 2013-02-10  0:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 07, 2013 at 05:16:07PM +0100, Nicolas Ferre wrote:
> On 01/23/2013 01:47 PM, Josh Wu :
> > Those patches will enable PMECC in dt parameters for at91sam9x5ek and 
> > at91sam9n12ek.
> > 
> > The PMECC driver will check minimum required ecc on ONFI parameter from NAND 
> > flash.
> > 
> > If pmecc-cap, pmecc-sector-size in dts file is specified, use those two.
> > otherwise, set those according to NAND flash ONFI parameters.
> > 
> > If the pmecc-cap, pmecc-sector-size in dts are different with ecc requirement
> > in ONFI, print out a warning.
> > 
> > 
> > For the following compile error:
> >   ERROR (phandle_references): Reference to non-existent node or label "pinctrl_ssc0_tx"
> > 
> >   ERROR: Input tree has errors, aborting (use -f to force output)
> >   make[2]: *** [arch/arm/boot/dts/at91sam9g20ek.dtb] Error 2
> > 
> > the fixes are already merged in Linux mainline in v3.8-rc4.
> > you can find in: 
> >  544ae6b2e676c3c37fb8c93ef9327932fc2e5bc2 (ARM: at91/dts: add pinctrl support for SSC peripheral)
> >  ea03c81521bde526570e1dec96eaa21fe5ac84a2 (ASoC: atmel-ssc: add pinctrl selection to driver) 
> 
> Artem,
> 
> I propose to take patches 2 and 3/5 of this series via arm-soc git tree.
> I will specify to merge them at the end of the merge-window so that the
> Device Tree properties will not be out-of-sync with driver modifications
> (may not cause big issues anyway).

I'm not cc:d on the patches, but if it's just new properties then there's
no reason to hold off to "late in the merge window". There's actually no
way for you to hold that off yourself, since we won't accept new patches
to arm-soc that late.

I don't see any cc to devicetree-discuss of the device tree bindings
though, and no update of Documentation/device-tree/bindings/, so the
patches are not ready to go in yet.


-Olof

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

* Re: [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek
  2013-02-10  0:40     ` Olof Johansson
@ 2013-02-11  3:44       ` Josh Wu
  -1 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-02-11  3:44 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Arnd Bergmann, Artem Bityutskiy, Nicolas Ferre, linux-mtd,
	plagnioj, linux-arm-kernel

Hi, Olof

On 2/10/2013 8:40 AM, Olof Johansson wrote:
> On Thu, Feb 07, 2013 at 05:16:07PM +0100, Nicolas Ferre wrote:
>> On 01/23/2013 01:47 PM, Josh Wu :
>>> Those patches will enable PMECC in dt parameters for at91sam9x5ek and
>>> at91sam9n12ek.
>>>
>>> The PMECC driver will check minimum required ecc on ONFI parameter from NAND
>>> flash.
>>>
>>> If pmecc-cap, pmecc-sector-size in dts file is specified, use those two.
>>> otherwise, set those according to NAND flash ONFI parameters.
>>>
>>> If the pmecc-cap, pmecc-sector-size in dts are different with ecc requirement
>>> in ONFI, print out a warning.
>>>
>>>
>>> For the following compile error:
>>>    ERROR (phandle_references): Reference to non-existent node or label "pinctrl_ssc0_tx"
>>>
>>>    ERROR: Input tree has errors, aborting (use -f to force output)
>>>    make[2]: *** [arch/arm/boot/dts/at91sam9g20ek.dtb] Error 2
>>>
>>> the fixes are already merged in Linux mainline in v3.8-rc4.
>>> you can find in:
>>>   544ae6b2e676c3c37fb8c93ef9327932fc2e5bc2 (ARM: at91/dts: add pinctrl support for SSC peripheral)
>>>   ea03c81521bde526570e1dec96eaa21fe5ac84a2 (ASoC: atmel-ssc: add pinctrl selection to driver)
>> Artem,
>>
>> I propose to take patches 2 and 3/5 of this series via arm-soc git tree.
>> I will specify to merge them at the end of the merge-window so that the
>> Device Tree properties will not be out-of-sync with driver modifications
>> (may not cause big issues anyway).
> I'm not cc:d on the patches, but if it's just new properties then there's
> no reason to hold off to "late in the merge window". There's actually no
> way for you to hold that off yourself, since we won't accept new patches
> to arm-soc that late.
>
> I don't see any cc to devicetree-discuss of the device tree bindings
> though, and no update of Documentation/device-tree/bindings/, so the
> patches are not ready to go in yet.

Since in my commit: a41b51a1f7c15a1b00f30a3ad2d0373ad51b883d (mtd: at91: 
add dt parameters for Atmel PMECC), it already added following 
properties to DT documentation:
   atmel,pmecc-cap
   atmel,pmecc-sector-size
   atmel,pmecc-lookup-table-offset
so in this patches series, NO. 2 and 3 just add it to at91 board's dts 
file according to the DT documentation.

Indeed, this patch series make a little bit different from the DT 
documentation, that is: the ROM code mapping size are smaller than the 
DT documentation example.
But original DT documentation example still works.

So I think the DT documentation's explanation are proper for this patch 
series. It seems I don't have to update the DT documentation so far.

>
>
> -Olof

Best Regards,
Josh Wu

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

* [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek
@ 2013-02-11  3:44       ` Josh Wu
  0 siblings, 0 replies; 24+ messages in thread
From: Josh Wu @ 2013-02-11  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, Olof

On 2/10/2013 8:40 AM, Olof Johansson wrote:
> On Thu, Feb 07, 2013 at 05:16:07PM +0100, Nicolas Ferre wrote:
>> On 01/23/2013 01:47 PM, Josh Wu :
>>> Those patches will enable PMECC in dt parameters for at91sam9x5ek and
>>> at91sam9n12ek.
>>>
>>> The PMECC driver will check minimum required ecc on ONFI parameter from NAND
>>> flash.
>>>
>>> If pmecc-cap, pmecc-sector-size in dts file is specified, use those two.
>>> otherwise, set those according to NAND flash ONFI parameters.
>>>
>>> If the pmecc-cap, pmecc-sector-size in dts are different with ecc requirement
>>> in ONFI, print out a warning.
>>>
>>>
>>> For the following compile error:
>>>    ERROR (phandle_references): Reference to non-existent node or label "pinctrl_ssc0_tx"
>>>
>>>    ERROR: Input tree has errors, aborting (use -f to force output)
>>>    make[2]: *** [arch/arm/boot/dts/at91sam9g20ek.dtb] Error 2
>>>
>>> the fixes are already merged in Linux mainline in v3.8-rc4.
>>> you can find in:
>>>   544ae6b2e676c3c37fb8c93ef9327932fc2e5bc2 (ARM: at91/dts: add pinctrl support for SSC peripheral)
>>>   ea03c81521bde526570e1dec96eaa21fe5ac84a2 (ASoC: atmel-ssc: add pinctrl selection to driver)
>> Artem,
>>
>> I propose to take patches 2 and 3/5 of this series via arm-soc git tree.
>> I will specify to merge them at the end of the merge-window so that the
>> Device Tree properties will not be out-of-sync with driver modifications
>> (may not cause big issues anyway).
> I'm not cc:d on the patches, but if it's just new properties then there's
> no reason to hold off to "late in the merge window". There's actually no
> way for you to hold that off yourself, since we won't accept new patches
> to arm-soc that late.
>
> I don't see any cc to devicetree-discuss of the device tree bindings
> though, and no update of Documentation/device-tree/bindings/, so the
> patches are not ready to go in yet.

Since in my commit: a41b51a1f7c15a1b00f30a3ad2d0373ad51b883d (mtd: at91: 
add dt parameters for Atmel PMECC), it already added following 
properties to DT documentation:
   atmel,pmecc-cap
   atmel,pmecc-sector-size
   atmel,pmecc-lookup-table-offset
so in this patches series, NO. 2 and 3 just add it to at91 board's dts 
file according to the DT documentation.

Indeed, this patch series make a little bit different from the DT 
documentation, that is: the ROM code mapping size are smaller than the 
DT documentation example.
But original DT documentation example still works.

So I think the DT documentation's explanation are proper for this patch 
series. It seems I don't have to update the DT documentation so far.

>
>
> -Olof

Best Regards,
Josh Wu

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

* Re: [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek
  2013-02-07 16:16   ` Nicolas Ferre
@ 2013-02-12 15:01     ` Artem Bityutskiy
  -1 siblings, 0 replies; 24+ messages in thread
From: Artem Bityutskiy @ 2013-02-12 15:01 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Arnd Bergmann, Josh Wu, linux-mtd, Olof Johansson, plagnioj,
	linux-arm-kernel

On Thu, 2013-02-07 at 17:16 +0100, Nicolas Ferre wrote:
> On 01/23/2013 01:47 PM, Josh Wu :
> > Those patches will enable PMECC in dt parameters for at91sam9x5ek and 
> > at91sam9n12ek.
> > 
> > The PMECC driver will check minimum required ecc on ONFI parameter from NAND 
> > flash.
> > 
> > If pmecc-cap, pmecc-sector-size in dts file is specified, use those two.
> > otherwise, set those according to NAND flash ONFI parameters.
> > 
> > If the pmecc-cap, pmecc-sector-size in dts are different with ecc requirement
> > in ONFI, print out a warning.
> > 
> > 
> > For the following compile error:
> >   ERROR (phandle_references): Reference to non-existent node or label "pinctrl_ssc0_tx"
> > 
> >   ERROR: Input tree has errors, aborting (use -f to force output)
> >   make[2]: *** [arch/arm/boot/dts/at91sam9g20ek.dtb] Error 2
> > 
> > the fixes are already merged in Linux mainline in v3.8-rc4.
> > you can find in: 
> >  544ae6b2e676c3c37fb8c93ef9327932fc2e5bc2 (ARM: at91/dts: add pinctrl support for SSC peripheral)
> >  ea03c81521bde526570e1dec96eaa21fe5ac84a2 (ASoC: atmel-ssc: add pinctrl selection to driver) 
> 
> Artem,
> 
> I propose to take patches 2 and 3/5 of this series via arm-soc git tree.
> I will specify to merge them at the end of the merge-window so that the
> Device Tree properties will not be out-of-sync with driver modifications
> (may not cause big issues anyway).

Hi, just pushed patches 1, 3, and 4 to the l2-mtd.git tree, thanks!
-- 
Best Regards,
Artem Bityutskiy

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

* [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek
@ 2013-02-12 15:01     ` Artem Bityutskiy
  0 siblings, 0 replies; 24+ messages in thread
From: Artem Bityutskiy @ 2013-02-12 15:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2013-02-07 at 17:16 +0100, Nicolas Ferre wrote:
> On 01/23/2013 01:47 PM, Josh Wu :
> > Those patches will enable PMECC in dt parameters for at91sam9x5ek and 
> > at91sam9n12ek.
> > 
> > The PMECC driver will check minimum required ecc on ONFI parameter from NAND 
> > flash.
> > 
> > If pmecc-cap, pmecc-sector-size in dts file is specified, use those two.
> > otherwise, set those according to NAND flash ONFI parameters.
> > 
> > If the pmecc-cap, pmecc-sector-size in dts are different with ecc requirement
> > in ONFI, print out a warning.
> > 
> > 
> > For the following compile error:
> >   ERROR (phandle_references): Reference to non-existent node or label "pinctrl_ssc0_tx"
> > 
> >   ERROR: Input tree has errors, aborting (use -f to force output)
> >   make[2]: *** [arch/arm/boot/dts/at91sam9g20ek.dtb] Error 2
> > 
> > the fixes are already merged in Linux mainline in v3.8-rc4.
> > you can find in: 
> >  544ae6b2e676c3c37fb8c93ef9327932fc2e5bc2 (ARM: at91/dts: add pinctrl support for SSC peripheral)
> >  ea03c81521bde526570e1dec96eaa21fe5ac84a2 (ASoC: atmel-ssc: add pinctrl selection to driver) 
> 
> Artem,
> 
> I propose to take patches 2 and 3/5 of this series via arm-soc git tree.
> I will specify to merge them at the end of the merge-window so that the
> Device Tree properties will not be out-of-sync with driver modifications
> (may not cause big issues anyway).

Hi, just pushed patches 1, 3, and 4 to the l2-mtd.git tree, thanks!
-- 
Best Regards,
Artem Bityutskiy

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

end of thread, other threads:[~2013-02-12 15:01 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-23 12:47 [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek Josh Wu
2013-01-23 12:47 ` Josh Wu
2013-01-23 12:47 ` [PATCH 1/5] MTD: atmel_nand: avoid to report an error when lookup table offset is 0 Josh Wu
2013-01-23 12:47   ` Josh Wu
2013-01-23 12:47 ` [PATCH 2/5] ARM: at91: at91sam9x5: add DT parameters to enable PMECC Josh Wu
2013-01-23 12:47   ` Josh Wu
2013-01-23 12:47 ` [PATCH 3/5] ARM: at91: at91sam9n12: " Josh Wu
2013-01-23 12:47   ` Josh Wu
2013-01-23 12:47 ` [PATCH 4/5] MTD: atmel_nand: make pmecc-cap, pmecc-sector-size in dts is optional Josh Wu
2013-01-23 12:47   ` Josh Wu
2013-01-23 12:47 ` [PATCH 5/5] MTD: at91: atmel_nand: for PMECC, add code to check the ONFI parameter ECC requirement Josh Wu
2013-01-23 12:47   ` Josh Wu
2013-02-07  3:04 ` [PATCH 0/5 v3] at91: PMECC: enable PMECC in dt for at91sam9x5ek, at91sam9n12ek Josh Wu
2013-02-07  3:04   ` Josh Wu
2013-02-07 16:16 ` Nicolas Ferre
2013-02-07 16:16   ` Nicolas Ferre
2013-02-08 16:57   ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-08 16:57     ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-10  0:40   ` Olof Johansson
2013-02-10  0:40     ` Olof Johansson
2013-02-11  3:44     ` Josh Wu
2013-02-11  3:44       ` Josh Wu
2013-02-12 15:01   ` Artem Bityutskiy
2013-02-12 15:01     ` Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.