Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6dfc6d25 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

[MTD] NAND modularize ECC



First step of modularizing ECC support.
- Move ECC related functionality into a seperate embedded data structure
- Get rid of the hardware dependend constants to simplify new ECC models

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 7aa65bfd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ static int __init ams_delta_init(void)
	}
	/* 25 us command delay time */
	this->chip_delay = 30;
	this->eccmode = NAND_ECC_SOFT;
	this->ecc.mode = NAND_ECC_SOFT;

	/* Set chip enabled, but  */
	ams_delta_latch2_write(NAND_MASK, AMS_DELTA_LATCH2_NAND_NRE |
+1 −1
Original line number Diff line number Diff line
@@ -578,7 +578,7 @@ static int __init au1xxx_nand_init(void)

	/* 30 us command delay time */
	this->chip_delay = 30;
	this->eccmode = NAND_ECC_SOFT;
	this->ecc.mode = NAND_ECC_SOFT;

	this->options = NAND_NO_AUTOINCR;

+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ static int __init autcpu12_init(void)
	this->dev_ready = autcpu12_device_ready;
	/* 20 us command delay time */
	this->chip_delay = 20;
	this->eccmode = NAND_ECC_SOFT;
	this->ecc.mode = NAND_ECC_SOFT;

	/* Enable the following for a flash based bad block table */
	/*
+7 −5
Original line number Diff line number Diff line
@@ -242,10 +242,12 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)

	this->chip_delay = 0;

	this->eccmode = NAND_ECC_HW3_256;
	this->enable_hwecc  = cs_enable_hwecc;
	this->calculate_ecc = cs_calculate_ecc;
	this->correct_data  = nand_correct_data;
	this->ecc.mode = NAND_ECC_HW;
	this->ecc.size = 256;
	this->ecc.bytes = 3;
	this->ecc.hwctl  = cs_enable_hwecc;
	this->ecc.calculate = cs_calculate_ecc;
	this->ecc.correct  = nand_correct_data;

	/* Enable the following for a flash based bad block table */
	this->options = NAND_USE_FLASH_BBT | NAND_NO_AUTOINCR;
+6 −4
Original line number Diff line number Diff line
@@ -1674,12 +1674,14 @@ static int __init doc_probe(unsigned long physadr)
	nand->dev_ready		= doc200x_dev_ready;
	nand->waitfunc		= doc200x_wait;
	nand->block_bad		= doc200x_block_bad;
	nand->enable_hwecc	= doc200x_enable_hwecc;
	nand->calculate_ecc	= doc200x_calculate_ecc;
	nand->correct_data	= doc200x_correct_data;
	nand->ecc.hwctl		= doc200x_enable_hwecc;
	nand->ecc.calculate	= doc200x_calculate_ecc;
	nand->ecc.correct	= doc200x_correct_data;

	nand->autooob		= &doc200x_oobinfo;
	nand->eccmode		= NAND_ECC_HW6_512;
	nand->ecc.mode		= NAND_ECC_HW_SYNDROME;
	nand->ecc.size		= 512;
	nand->ecc.bytes		= 6;
	nand->options		= NAND_USE_FLASH_BBT | NAND_HWECC_SYNDROME;

	doc->physadr		= physadr;
Loading