Lines Matching +full:has +full:- +full:ecc

1 // SPDX-License-Identifier: GPL-2.0-or-later
24 #include <linux/dma-mapping.h>
30 #define LPC32XX_MODNAME "lpc32xx-nand"
56 #define SLCCTRL_ECC_CLEAR (1 << 1) /* Reset ECC bit */
63 #define SLCCFG_DMA_ECC (1 << 4) /* Enable DMA ECC bit */
64 #define SLCCFG_ECC_EN (1 << 3) /* ECC enable bit */
72 #define SLCSTAT_DMA_FIFO (1 << 2) /* DMA FIFO has data bit */
73 #define SLCSTAT_SLC_FIFO (1 << 1) /* SLC FIFO has data bit */
86 #define SLCTAC_CLOCKS(c, n, s) (min_t(u32, DIV_ROUND_UP(c, n) - 1, 0xF) << s)
108 /* ECC line party fetch macro */
113 * DMA requires storage space for the DMA local buffer and the hardware ECC
120 /* Number of bytes used for ECC stored in NAND per 256 bytes */
134 * NAND ECC Layout for small page NAND devices
141 return -ERANGE; in lpc32xx_ooblayout_ecc()
143 oobregion->length = 6; in lpc32xx_ooblayout_ecc()
144 oobregion->offset = 10; in lpc32xx_ooblayout_ecc()
153 return -ERANGE; in lpc32xx_ooblayout_free()
156 oobregion->offset = 0; in lpc32xx_ooblayout_free()
157 oobregion->length = 4; in lpc32xx_ooblayout_free()
159 oobregion->offset = 6; in lpc32xx_ooblayout_free()
160 oobregion->length = 4; in lpc32xx_ooblayout_free()
167 .ecc = lpc32xx_ooblayout_ecc,
229 * DMA and CPU addresses of ECC work area and data buffer
241 writel(SLCCTRL_SW_RESET, SLC_CTRL(host->io_base)); in lpc32xx_nand_setup()
245 writel(0, SLC_CFG(host->io_base)); in lpc32xx_nand_setup()
246 writel(0, SLC_IEN(host->io_base)); in lpc32xx_nand_setup()
248 SLC_ICR(host->io_base)); in lpc32xx_nand_setup()
251 clkrate = clk_get_rate(host->clk); in lpc32xx_nand_setup()
256 tmp = SLCTAC_WDR(host->ncfg->wdr_clks) | in lpc32xx_nand_setup()
257 SLCTAC_WWIDTH(clkrate, host->ncfg->wwidth) | in lpc32xx_nand_setup()
258 SLCTAC_WHOLD(clkrate, host->ncfg->whold) | in lpc32xx_nand_setup()
259 SLCTAC_WSETUP(clkrate, host->ncfg->wsetup) | in lpc32xx_nand_setup()
260 SLCTAC_RDR(host->ncfg->rdr_clks) | in lpc32xx_nand_setup()
261 SLCTAC_RWIDTH(clkrate, host->ncfg->rwidth) | in lpc32xx_nand_setup()
262 SLCTAC_RHOLD(clkrate, host->ncfg->rhold) | in lpc32xx_nand_setup()
263 SLCTAC_RSETUP(clkrate, host->ncfg->rsetup); in lpc32xx_nand_setup()
264 writel(tmp, SLC_TAC(host->io_base)); in lpc32xx_nand_setup()
277 tmp = readl(SLC_CFG(host->io_base)); in lpc32xx_nand_cmd_ctrl()
282 writel(tmp, SLC_CFG(host->io_base)); in lpc32xx_nand_cmd_ctrl()
286 writel(cmd, SLC_CMD(host->io_base)); in lpc32xx_nand_cmd_ctrl()
288 writel(cmd, SLC_ADDR(host->io_base)); in lpc32xx_nand_cmd_ctrl()
300 if ((readl(SLC_STAT(host->io_base)) & SLCSTAT_NAND_READY) != 0) in lpc32xx_nand_device_ready()
311 if (host->wp_gpio) in lpc32xx_wp_enable()
312 gpiod_set_value_cansleep(host->wp_gpio, 1); in lpc32xx_wp_enable()
320 if (host->wp_gpio) in lpc32xx_wp_disable()
321 gpiod_set_value_cansleep(host->wp_gpio, 0); in lpc32xx_wp_disable()
325 * Prepares SLC for transfers with H/W ECC enabled
329 /* Hardware ECC is enabled automatically in hardware as needed */ in lpc32xx_nand_ecc_enable()
333 * Calculates the ECC for the data
340 * ECC is calculated automatically in hardware during syndrome read in lpc32xx_nand_ecc_calculate()
353 return (uint8_t)readl(SLC_DATA(host->io_base)); in lpc32xx_nand_read_byte()
357 * Simple device read without ECC
363 /* Direct device read with no ECC */ in lpc32xx_nand_read_buf()
364 while (len-- > 0) in lpc32xx_nand_read_buf()
365 *buf++ = (uint8_t)readl(SLC_DATA(host->io_base)); in lpc32xx_nand_read_buf()
369 * Simple device write without ECC
376 /* Direct device write with no ECC */ in lpc32xx_nand_write_buf()
377 while (len-- > 0) in lpc32xx_nand_write_buf()
378 writel((uint32_t)*buf++, SLC_DATA(host->io_base)); in lpc32xx_nand_write_buf()
382 * Read the OOB data from the device without ECC using FIFO method
388 return nand_read_oob_op(chip, page, 0, chip->oob_poi, mtd->oobsize); in lpc32xx_nand_read_oob_syndrome()
392 * Write the OOB data to the device without ECC using FIFO method
398 return nand_prog_page_op(chip, page, mtd->writesize, chip->oob_poi, in lpc32xx_nand_write_oob_syndrome()
399 mtd->oobsize); in lpc32xx_nand_write_oob_syndrome()
403 * Fills in the ECC fields in the OOB buffer with the hardware generated ECC
405 static void lpc32xx_slc_ecc_copy(uint8_t *spare, const uint32_t *ecc, int count) in lpc32xx_slc_ecc_copy() argument
410 uint32_t ce = ecc[i / 3]; in lpc32xx_slc_ecc_copy()
434 host->dma_slave_config.direction = dir; in lpc32xx_xmit_dma()
435 host->dma_slave_config.src_addr = dma; in lpc32xx_xmit_dma()
436 host->dma_slave_config.dst_addr = dma; in lpc32xx_xmit_dma()
437 host->dma_slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; in lpc32xx_xmit_dma()
438 host->dma_slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; in lpc32xx_xmit_dma()
439 host->dma_slave_config.src_maxburst = 4; in lpc32xx_xmit_dma()
440 host->dma_slave_config.dst_maxburst = 4; in lpc32xx_xmit_dma()
442 host->dma_slave_config.device_fc = false; in lpc32xx_xmit_dma()
443 if (dmaengine_slave_config(host->dma_chan, &host->dma_slave_config)) { in lpc32xx_xmit_dma()
444 dev_err(mtd->dev.parent, "Failed to setup DMA slave\n"); in lpc32xx_xmit_dma()
445 return -ENXIO; in lpc32xx_xmit_dma()
448 sg_init_one(&host->sgl, mem, len); in lpc32xx_xmit_dma()
450 res = dma_map_sg(host->dma_chan->device->dev, &host->sgl, 1, in lpc32xx_xmit_dma()
453 dev_err(mtd->dev.parent, "Failed to map sg list\n"); in lpc32xx_xmit_dma()
454 return -ENXIO; in lpc32xx_xmit_dma()
456 desc = dmaengine_prep_slave_sg(host->dma_chan, &host->sgl, 1, dir, in lpc32xx_xmit_dma()
459 dev_err(mtd->dev.parent, "Failed to prepare slave sg\n"); in lpc32xx_xmit_dma()
463 init_completion(&host->comp); in lpc32xx_xmit_dma()
464 desc->callback = lpc32xx_dma_complete_func; in lpc32xx_xmit_dma()
465 desc->callback_param = &host->comp; in lpc32xx_xmit_dma()
468 dma_async_issue_pending(host->dma_chan); in lpc32xx_xmit_dma()
470 wait_for_completion_timeout(&host->comp, msecs_to_jiffies(1000)); in lpc32xx_xmit_dma()
472 dma_unmap_sg(host->dma_chan->device->dev, &host->sgl, 1, in lpc32xx_xmit_dma()
477 dma_unmap_sg(host->dma_chan->device->dev, &host->sgl, 1, in lpc32xx_xmit_dma()
479 return -ENXIO; in lpc32xx_xmit_dma()
483 * DMA read/write transfers with ECC support
502 dma_buf = host->data_buf; in lpc32xx_xfer()
505 memcpy(host->data_buf, buf, mtd->writesize); in lpc32xx_xfer()
509 writel(readl(SLC_CFG(host->io_base)) | in lpc32xx_xfer()
511 SLCCFG_DMA_BURST, SLC_CFG(host->io_base)); in lpc32xx_xfer()
513 writel((readl(SLC_CFG(host->io_base)) | in lpc32xx_xfer()
516 SLC_CFG(host->io_base)); in lpc32xx_xfer()
519 /* Clear initial ECC */ in lpc32xx_xfer()
520 writel(SLCCTRL_ECC_CLEAR, SLC_CTRL(host->io_base)); in lpc32xx_xfer()
523 writel(mtd->writesize, SLC_TC(host->io_base)); in lpc32xx_xfer()
526 writel(readl(SLC_CTRL(host->io_base)) | SLCCTRL_DMA_START, in lpc32xx_xfer()
527 SLC_CTRL(host->io_base)); in lpc32xx_xfer()
529 for (i = 0; i < chip->ecc.steps; i++) { in lpc32xx_xfer()
531 res = lpc32xx_xmit_dma(mtd, SLC_DMA_DATA(host->io_base_dma), in lpc32xx_xfer()
532 dma_buf + i * chip->ecc.size, in lpc32xx_xfer()
533 mtd->writesize / chip->ecc.steps, dir); in lpc32xx_xfer()
537 /* Always _read_ ECC */ in lpc32xx_xfer()
538 if (i == chip->ecc.steps - 1) in lpc32xx_xfer()
540 if (!read) /* ECC availability delayed on write */ in lpc32xx_xfer()
542 res = lpc32xx_xmit_dma(mtd, SLC_ECC(host->io_base_dma), in lpc32xx_xfer()
543 &host->ecc_buf[i], 4, DMA_DEV_TO_MEM); in lpc32xx_xfer()
551 * dmaengine DMA driver (amba-pl080), the condition (DMA_FIFO empty) in lpc32xx_xfer()
555 if (readl(SLC_STAT(host->io_base)) & SLCSTAT_DMA_FIFO) { in lpc32xx_xfer()
556 dev_warn(mtd->dev.parent, "FIFO not empty!\n"); in lpc32xx_xfer()
558 while ((readl(SLC_STAT(host->io_base)) & SLCSTAT_DMA_FIFO) && in lpc32xx_xfer()
562 dev_err(mtd->dev.parent, "FIFO held data too long\n"); in lpc32xx_xfer()
563 status = -EIO; in lpc32xx_xfer()
567 /* Read last calculated ECC value */ in lpc32xx_xfer()
570 host->ecc_buf[chip->ecc.steps - 1] = in lpc32xx_xfer()
571 readl(SLC_ECC(host->io_base)); in lpc32xx_xfer()
574 dmaengine_terminate_all(host->dma_chan); in lpc32xx_xfer()
576 if (readl(SLC_STAT(host->io_base)) & SLCSTAT_DMA_FIFO || in lpc32xx_xfer()
577 readl(SLC_TC(host->io_base))) { in lpc32xx_xfer()
579 dev_err(mtd->dev.parent, "DMA FIFO failure\n"); in lpc32xx_xfer()
580 status = -EIO; in lpc32xx_xfer()
583 /* Stop DMA & HW ECC */ in lpc32xx_xfer()
584 writel(readl(SLC_CTRL(host->io_base)) & ~SLCCTRL_DMA_START, in lpc32xx_xfer()
585 SLC_CTRL(host->io_base)); in lpc32xx_xfer()
586 writel(readl(SLC_CFG(host->io_base)) & in lpc32xx_xfer()
588 SLCCFG_DMA_BURST), SLC_CFG(host->io_base)); in lpc32xx_xfer()
591 memcpy(buf, host->data_buf, mtd->writesize); in lpc32xx_xfer()
597 * Read the data and OOB data from the device, use ECC correction with the
598 * data, disable ECC for the OOB data
612 /* Read data and oob, calculate ECC */ in lpc32xx_nand_read_page_syndrome()
613 status = lpc32xx_xfer(mtd, buf, chip->ecc.steps, 1); in lpc32xx_nand_read_page_syndrome()
616 chip->legacy.read_buf(chip, chip->oob_poi, mtd->oobsize); in lpc32xx_nand_read_page_syndrome()
618 /* Convert to stored ECC format */ in lpc32xx_nand_read_page_syndrome()
619 lpc32xx_slc_ecc_copy(tmpecc, (uint32_t *) host->ecc_buf, chip->ecc.steps); in lpc32xx_nand_read_page_syndrome()
621 /* Pointer to ECC data retrieved from NAND spare area */ in lpc32xx_nand_read_page_syndrome()
626 oobecc = chip->oob_poi + oobregion.offset; in lpc32xx_nand_read_page_syndrome()
628 for (i = 0; i < chip->ecc.steps; i++) { in lpc32xx_nand_read_page_syndrome()
629 stat = chip->ecc.correct(chip, buf, oobecc, in lpc32xx_nand_read_page_syndrome()
630 &tmpecc[i * chip->ecc.bytes]); in lpc32xx_nand_read_page_syndrome()
632 mtd->ecc_stats.failed++; in lpc32xx_nand_read_page_syndrome()
634 mtd->ecc_stats.corrected += stat; in lpc32xx_nand_read_page_syndrome()
636 buf += chip->ecc.size; in lpc32xx_nand_read_page_syndrome()
637 oobecc += chip->ecc.bytes; in lpc32xx_nand_read_page_syndrome()
644 * Read the data and OOB data from the device, no ECC correction with the
657 chip->legacy.read_buf(chip, buf, chip->ecc.size * chip->ecc.steps); in lpc32xx_nand_read_page_raw_syndrome()
658 chip->legacy.read_buf(chip, chip->oob_poi, mtd->oobsize); in lpc32xx_nand_read_page_raw_syndrome()
664 * Write the data and OOB data to the device, use ECC with the data,
665 * disable ECC for the OOB data
679 /* Write data, calculate ECC on outbound data */ in lpc32xx_nand_write_page_syndrome()
680 error = lpc32xx_xfer(mtd, (uint8_t *)buf, chip->ecc.steps, 0); in lpc32xx_nand_write_page_syndrome()
685 * The calculated ECC needs some manual work done to it before in lpc32xx_nand_write_page_syndrome()
686 * committing it to NAND. Process the calculated ECC and place in lpc32xx_nand_write_page_syndrome()
692 pb = chip->oob_poi + oobregion.offset; in lpc32xx_nand_write_page_syndrome()
693 lpc32xx_slc_ecc_copy(pb, (uint32_t *)host->ecc_buf, chip->ecc.steps); in lpc32xx_nand_write_page_syndrome()
695 /* Write ECC data to device */ in lpc32xx_nand_write_page_syndrome()
696 chip->legacy.write_buf(chip, chip->oob_poi, mtd->oobsize); in lpc32xx_nand_write_page_syndrome()
702 * Write the data and OOB data to the device, no ECC correction with the
713 chip->ecc.size * chip->ecc.steps); in lpc32xx_nand_write_page_raw_syndrome()
714 chip->legacy.write_buf(chip, chip->oob_poi, mtd->oobsize); in lpc32xx_nand_write_page_raw_syndrome()
721 struct mtd_info *mtd = nand_to_mtd(&host->nand_chip); in lpc32xx_nand_dma_setup()
724 host->dma_chan = dma_request_chan(mtd->dev.parent, "rx-tx"); in lpc32xx_nand_dma_setup()
725 if (IS_ERR(host->dma_chan)) { in lpc32xx_nand_dma_setup()
727 if (!host->pdata || !host->pdata->dma_filter) { in lpc32xx_nand_dma_setup()
728 dev_err(mtd->dev.parent, "no DMA platform data\n"); in lpc32xx_nand_dma_setup()
729 return -ENOENT; in lpc32xx_nand_dma_setup()
734 host->dma_chan = dma_request_channel(mask, host->pdata->dma_filter, "nand-slc"); in lpc32xx_nand_dma_setup()
736 if (!host->dma_chan) { in lpc32xx_nand_dma_setup()
737 dev_err(mtd->dev.parent, "Failed to request DMA channel\n"); in lpc32xx_nand_dma_setup()
738 return -EBUSY; in lpc32xx_nand_dma_setup()
748 struct device_node *np = dev->of_node; in lpc32xx_parse_dt()
754 of_property_read_u32(np, "nxp,wdr-clks", &ncfg->wdr_clks); in lpc32xx_parse_dt()
755 of_property_read_u32(np, "nxp,wwidth", &ncfg->wwidth); in lpc32xx_parse_dt()
756 of_property_read_u32(np, "nxp,whold", &ncfg->whold); in lpc32xx_parse_dt()
757 of_property_read_u32(np, "nxp,wsetup", &ncfg->wsetup); in lpc32xx_parse_dt()
758 of_property_read_u32(np, "nxp,rdr-clks", &ncfg->rdr_clks); in lpc32xx_parse_dt()
759 of_property_read_u32(np, "nxp,rwidth", &ncfg->rwidth); in lpc32xx_parse_dt()
760 of_property_read_u32(np, "nxp,rhold", &ncfg->rhold); in lpc32xx_parse_dt()
761 of_property_read_u32(np, "nxp,rsetup", &ncfg->rsetup); in lpc32xx_parse_dt()
763 if (!ncfg->wdr_clks || !ncfg->wwidth || !ncfg->whold || in lpc32xx_parse_dt()
764 !ncfg->wsetup || !ncfg->rdr_clks || !ncfg->rwidth || in lpc32xx_parse_dt()
765 !ncfg->rhold || !ncfg->rsetup) { in lpc32xx_parse_dt()
778 if (chip->ecc.engine_type != NAND_ECC_ENGINE_TYPE_ON_HOST) in lpc32xx_nand_attach_chip()
781 /* OOB and ECC CPU and DMA work areas */ in lpc32xx_nand_attach_chip()
782 host->ecc_buf = (uint32_t *)(host->data_buf + LPC32XX_DMA_DATA_SIZE); in lpc32xx_nand_attach_chip()
785 * Small page FLASH has a unique OOB layout, but large and huge in lpc32xx_nand_attach_chip()
789 if (mtd->writesize <= 512) in lpc32xx_nand_attach_chip()
792 chip->ecc.placement = NAND_ECC_PLACEMENT_INTERLEAVED; in lpc32xx_nand_attach_chip()
794 chip->ecc.size = 256; in lpc32xx_nand_attach_chip()
795 chip->ecc.strength = 1; in lpc32xx_nand_attach_chip()
796 chip->ecc.bytes = LPC32XX_SLC_DEV_ECC_BYTES; in lpc32xx_nand_attach_chip()
797 chip->ecc.prepad = 0; in lpc32xx_nand_attach_chip()
798 chip->ecc.postpad = 0; in lpc32xx_nand_attach_chip()
799 chip->ecc.read_page_raw = lpc32xx_nand_read_page_raw_syndrome; in lpc32xx_nand_attach_chip()
800 chip->ecc.read_page = lpc32xx_nand_read_page_syndrome; in lpc32xx_nand_attach_chip()
801 chip->ecc.write_page_raw = lpc32xx_nand_write_page_raw_syndrome; in lpc32xx_nand_attach_chip()
802 chip->ecc.write_page = lpc32xx_nand_write_page_syndrome; in lpc32xx_nand_attach_chip()
803 chip->ecc.write_oob = lpc32xx_nand_write_oob_syndrome; in lpc32xx_nand_attach_chip()
804 chip->ecc.read_oob = lpc32xx_nand_read_oob_syndrome; in lpc32xx_nand_attach_chip()
805 chip->ecc.calculate = lpc32xx_nand_ecc_calculate; in lpc32xx_nand_attach_chip()
806 chip->ecc.correct = rawnand_sw_hamming_correct; in lpc32xx_nand_attach_chip()
807 chip->ecc.hwctl = lpc32xx_nand_ecc_enable; in lpc32xx_nand_attach_chip()
811 * won't interfere with the ECC layout. Large and huge page in lpc32xx_nand_attach_chip()
814 if ((chip->bbt_options & NAND_BBT_USE_FLASH) && in lpc32xx_nand_attach_chip()
815 mtd->writesize <= 512) { in lpc32xx_nand_attach_chip()
816 chip->bbt_td = &bbt_smallpage_main_descr; in lpc32xx_nand_attach_chip()
817 chip->bbt_md = &bbt_smallpage_mirror_descr; in lpc32xx_nand_attach_chip()
839 host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL); in lpc32xx_nand_probe()
841 return -ENOMEM; in lpc32xx_nand_probe()
843 host->io_base = devm_platform_get_and_ioremap_resource(pdev, 0, &rc); in lpc32xx_nand_probe()
844 if (IS_ERR(host->io_base)) in lpc32xx_nand_probe()
845 return PTR_ERR(host->io_base); in lpc32xx_nand_probe()
847 host->io_base_dma = rc->start; in lpc32xx_nand_probe()
848 if (pdev->dev.of_node) in lpc32xx_nand_probe()
849 host->ncfg = lpc32xx_parse_dt(&pdev->dev); in lpc32xx_nand_probe()
850 if (!host->ncfg) { in lpc32xx_nand_probe()
851 dev_err(&pdev->dev, in lpc32xx_nand_probe()
853 return -ENOENT; in lpc32xx_nand_probe()
857 host->wp_gpio = gpiod_get_optional(&pdev->dev, NULL, GPIOD_OUT_LOW); in lpc32xx_nand_probe()
858 res = PTR_ERR_OR_ZERO(host->wp_gpio); in lpc32xx_nand_probe()
860 if (res != -EPROBE_DEFER) in lpc32xx_nand_probe()
861 dev_err(&pdev->dev, "WP GPIO is not available: %d\n", in lpc32xx_nand_probe()
866 gpiod_set_consumer_name(host->wp_gpio, "NAND WP"); in lpc32xx_nand_probe()
868 host->pdata = dev_get_platdata(&pdev->dev); in lpc32xx_nand_probe()
870 chip = &host->nand_chip; in lpc32xx_nand_probe()
873 nand_set_flash_node(chip, pdev->dev.of_node); in lpc32xx_nand_probe()
874 mtd->owner = THIS_MODULE; in lpc32xx_nand_probe()
875 mtd->dev.parent = &pdev->dev; in lpc32xx_nand_probe()
878 host->clk = devm_clk_get_enabled(&pdev->dev, NULL); in lpc32xx_nand_probe()
879 if (IS_ERR(host->clk)) { in lpc32xx_nand_probe()
880 dev_err(&pdev->dev, "Clock failure\n"); in lpc32xx_nand_probe()
881 res = -ENOENT; in lpc32xx_nand_probe()
886 chip->legacy.IO_ADDR_R = SLC_DATA(host->io_base); in lpc32xx_nand_probe()
887 chip->legacy.IO_ADDR_W = SLC_DATA(host->io_base); in lpc32xx_nand_probe()
888 chip->legacy.cmd_ctrl = lpc32xx_nand_cmd_ctrl; in lpc32xx_nand_probe()
889 chip->legacy.dev_ready = lpc32xx_nand_device_ready; in lpc32xx_nand_probe()
890 chip->legacy.chip_delay = 20; /* 20us command delay time */ in lpc32xx_nand_probe()
898 chip->legacy.read_byte = lpc32xx_nand_read_byte; in lpc32xx_nand_probe()
899 chip->legacy.read_buf = lpc32xx_nand_read_buf; in lpc32xx_nand_probe()
900 chip->legacy.write_buf = lpc32xx_nand_write_buf; in lpc32xx_nand_probe()
904 * extra space for the spare area and ECC storage area in lpc32xx_nand_probe()
906 host->dma_buf_len = LPC32XX_DMA_DATA_SIZE + LPC32XX_ECC_SAVE_SIZE; in lpc32xx_nand_probe()
907 host->data_buf = devm_kzalloc(&pdev->dev, host->dma_buf_len, in lpc32xx_nand_probe()
909 if (host->data_buf == NULL) { in lpc32xx_nand_probe()
910 res = -ENOMEM; in lpc32xx_nand_probe()
916 res = -EIO; in lpc32xx_nand_probe()
921 chip->legacy.dummy_controller.ops = &lpc32xx_nand_controller_ops; in lpc32xx_nand_probe()
926 mtd->name = "nxp_lpc3220_slc"; in lpc32xx_nand_probe()
927 res = mtd_device_register(mtd, host->ncfg->parts, in lpc32xx_nand_probe()
928 host->ncfg->num_parts); in lpc32xx_nand_probe()
937 dma_release_channel(host->dma_chan); in lpc32xx_nand_probe()
951 struct nand_chip *chip = &host->nand_chip; in lpc32xx_nand_remove()
957 dma_release_channel(host->dma_chan); in lpc32xx_nand_remove()
960 tmp = readl(SLC_CTRL(host->io_base)); in lpc32xx_nand_remove()
962 writel(tmp, SLC_CTRL(host->io_base)); in lpc32xx_nand_remove()
972 /* Re-enable NAND clock */ in lpc32xx_nand_resume()
973 ret = clk_prepare_enable(host->clk); in lpc32xx_nand_resume()
992 tmp = readl(SLC_CTRL(host->io_base)); in lpc32xx_nand_suspend()
994 writel(tmp, SLC_CTRL(host->io_base)); in lpc32xx_nand_suspend()
1000 clk_disable_unprepare(host->clk); in lpc32xx_nand_suspend()
1006 { .compatible = "nxp,lpc3220-slc" },