nand 89 arch/arm/mach-dove/common.c struct clk *nand, *camera, *i2s0, *i2s1, *crypto, *ac97, *pdma; nand 101 arch/arm/mach-dove/common.c nand = dove_register_gate("nand", "tclk", CLOCK_GATING_BIT_NAND); nand 126 arch/arm/mach-dove/common.c orion_clkdev_add(NULL, "orion_nand", nand); nand 85 arch/arm/mach-mmp/clock-mmp2.c static APMU_CLK(nand, NAND, 0xbf, 100000000); nand 60 arch/arm/mach-mmp/clock-pxa168.c static APMU_CLK(nand, NAND, 0x19b, 156000000); nand 47 arch/arm/mach-mmp/clock-pxa910.c static APMU_CLK(nand, NAND, 0x19b, 156000000); nand 148 arch/arm/mach-mmp/mmp2.c MMP2_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x100, 28, 29); nand 102 arch/arm/mach-mmp/pxa168.c PXA168_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99); nand 142 arch/arm/mach-mmp/pxa910.c PXA910_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99); nand 236 arch/arm/mach-s3c24xx/mach-jive.c struct s3c2410_nand_set *nand = &jive_nand_sets[0]; nand 249 arch/arm/mach-s3c24xx/mach-jive.c nand->nr_partitions = ARRAY_SIZE(jive_imageB_nand_part); nand 250 arch/arm/mach-s3c24xx/mach-jive.c nand->partitions = jive_imageB_nand_part; nand 699 arch/arm/plat-samsung/devs.c void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand) nand 710 arch/arm/plat-samsung/devs.c npd = s3c_set_platdata(nand, sizeof(*npd), &s3c_device_nand); nand 502 arch/mips/include/asm/octeon/cvmx-mio-defs.h uint64_t nand:1; nand 506 arch/mips/include/asm/octeon/cvmx-mio-defs.h uint64_t nand:1; nand 526 arch/mips/include/asm/octeon/cvmx-mio-defs.h uint64_t nand:1; nand 530 arch/mips/include/asm/octeon/cvmx-mio-defs.h uint64_t nand:1; nand 571 arch/mips/include/asm/octeon/cvmx-mio-defs.h uint64_t nand:1; nand 575 arch/mips/include/asm/octeon/cvmx-mio-defs.h uint64_t nand:1; nand 281 arch/powerpc/include/asm/fsl_lbc.h void *nand; nand 120 drivers/mfd/tc6393xb.c static int tc6393xb_nand_enable(struct platform_device *nand) nand 122 drivers/mfd/tc6393xb.c struct tc6393xb *tc6393xb = dev_get_drvdata(nand->dev.parent); nand 128 drivers/mfd/tc6393xb.c dev_dbg(nand->dev.parent, "SMD buffer on\n"); nand 23 drivers/mtd/nand/bbt.c int nanddev_bbt_init(struct nand_device *nand) nand 26 drivers/mtd/nand/bbt.c unsigned int nblocks = nanddev_neraseblocks(nand); nand 30 drivers/mtd/nand/bbt.c nand->bbt.cache = kcalloc(nwords, sizeof(*nand->bbt.cache), nand 32 drivers/mtd/nand/bbt.c if (!nand->bbt.cache) nand 45 drivers/mtd/nand/bbt.c void nanddev_bbt_cleanup(struct nand_device *nand) nand 47 drivers/mtd/nand/bbt.c kfree(nand->bbt.cache); nand 60 drivers/mtd/nand/bbt.c int nanddev_bbt_update(struct nand_device *nand) nand 74 drivers/mtd/nand/bbt.c int nanddev_bbt_get_block_status(const struct nand_device *nand, nand 78 drivers/mtd/nand/bbt.c unsigned long *pos = nand->bbt.cache + nand 83 drivers/mtd/nand/bbt.c if (entry >= nanddev_neraseblocks(nand)) nand 107 drivers/mtd/nand/bbt.c int nanddev_bbt_set_block_status(struct nand_device *nand, unsigned int entry, nand 111 drivers/mtd/nand/bbt.c unsigned long *pos = nand->bbt.cache + nand 116 drivers/mtd/nand/bbt.c if (entry >= nanddev_neraseblocks(nand)) nand 22 drivers/mtd/nand/core.c bool nanddev_isbad(struct nand_device *nand, const struct nand_pos *pos) nand 24 drivers/mtd/nand/core.c if (nanddev_bbt_is_initialized(nand)) { nand 28 drivers/mtd/nand/core.c entry = nanddev_bbt_pos_to_entry(nand, pos); nand 29 drivers/mtd/nand/core.c status = nanddev_bbt_get_block_status(nand, entry); nand 32 drivers/mtd/nand/core.c if (nand->ops->isbad(nand, pos)) nand 37 drivers/mtd/nand/core.c nanddev_bbt_set_block_status(nand, entry, status); nand 47 drivers/mtd/nand/core.c return nand->ops->isbad(nand, pos); nand 61 drivers/mtd/nand/core.c int nanddev_markbad(struct nand_device *nand, const struct nand_pos *pos) nand 63 drivers/mtd/nand/core.c struct mtd_info *mtd = nanddev_to_mtd(nand); nand 67 drivers/mtd/nand/core.c if (nanddev_isbad(nand, pos)) nand 70 drivers/mtd/nand/core.c ret = nand->ops->markbad(nand, pos); nand 73 drivers/mtd/nand/core.c nanddev_pos_to_offs(nand, pos), ret); nand 75 drivers/mtd/nand/core.c if (!nanddev_bbt_is_initialized(nand)) nand 78 drivers/mtd/nand/core.c entry = nanddev_bbt_pos_to_entry(nand, pos); nand 79 drivers/mtd/nand/core.c ret = nanddev_bbt_set_block_status(nand, entry, NAND_BBT_BLOCK_WORN); nand 83 drivers/mtd/nand/core.c ret = nanddev_bbt_update(nand); nand 102 drivers/mtd/nand/core.c bool nanddev_isreserved(struct nand_device *nand, const struct nand_pos *pos) nand 107 drivers/mtd/nand/core.c if (!nanddev_bbt_is_initialized(nand)) nand 111 drivers/mtd/nand/core.c entry = nanddev_bbt_pos_to_entry(nand, pos); nand 112 drivers/mtd/nand/core.c status = nanddev_bbt_get_block_status(nand, entry); nand 126 drivers/mtd/nand/core.c int nanddev_erase(struct nand_device *nand, const struct nand_pos *pos) nand 128 drivers/mtd/nand/core.c if (nanddev_isbad(nand, pos) || nanddev_isreserved(nand, pos)) { nand 130 drivers/mtd/nand/core.c nanddev_pos_to_offs(nand, pos)); nand 134 drivers/mtd/nand/core.c return nand->ops->erase(nand, pos); nand 155 drivers/mtd/nand/core.c struct nand_device *nand = mtd_to_nanddev(mtd); nand 159 drivers/mtd/nand/core.c nanddev_offs_to_pos(nand, einfo->addr, &pos); nand 160 drivers/mtd/nand/core.c nanddev_offs_to_pos(nand, einfo->addr + einfo->len - 1, &last); nand 162 drivers/mtd/nand/core.c ret = nanddev_erase(nand, &pos); nand 164 drivers/mtd/nand/core.c einfo->fail_addr = nanddev_pos_to_offs(nand, &pos); nand 169 drivers/mtd/nand/core.c nanddev_pos_next_eraseblock(nand, &pos); nand 191 drivers/mtd/nand/core.c struct nand_device *nand = mtd_to_nanddev(mtd); nand 195 drivers/mtd/nand/core.c if (!nand->memorg.max_bad_eraseblocks_per_lun) nand 198 drivers/mtd/nand/core.c nanddev_offs_to_pos(nand, offs, &pos); nand 199 drivers/mtd/nand/core.c nanddev_offs_to_pos(nand, offs + len, &end); nand 201 drivers/mtd/nand/core.c for (nanddev_offs_to_pos(nand, offs, &pos); nand 203 drivers/mtd/nand/core.c nanddev_pos_next_lun(nand, &pos)) nand 204 drivers/mtd/nand/core.c max_bb += nand->memorg.max_bad_eraseblocks_per_lun; nand 221 drivers/mtd/nand/core.c int nanddev_init(struct nand_device *nand, const struct nand_ops *ops, nand 224 drivers/mtd/nand/core.c struct mtd_info *mtd = nanddev_to_mtd(nand); nand 225 drivers/mtd/nand/core.c struct nand_memory_organization *memorg = nanddev_get_memorg(nand); nand 227 drivers/mtd/nand/core.c if (!nand || !ops) nand 239 drivers/mtd/nand/core.c nand->rowconv.eraseblock_addr_shift = nand 241 drivers/mtd/nand/core.c nand->rowconv.lun_addr_shift = fls(memorg->eraseblocks_per_lun - 1) + nand 242 drivers/mtd/nand/core.c nand->rowconv.eraseblock_addr_shift; nand 244 drivers/mtd/nand/core.c nand->ops = ops; nand 253 drivers/mtd/nand/core.c mtd->size = nanddev_size(nand); nand 256 drivers/mtd/nand/core.c return nanddev_bbt_init(nand); nand 266 drivers/mtd/nand/core.c void nanddev_cleanup(struct nand_device *nand) nand 268 drivers/mtd/nand/core.c if (nanddev_bbt_is_initialized(nand)) nand 269 drivers/mtd/nand/core.c nanddev_bbt_cleanup(nand); nand 201 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand); nand 203 drivers/mtd/nand/raw/atmel/nand-controller.c int (*setup_data_interface)(struct atmel_nand *nand, int csline, nand 419 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 421 drivers/mtd/nand/raw/atmel/nand-controller.c return ioread8(nand->activecs->io.virt); nand 426 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 429 drivers/mtd/nand/raw/atmel/nand-controller.c iowrite16(byte | (byte << 8), nand->activecs->io.virt); nand 431 drivers/mtd/nand/raw/atmel/nand-controller.c iowrite8(byte, nand->activecs->io.virt); nand 436 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 448 drivers/mtd/nand/raw/atmel/nand-controller.c !atmel_nand_dma_transfer(nc, buf, nand->activecs->io.dma, len, nand 453 drivers/mtd/nand/raw/atmel/nand-controller.c ioread16_rep(nand->activecs->io.virt, buf, len / 2); nand 455 drivers/mtd/nand/raw/atmel/nand-controller.c ioread8_rep(nand->activecs->io.virt, buf, len); nand 460 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 472 drivers/mtd/nand/raw/atmel/nand-controller.c !atmel_nand_dma_transfer(nc, (void *)buf, nand->activecs->io.dma, nand 477 drivers/mtd/nand/raw/atmel/nand-controller.c iowrite16_rep(nand->activecs->io.virt, buf, len / 2); nand 479 drivers/mtd/nand/raw/atmel/nand-controller.c iowrite8_rep(nand->activecs->io.virt, buf, len); nand 484 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 486 drivers/mtd/nand/raw/atmel/nand-controller.c return gpiod_get_value(nand->activecs->rb.gpio); nand 491 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 493 drivers/mtd/nand/raw/atmel/nand-controller.c if (cs < 0 || cs >= nand->numcs) { nand 494 drivers/mtd/nand/raw/atmel/nand-controller.c nand->activecs = NULL; nand 499 drivers/mtd/nand/raw/atmel/nand-controller.c nand->activecs = &nand->cs[cs]; nand 501 drivers/mtd/nand/raw/atmel/nand-controller.c if (nand->activecs->rb.type == ATMEL_NAND_GPIO_RB) nand 507 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 515 drivers/mtd/nand/raw/atmel/nand-controller.c return status & ATMEL_HSMC_NFC_SR_RBEDGE(nand->activecs->rb.id); nand 521 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 528 drivers/mtd/nand/raw/atmel/nand-controller.c if (!nand->activecs) { nand 534 drivers/mtd/nand/raw/atmel/nand-controller.c if (nand->activecs->rb.type == ATMEL_NAND_NATIVE_RB) nand 602 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 620 drivers/mtd/nand/raw/atmel/nand-controller.c nc->op.cs = nand->activecs->id; nand 628 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 633 drivers/mtd/nand/raw/atmel/nand-controller.c if ((ctrl & NAND_CTRL_CHANGE) && nand->activecs->csgpio) { nand 635 drivers/mtd/nand/raw/atmel/nand-controller.c gpiod_set_value(nand->activecs->csgpio, 0); nand 637 drivers/mtd/nand/raw/atmel/nand-controller.c gpiod_set_value(nand->activecs->csgpio, 1); nand 641 drivers/mtd/nand/raw/atmel/nand-controller.c writeb(cmd, nand->activecs->io.virt + nc->caps->ale_offs); nand 643 drivers/mtd/nand/raw/atmel/nand-controller.c writeb(cmd, nand->activecs->io.virt + nc->caps->cle_offs); nand 719 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 728 drivers/mtd/nand/raw/atmel/nand-controller.c ret = atmel_pmecc_enable(nand->pmecc, op); nand 738 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 741 drivers/mtd/nand/raw/atmel/nand-controller.c atmel_pmecc_disable(nand->pmecc); nand 746 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 758 drivers/mtd/nand/raw/atmel/nand-controller.c ret = atmel_pmecc_wait_rdy(nand->pmecc); nand 770 drivers/mtd/nand/raw/atmel/nand-controller.c atmel_pmecc_get_generated_eccbytes(nand->pmecc, i, nand 781 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 793 drivers/mtd/nand/raw/atmel/nand-controller.c ret = atmel_pmecc_wait_rdy(nand->pmecc); nand 806 drivers/mtd/nand/raw/atmel/nand-controller.c ret = atmel_pmecc_correct_sector(nand->pmecc, i, databuf, nand 808 drivers/mtd/nand/raw/atmel/nand-controller.c if (ret < 0 && !atmel_pmecc_correct_erased_chunks(nand->pmecc)) nand 832 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 845 drivers/mtd/nand/raw/atmel/nand-controller.c atmel_pmecc_disable(nand->pmecc); nand 908 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 919 drivers/mtd/nand/raw/atmel/nand-controller.c nc->op.cs = nand->activecs->id; nand 946 drivers/mtd/nand/raw/atmel/nand-controller.c nc->op.cs = nand->activecs->id; nand 980 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 991 drivers/mtd/nand/raw/atmel/nand-controller.c if (nand->activecs->rb.type != ATMEL_NAND_NATIVE_RB) { nand 1004 drivers/mtd/nand/raw/atmel/nand-controller.c nc->op.cs = nand->activecs->id; nand 1047 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 1098 drivers/mtd/nand/raw/atmel/nand-controller.c nand->pmecc = atmel_pmecc_create_user(nc->pmecc, &req); nand 1099 drivers/mtd/nand/raw/atmel/nand-controller.c if (IS_ERR(nand->pmecc)) nand 1100 drivers/mtd/nand/raw/atmel/nand-controller.c return PTR_ERR(nand->pmecc); nand 1170 drivers/mtd/nand/raw/atmel/nand-controller.c static int atmel_smc_nand_prepare_smcconf(struct atmel_nand *nand, nand 1178 drivers/mtd/nand/raw/atmel/nand-controller.c nc = to_nand_controller(nand->base.controller); nand 1390 drivers/mtd/nand/raw/atmel/nand-controller.c if (nand->base.options & NAND_BUSWIDTH_16) nand 1400 drivers/mtd/nand/raw/atmel/nand-controller.c static int atmel_smc_nand_setup_data_interface(struct atmel_nand *nand, nand 1409 drivers/mtd/nand/raw/atmel/nand-controller.c nc = to_nand_controller(nand->base.controller); nand 1411 drivers/mtd/nand/raw/atmel/nand-controller.c ret = atmel_smc_nand_prepare_smcconf(nand, conf, &smcconf); nand 1418 drivers/mtd/nand/raw/atmel/nand-controller.c cs = &nand->cs[csline]; nand 1425 drivers/mtd/nand/raw/atmel/nand-controller.c static int atmel_hsmc_nand_setup_data_interface(struct atmel_nand *nand, nand 1434 drivers/mtd/nand/raw/atmel/nand-controller.c nc = to_hsmc_nand_controller(nand->base.controller); nand 1436 drivers/mtd/nand/raw/atmel/nand-controller.c ret = atmel_smc_nand_prepare_smcconf(nand, conf, &smcconf); nand 1443 drivers/mtd/nand/raw/atmel/nand-controller.c cs = &nand->cs[csline]; nand 1458 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 1461 drivers/mtd/nand/raw/atmel/nand-controller.c nc = to_nand_controller(nand->base.controller); nand 1463 drivers/mtd/nand/raw/atmel/nand-controller.c if (csline >= nand->numcs || nand 1467 drivers/mtd/nand/raw/atmel/nand-controller.c return nc->caps->ops->setup_data_interface(nand, csline, conf); nand 1471 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand) nand 1473 drivers/mtd/nand/raw/atmel/nand-controller.c struct nand_chip *chip = &nand->base; nand 1477 drivers/mtd/nand/raw/atmel/nand-controller.c nand->base.controller = &nc->base; nand 1505 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand) nand 1507 drivers/mtd/nand/raw/atmel/nand-controller.c struct nand_chip *chip = &nand->base; nand 1511 drivers/mtd/nand/raw/atmel/nand-controller.c atmel_nand_init(nc, nand); nand 1518 drivers/mtd/nand/raw/atmel/nand-controller.c for (i = 0; i < nand->numcs; i++) nand 1521 drivers/mtd/nand/raw/atmel/nand-controller.c BIT(nand->cs[i].id), BIT(nand->cs[i].id)); nand 1531 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand) nand 1533 drivers/mtd/nand/raw/atmel/nand-controller.c struct nand_chip *chip = &nand->base; nand 1535 drivers/mtd/nand/raw/atmel/nand-controller.c atmel_nand_init(nc, nand); nand 1542 drivers/mtd/nand/raw/atmel/nand-controller.c static int atmel_nand_controller_remove_nand(struct atmel_nand *nand) nand 1544 drivers/mtd/nand/raw/atmel/nand-controller.c struct nand_chip *chip = &nand->base; nand 1553 drivers/mtd/nand/raw/atmel/nand-controller.c list_del(&nand->node); nand 1562 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand; nand 1573 drivers/mtd/nand/raw/atmel/nand-controller.c nand = devm_kzalloc(nc->dev, struct_size(nand, cs, numcs), GFP_KERNEL); nand 1574 drivers/mtd/nand/raw/atmel/nand-controller.c if (!nand) { nand 1579 drivers/mtd/nand/raw/atmel/nand-controller.c nand->numcs = numcs; nand 1592 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cdgpio = gpio; nand 1613 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[i].id = val; nand 1615 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[i].io.dma = res.start; nand 1616 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[i].io.virt = devm_ioremap_resource(nc->dev, &res); nand 1617 drivers/mtd/nand/raw/atmel/nand-controller.c if (IS_ERR(nand->cs[i].io.virt)) nand 1618 drivers/mtd/nand/raw/atmel/nand-controller.c return ERR_CAST(nand->cs[i].io.virt); nand 1624 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[i].rb.type = ATMEL_NAND_NATIVE_RB; nand 1625 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[i].rb.id = val; nand 1638 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[i].rb.type = ATMEL_NAND_GPIO_RB; nand 1639 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[i].rb.gpio = gpio; nand 1655 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[i].csgpio = gpio; nand 1658 drivers/mtd/nand/raw/atmel/nand-controller.c nand_set_flash_node(&nand->base, np); nand 1660 drivers/mtd/nand/raw/atmel/nand-controller.c return nand; nand 1665 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand) nand 1667 drivers/mtd/nand/raw/atmel/nand-controller.c struct nand_chip *chip = &nand->base; nand 1672 drivers/mtd/nand/raw/atmel/nand-controller.c if (nand->cdgpio && gpiod_get_value(nand->cdgpio)) { nand 1677 drivers/mtd/nand/raw/atmel/nand-controller.c nc->caps->ops->nand_init(nc, nand); nand 1679 drivers/mtd/nand/raw/atmel/nand-controller.c ret = nand_scan(chip, nand->numcs); nand 1692 drivers/mtd/nand/raw/atmel/nand-controller.c list_add_tail(&nand->node, &nc->chips); nand 1700 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand, *tmp; nand 1703 drivers/mtd/nand/raw/atmel/nand-controller.c list_for_each_entry_safe(nand, tmp, &nc->chips, node) { nand 1704 drivers/mtd/nand/raw/atmel/nand-controller.c ret = atmel_nand_controller_remove_nand(nand); nand 1717 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand; nand 1725 drivers/mtd/nand/raw/atmel/nand-controller.c nand = devm_kzalloc(nc->dev, sizeof(*nand) + sizeof(*nand->cs), nand 1727 drivers/mtd/nand/raw/atmel/nand-controller.c if (!nand) nand 1730 drivers/mtd/nand/raw/atmel/nand-controller.c nand->numcs = 1; nand 1733 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[0].io.virt = devm_ioremap_resource(dev, res); nand 1734 drivers/mtd/nand/raw/atmel/nand-controller.c if (IS_ERR(nand->cs[0].io.virt)) nand 1735 drivers/mtd/nand/raw/atmel/nand-controller.c return PTR_ERR(nand->cs[0].io.virt); nand 1737 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[0].io.dma = res->start; nand 1747 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[0].id = 3; nand 1758 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[0].rb.type = ATMEL_NAND_GPIO_RB; nand 1759 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[0].rb.gpio = gpio; nand 1770 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[0].csgpio = gpio; nand 1781 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cdgpio = gpio; nand 1783 drivers/mtd/nand/raw/atmel/nand-controller.c nand_set_flash_node(&nand->base, nc->dev->of_node); nand 1785 drivers/mtd/nand/raw/atmel/nand-controller.c return atmel_nand_controller_add_nand(nc, nand); nand 1818 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand; nand 1820 drivers/mtd/nand/raw/atmel/nand-controller.c nand = atmel_nand_create(nc, nand_np, reg_cells); nand 1821 drivers/mtd/nand/raw/atmel/nand-controller.c if (IS_ERR(nand)) { nand 1822 drivers/mtd/nand/raw/atmel/nand-controller.c ret = PTR_ERR(nand); nand 1826 drivers/mtd/nand/raw/atmel/nand-controller.c ret = atmel_nand_controller_add_nand(nc, nand); nand 1919 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand = to_atmel_nand(chip); nand 1947 drivers/mtd/nand/raw/atmel/nand-controller.c nand->cs[0].id); nand 2564 drivers/mtd/nand/raw/atmel/nand-controller.c struct atmel_nand *nand; nand 2569 drivers/mtd/nand/raw/atmel/nand-controller.c list_for_each_entry(nand, &nc->chips, node) { nand 2572 drivers/mtd/nand/raw/atmel/nand-controller.c for (i = 0; i < nand->numcs; i++) nand 2573 drivers/mtd/nand/raw/atmel/nand-controller.c nand_reset(&nand->base, i); nand 61 drivers/mtd/nand/raw/cafe_nand.c struct nand_chip nand; nand 624 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.bbt_td = &cafe_bbt_main_descr_2048; nand 625 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.bbt_md = &cafe_bbt_mirror_descr_2048; nand 627 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.bbt_td = &cafe_bbt_main_descr_512; nand 628 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.bbt_md = &cafe_bbt_mirror_descr_512; nand 637 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.mode = NAND_ECC_HW_SYNDROME; nand 638 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.size = mtd->writesize; nand 639 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.bytes = 14; nand 640 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.strength = 4; nand 641 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.write_page = cafe_nand_write_page_lowlevel; nand 642 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.write_oob = cafe_nand_write_oob; nand 643 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.read_page = cafe_nand_read_page; nand 644 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.read_oob = cafe_nand_read_oob; nand 689 drivers/mtd/nand/raw/cafe_nand.c mtd = nand_to_mtd(&cafe->nand); nand 691 drivers/mtd/nand/raw/cafe_nand.c nand_set_controller_data(&cafe->nand, cafe); nand 707 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.legacy.cmdfunc = cafe_nand_cmdfunc; nand 708 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.legacy.dev_ready = cafe_device_ready; nand 709 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.legacy.read_byte = cafe_read_byte; nand 710 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.legacy.read_buf = cafe_read_buf; nand 711 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.legacy.write_buf = cafe_write_buf; nand 712 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.legacy.select_chip = cafe_select_chip; nand 713 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.legacy.set_features = nand_get_set_features_notsupp; nand 714 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.legacy.get_features = nand_get_set_features_notsupp; nand 716 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.legacy.chip_delay = 0; nand 719 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.bbt_options = NAND_BBT_USE_FLASH; nand 722 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.options |= NAND_SKIP_BBTSCAN; nand 723 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.legacy.block_bad = cafe_nand_block_bad; nand 784 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.legacy.dummy_controller.ops = &cafe_nand_controller_ops; nand 785 drivers/mtd/nand/raw/cafe_nand.c err = nand_scan(&cafe->nand, 2); nand 799 drivers/mtd/nand/raw/cafe_nand.c nand_cleanup(&cafe->nand); nand 87 drivers/mtd/nand/raw/davinci_nand.c static void nand_davinci_hwcontrol(struct nand_chip *nand, int cmd, nand 90 drivers/mtd/nand/raw/davinci_nand.c struct davinci_nand_info *info = to_davinci_nand(nand_to_mtd(nand)); nand 100 drivers/mtd/nand/raw/davinci_nand.c nand->legacy.IO_ADDR_W = addr; nand 104 drivers/mtd/nand/raw/davinci_nand.c iowrite8(cmd, nand->legacy.IO_ADDR_W); nand 107 drivers/mtd/nand/raw/davinci_nand.c static void nand_davinci_select_chip(struct nand_chip *nand, int chip) nand 109 drivers/mtd/nand/raw/davinci_nand.c struct davinci_nand_info *info = to_davinci_nand(nand_to_mtd(nand)); nand 1410 drivers/mtd/nand/raw/diskonchip.c struct nand_chip *nand = NULL; nand 1509 drivers/mtd/nand/raw/diskonchip.c nand = mtd_to_nand(mtd); nand 1510 drivers/mtd/nand/raw/diskonchip.c doc = nand_get_controller_data(nand); nand 1545 drivers/mtd/nand/raw/diskonchip.c nand = kzalloc(len, GFP_KERNEL); nand 1546 drivers/mtd/nand/raw/diskonchip.c if (!nand) { nand 1561 drivers/mtd/nand/raw/diskonchip.c doc = (struct doc_priv *) (nand + 1); nand 1569 drivers/mtd/nand/raw/diskonchip.c mtd = nand_to_mtd(nand); nand 1570 drivers/mtd/nand/raw/diskonchip.c nand->bbt_td = (struct nand_bbt_descr *) (doc + 1); nand 1571 drivers/mtd/nand/raw/diskonchip.c nand->bbt_md = nand->bbt_td + 1; nand 1576 drivers/mtd/nand/raw/diskonchip.c nand_set_controller_data(nand, doc); nand 1577 drivers/mtd/nand/raw/diskonchip.c nand->legacy.select_chip = doc200x_select_chip; nand 1578 drivers/mtd/nand/raw/diskonchip.c nand->legacy.cmd_ctrl = doc200x_hwcontrol; nand 1579 drivers/mtd/nand/raw/diskonchip.c nand->legacy.dev_ready = doc200x_dev_ready; nand 1580 drivers/mtd/nand/raw/diskonchip.c nand->legacy.waitfunc = doc200x_wait; nand 1581 drivers/mtd/nand/raw/diskonchip.c nand->legacy.block_bad = doc200x_block_bad; nand 1582 drivers/mtd/nand/raw/diskonchip.c nand->ecc.hwctl = doc200x_enable_hwecc; nand 1583 drivers/mtd/nand/raw/diskonchip.c nand->ecc.calculate = doc200x_calculate_ecc; nand 1584 drivers/mtd/nand/raw/diskonchip.c nand->ecc.correct = doc200x_correct_data; nand 1586 drivers/mtd/nand/raw/diskonchip.c nand->ecc.mode = NAND_ECC_HW_SYNDROME; nand 1587 drivers/mtd/nand/raw/diskonchip.c nand->ecc.size = 512; nand 1588 drivers/mtd/nand/raw/diskonchip.c nand->ecc.bytes = 6; nand 1589 drivers/mtd/nand/raw/diskonchip.c nand->ecc.strength = 2; nand 1590 drivers/mtd/nand/raw/diskonchip.c nand->ecc.options = NAND_ECC_GENERIC_ERASED_CHECK; nand 1591 drivers/mtd/nand/raw/diskonchip.c nand->bbt_options = NAND_BBT_USE_FLASH; nand 1593 drivers/mtd/nand/raw/diskonchip.c nand->options |= NAND_SKIP_BBTSCAN; nand 1611 drivers/mtd/nand/raw/diskonchip.c if ((ret = nand_scan(nand, numchips)) || (ret = doc->late_init(mtd))) { nand 1618 drivers/mtd/nand/raw/diskonchip.c nand_release(nand); nand 1633 drivers/mtd/nand/raw/diskonchip.c kfree(nand); nand 1645 drivers/mtd/nand/raw/diskonchip.c struct nand_chip *nand; nand 1649 drivers/mtd/nand/raw/diskonchip.c nand = mtd_to_nand(mtd); nand 1650 drivers/mtd/nand/raw/diskonchip.c doc = nand_get_controller_data(nand); nand 1653 drivers/mtd/nand/raw/diskonchip.c nand_release(nand); nand 1657 drivers/mtd/nand/raw/diskonchip.c kfree(nand); nand 158 drivers/mtd/nand/raw/fsl_elbc_nand.c struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = ctrl->nand; nand 208 drivers/mtd/nand/raw/fsl_elbc_nand.c struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = ctrl->nand; nand 313 drivers/mtd/nand/raw/fsl_elbc_nand.c struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = ctrl->nand; nand 546 drivers/mtd/nand/raw/fsl_elbc_nand.c struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = priv->ctrl->nand; nand 583 drivers/mtd/nand/raw/fsl_elbc_nand.c struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = priv->ctrl->nand; nand 599 drivers/mtd/nand/raw/fsl_elbc_nand.c struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = priv->ctrl->nand; nand 623 drivers/mtd/nand/raw/fsl_elbc_nand.c struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = priv->ctrl->nand; nand 640 drivers/mtd/nand/raw/fsl_elbc_nand.c struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = ctrl->nand; nand 685 drivers/mtd/nand/raw/fsl_elbc_nand.c struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = ctrl->nand; nand 832 drivers/mtd/nand/raw/fsl_elbc_nand.c struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = priv->ctrl->nand; nand 892 drivers/mtd/nand/raw/fsl_elbc_nand.c if (!fsl_lbc_ctrl_dev->nand) { nand 902 drivers/mtd/nand/raw/fsl_elbc_nand.c fsl_lbc_ctrl_dev->nand = elbc_fcm_ctrl; nand 904 drivers/mtd/nand/raw/fsl_elbc_nand.c elbc_fcm_ctrl = fsl_lbc_ctrl_dev->nand; nand 958 drivers/mtd/nand/raw/fsl_elbc_nand.c struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = fsl_lbc_ctrl_dev->nand; nand 967 drivers/mtd/nand/raw/fsl_elbc_nand.c fsl_lbc_ctrl_dev->nand = NULL; nand 1015 drivers/mtd/nand/raw/fsl_ifc_nand.c if (!fsl_ifc_ctrl_dev->nand) { nand 1025 drivers/mtd/nand/raw/fsl_ifc_nand.c fsl_ifc_ctrl_dev->nand = ifc_nand_ctrl; nand 1029 drivers/mtd/nand/raw/fsl_ifc_nand.c ifc_nand_ctrl = fsl_ifc_ctrl_dev->nand; nand 1103 drivers/mtd/nand/raw/fsl_ifc_nand.c fsl_ifc_ctrl_dev->nand = NULL; nand 137 drivers/mtd/nand/raw/fsmc_nand.c struct nand_chip nand; nand 244 drivers/mtd/nand/raw/fsmc_nand.c return container_of(chip, struct fsmc_nand_data, nand); nand 266 drivers/mtd/nand/raw/fsmc_nand.c if (host->nand.options & NAND_BUSWIDTH_16) nand 330 drivers/mtd/nand/raw/fsmc_nand.c static int fsmc_setup_data_interface(struct nand_chip *nand, int csline, nand 333 drivers/mtd/nand/raw/fsmc_nand.c struct fsmc_nand_data *host = nand_to_fsmc(nand); nand 831 drivers/mtd/nand/raw/fsmc_nand.c struct nand_chip *nand) nand 837 drivers/mtd/nand/raw/fsmc_nand.c nand->options = 0; nand 841 drivers/mtd/nand/raw/fsmc_nand.c nand->options |= NAND_BUSWIDTH_16; nand 849 drivers/mtd/nand/raw/fsmc_nand.c nand->options |= NAND_SKIP_BBTSCAN; nand 874 drivers/mtd/nand/raw/fsmc_nand.c static int fsmc_nand_attach_chip(struct nand_chip *nand) nand 876 drivers/mtd/nand/raw/fsmc_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 877 drivers/mtd/nand/raw/fsmc_nand.c struct fsmc_nand_data *host = nand_to_fsmc(nand); nand 899 drivers/mtd/nand/raw/fsmc_nand.c switch (nand->ecc.mode) { nand 902 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.calculate = fsmc_read_hwecc_ecc1; nand 903 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.correct = nand_correct_data; nand 904 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.bytes = 3; nand 905 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.strength = 1; nand 906 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.options |= NAND_ECC_SOFT_HAMMING_SM_ORDER; nand 910 drivers/mtd/nand/raw/fsmc_nand.c if (nand->ecc.algo == NAND_ECC_BCH) { nand 928 drivers/mtd/nand/raw/fsmc_nand.c if (nand->ecc.mode == NAND_ECC_HW) { nand 974 drivers/mtd/nand/raw/fsmc_nand.c struct nand_chip *nand; nand 987 drivers/mtd/nand/raw/fsmc_nand.c nand = &host->nand; nand 989 drivers/mtd/nand/raw/fsmc_nand.c ret = fsmc_nand_probe_config_dt(pdev, host, nand); nand 1049 drivers/mtd/nand/raw/fsmc_nand.c mtd = nand_to_mtd(&host->nand); nand 1050 drivers/mtd/nand/raw/fsmc_nand.c nand_set_flash_node(nand, pdev->dev.of_node); nand 1058 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.mode = NAND_ECC_HW; nand 1059 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.hwctl = fsmc_enable_hwecc; nand 1060 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.size = 512; nand 1061 drivers/mtd/nand/raw/fsmc_nand.c nand->badblockbits = 7; nand 1080 drivers/mtd/nand/raw/fsmc_nand.c nand->options |= NAND_KEEP_TIMINGS; nand 1084 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.read_page = fsmc_read_page_hwecc; nand 1085 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.calculate = fsmc_read_hwecc_ecc4; nand 1086 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.correct = fsmc_bch8_correct_data; nand 1087 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.bytes = 13; nand 1088 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.strength = 8; nand 1093 drivers/mtd/nand/raw/fsmc_nand.c nand->controller = &host->base; nand 1098 drivers/mtd/nand/raw/fsmc_nand.c ret = nand_scan(nand, 1); nand 1113 drivers/mtd/nand/raw/fsmc_nand.c nand_cleanup(nand); nand 1135 drivers/mtd/nand/raw/fsmc_nand.c nand_release(&host->nand); nand 1167 drivers/mtd/nand/raw/fsmc_nand.c nand_reset(&host->nand, 0); nand 261 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c struct nand_chip *chip = &this->nand; nand 388 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c struct mtd_info *mtd = nand_to_mtd(&this->nand); nand 401 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c struct mtd_info *mtd = nand_to_mtd(&this->nand); nand 512 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c struct nand_chip *chip = &this->nand; nand 1256 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c struct mtd_info *mtd = nand_to_mtd(&this->nand); nand 1946 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c struct nand_chip *chip = &this->nand; nand 2001 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c struct nand_chip *chip = &this->nand; nand 2066 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c struct nand_chip *chip = &this->nand; nand 2166 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c struct nand_chip *chip = &this->nand; nand 2247 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c int chip = this->nand.cur_cs; nand 2291 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | BF_GPMI_CTRL0_CS(this->nand.cur_cs, this) nand 2320 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | BF_GPMI_CTRL0_CS(this->nand.cur_cs, this) nand 2366 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | BF_GPMI_CTRL0_CS(this->nand.cur_cs, this) nand 2557 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c struct nand_chip *chip = &this->nand; nand 2699 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c nand_release(&this->nand); nand 138 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h struct nand_chip nand; nand 147 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct ingenic_nand *nand = to_ingenic_nand(nand_to_mtd(chip)); nand 148 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct ingenic_nfc *nfc = to_ingenic_nfc(nand->chip.controller); nand 163 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct ingenic_nand *nand = to_ingenic_nand(nand_to_mtd(chip)); nand 164 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct ingenic_nfc *nfc = to_ingenic_nfc(nand->chip.controller); nand 185 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct ingenic_nand *nand = to_ingenic_nand(nand_to_mtd(chip)); nand 187 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c return !gpiod_get_value_cansleep(nand->busy_gpio); nand 192 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct ingenic_nand *nand = to_ingenic_nand(nand_to_mtd(chip)); nand 194 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c nand->reading = (mode == NAND_ECC_READ); nand 200 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct ingenic_nand *nand = to_ingenic_nand(nand_to_mtd(chip)); nand 201 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct ingenic_nfc *nfc = to_ingenic_nfc(nand->chip.controller); nand 208 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c if (nand->reading) nand 211 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c params.size = nand->chip.ecc.size; nand 212 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c params.bytes = nand->chip.ecc.bytes; nand 213 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c params.strength = nand->chip.ecc.strength; nand 221 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct ingenic_nand *nand = to_ingenic_nand(nand_to_mtd(chip)); nand 222 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct ingenic_nfc *nfc = to_ingenic_nfc(nand->chip.controller); nand 225 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c params.size = nand->chip.ecc.size; nand 226 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c params.bytes = nand->chip.ecc.bytes; nand 227 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c params.strength = nand->chip.ecc.strength; nand 311 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct ingenic_nand *nand; nand 332 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c nand = devm_kzalloc(dev, sizeof(*nand), GFP_KERNEL); nand 333 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c if (!nand) nand 336 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c nand->busy_gpio = devm_gpiod_get_optional(dev, "rb", GPIOD_IN); nand 338 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c if (IS_ERR(nand->busy_gpio)) { nand 339 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c ret = PTR_ERR(nand->busy_gpio); nand 342 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c } else if (nand->busy_gpio) { nand 343 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c nand->chip.legacy.dev_ready = ingenic_nand_dev_ready; nand 346 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c nand->wp_gpio = devm_gpiod_get_optional(dev, "wp", GPIOD_OUT_LOW); nand 348 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c if (IS_ERR(nand->wp_gpio)) { nand 349 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c ret = PTR_ERR(nand->wp_gpio); nand 354 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c chip = &nand->chip; nand 383 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c list_add_tail(&nand->chip_list, &nfc->chips); nand 346 drivers/mtd/nand/raw/marvell_nand.c *nand) nand 348 drivers/mtd/nand/raw/marvell_nand.c return &nand->sels[nand->selected_die]; nand 109 drivers/mtd/nand/raw/meson_nand.c struct nand_chip nand; nand 217 drivers/mtd/nand/raw/meson_nand.c static struct meson_nfc_nand_chip *to_meson_nand(struct nand_chip *nand) nand 219 drivers/mtd/nand/raw/meson_nand.c return container_of(nand, struct meson_nfc_nand_chip, nand); nand 222 drivers/mtd/nand/raw/meson_nand.c static void meson_nfc_select_chip(struct nand_chip *nand, int chip) nand 224 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 225 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc *nfc = nand_get_controller_data(nand); nand 265 drivers/mtd/nand/raw/meson_nand.c static void meson_nfc_cmd_access(struct nand_chip *nand, int raw, bool dir, nand 268 drivers/mtd/nand/raw/meson_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 270 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 274 drivers/mtd/nand/raw/meson_nand.c pagesize = nand->ecc.size; nand 283 drivers/mtd/nand/raw/meson_nand.c pages = len / nand->ecc.size; nand 331 drivers/mtd/nand/raw/meson_nand.c static u8 *meson_nfc_oob_ptr(struct nand_chip *nand, int i) nand 333 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 336 drivers/mtd/nand/raw/meson_nand.c len = nand->ecc.size * (i + 1) + (nand->ecc.bytes + 2) * i; nand 341 drivers/mtd/nand/raw/meson_nand.c static u8 *meson_nfc_data_ptr(struct nand_chip *nand, int i) nand 343 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 346 drivers/mtd/nand/raw/meson_nand.c temp = nand->ecc.size + nand->ecc.bytes; nand 352 drivers/mtd/nand/raw/meson_nand.c static void meson_nfc_get_data_oob(struct nand_chip *nand, nand 358 drivers/mtd/nand/raw/meson_nand.c oob_len = nand->ecc.bytes + 2; nand 359 drivers/mtd/nand/raw/meson_nand.c for (i = 0; i < nand->ecc.steps; i++) { nand 361 drivers/mtd/nand/raw/meson_nand.c dsrc = meson_nfc_data_ptr(nand, i); nand 362 drivers/mtd/nand/raw/meson_nand.c memcpy(buf, dsrc, nand->ecc.size); nand 363 drivers/mtd/nand/raw/meson_nand.c buf += nand->ecc.size; nand 365 drivers/mtd/nand/raw/meson_nand.c osrc = meson_nfc_oob_ptr(nand, i); nand 371 drivers/mtd/nand/raw/meson_nand.c static void meson_nfc_set_data_oob(struct nand_chip *nand, nand 377 drivers/mtd/nand/raw/meson_nand.c oob_len = nand->ecc.bytes + 2; nand 378 drivers/mtd/nand/raw/meson_nand.c for (i = 0; i < nand->ecc.steps; i++) { nand 380 drivers/mtd/nand/raw/meson_nand.c dsrc = meson_nfc_data_ptr(nand, i); nand 381 drivers/mtd/nand/raw/meson_nand.c memcpy(dsrc, buf, nand->ecc.size); nand 382 drivers/mtd/nand/raw/meson_nand.c buf += nand->ecc.size; nand 384 drivers/mtd/nand/raw/meson_nand.c osrc = meson_nfc_oob_ptr(nand, i); nand 418 drivers/mtd/nand/raw/meson_nand.c static void meson_nfc_set_user_byte(struct nand_chip *nand, u8 *oob_buf) nand 420 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 424 drivers/mtd/nand/raw/meson_nand.c for (i = 0, count = 0; i < nand->ecc.steps; i++, count += 2) { nand 431 drivers/mtd/nand/raw/meson_nand.c static void meson_nfc_get_user_byte(struct nand_chip *nand, u8 *oob_buf) nand 433 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 437 drivers/mtd/nand/raw/meson_nand.c for (i = 0, count = 0; i < nand->ecc.steps; i++, count += 2) { nand 444 drivers/mtd/nand/raw/meson_nand.c static int meson_nfc_ecc_correct(struct nand_chip *nand, u32 *bitflips, nand 447 drivers/mtd/nand/raw/meson_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 448 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 452 drivers/mtd/nand/raw/meson_nand.c for (i = 0; i < nand->ecc.steps; i++) { nand 460 drivers/mtd/nand/raw/meson_nand.c if ((nand->options & NAND_NEED_SCRAMBLING) && nand 461 drivers/mtd/nand/raw/meson_nand.c ECC_ZERO_CNT(*info) < nand->ecc.strength) { nand 473 drivers/mtd/nand/raw/meson_nand.c static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, void *databuf, nand 477 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc *nfc = nand_get_controller_data(nand); nand 512 drivers/mtd/nand/raw/meson_nand.c static void meson_nfc_dma_buffer_release(struct nand_chip *nand, nand 516 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc *nfc = nand_get_controller_data(nand); nand 523 drivers/mtd/nand/raw/meson_nand.c static int meson_nfc_read_buf(struct nand_chip *nand, u8 *buf, int len) nand 525 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc *nfc = nand_get_controller_data(nand); nand 534 drivers/mtd/nand/raw/meson_nand.c ret = meson_nfc_dma_buffer_setup(nand, buf, len, info, nand 544 drivers/mtd/nand/raw/meson_nand.c meson_nfc_dma_buffer_release(nand, len, PER_INFO_BYTE, DMA_FROM_DEVICE); nand 552 drivers/mtd/nand/raw/meson_nand.c static int meson_nfc_write_buf(struct nand_chip *nand, u8 *buf, int len) nand 554 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc *nfc = nand_get_controller_data(nand); nand 558 drivers/mtd/nand/raw/meson_nand.c ret = meson_nfc_dma_buffer_setup(nand, buf, len, NULL, nand 568 drivers/mtd/nand/raw/meson_nand.c meson_nfc_dma_buffer_release(nand, len, 0, DMA_TO_DEVICE); nand 573 drivers/mtd/nand/raw/meson_nand.c static int meson_nfc_rw_cmd_prepare_and_execute(struct nand_chip *nand, nand 576 drivers/mtd/nand/raw/meson_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 577 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc *nfc = nand_get_controller_data(nand); nand 579 drivers/mtd/nand/raw/meson_nand.c nand_get_sdr_timings(&nand->data_interface); nand 602 drivers/mtd/nand/raw/meson_nand.c if (nand->options & NAND_ROW_ADDR_3) nand 626 drivers/mtd/nand/raw/meson_nand.c static int meson_nfc_write_page_sub(struct nand_chip *nand, nand 629 drivers/mtd/nand/raw/meson_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 631 drivers/mtd/nand/raw/meson_nand.c nand_get_sdr_timings(&nand->data_interface); nand 632 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 633 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc *nfc = nand_get_controller_data(nand); nand 638 drivers/mtd/nand/raw/meson_nand.c meson_nfc_select_chip(nand, nand->cur_cs); nand 641 drivers/mtd/nand/raw/meson_nand.c info_len = nand->ecc.steps * PER_INFO_BYTE; nand 643 drivers/mtd/nand/raw/meson_nand.c ret = meson_nfc_rw_cmd_prepare_and_execute(nand, page, DIRWRITE); nand 647 drivers/mtd/nand/raw/meson_nand.c ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, nand 653 drivers/mtd/nand/raw/meson_nand.c if (nand->options & NAND_NEED_SCRAMBLING) { nand 655 drivers/mtd/nand/raw/meson_nand.c meson_nfc_cmd_access(nand, raw, DIRWRITE, nand 658 drivers/mtd/nand/raw/meson_nand.c meson_nfc_cmd_access(nand, raw, DIRWRITE, nand 666 drivers/mtd/nand/raw/meson_nand.c meson_nfc_dma_buffer_release(nand, data_len, info_len, DMA_TO_DEVICE); nand 671 drivers/mtd/nand/raw/meson_nand.c static int meson_nfc_write_page_raw(struct nand_chip *nand, const u8 *buf, nand 674 drivers/mtd/nand/raw/meson_nand.c u8 *oob_buf = nand->oob_poi; nand 676 drivers/mtd/nand/raw/meson_nand.c meson_nfc_set_data_oob(nand, buf, oob_buf); nand 678 drivers/mtd/nand/raw/meson_nand.c return meson_nfc_write_page_sub(nand, page, 1); nand 681 drivers/mtd/nand/raw/meson_nand.c static int meson_nfc_write_page_hwecc(struct nand_chip *nand, nand 684 drivers/mtd/nand/raw/meson_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 685 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 686 drivers/mtd/nand/raw/meson_nand.c u8 *oob_buf = nand->oob_poi; nand 689 drivers/mtd/nand/raw/meson_nand.c memset(meson_chip->info_buf, 0, nand->ecc.steps * PER_INFO_BYTE); nand 690 drivers/mtd/nand/raw/meson_nand.c meson_nfc_set_user_byte(nand, oob_buf); nand 692 drivers/mtd/nand/raw/meson_nand.c return meson_nfc_write_page_sub(nand, page, 0); nand 696 drivers/mtd/nand/raw/meson_nand.c struct nand_chip *nand, int raw) nand 698 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 703 drivers/mtd/nand/raw/meson_nand.c neccpages = raw ? 1 : nand->ecc.steps; nand 713 drivers/mtd/nand/raw/meson_nand.c static int meson_nfc_read_page_sub(struct nand_chip *nand, nand 716 drivers/mtd/nand/raw/meson_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 717 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc *nfc = nand_get_controller_data(nand); nand 718 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 722 drivers/mtd/nand/raw/meson_nand.c meson_nfc_select_chip(nand, nand->cur_cs); nand 725 drivers/mtd/nand/raw/meson_nand.c info_len = nand->ecc.steps * PER_INFO_BYTE; nand 727 drivers/mtd/nand/raw/meson_nand.c ret = meson_nfc_rw_cmd_prepare_and_execute(nand, page, DIRREAD); nand 731 drivers/mtd/nand/raw/meson_nand.c ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, nand 737 drivers/mtd/nand/raw/meson_nand.c if (nand->options & NAND_NEED_SCRAMBLING) { nand 739 drivers/mtd/nand/raw/meson_nand.c meson_nfc_cmd_access(nand, raw, DIRREAD, nand 742 drivers/mtd/nand/raw/meson_nand.c meson_nfc_cmd_access(nand, raw, DIRREAD, nand 747 drivers/mtd/nand/raw/meson_nand.c meson_nfc_check_ecc_pages_valid(nfc, nand, raw); nand 749 drivers/mtd/nand/raw/meson_nand.c meson_nfc_dma_buffer_release(nand, data_len, info_len, DMA_FROM_DEVICE); nand 754 drivers/mtd/nand/raw/meson_nand.c static int meson_nfc_read_page_raw(struct nand_chip *nand, u8 *buf, nand 757 drivers/mtd/nand/raw/meson_nand.c u8 *oob_buf = nand->oob_poi; nand 760 drivers/mtd/nand/raw/meson_nand.c ret = meson_nfc_read_page_sub(nand, page, 1); nand 764 drivers/mtd/nand/raw/meson_nand.c meson_nfc_get_data_oob(nand, buf, oob_buf); nand 769 drivers/mtd/nand/raw/meson_nand.c static int meson_nfc_read_page_hwecc(struct nand_chip *nand, u8 *buf, nand 772 drivers/mtd/nand/raw/meson_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 773 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 774 drivers/mtd/nand/raw/meson_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 777 drivers/mtd/nand/raw/meson_nand.c u8 *oob_buf = nand->oob_poi; nand 780 drivers/mtd/nand/raw/meson_nand.c ret = meson_nfc_read_page_sub(nand, page, 0); nand 784 drivers/mtd/nand/raw/meson_nand.c meson_nfc_get_user_byte(nand, oob_buf); nand 785 drivers/mtd/nand/raw/meson_nand.c ret = meson_nfc_ecc_correct(nand, &bitflips, &correct_bitmap); nand 791 drivers/mtd/nand/raw/meson_nand.c if ((nand->options & NAND_NEED_SCRAMBLING) || !buf) { nand 795 drivers/mtd/nand/raw/meson_nand.c ret = meson_nfc_read_page_raw(nand, buf, 0, page); nand 799 drivers/mtd/nand/raw/meson_nand.c for (i = 0; i < nand->ecc.steps ; i++) { nand 801 drivers/mtd/nand/raw/meson_nand.c u8 *oob = nand->oob_poi + i * (ecc->bytes + 2); nand 823 drivers/mtd/nand/raw/meson_nand.c static int meson_nfc_read_oob_raw(struct nand_chip *nand, int page) nand 825 drivers/mtd/nand/raw/meson_nand.c return meson_nfc_read_page_raw(nand, NULL, 1, page); nand 828 drivers/mtd/nand/raw/meson_nand.c static int meson_nfc_read_oob(struct nand_chip *nand, int page) nand 830 drivers/mtd/nand/raw/meson_nand.c return meson_nfc_read_page_hwecc(nand, NULL, 1, page); nand 892 drivers/mtd/nand/raw/meson_nand.c static int meson_nfc_exec_op(struct nand_chip *nand, nand 895 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 896 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc *nfc = nand_get_controller_data(nand); nand 902 drivers/mtd/nand/raw/meson_nand.c meson_nfc_select_chip(nand, op->cs); nand 929 drivers/mtd/nand/raw/meson_nand.c meson_nfc_read_buf(nand, buf, instr->ctx.data.len); nand 937 drivers/mtd/nand/raw/meson_nand.c meson_nfc_write_buf(nand, buf, instr->ctx.data.len); nand 955 drivers/mtd/nand/raw/meson_nand.c struct nand_chip *nand = mtd_to_nand(mtd); nand 957 drivers/mtd/nand/raw/meson_nand.c if (section >= nand->ecc.steps) nand 960 drivers/mtd/nand/raw/meson_nand.c oobregion->offset = 2 + (section * (2 + nand->ecc.bytes)); nand 961 drivers/mtd/nand/raw/meson_nand.c oobregion->length = nand->ecc.bytes; nand 969 drivers/mtd/nand/raw/meson_nand.c struct nand_chip *nand = mtd_to_nand(mtd); nand 971 drivers/mtd/nand/raw/meson_nand.c if (section >= nand->ecc.steps) nand 974 drivers/mtd/nand/raw/meson_nand.c oobregion->offset = section * (2 + nand->ecc.bytes); nand 1064 drivers/mtd/nand/raw/meson_nand.c static void meson_nfc_free_buffer(struct nand_chip *nand) nand 1066 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 1072 drivers/mtd/nand/raw/meson_nand.c static int meson_chip_buffer_init(struct nand_chip *nand) nand 1074 drivers/mtd/nand/raw/meson_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 1075 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 1078 drivers/mtd/nand/raw/meson_nand.c nsectors = mtd->writesize / nand->ecc.size; nand 1097 drivers/mtd/nand/raw/meson_nand.c int meson_nfc_setup_data_interface(struct nand_chip *nand, int csline, nand 1100 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 1139 drivers/mtd/nand/raw/meson_nand.c static int meson_nand_bch_mode(struct nand_chip *nand) nand 1141 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 1144 drivers/mtd/nand/raw/meson_nand.c if (nand->ecc.strength > 60 || nand->ecc.strength < 8) nand 1148 drivers/mtd/nand/raw/meson_nand.c if (meson_ecc[i].strength == nand->ecc.strength) { nand 1157 drivers/mtd/nand/raw/meson_nand.c static void meson_nand_detach_chip(struct nand_chip *nand) nand 1159 drivers/mtd/nand/raw/meson_nand.c meson_nfc_free_buffer(nand); nand 1162 drivers/mtd/nand/raw/meson_nand.c static int meson_nand_attach_chip(struct nand_chip *nand) nand 1164 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc *nfc = nand_get_controller_data(nand); nand 1165 drivers/mtd/nand/raw/meson_nand.c struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); nand 1166 drivers/mtd/nand/raw/meson_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 1179 drivers/mtd/nand/raw/meson_nand.c if (nand->bbt_options & NAND_BBT_USE_FLASH) nand 1180 drivers/mtd/nand/raw/meson_nand.c nand->bbt_options |= NAND_BBT_NO_OOB; nand 1182 drivers/mtd/nand/raw/meson_nand.c nand->options |= NAND_NO_SUBPAGE_WRITE; nand 1184 drivers/mtd/nand/raw/meson_nand.c ret = nand_ecc_choose_conf(nand, nfc->data->ecc_caps, nand 1193 drivers/mtd/nand/raw/meson_nand.c ret = meson_nand_bch_mode(nand); nand 1197 drivers/mtd/nand/raw/meson_nand.c nand->ecc.mode = NAND_ECC_HW; nand 1198 drivers/mtd/nand/raw/meson_nand.c nand->ecc.write_page_raw = meson_nfc_write_page_raw; nand 1199 drivers/mtd/nand/raw/meson_nand.c nand->ecc.write_page = meson_nfc_write_page_hwecc; nand 1200 drivers/mtd/nand/raw/meson_nand.c nand->ecc.write_oob_raw = nand_write_oob_std; nand 1201 drivers/mtd/nand/raw/meson_nand.c nand->ecc.write_oob = nand_write_oob_std; nand 1203 drivers/mtd/nand/raw/meson_nand.c nand->ecc.read_page_raw = meson_nfc_read_page_raw; nand 1204 drivers/mtd/nand/raw/meson_nand.c nand->ecc.read_page = meson_nfc_read_page_hwecc; nand 1205 drivers/mtd/nand/raw/meson_nand.c nand->ecc.read_oob_raw = meson_nfc_read_oob_raw; nand 1206 drivers/mtd/nand/raw/meson_nand.c nand->ecc.read_oob = meson_nfc_read_oob; nand 1208 drivers/mtd/nand/raw/meson_nand.c if (nand->options & NAND_BUSWIDTH_16) { nand 1212 drivers/mtd/nand/raw/meson_nand.c ret = meson_chip_buffer_init(nand); nand 1231 drivers/mtd/nand/raw/meson_nand.c struct nand_chip *nand; nand 1263 drivers/mtd/nand/raw/meson_nand.c nand = &meson_chip->nand; nand 1264 drivers/mtd/nand/raw/meson_nand.c nand->controller = &nfc->controller; nand 1265 drivers/mtd/nand/raw/meson_nand.c nand->controller->ops = &meson_nand_controller_ops; nand 1266 drivers/mtd/nand/raw/meson_nand.c nand_set_flash_node(nand, np); nand 1267 drivers/mtd/nand/raw/meson_nand.c nand_set_controller_data(nand, nfc); nand 1269 drivers/mtd/nand/raw/meson_nand.c nand->options |= NAND_USE_BOUNCE_BUFFER; nand 1270 drivers/mtd/nand/raw/meson_nand.c mtd = nand_to_mtd(nand); nand 1274 drivers/mtd/nand/raw/meson_nand.c ret = nand_scan(nand, nsels); nand 1281 drivers/mtd/nand/raw/meson_nand.c nand_cleanup(nand); nand 1299 drivers/mtd/nand/raw/meson_nand.c mtd = nand_to_mtd(&meson_chip->nand); nand 1304 drivers/mtd/nand/raw/meson_nand.c meson_nfc_free_buffer(&meson_chip->nand); nand 1305 drivers/mtd/nand/raw/meson_nand.c nand_cleanup(&meson_chip->nand); nand 253 drivers/mtd/nand/raw/mpc5121_nfc.c static void mpc5121_nfc_select_chip(struct nand_chip *nand, int chip) nand 255 drivers/mtd/nand/raw/mpc5121_nfc.c struct mtd_info *mtd = nand_to_mtd(nand); nand 291 drivers/mtd/nand/raw/mpc5121_nfc.c static void ads5121_select_chip(struct nand_chip *nand, int chip) nand 293 drivers/mtd/nand/raw/mpc5121_nfc.c struct mtd_info *mtd = nand_to_mtd(nand); nand 294 drivers/mtd/nand/raw/mpc5121_nfc.c struct mpc5121_nfc_prv *prv = nand_get_controller_data(nand); nand 301 drivers/mtd/nand/raw/mpc5121_nfc.c mpc5121_nfc_select_chip(nand, 0); nand 304 drivers/mtd/nand/raw/mpc5121_nfc.c mpc5121_nfc_select_chip(nand, -1); nand 310 drivers/mtd/nand/raw/mpc5121_nfc.c static int mpc5121_nfc_dev_ready(struct nand_chip *nand) nand 396 drivers/mtd/nand/raw/mpc5121_nfc.c struct nand_chip *nand = mtd_to_nand(mtd); nand 397 drivers/mtd/nand/raw/mpc5121_nfc.c struct mpc5121_nfc_prv *prv = nand_get_controller_data(nand); nand 127 drivers/mtd/nand/raw/mtk_nand.c struct nand_chip nand; nand 179 drivers/mtd/nand/raw/mtk_nand.c static inline struct mtk_nfc_nand_chip *to_mtk_nand(struct nand_chip *nand) nand 181 drivers/mtd/nand/raw/mtk_nand.c return container_of(nand, struct mtk_nfc_nand_chip, nand); nand 390 drivers/mtd/nand/raw/mtk_nand.c static void mtk_nfc_select_chip(struct nand_chip *nand, int chip) nand 392 drivers/mtd/nand/raw/mtk_nand.c struct mtk_nfc *nfc = nand_get_controller_data(nand); nand 393 drivers/mtd/nand/raw/mtk_nand.c struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(nand); nand 398 drivers/mtd/nand/raw/mtk_nand.c mtk_nfc_hw_runtime_config(nand_to_mtd(nand)); nand 403 drivers/mtd/nand/raw/mtk_nand.c static int mtk_nfc_dev_ready(struct nand_chip *nand) nand 405 drivers/mtd/nand/raw/mtk_nand.c struct mtk_nfc *nfc = nand_get_controller_data(nand); nand 632 drivers/mtd/nand/raw/mtk_nand.c struct mtk_nfc_nand_chip *nand = to_mtk_nand(chip); nand 633 drivers/mtd/nand/raw/mtk_nand.c u32 bad_pos = nand->bad_mark.pos; nand 636 drivers/mtd/nand/raw/mtk_nand.c bad_pos += nand->bad_mark.sec * mtk_data_len(chip); nand 638 drivers/mtd/nand/raw/mtk_nand.c bad_pos += nand->bad_mark.sec * chip->ecc.size; nand 1159 drivers/mtd/nand/raw/mtk_nand.c struct nand_chip *nand = mtd_to_nand(mtd); nand 1160 drivers/mtd/nand/raw/mtk_nand.c struct mtk_nfc_nand_chip *chip = to_mtk_nand(nand); nand 1161 drivers/mtd/nand/raw/mtk_nand.c struct mtk_nfc *nfc = nand_get_controller_data(nand); nand 1164 drivers/mtd/nand/raw/mtk_nand.c ecc_bytes = DIV_ROUND_UP(nand->ecc.strength * nand 1178 drivers/mtd/nand/raw/mtk_nand.c struct nand_chip *nand = mtd_to_nand(mtd); nand 1184 drivers/mtd/nand/raw/mtk_nand.c bm_ctl->sec = mtd->writesize / mtk_data_len(nand); nand 1185 drivers/mtd/nand/raw/mtk_nand.c bm_ctl->pos = mtd->writesize % mtk_data_len(nand); nand 1191 drivers/mtd/nand/raw/mtk_nand.c struct nand_chip *nand = mtd_to_nand(mtd); nand 1192 drivers/mtd/nand/raw/mtk_nand.c struct mtk_nfc *nfc = nand_get_controller_data(nand); nand 1196 drivers/mtd/nand/raw/mtk_nand.c eccsteps = mtd->writesize / nand->ecc.size; nand 1199 drivers/mtd/nand/raw/mtk_nand.c if (nand->ecc.size == 1024) nand 1215 drivers/mtd/nand/raw/mtk_nand.c if (nand->ecc.size == 1024) nand 1223 drivers/mtd/nand/raw/mtk_nand.c struct nand_chip *nand = mtd_to_nand(mtd); nand 1224 drivers/mtd/nand/raw/mtk_nand.c struct mtk_nfc *nfc = nand_get_controller_data(nand); nand 1229 drivers/mtd/nand/raw/mtk_nand.c if (nand->ecc.mode != NAND_ECC_HW) { nand 1235 drivers/mtd/nand/raw/mtk_nand.c if (!nand->ecc.size || !nand->ecc.strength) { nand 1237 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.strength = nand->base.eccreq.strength; nand 1238 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.size = nand->base.eccreq.step_size; nand 1244 drivers/mtd/nand/raw/mtk_nand.c if (nand->ecc.size < 1024) { nand 1247 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.size = 1024; nand 1248 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.strength <<= 1; nand 1250 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.size = 512; nand 1253 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.size = 1024; nand 1261 drivers/mtd/nand/raw/mtk_nand.c free = (nand->ecc.strength * mtk_ecc_get_parity_bits(nfc->ecc) nand 1272 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.strength = (spare << 3) / nand 1276 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.strength = (spare << 3) / nand 1281 drivers/mtd/nand/raw/mtk_nand.c mtk_ecc_adjust_strength(nfc->ecc, &nand->ecc.strength); nand 1284 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.size, nand->ecc.strength); nand 1335 drivers/mtd/nand/raw/mtk_nand.c struct nand_chip *nand; nand 1377 drivers/mtd/nand/raw/mtk_nand.c nand = &chip->nand; nand 1378 drivers/mtd/nand/raw/mtk_nand.c nand->controller = &nfc->controller; nand 1380 drivers/mtd/nand/raw/mtk_nand.c nand_set_flash_node(nand, np); nand 1381 drivers/mtd/nand/raw/mtk_nand.c nand_set_controller_data(nand, nfc); nand 1383 drivers/mtd/nand/raw/mtk_nand.c nand->options |= NAND_USE_BOUNCE_BUFFER | NAND_SUBPAGE_READ; nand 1384 drivers/mtd/nand/raw/mtk_nand.c nand->legacy.dev_ready = mtk_nfc_dev_ready; nand 1385 drivers/mtd/nand/raw/mtk_nand.c nand->legacy.select_chip = mtk_nfc_select_chip; nand 1386 drivers/mtd/nand/raw/mtk_nand.c nand->legacy.write_byte = mtk_nfc_write_byte; nand 1387 drivers/mtd/nand/raw/mtk_nand.c nand->legacy.write_buf = mtk_nfc_write_buf; nand 1388 drivers/mtd/nand/raw/mtk_nand.c nand->legacy.read_byte = mtk_nfc_read_byte; nand 1389 drivers/mtd/nand/raw/mtk_nand.c nand->legacy.read_buf = mtk_nfc_read_buf; nand 1390 drivers/mtd/nand/raw/mtk_nand.c nand->legacy.cmd_ctrl = mtk_nfc_cmd_ctrl; nand 1393 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.mode = NAND_ECC_HW; nand 1395 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.write_subpage = mtk_nfc_write_subpage_hwecc; nand 1396 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.write_page_raw = mtk_nfc_write_page_raw; nand 1397 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.write_page = mtk_nfc_write_page_hwecc; nand 1398 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.write_oob_raw = mtk_nfc_write_oob_std; nand 1399 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.write_oob = mtk_nfc_write_oob_std; nand 1401 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.read_subpage = mtk_nfc_read_subpage_hwecc; nand 1402 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.read_page_raw = mtk_nfc_read_page_raw; nand 1403 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.read_page = mtk_nfc_read_page_hwecc; nand 1404 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.read_oob_raw = mtk_nfc_read_oob_std; nand 1405 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.read_oob = mtk_nfc_read_oob_std; nand 1407 drivers/mtd/nand/raw/mtk_nand.c mtd = nand_to_mtd(nand); nand 1415 drivers/mtd/nand/raw/mtk_nand.c ret = nand_scan(nand, nsels); nand 1422 drivers/mtd/nand/raw/mtk_nand.c nand_release(nand); nand 1587 drivers/mtd/nand/raw/mtk_nand.c nand_release(&chip->nand); nand 1611 drivers/mtd/nand/raw/mtk_nand.c struct nand_chip *nand; nand 1623 drivers/mtd/nand/raw/mtk_nand.c nand = &chip->nand; nand 1625 drivers/mtd/nand/raw/mtk_nand.c nand_reset(nand, i); nand 163 drivers/mtd/nand/raw/mxc_nand.c struct nand_chip nand; nand 1775 drivers/mtd/nand/raw/mxc_nand.c this = &host->nand; nand 1923 drivers/mtd/nand/raw/mxc_nand.c nand_release(&host->nand); nand 5461 drivers/mtd/nand/raw/nand_base.c static int rawnand_erase(struct nand_device *nand, const struct nand_pos *pos) nand 5463 drivers/mtd/nand/raw/nand_base.c struct nand_chip *chip = container_of(nand, struct nand_chip, nand 5465 drivers/mtd/nand/raw/nand_base.c unsigned int eb = nanddev_pos_to_row(nand, pos); nand 5468 drivers/mtd/nand/raw/nand_base.c eb >>= nand->rowconv.eraseblock_addr_shift; nand 5477 drivers/mtd/nand/raw/nand_base.c static int rawnand_markbad(struct nand_device *nand, nand 5480 drivers/mtd/nand/raw/nand_base.c struct nand_chip *chip = container_of(nand, struct nand_chip, nand 5483 drivers/mtd/nand/raw/nand_base.c return nand_markbad_bbm(chip, nanddev_pos_to_offs(nand, pos)); nand 5486 drivers/mtd/nand/raw/nand_base.c static bool rawnand_isbad(struct nand_device *nand, const struct nand_pos *pos) nand 5488 drivers/mtd/nand/raw/nand_base.c struct nand_chip *chip = container_of(nand, struct nand_chip, nand 5493 drivers/mtd/nand/raw/nand_base.c ret = nand_isbad_bbm(chip, nanddev_pos_to_offs(nand, pos)); nand 108 drivers/mtd/nand/raw/nand_bch.c struct nand_chip *nand = mtd_to_nand(mtd); nand 112 drivers/mtd/nand/raw/nand_bch.c unsigned int eccsize = nand->ecc.size; nand 113 drivers/mtd/nand/raw/nand_bch.c unsigned int eccbytes = nand->ecc.bytes; nand 114 drivers/mtd/nand/raw/nand_bch.c unsigned int eccstrength = nand->ecc.strength; nand 118 drivers/mtd/nand/raw/nand_bch.c nand->ecc.bytes = eccbytes; nand 166 drivers/mtd/nand/raw/nand_bch.c nand->ecc.steps = eccsteps; nand 167 drivers/mtd/nand/raw/nand_bch.c nand->ecc.total = eccsteps * eccbytes; nand 192 drivers/mtd/nand/raw/nand_bch.c nand->ecc.strength = (eccbytes * 8) / fls(8 * eccsize); nand 145 drivers/mtd/nand/raw/omap2.c struct nand_chip nand; nand 178 drivers/mtd/nand/raw/omap2.c return container_of(mtd_to_nand(mtd), struct omap_nand_info, nand); nand 273 drivers/mtd/nand/raw/omap2.c struct nand_chip *nand = mtd_to_nand(mtd); nand 275 drivers/mtd/nand/raw/omap2.c ioread8_rep(nand->legacy.IO_ADDR_R, buf, len); nand 291 drivers/mtd/nand/raw/omap2.c iowrite8(*p++, info->nand.legacy.IO_ADDR_W); nand 307 drivers/mtd/nand/raw/omap2.c struct nand_chip *nand = mtd_to_nand(mtd); nand 309 drivers/mtd/nand/raw/omap2.c ioread16_rep(nand->legacy.IO_ADDR_R, buf, len / 2); nand 327 drivers/mtd/nand/raw/omap2.c iowrite16(*p++, info->nand.legacy.IO_ADDR_W); nand 351 drivers/mtd/nand/raw/omap2.c if (info->nand.options & NAND_BUSWIDTH_16) nand 364 drivers/mtd/nand/raw/omap2.c if (info->nand.options & NAND_BUSWIDTH_16) nand 373 drivers/mtd/nand/raw/omap2.c ioread32_rep(info->nand.legacy.IO_ADDR_R, p, r_count); nand 401 drivers/mtd/nand/raw/omap2.c writeb(*buf, info->nand.legacy.IO_ADDR_W); nand 411 drivers/mtd/nand/raw/omap2.c if (info->nand.options & NAND_BUSWIDTH_16) nand 421 drivers/mtd/nand/raw/omap2.c iowrite16(*p++, info->nand.legacy.IO_ADDR_W); nand 519 drivers/mtd/nand/raw/omap2.c if (info->nand.options & NAND_BUSWIDTH_16) nand 585 drivers/mtd/nand/raw/omap2.c iowrite32_rep(info->nand.legacy.IO_ADDR_W, (u32 *)info->buf, nand 591 drivers/mtd/nand/raw/omap2.c ioread32_rep(info->nand.legacy.IO_ADDR_R, (u32 *)info->buf, nand 652 drivers/mtd/nand/raw/omap2.c if (info->nand.options & NAND_BUSWIDTH_16) nand 711 drivers/mtd/nand/raw/omap2.c if (info->nand.options & NAND_BUSWIDTH_16) nand 887 drivers/mtd/nand/raw/omap2.c if ((info->nand.ecc.mode == NAND_ECC_HW) && nand 888 drivers/mtd/nand/raw/omap2.c (info->nand.ecc.size == 2048)) nand 956 drivers/mtd/nand/raw/omap2.c val = ((((info->nand.ecc.size >> 1) - 1) << ECCSIZE1_SHIFT) | nand 1144 drivers/mtd/nand/raw/omap2.c int eccbytes = info->nand.ecc.bytes; nand 1286 drivers/mtd/nand/raw/omap2.c int eccbytes = info->nand.ecc.bytes; nand 1317 drivers/mtd/nand/raw/omap2.c for (i = 0; i < info->nand.ecc.size; i++) { nand 1319 drivers/mtd/nand/raw/omap2.c if (flip_bits > info->nand.ecc.strength) nand 1323 drivers/mtd/nand/raw/omap2.c for (i = 0; i < info->nand.ecc.bytes - 1; i++) { nand 1325 drivers/mtd/nand/raw/omap2.c if (flip_bits > info->nand.ecc.strength) nand 1334 drivers/mtd/nand/raw/omap2.c memset(data, 0xFF, info->nand.ecc.size); nand 1335 drivers/mtd/nand/raw/omap2.c memset(oob, 0xFF, info->nand.ecc.bytes); nand 1356 drivers/mtd/nand/raw/omap2.c struct nand_ecc_ctrl *ecc = &info->nand.ecc; nand 1357 drivers/mtd/nand/raw/omap2.c int eccsteps = info->nand.ecc.steps; nand 1415 drivers/mtd/nand/raw/omap2.c buf = &data[info->nand.ecc.size * i]; nand 1820 drivers/mtd/nand/raw/omap2.c struct nand_chip *chip = &info->nand; nand 1840 drivers/mtd/nand/raw/omap2.c struct nand_chip *chip = &info->nand; nand 2199 drivers/mtd/nand/raw/omap2.c nand_chip = &info->nand; nand 1116 drivers/mtd/nand/raw/sh_flctl.c struct nand_chip *nand; nand 1155 drivers/mtd/nand/raw/sh_flctl.c nand = &flctl->chip; nand 1156 drivers/mtd/nand/raw/sh_flctl.c flctl_mtd = nand_to_mtd(nand); nand 1157 drivers/mtd/nand/raw/sh_flctl.c nand_set_flash_node(nand, pdev->dev.of_node); nand 1167 drivers/mtd/nand/raw/sh_flctl.c nand->legacy.chip_delay = 20; nand 1169 drivers/mtd/nand/raw/sh_flctl.c nand->legacy.read_byte = flctl_read_byte; nand 1170 drivers/mtd/nand/raw/sh_flctl.c nand->legacy.write_buf = flctl_write_buf; nand 1171 drivers/mtd/nand/raw/sh_flctl.c nand->legacy.read_buf = flctl_read_buf; nand 1172 drivers/mtd/nand/raw/sh_flctl.c nand->legacy.select_chip = flctl_select_chip; nand 1173 drivers/mtd/nand/raw/sh_flctl.c nand->legacy.cmdfunc = flctl_cmdfunc; nand 1174 drivers/mtd/nand/raw/sh_flctl.c nand->legacy.set_features = nand_get_set_features_notsupp; nand 1175 drivers/mtd/nand/raw/sh_flctl.c nand->legacy.get_features = nand_get_set_features_notsupp; nand 1178 drivers/mtd/nand/raw/sh_flctl.c nand->options |= NAND_BUSWIDTH_16; nand 1180 drivers/mtd/nand/raw/sh_flctl.c nand->options |= NAND_BBM_FIRSTPAGE | NAND_BBM_SECONDPAGE; nand 1187 drivers/mtd/nand/raw/sh_flctl.c nand->legacy.dummy_controller.ops = &flctl_nand_controller_ops; nand 1188 drivers/mtd/nand/raw/sh_flctl.c ret = nand_scan(nand, 1); nand 1199 drivers/mtd/nand/raw/sh_flctl.c nand_cleanup(nand); nand 252 drivers/mtd/nand/raw/stm32_fmc2_nand.c struct stm32_fmc2_nand nand; nand 288 drivers/mtd/nand/raw/stm32_fmc2_nand.c struct stm32_fmc2_nand *nand = to_fmc2_nand(chip); nand 289 drivers/mtd/nand/raw/stm32_fmc2_nand.c struct stm32_fmc2_timings *timings = &nand->timings; nand 348 drivers/mtd/nand/raw/stm32_fmc2_nand.c struct stm32_fmc2_nand *nand = to_fmc2_nand(chip); nand 352 drivers/mtd/nand/raw/stm32_fmc2_nand.c if (nand->cs_used[chipnr] == fmc2->cs_sel) nand 355 drivers/mtd/nand/raw/stm32_fmc2_nand.c fmc2->cs_sel = nand->cs_used[chipnr]; nand 1460 drivers/mtd/nand/raw/stm32_fmc2_nand.c struct stm32_fmc2_nand *nand = to_fmc2_nand(chip); nand 1461 drivers/mtd/nand/raw/stm32_fmc2_nand.c struct stm32_fmc2_timings *tims = &nand->timings; nand 1793 drivers/mtd/nand/raw/stm32_fmc2_nand.c struct stm32_fmc2_nand *nand = &fmc2->nand; nand 1797 drivers/mtd/nand/raw/stm32_fmc2_nand.c if (!of_get_property(dn, "reg", &nand->ncs)) nand 1800 drivers/mtd/nand/raw/stm32_fmc2_nand.c nand->ncs /= sizeof(u32); nand 1801 drivers/mtd/nand/raw/stm32_fmc2_nand.c if (!nand->ncs) { nand 1806 drivers/mtd/nand/raw/stm32_fmc2_nand.c for (i = 0; i < nand->ncs; i++) { nand 1825 drivers/mtd/nand/raw/stm32_fmc2_nand.c nand->cs_used[i] = cs; nand 1828 drivers/mtd/nand/raw/stm32_fmc2_nand.c nand_set_flash_node(&nand->chip, dn); nand 1866 drivers/mtd/nand/raw/stm32_fmc2_nand.c struct stm32_fmc2_nand *nand; nand 1956 drivers/mtd/nand/raw/stm32_fmc2_nand.c nand = &fmc2->nand; nand 1957 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip = &nand->chip; nand 1971 drivers/mtd/nand/raw/stm32_fmc2_nand.c ret = nand_scan(chip, nand->ncs); nand 2005 drivers/mtd/nand/raw/stm32_fmc2_nand.c struct stm32_fmc2_nand *nand = &fmc2->nand; nand 2007 drivers/mtd/nand/raw/stm32_fmc2_nand.c nand_release(&nand->chip); nand 2038 drivers/mtd/nand/raw/stm32_fmc2_nand.c struct stm32_fmc2_nand *nand = &fmc2->nand; nand 2055 drivers/mtd/nand/raw/stm32_fmc2_nand.c nand_reset(&nand->chip, chip_cs); nand 193 drivers/mtd/nand/raw/sunxi_nand.c struct nand_chip nand; nand 201 drivers/mtd/nand/raw/sunxi_nand.c static inline struct sunxi_nand_chip *to_sunxi_nand(struct nand_chip *nand) nand 203 drivers/mtd/nand/raw/sunxi_nand.c return container_of(nand, struct sunxi_nand_chip, nand); nand 405 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_select_chip(struct nand_chip *nand, unsigned int cs) nand 407 drivers/mtd/nand/raw/sunxi_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 408 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nand_chip *sunxi_nand = to_sunxi_nand(nand); nand 409 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(sunxi_nand->nand.controller); nand 420 drivers/mtd/nand/raw/sunxi_nand.c ctl |= NFC_CE_SEL(sel->cs) | NFC_EN | NFC_PAGE_SHIFT(nand->page_shift); nand 436 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_read_buf(struct nand_chip *nand, uint8_t *buf, int len) nand 438 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nand_chip *sunxi_nand = to_sunxi_nand(nand); nand 439 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(sunxi_nand->nand.controller); nand 473 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_write_buf(struct nand_chip *nand, const uint8_t *buf, nand 476 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nand_chip *sunxi_nand = to_sunxi_nand(nand); nand 477 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(sunxi_nand->nand.controller); nand 592 drivers/mtd/nand/raw/sunxi_nand.c static u16 sunxi_nfc_randomizer_state(struct nand_chip *nand, int page, nand 595 drivers/mtd/nand/raw/sunxi_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 612 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_randomizer_config(struct nand_chip *nand, int page, nand 615 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); nand 619 drivers/mtd/nand/raw/sunxi_nand.c if (!(nand->options & NAND_NEED_SCRAMBLING)) nand 623 drivers/mtd/nand/raw/sunxi_nand.c state = sunxi_nfc_randomizer_state(nand, page, ecc); nand 628 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_randomizer_enable(struct nand_chip *nand) nand 630 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); nand 632 drivers/mtd/nand/raw/sunxi_nand.c if (!(nand->options & NAND_NEED_SCRAMBLING)) nand 639 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_randomizer_disable(struct nand_chip *nand) nand 641 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); nand 643 drivers/mtd/nand/raw/sunxi_nand.c if (!(nand->options & NAND_NEED_SCRAMBLING)) nand 650 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_randomize_bbm(struct nand_chip *nand, int page, u8 *bbm) nand 652 drivers/mtd/nand/raw/sunxi_nand.c u16 state = sunxi_nfc_randomizer_state(nand, page, true); nand 658 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_randomizer_write_buf(struct nand_chip *nand, nand 662 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_config(nand, page, ecc); nand 663 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_enable(nand); nand 664 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_write_buf(nand, buf, len); nand 665 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_disable(nand); nand 668 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_randomizer_read_buf(struct nand_chip *nand, uint8_t *buf, nand 671 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_config(nand, page, ecc); nand 672 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_enable(nand); nand 673 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_read_buf(nand, buf, len); nand 674 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_disable(nand); nand 677 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_hw_ecc_enable(struct nand_chip *nand) nand 679 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); nand 680 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nand_hw_ecc *data = nand->ecc.priv; nand 689 drivers/mtd/nand/raw/sunxi_nand.c if (nand->ecc.size == 512) nand 695 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_hw_ecc_disable(struct nand_chip *nand) nand 697 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); nand 716 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_hw_ecc_get_prot_oob_bytes(struct nand_chip *nand, u8 *oob, nand 719 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); nand 725 drivers/mtd/nand/raw/sunxi_nand.c if (bbm && (nand->options & NAND_NEED_SCRAMBLING)) nand 726 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomize_bbm(nand, page, oob); nand 729 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_hw_ecc_set_prot_oob_bytes(struct nand_chip *nand, nand 733 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); nand 737 drivers/mtd/nand/raw/sunxi_nand.c if (bbm && (nand->options & NAND_NEED_SCRAMBLING)) { nand 739 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomize_bbm(nand, page, user_data); nand 747 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_hw_ecc_update_stats(struct nand_chip *nand, nand 750 drivers/mtd/nand/raw/sunxi_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 760 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_hw_ecc_correct(struct nand_chip *nand, u8 *data, u8 *oob, nand 763 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); nand 764 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 796 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_hw_ecc_read_chunk(struct nand_chip *nand, nand 803 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); nand 804 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 810 drivers/mtd/nand/raw/sunxi_nand.c nand_change_read_column_op(nand, data_off, NULL, 0, false); nand 812 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_read_buf(nand, NULL, ecc->size, false, page); nand 815 drivers/mtd/nand/raw/sunxi_nand.c nand_change_read_column_op(nand, oob_off, NULL, 0, false); nand 821 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_enable(nand); nand 826 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_disable(nand); nand 832 drivers/mtd/nand/raw/sunxi_nand.c ret = sunxi_nfc_hw_ecc_correct(nand, data, oob_required ? oob : NULL, 0, nand 843 drivers/mtd/nand/raw/sunxi_nand.c if (nand->options & NAND_NEED_SCRAMBLING) nand 844 drivers/mtd/nand/raw/sunxi_nand.c nand_change_read_column_op(nand, data_off, data, nand 850 drivers/mtd/nand/raw/sunxi_nand.c nand_change_read_column_op(nand, oob_off, oob, ecc->bytes + 4, nand 862 drivers/mtd/nand/raw/sunxi_nand.c nand_change_read_column_op(nand, oob_off, NULL, 0, nand 864 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_read_buf(nand, oob, ecc->bytes + 4, nand 867 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_get_prot_oob_bytes(nand, oob, 0, nand 872 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_update_stats(nand, max_bitflips, ret); nand 877 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_hw_ecc_read_extra_oob(struct nand_chip *nand, nand 881 drivers/mtd/nand/raw/sunxi_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 882 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 890 drivers/mtd/nand/raw/sunxi_nand.c nand_change_read_column_op(nand, mtd->writesize, NULL, 0, nand 894 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_read_buf(nand, oob + offset, len); nand 896 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_read_buf(nand, oob + offset, len, nand 903 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_hw_ecc_read_chunks_dma(struct nand_chip *nand, uint8_t *buf, nand 907 drivers/mtd/nand/raw/sunxi_nand.c bool randomized = nand->options & NAND_NEED_SCRAMBLING; nand 908 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); nand 909 drivers/mtd/nand/raw/sunxi_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 910 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 925 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_enable(nand); nand 926 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_config(nand, page, false); nand 927 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_enable(nand); nand 941 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_disable(nand); nand 942 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_disable(nand); nand 955 drivers/mtd/nand/raw/sunxi_nand.c u8 *oob = nand->oob_poi + oob_off; nand 958 drivers/mtd/nand/raw/sunxi_nand.c ret = sunxi_nfc_hw_ecc_correct(nand, randomized ? data : NULL, nand 968 drivers/mtd/nand/raw/sunxi_nand.c nand_change_read_column_op(nand, nand 972 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_get_prot_oob_bytes(nand, oob, i, nand 979 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_update_stats(nand, &max_bitflips, ret); nand 987 drivers/mtd/nand/raw/sunxi_nand.c u8 *oob = nand->oob_poi + oob_off; nand 998 drivers/mtd/nand/raw/sunxi_nand.c nand_change_read_column_op(nand, data_off, nand 1003 drivers/mtd/nand/raw/sunxi_nand.c nand_change_read_column_op(nand, nand 1014 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_update_stats(nand, &max_bitflips, ret); nand 1019 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_read_extra_oob(nand, nand->oob_poi, nand 1026 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_hw_ecc_write_chunk(struct nand_chip *nand, nand 1032 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); nand 1033 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 1037 drivers/mtd/nand/raw/sunxi_nand.c nand_change_write_column_op(nand, data_off, NULL, 0, false); nand 1039 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_write_buf(nand, data, ecc->size, false, page); nand 1042 drivers/mtd/nand/raw/sunxi_nand.c nand_change_write_column_op(nand, oob_off, NULL, 0, false); nand 1048 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_enable(nand); nand 1049 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_set_prot_oob_bytes(nand, oob, 0, bbm, page); nand 1056 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_disable(nand); nand 1065 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nfc_hw_ecc_write_extra_oob(struct nand_chip *nand, nand 1069 drivers/mtd/nand/raw/sunxi_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 1070 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 1078 drivers/mtd/nand/raw/sunxi_nand.c nand_change_write_column_op(nand, offset + mtd->writesize, nand 1081 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_write_buf(nand, oob + offset, len, false, page); nand 1087 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_hw_ecc_read_page(struct nand_chip *nand, uint8_t *buf, nand 1090 drivers/mtd/nand/raw/sunxi_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 1091 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 1096 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_select_chip(nand, nand->cur_cs); nand 1098 drivers/mtd/nand/raw/sunxi_nand.c nand_read_page_op(nand, page, 0, NULL, 0); nand 1100 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_enable(nand); nand 1106 drivers/mtd/nand/raw/sunxi_nand.c u8 *oob = nand->oob_poi + oob_off; nand 1108 drivers/mtd/nand/raw/sunxi_nand.c ret = sunxi_nfc_hw_ecc_read_chunk(nand, data, data_off, oob, nand 1119 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_read_extra_oob(nand, nand->oob_poi, &cur_off, nand 1122 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_disable(nand); nand 1127 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_hw_ecc_read_page_dma(struct nand_chip *nand, u8 *buf, nand 1132 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_select_chip(nand, nand->cur_cs); nand 1134 drivers/mtd/nand/raw/sunxi_nand.c nand_read_page_op(nand, page, 0, NULL, 0); nand 1136 drivers/mtd/nand/raw/sunxi_nand.c ret = sunxi_nfc_hw_ecc_read_chunks_dma(nand, buf, oob_required, page, nand 1137 drivers/mtd/nand/raw/sunxi_nand.c nand->ecc.steps); nand 1142 drivers/mtd/nand/raw/sunxi_nand.c return sunxi_nfc_hw_ecc_read_page(nand, buf, oob_required, page); nand 1145 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_hw_ecc_read_subpage(struct nand_chip *nand, nand 1149 drivers/mtd/nand/raw/sunxi_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 1150 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 1154 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_select_chip(nand, nand->cur_cs); nand 1156 drivers/mtd/nand/raw/sunxi_nand.c nand_read_page_op(nand, page, 0, NULL, 0); nand 1158 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_enable(nand); nand 1165 drivers/mtd/nand/raw/sunxi_nand.c u8 *oob = nand->oob_poi + oob_off; nand 1167 drivers/mtd/nand/raw/sunxi_nand.c ret = sunxi_nfc_hw_ecc_read_chunk(nand, data, data_off, nand 1176 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_disable(nand); nand 1181 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_hw_ecc_read_subpage_dma(struct nand_chip *nand, nand 1185 drivers/mtd/nand/raw/sunxi_nand.c int nchunks = DIV_ROUND_UP(data_offs + readlen, nand->ecc.size); nand 1188 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_select_chip(nand, nand->cur_cs); nand 1190 drivers/mtd/nand/raw/sunxi_nand.c nand_read_page_op(nand, page, 0, NULL, 0); nand 1192 drivers/mtd/nand/raw/sunxi_nand.c ret = sunxi_nfc_hw_ecc_read_chunks_dma(nand, buf, false, page, nchunks); nand 1197 drivers/mtd/nand/raw/sunxi_nand.c return sunxi_nfc_hw_ecc_read_subpage(nand, data_offs, readlen, nand 1201 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_hw_ecc_write_page(struct nand_chip *nand, nand 1205 drivers/mtd/nand/raw/sunxi_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 1206 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 1209 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_select_chip(nand, nand->cur_cs); nand 1211 drivers/mtd/nand/raw/sunxi_nand.c nand_prog_page_begin_op(nand, page, 0, NULL, 0); nand 1213 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_enable(nand); nand 1219 drivers/mtd/nand/raw/sunxi_nand.c const u8 *oob = nand->oob_poi + oob_off; nand 1221 drivers/mtd/nand/raw/sunxi_nand.c ret = sunxi_nfc_hw_ecc_write_chunk(nand, data, data_off, oob, nand 1228 drivers/mtd/nand/raw/sunxi_nand.c if (oob_required || (nand->options & NAND_NEED_SCRAMBLING)) nand 1229 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_write_extra_oob(nand, nand->oob_poi, nand 1232 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_disable(nand); nand 1234 drivers/mtd/nand/raw/sunxi_nand.c return nand_prog_page_end_op(nand); nand 1237 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_hw_ecc_write_subpage(struct nand_chip *nand, nand 1242 drivers/mtd/nand/raw/sunxi_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 1243 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 1246 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_select_chip(nand, nand->cur_cs); nand 1248 drivers/mtd/nand/raw/sunxi_nand.c nand_prog_page_begin_op(nand, page, 0, NULL, 0); nand 1250 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_enable(nand); nand 1257 drivers/mtd/nand/raw/sunxi_nand.c const u8 *oob = nand->oob_poi + oob_off; nand 1259 drivers/mtd/nand/raw/sunxi_nand.c ret = sunxi_nfc_hw_ecc_write_chunk(nand, data, data_off, oob, nand 1266 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_disable(nand); nand 1268 drivers/mtd/nand/raw/sunxi_nand.c return nand_prog_page_end_op(nand); nand 1271 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_hw_ecc_write_page_dma(struct nand_chip *nand, nand 1276 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); nand 1277 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 1281 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_select_chip(nand, nand->cur_cs); nand 1293 drivers/mtd/nand/raw/sunxi_nand.c const u8 *oob = nand->oob_poi + (i * (ecc->bytes + 4)); nand 1295 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_set_prot_oob_bytes(nand, oob, i, !i, page); nand 1298 drivers/mtd/nand/raw/sunxi_nand.c nand_prog_page_begin_op(nand, page, 0, NULL, 0); nand 1300 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_enable(nand); nand 1301 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_config(nand, page, false); nand 1302 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_enable(nand); nand 1317 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_disable(nand); nand 1318 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_disable(nand); nand 1325 drivers/mtd/nand/raw/sunxi_nand.c if (oob_required || (nand->options & NAND_NEED_SCRAMBLING)) nand 1327 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_hw_ecc_write_extra_oob(nand, nand->oob_poi, nand 1330 drivers/mtd/nand/raw/sunxi_nand.c return nand_prog_page_end_op(nand); nand 1333 drivers/mtd/nand/raw/sunxi_nand.c return sunxi_nfc_hw_ecc_write_page(nand, buf, oob_required, page); nand 1336 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_hw_ecc_read_oob(struct nand_chip *nand, int page) nand 1338 drivers/mtd/nand/raw/sunxi_nand.c u8 *buf = nand_get_data_buf(nand); nand 1340 drivers/mtd/nand/raw/sunxi_nand.c return nand->ecc.read_page(nand, buf, 1, page); nand 1343 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_hw_ecc_write_oob(struct nand_chip *nand, int page) nand 1345 drivers/mtd/nand/raw/sunxi_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 1346 drivers/mtd/nand/raw/sunxi_nand.c u8 *buf = nand_get_data_buf(nand); nand 1350 drivers/mtd/nand/raw/sunxi_nand.c ret = nand->ecc.write_page(nand, buf, 1, page); nand 1355 drivers/mtd/nand/raw/sunxi_nand.c return nand_prog_page_end_op(nand); nand 1379 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_setup_data_interface(struct nand_chip *nand, int csline, nand 1382 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nand_chip *sunxi_nand = to_sunxi_nand(nand); nand 1383 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(sunxi_nand->nand.controller); nand 1552 drivers/mtd/nand/raw/sunxi_nand.c struct nand_chip *nand = mtd_to_nand(mtd); nand 1553 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 1567 drivers/mtd/nand/raw/sunxi_nand.c struct nand_chip *nand = mtd_to_nand(mtd); nand 1568 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 1605 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nand_hw_ecc_ctrl_init(struct nand_chip *nand, nand 1610 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); nand 1611 drivers/mtd/nand/raw/sunxi_nand.c struct mtd_info *mtd = nand_to_mtd(nand); nand 1701 drivers/mtd/nand/raw/sunxi_nand.c nand->options |= NAND_USE_BOUNCE_BUFFER; nand 1733 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nand_attach_chip(struct nand_chip *nand) nand 1735 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; nand 1736 drivers/mtd/nand/raw/sunxi_nand.c struct device_node *np = nand_get_flash_node(nand); nand 1739 drivers/mtd/nand/raw/sunxi_nand.c if (nand->bbt_options & NAND_BBT_USE_FLASH) nand 1740 drivers/mtd/nand/raw/sunxi_nand.c nand->bbt_options |= NAND_BBT_NO_OOB; nand 1742 drivers/mtd/nand/raw/sunxi_nand.c if (nand->options & NAND_NEED_SCRAMBLING) nand 1743 drivers/mtd/nand/raw/sunxi_nand.c nand->options |= NAND_NO_SUBPAGE_WRITE; nand 1745 drivers/mtd/nand/raw/sunxi_nand.c nand->options |= NAND_SUBPAGE_READ; nand 1748 drivers/mtd/nand/raw/sunxi_nand.c ecc->size = nand->base.eccreq.step_size; nand 1749 drivers/mtd/nand/raw/sunxi_nand.c ecc->strength = nand->base.eccreq.strength; nand 1757 drivers/mtd/nand/raw/sunxi_nand.c ret = sunxi_nand_hw_ecc_ctrl_init(nand, ecc, np); nand 1771 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_exec_subop(struct nand_chip *nand, nand 1774 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); nand 1867 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_soft_waitrdy(struct nand_chip *nand, nand 1870 drivers/mtd/nand/raw/sunxi_nand.c return nand_soft_waitrdy(nand, nand 1904 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nfc_exec_op(struct nand_chip *nand, nand 1907 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nand_chip *sunxi_nand = to_sunxi_nand(nand); nand 1910 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_select_chip(nand, op->cs); nand 1917 drivers/mtd/nand/raw/sunxi_nand.c return nand_op_parser_exec_op(nand, parser, op, check_only); nand 1931 drivers/mtd/nand/raw/sunxi_nand.c struct nand_chip *nand; nand 1984 drivers/mtd/nand/raw/sunxi_nand.c nand = &sunxi_nand->nand; nand 1986 drivers/mtd/nand/raw/sunxi_nand.c nand->controller = &nfc->controller; nand 1987 drivers/mtd/nand/raw/sunxi_nand.c nand->controller->ops = &sunxi_nand_controller_ops; nand 1993 drivers/mtd/nand/raw/sunxi_nand.c nand->ecc.mode = NAND_ECC_HW; nand 1994 drivers/mtd/nand/raw/sunxi_nand.c nand_set_flash_node(nand, np); nand 1996 drivers/mtd/nand/raw/sunxi_nand.c mtd = nand_to_mtd(nand); nand 1999 drivers/mtd/nand/raw/sunxi_nand.c ret = nand_scan(nand, nsels); nand 2006 drivers/mtd/nand/raw/sunxi_nand.c nand_release(nand); nand 2046 drivers/mtd/nand/raw/sunxi_nand.c nand_release(&sunxi_nand->nand); nand 2047 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nand_ecc_cleanup(&sunxi_nand->nand.ecc); nand 460 drivers/mtd/nand/raw/tegra_nand.c struct tegra_nand_chip *nand = to_tegra_chip(chip); nand 463 drivers/mtd/nand/raw/tegra_nand.c ctrl->cur_cs = nand->cs[die_nr]; nand 478 drivers/mtd/nand/raw/tegra_nand.c struct tegra_nand_chip *nand = to_tegra_chip(chip); nand 481 drivers/mtd/nand/raw/tegra_nand.c writel_relaxed(nand->bch_config, ctrl->regs + BCH_CONFIG); nand 486 drivers/mtd/nand/raw/tegra_nand.c writel_relaxed(nand->config_ecc, ctrl->regs + CONFIG); nand 488 drivers/mtd/nand/raw/tegra_nand.c writel_relaxed(nand->config, ctrl->regs + CONFIG); nand 655 drivers/mtd/nand/raw/tegra_nand.c struct tegra_nand_chip *nand = to_tegra_chip(chip); nand 723 drivers/mtd/nand/raw/tegra_nand.c u8 *oob = chip->oob_poi + nand->ecc.offset + nand 909 drivers/mtd/nand/raw/tegra_nand.c struct tegra_nand_chip *nand = to_tegra_chip(chip); nand 934 drivers/mtd/nand/raw/tegra_nand.c nand->config |= CONFIG_BUS_WIDTH_16; nand 960 drivers/mtd/nand/raw/tegra_nand.c nand->config_ecc = CONFIG_PIPE_EN | CONFIG_SKIP_SPARE | nand 967 drivers/mtd/nand/raw/tegra_nand.c nand->config_ecc |= CONFIG_HW_ECC | CONFIG_ECC_SEL | nand 971 drivers/mtd/nand/raw/tegra_nand.c nand->config_ecc |= CONFIG_TVAL_4; nand 974 drivers/mtd/nand/raw/tegra_nand.c nand->config_ecc |= CONFIG_TVAL_6; nand 977 drivers/mtd/nand/raw/tegra_nand.c nand->config_ecc |= CONFIG_TVAL_8; nand 988 drivers/mtd/nand/raw/tegra_nand.c nand->bch_config = BCH_ENABLE; nand 991 drivers/mtd/nand/raw/tegra_nand.c nand->bch_config |= BCH_TVAL_4; nand 994 drivers/mtd/nand/raw/tegra_nand.c nand->bch_config |= BCH_TVAL_8; nand 997 drivers/mtd/nand/raw/tegra_nand.c nand->bch_config |= BCH_TVAL_14; nand 1000 drivers/mtd/nand/raw/tegra_nand.c nand->bch_config |= BCH_TVAL_16; nand 1021 drivers/mtd/nand/raw/tegra_nand.c nand->config |= CONFIG_PS_256; nand 1024 drivers/mtd/nand/raw/tegra_nand.c nand->config |= CONFIG_PS_512; nand 1027 drivers/mtd/nand/raw/tegra_nand.c nand->config |= CONFIG_PS_1024; nand 1030 drivers/mtd/nand/raw/tegra_nand.c nand->config |= CONFIG_PS_2048; nand 1033 drivers/mtd/nand/raw/tegra_nand.c nand->config |= CONFIG_PS_4096; nand 1042 drivers/mtd/nand/raw/tegra_nand.c nand->config_ecc |= nand->config; nand 1045 drivers/mtd/nand/raw/tegra_nand.c nand->config |= CONFIG_TAG_BYTE_SIZE(mtd->oobsize - 1); nand 1046 drivers/mtd/nand/raw/tegra_nand.c writel_relaxed(nand->config, ctrl->regs + CONFIG); nand 1063 drivers/mtd/nand/raw/tegra_nand.c struct tegra_nand_chip *nand; nand 1089 drivers/mtd/nand/raw/tegra_nand.c nand = devm_kzalloc(dev, sizeof(*nand), GFP_KERNEL); nand 1090 drivers/mtd/nand/raw/tegra_nand.c if (!nand) nand 1093 drivers/mtd/nand/raw/tegra_nand.c nand->cs[0] = cs; nand 1095 drivers/mtd/nand/raw/tegra_nand.c nand->wp_gpio = devm_gpiod_get_optional(dev, "wp", GPIOD_OUT_LOW); nand 1097 drivers/mtd/nand/raw/tegra_nand.c if (IS_ERR(nand->wp_gpio)) { nand 1098 drivers/mtd/nand/raw/tegra_nand.c ret = PTR_ERR(nand->wp_gpio); nand 1103 drivers/mtd/nand/raw/tegra_nand.c chip = &nand->chip; nand 1122 drivers/mtd/nand/raw/tegra_nand.c mtd_ooblayout_ecc(mtd, 0, &nand->ecc); nand 52 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 55 drivers/mtd/nand/spi/core.c spinand->cur_target >= nand->memorg.ntargets)) nand 64 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 68 drivers/mtd/nand/spi/core.c spinand->cur_target >= nand->memorg.ntargets)) nand 118 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 121 drivers/mtd/nand/spi/core.c if (WARN_ON(target >= nand->memorg.ntargets)) nand 127 drivers/mtd/nand/spi/core.c if (nand->memorg.ntargets == 1) { nand 142 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 148 drivers/mtd/nand/spi/core.c nand->memorg.ntargets, nand 154 drivers/mtd/nand/spi/core.c for (target = 0; target < nand->memorg.ntargets; target++) { nand 205 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 206 drivers/mtd/nand/spi/core.c unsigned int row = nanddev_pos_to_row(nand, &req->pos); nand 215 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 216 drivers/mtd/nand/spi/core.c struct mtd_info *mtd = nanddev_to_mtd(nand); nand 225 drivers/mtd/nand/spi/core.c nbytes = nanddev_page_size(nand); nand 230 drivers/mtd/nand/spi/core.c nbytes += nanddev_per_page_oobsize(nand); nand 233 drivers/mtd/nand/spi/core.c column = nanddev_page_size(nand); nand 273 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 274 drivers/mtd/nand/spi/core.c struct mtd_info *mtd = nanddev_to_mtd(nand); nand 287 drivers/mtd/nand/spi/core.c nbytes = nanddev_page_size(nand) + nanddev_per_page_oobsize(nand); nand 326 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 327 drivers/mtd/nand/spi/core.c unsigned int row = nanddev_pos_to_row(nand, &req->pos); nand 336 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 337 drivers/mtd/nand/spi/core.c unsigned int row = nanddev_pos_to_row(nand, pos); nand 405 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 420 drivers/mtd/nand/spi/core.c return nand->eccreq.strength; nand 486 drivers/mtd/nand/spi/core.c struct nand_device *nand = mtd_to_nanddev(mtd); nand 498 drivers/mtd/nand/spi/core.c nanddev_io_for_each_page(nand, from, ops, &iter) { nand 536 drivers/mtd/nand/spi/core.c struct nand_device *nand = mtd_to_nanddev(mtd); nand 546 drivers/mtd/nand/spi/core.c nanddev_io_for_each_page(nand, to, ops, &iter) { nand 568 drivers/mtd/nand/spi/core.c static bool spinand_isbad(struct nand_device *nand, const struct nand_pos *pos) nand 570 drivers/mtd/nand/spi/core.c struct spinand_device *spinand = nand_to_spinand(nand); nand 590 drivers/mtd/nand/spi/core.c struct nand_device *nand = mtd_to_nanddev(mtd); nand 591 drivers/mtd/nand/spi/core.c struct spinand_device *spinand = nand_to_spinand(nand); nand 595 drivers/mtd/nand/spi/core.c nanddev_offs_to_pos(nand, offs, &pos); nand 597 drivers/mtd/nand/spi/core.c ret = nanddev_isbad(nand, &pos); nand 603 drivers/mtd/nand/spi/core.c static int spinand_markbad(struct nand_device *nand, const struct nand_pos *pos) nand 605 drivers/mtd/nand/spi/core.c struct spinand_device *spinand = nand_to_spinand(nand); nand 629 drivers/mtd/nand/spi/core.c struct nand_device *nand = mtd_to_nanddev(mtd); nand 630 drivers/mtd/nand/spi/core.c struct spinand_device *spinand = nand_to_spinand(nand); nand 634 drivers/mtd/nand/spi/core.c nanddev_offs_to_pos(nand, offs, &pos); nand 636 drivers/mtd/nand/spi/core.c ret = nanddev_markbad(nand, &pos); nand 642 drivers/mtd/nand/spi/core.c static int spinand_erase(struct nand_device *nand, const struct nand_pos *pos) nand 644 drivers/mtd/nand/spi/core.c struct spinand_device *spinand = nand_to_spinand(nand); nand 683 drivers/mtd/nand/spi/core.c struct nand_device *nand = mtd_to_nanddev(mtd); nand 687 drivers/mtd/nand/spi/core.c nanddev_offs_to_pos(nand, offs, &pos); nand 689 drivers/mtd/nand/spi/core.c ret = nanddev_isreserved(nand, &pos); nand 698 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 700 drivers/mtd/nand/spi/core.c .length = nanddev_page_size(nand) + nand 701 drivers/mtd/nand/spi/core.c nanddev_per_page_oobsize(nand), nand 706 drivers/mtd/nand/spi/core.c info.offset = plane << fls(nand->memorg.pagesize); nand 729 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 734 drivers/mtd/nand/spi/core.c nand->memorg.planes_per_lun, nand 739 drivers/mtd/nand/spi/core.c for (i = 0; i < nand->memorg.planes_per_lun; i++) { nand 800 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 808 drivers/mtd/nand/spi/core.c nbytes = nanddev_per_page_oobsize(nand) + nand 809 drivers/mtd/nand/spi/core.c nanddev_page_size(nand); nand 849 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 859 drivers/mtd/nand/spi/core.c nand->memorg = table[i].memorg; nand 860 drivers/mtd/nand/spi/core.c nand->eccreq = table[i].eccreq; nand 892 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 912 drivers/mtd/nand/spi/core.c if (nand->memorg.ntargets > 1 && !spinand->select_target) { nand 922 drivers/mtd/nand/spi/core.c nanddev_size(nand) >> 20, nanddev_eraseblock_size(nand) >> 10, nand 923 drivers/mtd/nand/spi/core.c nanddev_page_size(nand), nanddev_per_page_oobsize(nand)); nand 956 drivers/mtd/nand/spi/core.c struct nand_device *nand = mtd_to_nanddev(mtd); nand 976 drivers/mtd/nand/spi/core.c spinand->databuf = kzalloc(nanddev_page_size(nand) + nand 977 drivers/mtd/nand/spi/core.c nanddev_per_page_oobsize(nand), nand 984 drivers/mtd/nand/spi/core.c spinand->oobbuf = spinand->databuf + nanddev_page_size(nand); nand 1015 drivers/mtd/nand/spi/core.c for (i = 0; i < nand->memorg.ntargets; i++) { nand 1025 drivers/mtd/nand/spi/core.c ret = nanddev_init(nand, &spinand_ops, THIS_MODULE); nand 1053 drivers/mtd/nand/spi/core.c mtd->ecc_strength = nand->eccreq.strength; nand 1054 drivers/mtd/nand/spi/core.c mtd->ecc_step_size = nand->eccreq.step_size; nand 1059 drivers/mtd/nand/spi/core.c nanddev_cleanup(nand); nand 1072 drivers/mtd/nand/spi/core.c struct nand_device *nand = spinand_to_nand(spinand); nand 1074 drivers/mtd/nand/spi/core.c nanddev_cleanup(nand); nand 70 drivers/mtd/nand/spi/macronix.c struct nand_device *nand = spinand_to_nand(spinand); nand 87 drivers/mtd/nand/spi/macronix.c return nand->eccreq.strength; nand 89 drivers/mtd/nand/spi/macronix.c if (WARN_ON(eccsr > nand->eccreq.strength || !eccsr)) nand 90 drivers/mtd/nand/spi/macronix.c return nand->eccreq.strength; nand 61 drivers/mtd/nand/spi/toshiba.c struct nand_device *nand = spinand_to_nand(spinand); nand 80 drivers/mtd/nand/spi/toshiba.c return nand->eccreq.strength; nand 84 drivers/mtd/nand/spi/toshiba.c if (WARN_ON(mbf > nand->eccreq.strength || !mbf)) nand 85 drivers/mtd/nand/spi/toshiba.c return nand->eccreq.strength; nand 124 drivers/mtd/nand/spi/winbond.c struct nand_device *nand = spinand_to_nand(spinand); nand 131 drivers/mtd/nand/spi/winbond.c for (i = 0; i < nand->memorg.ntargets; i++) { nand 1587 drivers/pinctrl/actions/pinctrl-s700.c [S700_MUX_NAND] = FUNCTION(nand), nand 555 drivers/pinctrl/bcm/pinctrl-cygnus-mux.c CYGNUS_PIN_GROUP(nand, 0x14, 20, 0), nand 692 drivers/pinctrl/bcm/pinctrl-cygnus-mux.c CYGNUS_PIN_FUNCTION(nand), nand 390 drivers/pinctrl/bcm/pinctrl-ns2-mux.c NS2_PIN_GROUP(nand, 0, 0, 31, 1, 0), nand 491 drivers/pinctrl/bcm/pinctrl-ns2-mux.c NS2_PIN_FUNCTION(nand), nand 265 drivers/pinctrl/bcm/pinctrl-nsp-mux.c NSP_PIN_GROUP(nand, NSP_MUX_BASE2, 0, 0x01, 0x00), nand 314 drivers/pinctrl/bcm/pinctrl-nsp-mux.c NSP_PIN_FUNCTION(nand), nand 965 drivers/pinctrl/meson/pinctrl-meson-axg.c FUNCTION(nand), nand 1258 drivers/pinctrl/meson/pinctrl-meson-g12a.c FUNCTION(nand), nand 775 drivers/pinctrl/meson/pinctrl-meson-gxbb.c FUNCTION(nand), nand 747 drivers/pinctrl/meson/pinctrl-meson-gxl.c FUNCTION(nand), nand 1041 drivers/pinctrl/meson/pinctrl-meson8.c FUNCTION(nand), nand 886 drivers/pinctrl/meson/pinctrl-meson8b.c FUNCTION(nand), nand 369 drivers/pinctrl/pinctrl-bm1880.c BM1880_PINCTRL_GRP(nand), nand 656 drivers/pinctrl/pinctrl-bm1880.c BM1880_PINMUX_FUNCTION(nand, 2), nand 510 drivers/pinctrl/qcom/pinctrl-ipq8064.c FUNCTION(nand), nand 574 drivers/pinctrl/qcom/pinctrl-ipq8064.c PINGROUP(34, nand, pdm, NA, NA, NA, NA, NA, NA, NA, NA), nand 575 drivers/pinctrl/qcom/pinctrl-ipq8064.c PINGROUP(35, nand, pdm, NA, NA, NA, NA, NA, NA, NA, NA), nand 576 drivers/pinctrl/qcom/pinctrl-ipq8064.c PINGROUP(36, nand, NA, NA, NA, NA, NA, NA, NA, NA, NA), nand 577 drivers/pinctrl/qcom/pinctrl-ipq8064.c PINGROUP(37, nand, NA, NA, NA, NA, NA, NA, NA, NA, NA), nand 578 drivers/pinctrl/qcom/pinctrl-ipq8064.c PINGROUP(38, nand, sdc1, NA, NA, NA, NA, NA, NA, NA, NA), nand 579 drivers/pinctrl/qcom/pinctrl-ipq8064.c PINGROUP(39, nand, sdc1, NA, NA, NA, NA, NA, NA, NA, NA), nand 580 drivers/pinctrl/qcom/pinctrl-ipq8064.c PINGROUP(40, nand, sdc1, NA, NA, NA, NA, NA, NA, NA, NA), nand 581 drivers/pinctrl/qcom/pinctrl-ipq8064.c PINGROUP(41, nand, sdc1, NA, NA, NA, NA, NA, NA, NA, NA), nand 582 drivers/pinctrl/qcom/pinctrl-ipq8064.c PINGROUP(42, nand, sdc1, NA, NA, NA, NA, NA, NA, NA, NA), nand 583 drivers/pinctrl/qcom/pinctrl-ipq8064.c PINGROUP(43, nand, sdc1, NA, NA, NA, NA, NA, NA, NA, NA), nand 584 drivers/pinctrl/qcom/pinctrl-ipq8064.c PINGROUP(44, nand, sdc1, NA, NA, NA, NA, NA, NA, NA, NA), nand 585 drivers/pinctrl/qcom/pinctrl-ipq8064.c PINGROUP(45, nand, sdc1, NA, NA, NA, NA, NA, NA, NA, NA), nand 586 drivers/pinctrl/qcom/pinctrl-ipq8064.c PINGROUP(46, nand, sdc1, NA, NA, NA, NA, NA, NA, NA, NA), nand 587 drivers/pinctrl/qcom/pinctrl-ipq8064.c PINGROUP(47, nand, sdc1, NA, NA, NA, NA, NA, NA, NA, NA), nand 1495 drivers/pinctrl/tegra/pinctrl-tegra114.c FUNCTION(nand), nand 1923 drivers/pinctrl/tegra/pinctrl-tegra20.c FUNCTION(nand), nand 2054 drivers/pinctrl/tegra/pinctrl-tegra30.c FUNCTION(nand), nand 595 drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c UNIPHIER_PINCTRL_GROUP(nand), nand 662 drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c UNIPHIER_PINMUX_FUNCTION(nand), nand 693 drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c UNIPHIER_PINCTRL_GROUP(nand), nand 771 drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c UNIPHIER_PINMUX_FUNCTION(nand), nand 635 drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c UNIPHIER_PINCTRL_GROUP(nand), nand 690 drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c UNIPHIER_PINMUX_FUNCTION(nand), nand 848 drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c UNIPHIER_PINCTRL_GROUP(nand), nand 911 drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c UNIPHIER_PINMUX_FUNCTION(nand), nand 1133 drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c UNIPHIER_PINCTRL_GROUP(nand), nand 1204 drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c UNIPHIER_PINMUX_FUNCTION(nand), nand 895 drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c UNIPHIER_PINCTRL_GROUP(nand), nand 973 drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c UNIPHIER_PINMUX_FUNCTION(nand), nand 858 drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c UNIPHIER_PINCTRL_GROUP(nand), nand 932 drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c UNIPHIER_PINMUX_FUNCTION(nand), nand 884 drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c UNIPHIER_PINCTRL_GROUP(nand), nand 940 drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c UNIPHIER_PINMUX_FUNCTION(nand), nand 565 drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c UNIPHIER_PINCTRL_GROUP(nand), nand 622 drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c UNIPHIER_PINMUX_FUNCTION(nand), nand 68 drivers/watchdog/rc32434_wdt.c #define SET_BITS(addr, or, nand) \ nand 69 drivers/watchdog/rc32434_wdt.c writel((readl(&addr) | or) & ~nand, &addr) nand 89 drivers/watchdog/rc32434_wdt.c u32 or, nand; nand 98 drivers/watchdog/rc32434_wdt.c nand = 1 << RC32434_ERR_WNE; nand 102 drivers/watchdog/rc32434_wdt.c nand |= 1 << RC32434_ERR_WTO; nand 104 drivers/watchdog/rc32434_wdt.c SET_BITS(wdt_reg->errcs, or, nand); nand 110 drivers/watchdog/rc32434_wdt.c nand = 1 << RC32434_WTC_TO; nand 113 drivers/watchdog/rc32434_wdt.c SET_BITS(wdt_reg->wtc, or, nand); nand 842 include/linux/fsl_ifc.h void *nand; nand 155 include/linux/mtd/nand.h int (*erase)(struct nand_device *nand, const struct nand_pos *pos); nand 156 include/linux/mtd/nand.h int (*markbad)(struct nand_device *nand, const struct nand_pos *pos); nand 157 include/linux/mtd/nand.h bool (*isbad)(struct nand_device *nand, const struct nand_pos *pos); nand 223 include/linux/mtd/nand.h static inline struct mtd_info *nanddev_to_mtd(struct nand_device *nand) nand 225 include/linux/mtd/nand.h return &nand->mtd; nand 234 include/linux/mtd/nand.h static inline unsigned int nanddev_bits_per_cell(const struct nand_device *nand) nand 236 include/linux/mtd/nand.h return nand->memorg.bits_per_cell; nand 245 include/linux/mtd/nand.h static inline size_t nanddev_page_size(const struct nand_device *nand) nand 247 include/linux/mtd/nand.h return nand->memorg.pagesize; nand 257 include/linux/mtd/nand.h nanddev_per_page_oobsize(const struct nand_device *nand) nand 259 include/linux/mtd/nand.h return nand->memorg.oobsize; nand 269 include/linux/mtd/nand.h nanddev_pages_per_eraseblock(const struct nand_device *nand) nand 271 include/linux/mtd/nand.h return nand->memorg.pages_per_eraseblock; nand 281 include/linux/mtd/nand.h nanddev_pages_per_target(const struct nand_device *nand) nand 283 include/linux/mtd/nand.h return nand->memorg.pages_per_eraseblock * nand 284 include/linux/mtd/nand.h nand->memorg.eraseblocks_per_lun * nand 285 include/linux/mtd/nand.h nand->memorg.luns_per_target; nand 294 include/linux/mtd/nand.h static inline size_t nanddev_eraseblock_size(const struct nand_device *nand) nand 296 include/linux/mtd/nand.h return nand->memorg.pagesize * nand->memorg.pages_per_eraseblock; nand 306 include/linux/mtd/nand.h nanddev_eraseblocks_per_lun(const struct nand_device *nand) nand 308 include/linux/mtd/nand.h return nand->memorg.eraseblocks_per_lun; nand 318 include/linux/mtd/nand.h nanddev_eraseblocks_per_target(const struct nand_device *nand) nand 320 include/linux/mtd/nand.h return nand->memorg.eraseblocks_per_lun * nand->memorg.luns_per_target; nand 329 include/linux/mtd/nand.h static inline u64 nanddev_target_size(const struct nand_device *nand) nand 331 include/linux/mtd/nand.h return (u64)nand->memorg.luns_per_target * nand 332 include/linux/mtd/nand.h nand->memorg.eraseblocks_per_lun * nand 333 include/linux/mtd/nand.h nand->memorg.pages_per_eraseblock * nand 334 include/linux/mtd/nand.h nand->memorg.pagesize; nand 343 include/linux/mtd/nand.h static inline unsigned int nanddev_ntargets(const struct nand_device *nand) nand 345 include/linux/mtd/nand.h return nand->memorg.ntargets; nand 354 include/linux/mtd/nand.h static inline unsigned int nanddev_neraseblocks(const struct nand_device *nand) nand 356 include/linux/mtd/nand.h return nand->memorg.ntargets * nand->memorg.luns_per_target * nand 357 include/linux/mtd/nand.h nand->memorg.eraseblocks_per_lun; nand 366 include/linux/mtd/nand.h static inline u64 nanddev_size(const struct nand_device *nand) nand 368 include/linux/mtd/nand.h return nanddev_target_size(nand) * nanddev_ntargets(nand); nand 381 include/linux/mtd/nand.h nanddev_get_memorg(struct nand_device *nand) nand 383 include/linux/mtd/nand.h return &nand->memorg; nand 386 include/linux/mtd/nand.h int nanddev_init(struct nand_device *nand, const struct nand_ops *ops, nand 388 include/linux/mtd/nand.h void nanddev_cleanup(struct nand_device *nand); nand 400 include/linux/mtd/nand.h static inline int nanddev_register(struct nand_device *nand) nand 402 include/linux/mtd/nand.h return mtd_device_register(&nand->mtd, NULL, 0); nand 415 include/linux/mtd/nand.h static inline int nanddev_unregister(struct nand_device *nand) nand 417 include/linux/mtd/nand.h return mtd_device_unregister(&nand->mtd); nand 427 include/linux/mtd/nand.h static inline void nanddev_set_of_node(struct nand_device *nand, nand 430 include/linux/mtd/nand.h mtd_set_of_node(&nand->mtd, np); nand 439 include/linux/mtd/nand.h static inline struct device_node *nanddev_get_of_node(struct nand_device *nand) nand 441 include/linux/mtd/nand.h return mtd_get_of_node(&nand->mtd); nand 454 include/linux/mtd/nand.h static inline unsigned int nanddev_offs_to_pos(struct nand_device *nand, nand 461 include/linux/mtd/nand.h pageoffs = do_div(tmp, nand->memorg.pagesize); nand 462 include/linux/mtd/nand.h pos->page = do_div(tmp, nand->memorg.pages_per_eraseblock); nand 463 include/linux/mtd/nand.h pos->eraseblock = do_div(tmp, nand->memorg.eraseblocks_per_lun); nand 464 include/linux/mtd/nand.h pos->plane = pos->eraseblock % nand->memorg.planes_per_lun; nand 465 include/linux/mtd/nand.h pos->lun = do_div(tmp, nand->memorg.luns_per_target); nand 509 include/linux/mtd/nand.h static inline loff_t nanddev_pos_to_offs(struct nand_device *nand, nand 517 include/linux/mtd/nand.h (pos->target * nand->memorg.luns_per_target)) * nand 518 include/linux/mtd/nand.h nand->memorg.eraseblocks_per_lun) * nand 519 include/linux/mtd/nand.h nand->memorg.pages_per_eraseblock); nand 521 include/linux/mtd/nand.h return (loff_t)npages * nand->memorg.pagesize; nand 534 include/linux/mtd/nand.h static inline unsigned int nanddev_pos_to_row(struct nand_device *nand, nand 537 include/linux/mtd/nand.h return (pos->lun << nand->rowconv.lun_addr_shift) | nand 538 include/linux/mtd/nand.h (pos->eraseblock << nand->rowconv.eraseblock_addr_shift) | nand 550 include/linux/mtd/nand.h static inline void nanddev_pos_next_target(struct nand_device *nand, nand 568 include/linux/mtd/nand.h static inline void nanddev_pos_next_lun(struct nand_device *nand, nand 571 include/linux/mtd/nand.h if (pos->lun >= nand->memorg.luns_per_target - 1) nand 572 include/linux/mtd/nand.h return nanddev_pos_next_target(nand, pos); nand 588 include/linux/mtd/nand.h static inline void nanddev_pos_next_eraseblock(struct nand_device *nand, nand 591 include/linux/mtd/nand.h if (pos->eraseblock >= nand->memorg.eraseblocks_per_lun - 1) nand 592 include/linux/mtd/nand.h return nanddev_pos_next_lun(nand, pos); nand 596 include/linux/mtd/nand.h pos->plane = pos->eraseblock % nand->memorg.planes_per_lun; nand 607 include/linux/mtd/nand.h static inline void nanddev_pos_next_page(struct nand_device *nand, nand 610 include/linux/mtd/nand.h if (pos->page >= nand->memorg.pages_per_eraseblock - 1) nand 611 include/linux/mtd/nand.h return nanddev_pos_next_eraseblock(nand, pos); nand 626 include/linux/mtd/nand.h static inline void nanddev_io_iter_init(struct nand_device *nand, nand 630 include/linux/mtd/nand.h struct mtd_info *mtd = nanddev_to_mtd(nand); nand 633 include/linux/mtd/nand.h iter->req.dataoffs = nanddev_offs_to_pos(nand, offs, &iter->req.pos); nand 640 include/linux/mtd/nand.h nand->memorg.pagesize - iter->req.dataoffs, nand 655 include/linux/mtd/nand.h static inline void nanddev_io_iter_next_page(struct nand_device *nand, nand 658 include/linux/mtd/nand.h nanddev_pos_next_page(nand, &iter->req.pos); nand 665 include/linux/mtd/nand.h iter->req.datalen = min_t(unsigned int, nand->memorg.pagesize, nand 682 include/linux/mtd/nand.h static inline bool nanddev_io_iter_end(struct nand_device *nand, nand 701 include/linux/mtd/nand.h #define nanddev_io_for_each_page(nand, start, req, iter) \ nand 702 include/linux/mtd/nand.h for (nanddev_io_iter_init(nand, start, req, iter); \ nand 703 include/linux/mtd/nand.h !nanddev_io_iter_end(nand, iter); \ nand 704 include/linux/mtd/nand.h nanddev_io_iter_next_page(nand, iter)) nand 706 include/linux/mtd/nand.h bool nanddev_isbad(struct nand_device *nand, const struct nand_pos *pos); nand 707 include/linux/mtd/nand.h bool nanddev_isreserved(struct nand_device *nand, const struct nand_pos *pos); nand 708 include/linux/mtd/nand.h int nanddev_erase(struct nand_device *nand, const struct nand_pos *pos); nand 709 include/linux/mtd/nand.h int nanddev_markbad(struct nand_device *nand, const struct nand_pos *pos); nand 721 include/linux/mtd/nand.h int nanddev_bbt_init(struct nand_device *nand); nand 722 include/linux/mtd/nand.h void nanddev_bbt_cleanup(struct nand_device *nand); nand 723 include/linux/mtd/nand.h int nanddev_bbt_update(struct nand_device *nand); nand 724 include/linux/mtd/nand.h int nanddev_bbt_get_block_status(const struct nand_device *nand, nand 726 include/linux/mtd/nand.h int nanddev_bbt_set_block_status(struct nand_device *nand, unsigned int entry, nand 728 include/linux/mtd/nand.h int nanddev_bbt_markbad(struct nand_device *nand, unsigned int block); nand 740 include/linux/mtd/nand.h static inline unsigned int nanddev_bbt_pos_to_entry(struct nand_device *nand, nand 744 include/linux/mtd/nand.h ((pos->lun + (pos->target * nand->memorg.luns_per_target)) * nand 745 include/linux/mtd/nand.h nand->memorg.eraseblocks_per_lun); nand 754 include/linux/mtd/nand.h static inline bool nanddev_bbt_is_initialized(struct nand_device *nand) nand 756 include/linux/mtd/nand.h return !!nand->bbt.cache; nand 424 include/linux/mtd/spinand.h static inline struct spinand_device *nand_to_spinand(struct nand_device *nand) nand 426 include/linux/mtd/spinand.h return container_of(nand, struct spinand_device, base); nand 68 include/linux/platform_data/mtd-nand-s3c2410.h extern void s3c_nand_set_platdata(struct s3c2410_platform_nand *nand);