Skip to contentSkip to conversation

mtd: nand: set ECC algorithm explicitly

PATCH In review Rafał Miłecki 2 participants 10 messages Apr 8, 2016 – Apr 13, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover mtd: nand: set ECC algorithm explicitly

As part of nand_ecc_modes_t cleaning process we introduced enum nand_ecc_algo. Before we start using it (mostly in nand_core.c) we have to modify all driver to set it properly.

This is the first patchset modifying existing drivers. All patches were compile-tested. More patches will follow in the future, but I was hoping to have this first series accepted meanwhile.

This work is based on the nand/next branch.

Rafał Miłecki (8):
mtd: nand: ams-delta: set ECC algorithm explicitly
mtd: nand: gpio: set ECC algorithm explicitly
mtd: nand: mxc: set ECC algorithm explicitly
mtd: nand: nuc900: set ECC algorithm explicitly
mtd: nand: orion: set ECC algorithm explicitly
mtd: nand: pasemi: set ECC algorithm explicitly
mtd: nand: plat: set ECC algorithm explicitly
mtd: nand: socrates: set ECC algorithm explicitly

 drivers/mtd/nand/ams-delta.c     | 1 +
 drivers/mtd/nand/gpio.c          | 1 +
 drivers/mtd/nand/mxc_nand.c      | 1 +
 drivers/mtd/nand/nuc900_nand.c   | 1 +
 drivers/mtd/nand/orion_nand.c    | 1 +
 drivers/mtd/nand/pasemi_nand.c   | 1 +
 drivers/mtd/nand/plat_nand.c     | 1 +
 drivers/mtd/nand/socrates_nand.c | 1 +
 8 files changed, 8 insertions(+)
Signature · 1 line
1.8.4.5
#1 lore raw

PATCH 1/8 mtd: nand: ams-delta: set ECC algorithm explicitly

This is part of process deprecating NAND_ECC_SOFT_BCH (and switching to enum nand_ecc_algo).

---
 drivers/mtd/nand/ams-delta.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/ams-delta.c +1 -0
index 68b58c8..78e12cc 100644
@@ -224,6 +224,7 @@ static int ams_delta_init(struct platform_device *pdev)
 	/* 25 us command delay time */
 	this->chip_delay = 30;
 	this->ecc.mode = NAND_ECC_SOFT;
+	this->ecc.algo = NAND_ECC_HAMMING;
 
 	platform_set_drvdata(pdev, io_base);
 
Signature · 1 line
1.8.4.5
#2 lore raw

PATCH 2/8 mtd: nand: gpio: set ECC algorithm explicitly

In reply to Rafał Miłecki

This is part of process deprecating NAND_ECC_SOFT_BCH (and switching to enum nand_ecc_algo).

---
 drivers/mtd/nand/gpio.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/gpio.c +1 -0
index ded658f..6317f68 100644
@@ -273,6 +273,7 @@ static int gpio_nand_probe(struct platform_device *pdev)
 	nand_set_flash_node(chip, pdev->dev.of_node);
 	chip->IO_ADDR_W		= chip->IO_ADDR_R;
 	chip->ecc.mode		= NAND_ECC_SOFT;
+	chip->ecc.algo		= NAND_ECC_HAMMING;
 	chip->options		= gpiomtd->plat.options;
 	chip->chip_delay	= gpiomtd->plat.chip_delay;
 	chip->cmd_ctrl		= gpio_nand_cmd_ctrl;
Signature · 1 line
1.8.4.5
#3 lore raw

PATCH 3/8 mtd: nand: mxc: set ECC algorithm explicitly

In reply to Rafał Miłecki

This is part of process deprecating NAND_ECC_SOFT_BCH (and switching to enum nand_ecc_algo).

---
 drivers/mtd/nand/mxc_nand.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/mxc_nand.c +1 -0
index 854c832..57b1b74 100644
@@ -1585,6 +1585,7 @@ static int mxcnd_probe(struct platform_device *pdev)
 		this->ecc.mode = NAND_ECC_HW;
 	} else {
 		this->ecc.mode = NAND_ECC_SOFT;
+		this->ecc.algo = NAND_ECC_HAMMING;
 	}
 
 	/* NAND bus width determines access functions used by upper layer */
Signature · 1 line
1.8.4.5
#4 lore raw

PATCH 4/8 mtd: nand: nuc900: set ECC algorithm explicitly

In reply to Rafał Miłecki

This is part of process deprecating NAND_ECC_SOFT_BCH (and switching to enum nand_ecc_algo).

---
 drivers/mtd/nand/nuc900_nand.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/nuc900_nand.c +1 -0
index dbc5b57..8f64011 100644
@@ -261,6 +261,7 @@ static int nuc900_nand_probe(struct platform_device *pdev)
 	chip->chip_delay	= 50;
 	chip->options		= 0;
 	chip->ecc.mode		= NAND_ECC_SOFT;
+	chip->ecc.algo		= NAND_ECC_HAMMING;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	nuc900_nand->reg = devm_ioremap_resource(&pdev->dev, res);
Signature · 1 line
1.8.4.5
#5 lore raw

PATCH 5/8 mtd: nand: orion: set ECC algorithm explicitly

In reply to Rafał Miłecki

This is part of process deprecating NAND_ECC_SOFT_BCH (and switching to enum nand_ecc_algo).

---
 drivers/mtd/nand/orion_nand.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/orion_nand.c +1 -0
index d4614bf..40a7c4a 100644
@@ -130,6 +130,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
 	nc->cmd_ctrl = orion_nand_cmd_ctrl;
 	nc->read_buf = orion_nand_read_buf;
 	nc->ecc.mode = NAND_ECC_SOFT;
+	nc->ecc.algo = NAND_ECC_HAMMING;
 
 	if (board->chip_delay)
 		nc->chip_delay = board->chip_delay;
Signature · 1 line
1.8.4.5
#6 lore raw

PATCH 6/8 mtd: nand: pasemi: set ECC algorithm explicitly

In reply to Rafał Miłecki

This is part of process deprecating NAND_ECC_SOFT_BCH (and switching to enum nand_ecc_algo).

---
 drivers/mtd/nand/pasemi_nand.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/pasemi_nand.c +1 -0
index 3ab53ca..63fcb8c 100644
@@ -151,6 +151,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
 	chip->write_buf = pasemi_write_buf;
 	chip->chip_delay = 0;
 	chip->ecc.mode = NAND_ECC_SOFT;
+	chip->ecc.algo = NAND_ECC_HAMMING;
 
 	/* Enable the following for a flash based bad block table */
 	chip->bbt_options = NAND_BBT_USE_FLASH;
Signature · 1 line
1.8.4.5
#7 lore raw

PATCH 7/8 mtd: nand: plat: set ECC algorithm explicitly

In reply to Rafał Miłecki

This is part of process deprecating NAND_ECC_SOFT_BCH (and switching to enum nand_ecc_algo).

---
 drivers/mtd/nand/plat_nand.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/plat_nand.c +1 -0
index e4e50da..415a53a 100644
@@ -74,6 +74,7 @@ static int plat_nand_probe(struct platform_device *pdev)
 
 	data->chip.ecc.hwctl = pdata->ctrl.hwcontrol;
 	data->chip.ecc.mode = NAND_ECC_SOFT;
+	data->chip.ecc.algo = NAND_ECC_HAMMING;
 
 	platform_set_drvdata(pdev, data);
 
Signature · 1 line
1.8.4.5
#8 lore raw

PATCH 8/8 mtd: nand: socrates: set ECC algorithm explicitly

In reply to Rafał Miłecki

This is part of process deprecating NAND_ECC_SOFT_BCH (and switching to enum nand_ecc_algo).

---
 drivers/mtd/nand/socrates_nand.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/socrates_nand.c +1 -0
index e3305f9..888fd31 100644
@@ -180,6 +180,7 @@ static int socrates_nand_probe(struct platform_device *ofdev)
 	nand_chip->dev_ready = socrates_nand_device_ready;
 
 	nand_chip->ecc.mode = NAND_ECC_SOFT;	/* enable ECC */
+	nand_chip->ecc.algo = NAND_ECC_HAMMING;
 
 	/* TODO: I have no idea what real delay is. */
 	nand_chip->chip_delay = 20;		/* 20us command delay time */
Signature · 1 line
1.8.4.5
#9 lore raw
In reply to Rafał Miłecki

Hi Rafal,

Quoted 9 lines · On Fri, 8 Apr 2016 12:23:43 +0200 Rafał Miłecki <[email protected]> wrote:

As part of nand_ecc_modes_t cleaning process we introduced enum nand_ecc_algo. Before we start using it (mostly in nand_core.c) we have to modify all driver to set it properly.

This is the first patchset modifying existing drivers. All patches were compile-tested. More patches will follow in the future, but I was hoping to have this first series accepted meanwhile.

This work is based on the nand/next branch.

Whole series applied.

Thanks,

Boris

Quoted 21 lines

Rafał Miłecki (8):
mtd: nand: ams-delta: set ECC algorithm explicitly
mtd: nand: gpio: set ECC algorithm explicitly
mtd: nand: mxc: set ECC algorithm explicitly
mtd: nand: nuc900: set ECC algorithm explicitly
mtd: nand: orion: set ECC algorithm explicitly
mtd: nand: pasemi: set ECC algorithm explicitly
mtd: nand: plat: set ECC algorithm explicitly
mtd: nand: socrates: set ECC algorithm explicitly

 drivers/mtd/nand/ams-delta.c     | 1 +
 drivers/mtd/nand/gpio.c          | 1 +
 drivers/mtd/nand/mxc_nand.c      | 1 +
 drivers/mtd/nand/nuc900_nand.c   | 1 +
 drivers/mtd/nand/orion_nand.c    | 1 +
 drivers/mtd/nand/pasemi_nand.c   | 1 +
 drivers/mtd/nand/plat_nand.c     | 1 +
 drivers/mtd/nand/socrates_nand.c | 1 +
 8 files changed, 8 insertions(+)
Signature · 3 lines
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com