9
0
Fork 0

mtd: nand: add has_pmecc member

By adding this structure member, we can retrieve the pmecc config, through the device tree.

Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Raphaël Poggi 2014-09-01 14:27:33 +02:00 committed by Sascha Hauer
parent a4f0146e0e
commit af8e7d3a6e
6 changed files with 6 additions and 1 deletions

View File

@ -47,6 +47,7 @@ static struct atmel_nand_data nand_pdata = {
.det_pin = -EINVAL,
.rdy_pin = AT91_PIN_PD5,
.enable_pin = AT91_PIN_PD4,
.has_pmecc = 1,
.ecc_mode = NAND_ECC_HW,
.pmecc_sector_size = 512,
.pmecc_corr_cap = 2,

View File

@ -57,6 +57,7 @@ static struct atmel_nand_data nand_pdata = {
.det_pin = -EINVAL,
.rdy_pin = AT91_PIN_PD5,
.enable_pin = AT91_PIN_PD4,
.has_pmecc = 1,
.ecc_mode = NAND_ECC_HW,
.pmecc_sector_size = 512,
.pmecc_corr_cap = 2,

View File

@ -48,6 +48,7 @@ static struct atmel_nand_data nand_pdata = {
.rdy_pin = -EINVAL,
.enable_pin = -EINVAL,
.ecc_mode = NAND_ECC_HW,
.has_pmecc = 1,
.pmecc_sector_size = 512,
.pmecc_corr_cap = 4,
#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)

View File

@ -63,6 +63,7 @@ static struct atmel_nand_data nand_pdata = {
.rdy_pin = -EINVAL,
.enable_pin = -EINVAL,
.ecc_mode = NAND_ECC_HW,
.has_pmecc = 1,
.pmecc_sector_size = 512,
.pmecc_corr_cap = 4,
#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)

View File

@ -63,6 +63,7 @@ struct atmel_nand_data {
u8 bus_width_16; /* buswidth is 16 bit */
u8 ecc_mode; /* NAND_ECC_* */
u8 on_flash_bbt; /* Use flash based bbt */
u8 has_pmecc; /* Use PMECC */
u8 bus_on_d0;
u8 pmecc_corr_cap;

View File

@ -1219,7 +1219,7 @@ static int __init atmel_nand_probe(struct device_d *dev)
if (IS_ENABLED(CONFIG_NAND_ECC_HW) &&
nand_chip->ecc.mode == NAND_ECC_HW) {
if (IS_ENABLED(CONFIG_NAND_ATMEL_PMECC))
if (IS_ENABLED(CONFIG_NAND_ATMEL_PMECC) && pdata->has_pmecc)
res = atmel_pmecc_nand_init_params(dev, host);
else
res = atmel_hw_nand_init_params(dev, host);