Commit 3cece3ab authored by Boris Brezillon's avatar Boris Brezillon Committed by Miquel Raynal
Browse files

mtd: rawnand: Deprecate ->chip_delay


The wait timeouts and delays are directly extracted from the NAND
timings and ->chip_delay is only used in legacy path, so let's move it
to the nand_legacy struct to make it clear.
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 45240367
...@@ -240,7 +240,7 @@ necessary information about the device. ...@@ -240,7 +240,7 @@ necessary information about the device.
/* Reference hardware control function */ /* Reference hardware control function */
this->hwcontrol = board_hwcontrol; this->hwcontrol = board_hwcontrol;
/* Set command delay time, see datasheet for correct value */ /* Set command delay time, see datasheet for correct value */
this->chip_delay = CHIP_DEPENDEND_COMMAND_DELAY; this->legacy.chip_delay = CHIP_DEPENDEND_COMMAND_DELAY;
/* Assign the device ready function, if available */ /* Assign the device ready function, if available */
this->legacy.dev_ready = board_dev_ready; this->legacy.dev_ready = board_dev_ready;
this->eccmode = NAND_ECC_SOFT; this->eccmode = NAND_ECC_SOFT;
......
...@@ -221,7 +221,7 @@ static int ams_delta_init(struct platform_device *pdev) ...@@ -221,7 +221,7 @@ static int ams_delta_init(struct platform_device *pdev)
pr_notice("Couldn't request gpio for Delta NAND ready.\n"); pr_notice("Couldn't request gpio for Delta NAND ready.\n");
} }
/* 25 us command delay time */ /* 25 us command delay time */
this->chip_delay = 30; this->legacy.chip_delay = 30;
this->ecc.mode = NAND_ECC_SOFT; this->ecc.mode = NAND_ECC_SOFT;
this->ecc.algo = NAND_ECC_HAMMING; this->ecc.algo = NAND_ECC_HAMMING;
......
...@@ -1483,7 +1483,7 @@ static void atmel_nand_init(struct atmel_nand_controller *nc, ...@@ -1483,7 +1483,7 @@ static void atmel_nand_init(struct atmel_nand_controller *nc,
chip->setup_data_interface = atmel_nand_setup_data_interface; chip->setup_data_interface = atmel_nand_setup_data_interface;
/* Some NANDs require a longer delay than the default one (20us). */ /* Some NANDs require a longer delay than the default one (20us). */
chip->chip_delay = 40; chip->legacy.chip_delay = 40;
/* /*
* Use a bounce buffer when the buffer passed by the MTD user is not * Use a bounce buffer when the buffer passed by the MTD user is not
......
...@@ -342,7 +342,7 @@ static void au1550_command(struct nand_chip *this, unsigned command, ...@@ -342,7 +342,7 @@ static void au1550_command(struct nand_chip *this, unsigned command,
/* Apply a short delay always to ensure that we do wait tWB. */ /* Apply a short delay always to ensure that we do wait tWB. */
ndelay(100); ndelay(100);
/* Wait for a chip to become ready... */ /* Wait for a chip to become ready... */
for (i = this->chip_delay; for (i = this->legacy.chip_delay;
!this->legacy.dev_ready(this) && i > 0; --i) !this->legacy.dev_ready(this) && i > 0; --i)
udelay(1); udelay(1);
...@@ -434,7 +434,7 @@ static int au1550nd_probe(struct platform_device *pdev) ...@@ -434,7 +434,7 @@ static int au1550nd_probe(struct platform_device *pdev)
this->legacy.cmdfunc = au1550_command; this->legacy.cmdfunc = au1550_command;
/* 30 us command delay time */ /* 30 us command delay time */
this->chip_delay = 30; this->legacy.chip_delay = 30;
this->ecc.mode = NAND_ECC_SOFT; this->ecc.mode = NAND_ECC_SOFT;
this->ecc.algo = NAND_ECC_HAMMING; this->ecc.algo = NAND_ECC_HAMMING;
......
...@@ -393,7 +393,7 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) ...@@ -393,7 +393,7 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n)
b47n->nand_chip.legacy.set_features = nand_get_set_features_notsupp; b47n->nand_chip.legacy.set_features = nand_get_set_features_notsupp;
b47n->nand_chip.legacy.get_features = nand_get_set_features_notsupp; b47n->nand_chip.legacy.get_features = nand_get_set_features_notsupp;
nand_chip->chip_delay = 50; nand_chip->legacy.chip_delay = 50;
b47n->nand_chip.bbt_options = NAND_BBT_USE_FLASH; b47n->nand_chip.bbt_options = NAND_BBT_USE_FLASH;
b47n->nand_chip.ecc.mode = NAND_ECC_NONE; /* TODO: implement ECC */ b47n->nand_chip.ecc.mode = NAND_ECC_NONE; /* TODO: implement ECC */
......
...@@ -712,7 +712,7 @@ static int cafe_nand_probe(struct pci_dev *pdev, ...@@ -712,7 +712,7 @@ static int cafe_nand_probe(struct pci_dev *pdev,
cafe->nand.legacy.set_features = nand_get_set_features_notsupp; cafe->nand.legacy.set_features = nand_get_set_features_notsupp;
cafe->nand.legacy.get_features = nand_get_set_features_notsupp; cafe->nand.legacy.get_features = nand_get_set_features_notsupp;
cafe->nand.chip_delay = 0; cafe->nand.legacy.chip_delay = 0;
/* Enable the following for a flash based bad block table */ /* Enable the following for a flash based bad block table */
cafe->nand.bbt_options = NAND_BBT_USE_FLASH; cafe->nand.bbt_options = NAND_BBT_USE_FLASH;
......
...@@ -179,7 +179,7 @@ static int __init cmx270_init(void) ...@@ -179,7 +179,7 @@ static int __init cmx270_init(void)
this->legacy.dev_ready = cmx270_device_ready; this->legacy.dev_ready = cmx270_device_ready;
/* 15 us command delay time */ /* 15 us command delay time */
this->chip_delay = 20; this->legacy.chip_delay = 20;
this->ecc.mode = NAND_ECC_SOFT; this->ecc.mode = NAND_ECC_SOFT;
this->ecc.algo = NAND_ECC_HAMMING; this->ecc.algo = NAND_ECC_HAMMING;
......
...@@ -212,7 +212,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) ...@@ -212,7 +212,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)
this->legacy.read_buf = cs553x_read_buf; this->legacy.read_buf = cs553x_read_buf;
this->legacy.write_buf = cs553x_write_buf; this->legacy.write_buf = cs553x_write_buf;
this->chip_delay = 0; this->legacy.chip_delay = 0;
this->ecc.mode = NAND_ECC_HW; this->ecc.mode = NAND_ECC_HW;
this->ecc.size = 256; this->ecc.size = 256;
......
...@@ -761,7 +761,7 @@ static int nand_davinci_probe(struct platform_device *pdev) ...@@ -761,7 +761,7 @@ static int nand_davinci_probe(struct platform_device *pdev)
info->chip.legacy.IO_ADDR_R = vaddr; info->chip.legacy.IO_ADDR_R = vaddr;
info->chip.legacy.IO_ADDR_W = vaddr; info->chip.legacy.IO_ADDR_W = vaddr;
info->chip.chip_delay = 0; info->chip.legacy.chip_delay = 0;
info->chip.select_chip = nand_davinci_select_chip; info->chip.select_chip = nand_davinci_select_chip;
/* options such as NAND_BBT_USE_FLASH */ /* options such as NAND_BBT_USE_FLASH */
......
...@@ -717,7 +717,7 @@ static void doc2001plus_command(struct nand_chip *this, unsigned command, ...@@ -717,7 +717,7 @@ static void doc2001plus_command(struct nand_chip *this, unsigned command,
case NAND_CMD_RESET: case NAND_CMD_RESET:
if (this->legacy.dev_ready) if (this->legacy.dev_ready)
break; break;
udelay(this->chip_delay); udelay(this->legacy.chip_delay);
WriteDOC(NAND_CMD_STATUS, docptr, Mplus_FlashCmd); WriteDOC(NAND_CMD_STATUS, docptr, Mplus_FlashCmd);
WriteDOC(0, docptr, Mplus_WritePipeTerm); WriteDOC(0, docptr, Mplus_WritePipeTerm);
WriteDOC(0, docptr, Mplus_WritePipeTerm); WriteDOC(0, docptr, Mplus_WritePipeTerm);
...@@ -731,7 +731,7 @@ static void doc2001plus_command(struct nand_chip *this, unsigned command, ...@@ -731,7 +731,7 @@ static void doc2001plus_command(struct nand_chip *this, unsigned command,
* command delay * command delay
*/ */
if (!this->legacy.dev_ready) { if (!this->legacy.dev_ready) {
udelay(this->chip_delay); udelay(this->legacy.chip_delay);
return; return;
} }
} }
......
...@@ -658,8 +658,8 @@ static int fsl_elbc_attach_chip(struct nand_chip *chip) ...@@ -658,8 +658,8 @@ static int fsl_elbc_attach_chip(struct nand_chip *chip)
chip->chipsize); chip->chipsize);
dev_dbg(priv->dev, "fsl_elbc_init: nand->pagemask = %8x\n", dev_dbg(priv->dev, "fsl_elbc_init: nand->pagemask = %8x\n",
chip->pagemask); chip->pagemask);
dev_dbg(priv->dev, "fsl_elbc_init: nand->chip_delay = %d\n", dev_dbg(priv->dev, "fsl_elbc_init: nand->legacy.chip_delay = %d\n",
chip->chip_delay); chip->legacy.chip_delay);
dev_dbg(priv->dev, "fsl_elbc_init: nand->badblockpos = %d\n", dev_dbg(priv->dev, "fsl_elbc_init: nand->badblockpos = %d\n",
chip->badblockpos); chip->badblockpos);
dev_dbg(priv->dev, "fsl_elbc_init: nand->chip_shift = %d\n", dev_dbg(priv->dev, "fsl_elbc_init: nand->chip_shift = %d\n",
......
...@@ -727,8 +727,8 @@ static int fsl_ifc_attach_chip(struct nand_chip *chip) ...@@ -727,8 +727,8 @@ static int fsl_ifc_attach_chip(struct nand_chip *chip)
chip->chipsize); chip->chipsize);
dev_dbg(priv->dev, "%s: nand->pagemask = %8x\n", __func__, dev_dbg(priv->dev, "%s: nand->pagemask = %8x\n", __func__,
chip->pagemask); chip->pagemask);
dev_dbg(priv->dev, "%s: nand->chip_delay = %d\n", __func__, dev_dbg(priv->dev, "%s: nand->legacy.chip_delay = %d\n", __func__,
chip->chip_delay); chip->legacy.chip_delay);
dev_dbg(priv->dev, "%s: nand->badblockpos = %d\n", __func__, dev_dbg(priv->dev, "%s: nand->badblockpos = %d\n", __func__,
chip->badblockpos); chip->badblockpos);
dev_dbg(priv->dev, "%s: nand->chip_shift = %d\n", __func__, dev_dbg(priv->dev, "%s: nand->chip_shift = %d\n", __func__,
......
...@@ -163,7 +163,7 @@ static int fun_chip_init(struct fsl_upm_nand *fun, ...@@ -163,7 +163,7 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
fun->chip.legacy.IO_ADDR_R = fun->io_base; fun->chip.legacy.IO_ADDR_R = fun->io_base;
fun->chip.legacy.IO_ADDR_W = fun->io_base; fun->chip.legacy.IO_ADDR_W = fun->io_base;
fun->chip.legacy.cmd_ctrl = fun_cmd_ctrl; fun->chip.legacy.cmd_ctrl = fun_cmd_ctrl;
fun->chip.chip_delay = fun->chip_delay; fun->chip.legacy.chip_delay = fun->chip_delay;
fun->chip.legacy.read_byte = fun_read_byte; fun->chip.legacy.read_byte = fun_read_byte;
fun->chip.legacy.read_buf = fun_read_buf; fun->chip.legacy.read_buf = fun_read_buf;
fun->chip.legacy.write_buf = fun_write_buf; fun->chip.legacy.write_buf = fun_write_buf;
......
...@@ -1080,7 +1080,6 @@ static int __init fsmc_nand_probe(struct platform_device *pdev) ...@@ -1080,7 +1080,6 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
mtd->dev.parent = &pdev->dev; mtd->dev.parent = &pdev->dev;
nand->exec_op = fsmc_exec_op; nand->exec_op = fsmc_exec_op;
nand->select_chip = fsmc_select_chip; nand->select_chip = fsmc_select_chip;
nand->chip_delay = 30;
/* /*
* Setup default ECC mode. nand_dt_init() called from nand_scan_ident() * Setup default ECC mode. nand_dt_init() called from nand_scan_ident()
......
...@@ -278,7 +278,7 @@ static int gpio_nand_probe(struct platform_device *pdev) ...@@ -278,7 +278,7 @@ static int gpio_nand_probe(struct platform_device *pdev)
chip->ecc.mode = NAND_ECC_SOFT; chip->ecc.mode = NAND_ECC_SOFT;
chip->ecc.algo = NAND_ECC_HAMMING; chip->ecc.algo = NAND_ECC_HAMMING;
chip->options = gpiomtd->plat.options; chip->options = gpiomtd->plat.options;
chip->chip_delay = gpiomtd->plat.chip_delay; chip->legacy.chip_delay = gpiomtd->plat.chip_delay;
chip->legacy.cmd_ctrl = gpio_nand_cmd_ctrl; chip->legacy.cmd_ctrl = gpio_nand_cmd_ctrl;
mtd = nand_to_mtd(chip); mtd = nand_to_mtd(chip);
......
...@@ -787,7 +787,7 @@ static int hisi_nfc_probe(struct platform_device *pdev) ...@@ -787,7 +787,7 @@ static int hisi_nfc_probe(struct platform_device *pdev)
chip->legacy.read_byte = hisi_nfc_read_byte; chip->legacy.read_byte = hisi_nfc_read_byte;
chip->legacy.write_buf = hisi_nfc_write_buf; chip->legacy.write_buf = hisi_nfc_write_buf;
chip->legacy.read_buf = hisi_nfc_read_buf; chip->legacy.read_buf = hisi_nfc_read_buf;
chip->chip_delay = HINFC504_CHIP_DELAY; chip->legacy.chip_delay = HINFC504_CHIP_DELAY;
chip->legacy.set_features = nand_get_set_features_notsupp; chip->legacy.set_features = nand_get_set_features_notsupp;
chip->legacy.get_features = nand_get_set_features_notsupp; chip->legacy.get_features = nand_get_set_features_notsupp;
......
...@@ -425,7 +425,7 @@ static int jz_nand_probe(struct platform_device *pdev) ...@@ -425,7 +425,7 @@ static int jz_nand_probe(struct platform_device *pdev)
chip->ecc.strength = 4; chip->ecc.strength = 4;
chip->ecc.options = NAND_ECC_GENERIC_ERASED_CHECK; chip->ecc.options = NAND_ECC_GENERIC_ERASED_CHECK;
chip->chip_delay = 50; chip->legacy.chip_delay = 50;
chip->legacy.cmd_ctrl = jz_nand_cmd_ctrl; chip->legacy.cmd_ctrl = jz_nand_cmd_ctrl;
chip->select_chip = jz_nand_select_chip; chip->select_chip = jz_nand_select_chip;
chip->dummy_controller.ops = &jz_nand_controller_ops; chip->dummy_controller.ops = &jz_nand_controller_ops;
......
...@@ -277,7 +277,7 @@ static int jz4780_nand_init_chip(struct platform_device *pdev, ...@@ -277,7 +277,7 @@ static int jz4780_nand_init_chip(struct platform_device *pdev,
chip->legacy.IO_ADDR_R = cs->base + OFFSET_DATA; chip->legacy.IO_ADDR_R = cs->base + OFFSET_DATA;
chip->legacy.IO_ADDR_W = cs->base + OFFSET_DATA; chip->legacy.IO_ADDR_W = cs->base + OFFSET_DATA;
chip->chip_delay = RB_DELAY_US; chip->legacy.chip_delay = RB_DELAY_US;
chip->options = NAND_NO_SUBPAGE_WRITE; chip->options = NAND_NO_SUBPAGE_WRITE;
chip->select_chip = jz4780_nand_select_chip; chip->select_chip = jz4780_nand_select_chip;
chip->legacy.cmd_ctrl = jz4780_nand_cmd_ctrl; chip->legacy.cmd_ctrl = jz4780_nand_cmd_ctrl;
......
...@@ -741,7 +741,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) ...@@ -741,7 +741,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
nand_chip->legacy.cmd_ctrl = lpc32xx_nand_cmd_ctrl; nand_chip->legacy.cmd_ctrl = lpc32xx_nand_cmd_ctrl;
nand_chip->legacy.dev_ready = lpc32xx_nand_device_ready; nand_chip->legacy.dev_ready = lpc32xx_nand_device_ready;
nand_chip->chip_delay = 25; /* us */ nand_chip->legacy.chip_delay = 25; /* us */
nand_chip->legacy.IO_ADDR_R = MLC_DATA(host->io_base); nand_chip->legacy.IO_ADDR_R = MLC_DATA(host->io_base);
nand_chip->legacy.IO_ADDR_W = MLC_DATA(host->io_base); nand_chip->legacy.IO_ADDR_W = MLC_DATA(host->io_base);
......
...@@ -882,7 +882,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) ...@@ -882,7 +882,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
chip->legacy.IO_ADDR_W = SLC_DATA(host->io_base); chip->legacy.IO_ADDR_W = SLC_DATA(host->io_base);
chip->legacy.cmd_ctrl = lpc32xx_nand_cmd_ctrl; chip->legacy.cmd_ctrl = lpc32xx_nand_cmd_ctrl;
chip->legacy.dev_ready = lpc32xx_nand_device_ready; chip->legacy.dev_ready = lpc32xx_nand_device_ready;
chip->chip_delay = 20; /* 20us command delay time */ chip->legacy.chip_delay = 20; /* 20us command delay time */
/* Init NAND controller */ /* Init NAND controller */
lpc32xx_nand_setup(host); lpc32xx_nand_setup(host);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment