Lines Matching refs:mtd
175 struct mtd_info *mtd; member
462 chip->cmdfunc(host->mtd, NAND_CMD_READID, 0x00, -1); in pxa3xx_nand_init_timings_compat()
464 id = chip->read_byte(host->mtd); in pxa3xx_nand_init_timings_compat()
465 id |= chip->read_byte(host->mtd) << 0x8; in pxa3xx_nand_init_timings_compat()
540 struct mtd_info *mtd) in pxa3xx_set_datasize() argument
544 info->data_size = mtd->writesize; in pxa3xx_set_datasize()
898 struct mtd_info *mtd = host->mtd; in prepare_start_command() local
918 pxa3xx_set_datasize(info, mtd); in prepare_start_command()
937 info->buf_count = mtd->writesize + mtd->oobsize; in prepare_start_command()
948 struct mtd_info *mtd; in prepare_set_command() local
951 mtd = host->mtd; in prepare_set_command()
975 info->buf_start += mtd->writesize; in prepare_set_command()
982 if (mtd->writesize == PAGE_CHUNK_SIZE) { in prepare_set_command()
984 } else if (mtd->writesize > PAGE_CHUNK_SIZE) { in prepare_set_command()
992 set_command_address(info, mtd->writesize, column, page_addr); in prepare_set_command()
998 set_command_address(info, mtd->writesize, 0, page_addr); in prepare_set_command()
1004 if (mtd->writesize > PAGE_CHUNK_SIZE) { in prepare_set_command()
1017 (mtd->writesize + mtd->oobsize))) { in prepare_set_command()
1023 if (mtd->writesize > PAGE_CHUNK_SIZE) { in prepare_set_command()
1118 static void nand_cmdfunc(struct mtd_info *mtd, unsigned command, in nand_cmdfunc() argument
1121 struct pxa3xx_nand_host *host = mtd->priv; in nand_cmdfunc()
1165 static void nand_cmdfunc_extended(struct mtd_info *mtd, in nand_cmdfunc_extended() argument
1169 struct pxa3xx_nand_host *host = mtd->priv; in nand_cmdfunc_extended()
1275 static int pxa3xx_nand_write_page_hwecc(struct mtd_info *mtd, in pxa3xx_nand_write_page_hwecc() argument
1279 chip->write_buf(mtd, buf, mtd->writesize); in pxa3xx_nand_write_page_hwecc()
1280 chip->write_buf(mtd, chip->oob_poi, mtd->oobsize); in pxa3xx_nand_write_page_hwecc()
1285 static int pxa3xx_nand_read_page_hwecc(struct mtd_info *mtd, in pxa3xx_nand_read_page_hwecc() argument
1289 struct pxa3xx_nand_host *host = mtd->priv; in pxa3xx_nand_read_page_hwecc()
1292 chip->read_buf(mtd, buf, mtd->writesize); in pxa3xx_nand_read_page_hwecc()
1293 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); in pxa3xx_nand_read_page_hwecc()
1296 mtd->ecc_stats.corrected += info->ecc_err_cnt; in pxa3xx_nand_read_page_hwecc()
1304 if (is_buf_blank(buf, mtd->writesize)) in pxa3xx_nand_read_page_hwecc()
1307 mtd->ecc_stats.failed++; in pxa3xx_nand_read_page_hwecc()
1313 static uint8_t pxa3xx_nand_read_byte(struct mtd_info *mtd) in pxa3xx_nand_read_byte() argument
1315 struct pxa3xx_nand_host *host = mtd->priv; in pxa3xx_nand_read_byte()
1326 static u16 pxa3xx_nand_read_word(struct mtd_info *mtd) in pxa3xx_nand_read_word() argument
1328 struct pxa3xx_nand_host *host = mtd->priv; in pxa3xx_nand_read_word()
1339 static void pxa3xx_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in pxa3xx_nand_read_buf() argument
1341 struct pxa3xx_nand_host *host = mtd->priv; in pxa3xx_nand_read_buf()
1349 static void pxa3xx_nand_write_buf(struct mtd_info *mtd, in pxa3xx_nand_write_buf() argument
1352 struct pxa3xx_nand_host *host = mtd->priv; in pxa3xx_nand_write_buf()
1360 static void pxa3xx_nand_select_chip(struct mtd_info *mtd, int chip) in pxa3xx_nand_select_chip() argument
1365 static int pxa3xx_nand_waitfunc(struct mtd_info *mtd, struct nand_chip *this) in pxa3xx_nand_waitfunc() argument
1367 struct pxa3xx_nand_host *host = mtd->priv; in pxa3xx_nand_waitfunc()
1395 struct mtd_info *mtd = host->mtd; in pxa3xx_nand_config_flash() local
1396 struct nand_chip *chip = mtd->priv; in pxa3xx_nand_config_flash()
1405 info->reg_ndcr |= (mtd->writesize == 2048) ? NDCR_PAGE_SZ : 0; in pxa3xx_nand_config_flash()
1489 struct mtd_info *mtd; in pxa3xx_nand_sensing() local
1494 mtd = info->host[info->cs]->mtd; in pxa3xx_nand_sensing()
1495 chip = mtd->priv; in pxa3xx_nand_sensing()
1504 chip->cmdfunc(mtd, NAND_CMD_RESET, 0, 0); in pxa3xx_nand_sensing()
1505 ret = chip->waitfunc(mtd, chip); in pxa3xx_nand_sensing()
1581 static int pxa3xx_nand_scan(struct mtd_info *mtd) in pxa3xx_nand_scan() argument
1583 struct pxa3xx_nand_host *host = mtd->priv; in pxa3xx_nand_scan()
1587 struct nand_chip *chip = mtd->priv; in pxa3xx_nand_scan()
1618 if (nand_scan_ident(mtd, 1, NULL)) in pxa3xx_nand_scan()
1646 if (mtd->writesize > PAGE_CHUNK_SIZE) { in pxa3xx_nand_scan()
1671 ecc_step, mtd->writesize); in pxa3xx_nand_scan()
1676 if (mtd->writesize >= 2048) in pxa3xx_nand_scan()
1685 info->buf_size = mtd->writesize + mtd->oobsize; in pxa3xx_nand_scan()
1689 info->oob_buff = info->data_buff + mtd->writesize; in pxa3xx_nand_scan()
1691 if ((mtd->size >> chip->page_shift) > 65536) in pxa3xx_nand_scan()
1695 return nand_scan_tail(mtd); in pxa3xx_nand_scan()
1704 struct mtd_info *mtd; in alloc_nand_resource() local
1711 info = devm_kzalloc(&pdev->dev, sizeof(*info) + (sizeof(*mtd) + in alloc_nand_resource()
1719 mtd = (void *)&info[1] + (sizeof(*mtd) + sizeof(*host)) * cs; in alloc_nand_resource()
1720 chip = (struct nand_chip *)(&mtd[1]); in alloc_nand_resource()
1723 host->mtd = mtd; in alloc_nand_resource()
1726 mtd->priv = host; in alloc_nand_resource()
1727 mtd->dev.parent = &pdev->dev; in alloc_nand_resource()
1848 nand_release(info->host[cs]->mtd); in pxa3xx_nand_remove()
1920 struct mtd_info *mtd = info->host[cs]->mtd; in pxa3xx_nand_probe() local
1927 mtd->name = "pxa3xx_nand-0"; in pxa3xx_nand_probe()
1929 ret = pxa3xx_nand_scan(mtd); in pxa3xx_nand_probe()
1937 ret = mtd_device_parse_register(mtd, NULL, in pxa3xx_nand_probe()