Lines Matching refs:this

71  * You will see a DMA timeout in this case. The bug has been fixed
74 * To avoid this bug, just add a new parameter `just_enable` for
119 static int __gpmi_enable_clk(struct gpmi_nand_data *this, bool v)
126 clk = this->resources.clock[i];
142 clk_disable_unprepare(this->resources.clock[i - 1]);
146 static int gpmi_init(struct gpmi_nand_data *this)
148 struct resources *r = &this->resources;
151 ret = pm_runtime_resume_and_get(this->dev);
163 ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MXS(this));
189 pm_runtime_mark_last_busy(this->dev);
190 pm_runtime_put_autosuspend(this->dev);
195 static void gpmi_dump_info(struct gpmi_nand_data *this)
197 struct resources *r = &this->resources;
198 struct bch_geometry *geo = &this->bch_geometry;
202 dev_err(this->dev, "Show GPMI registers :\n");
205 dev_err(this->dev, "offset 0x%.3x : 0x%.8x\n", i * 0x10, reg);
209 dev_err(this->dev, "Show BCH registers :\n");
212 dev_err(this->dev, "offset 0x%.3x : 0x%.8x\n", i * 0x10, reg);
214 dev_err(this->dev, "BCH Geometry :\n"
241 static bool gpmi_check_ecc(struct gpmi_nand_data *this)
243 struct nand_chip *chip = &this->nand;
244 struct bch_geometry *geo = &this->bch_geometry;
252 if (GPMI_IS_MXS(this)) {
258 if (geo->ecc_strength > this->devdata->bch_max_ecc_strength)
268 static bool bbm_in_data_chunk(struct gpmi_nand_data *this,
271 struct bch_geometry *geo = &this->bch_geometry;
272 struct nand_chip *chip = &this->nand;
277 dev_err(this->dev,
292 dev_dbg(this->dev, "Set ecc to %d and bbm in chunk %d\n",
304 * We may have available oob space in this case.
306 static int set_geometry_by_ecc_info(struct gpmi_nand_data *this,
310 struct bch_geometry *geo = &this->bch_geometry;
311 struct nand_chip *chip = &this->nand;
323 dev_err(this->dev,
332 if (!gpmi_check_ecc(this))
337 dev_err(this->dev,
405 if (!this->swap_block_mark)
436 static inline int get_ecc_strength(struct gpmi_nand_data *this)
438 struct bch_geometry *geo = &this->bch_geometry;
439 struct mtd_info *mtd = nand_to_mtd(&this->nand);
449 static int set_geometry_for_large_oob(struct gpmi_nand_data *this)
451 struct bch_geometry *geo = &this->bch_geometry;
452 struct nand_chip *chip = &this->nand;
467 /* check if platform can support this nand */
468 if (!gpmi_check_ecc(this)) {
469 dev_err(this->dev,
481 max_ecc = min(get_ecc_strength(this),
482 this->devdata->bch_max_ecc_strength);
490 if (bbm_in_data_chunk(this, &bbm_chunk))
502 /* check if oob can afford this extra ecc chunk */
505 dev_err(this->dev, "unsupported NAND chip with new layout\n");
531 if (!this->swap_block_mark)
544 dev_dbg(this->dev, "BCH Geometry :\n"
577 static int legacy_set_geometry(struct gpmi_nand_data *this)
579 struct bch_geometry *geo = &this->bch_geometry;
580 struct mtd_info *mtd = nand_to_mtd(&this->nand);
607 geo->ecc_strength = get_ecc_strength(this);
608 if (!gpmi_check_ecc(this)) {
609 dev_err(this->dev,
613 this->devdata->bch_max_ecc_strength);
633 if (!this->swap_block_mark)
691 static int common_nfc_set_geometry(struct gpmi_nand_data *this)
693 struct nand_chip *chip = &this->nand;
694 struct mtd_info *mtd = nand_to_mtd(&this->nand);
700 use_minimun_ecc = of_property_read_bool(this->dev->of_node,
706 dev_dbg(this->dev, "use legacy bch geometry\n");
707 err = legacy_set_geometry(this);
714 dev_dbg(this->dev, "use large oob bch geometry\n");
715 err = set_geometry_for_large_oob(this);
721 dev_dbg(this->dev, "use minimum ecc bch geometry\n");
722 err = set_geometry_by_ecc_info(this, requirements->strength,
725 dev_err(this->dev, "none of the bch geometry setting works\n");
731 static int bch_set_geometry(struct gpmi_nand_data *this)
733 struct resources *r = &this->resources;
736 ret = common_nfc_set_geometry(this);
740 ret = pm_runtime_get_sync(this->dev);
742 pm_runtime_put_autosuspend(this->dev);
747 * Due to erratum #2847 of the MX23, the BCH cannot be soft reset on this
751 ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MXS(this));
760 pm_runtime_mark_last_busy(this->dev);
761 pm_runtime_put_autosuspend(this->dev);
840 static int gpmi_nfc_compute_timings(struct gpmi_nand_data *this,
843 struct gpmi_nfc_hardware_timing *hw = &this->hw;
844 struct resources *r = &this->resources;
845 unsigned int dll_threshold_ps = this->devdata->max_chain_delay;
875 dev_err(this->dev, "clock setting: expected %ld, got %ld\n",
925 static int gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
927 struct gpmi_nfc_hardware_timing *hw = &this->hw;
928 struct resources *r = &this->resources;
937 if (GPMI_IS_MX6Q(this) || GPMI_IS_MX6SX(this))
942 dev_err(this->dev, "cannot set clock rate to %lu Hz: %d\n", hw->clk_rate, ret);
946 if (GPMI_IS_MX6Q(this) || GPMI_IS_MX6SX(this)) {
976 struct gpmi_nand_data *this = nand_get_controller_data(chip);
986 if (sdr->tRC_min <= 25000 && !GPMI_IS_MX28(this) && !GPMI_IS_MX6(this))
989 /* Stop here if this call was just a check */
994 ret = gpmi_nfc_compute_timings(this, sdr);
998 this->hw.must_apply_timings = true;
1004 static void gpmi_clear_bch(struct gpmi_nand_data *this)
1006 struct resources *r = &this->resources;
1010 static struct dma_chan *get_dma_chan(struct gpmi_nand_data *this)
1013 return this->dma_chans[0];
1019 struct gpmi_nand_data *this = param;
1020 struct completion *dma_c = &this->dma_done;
1027 struct gpmi_nand_data *this = cookie;
1029 gpmi_clear_bch(this);
1030 complete(&this->bch_done);
1034 static int gpmi_raw_len_to_len(struct gpmi_nand_data *this, int raw_len)
1040 if (this->bch)
1041 return ALIGN_DOWN(raw_len, this->bch_geometry.eccn_chunk_size);
1047 static bool prepare_data_dma(struct gpmi_nand_data *this, const void *buf,
1052 int len = gpmi_raw_len_to_len(this, raw_len);
1057 ret = dma_map_sg(this->dev, sgl, 1, dr);
1066 sg_init_one(sgl, this->data_buffer_dma, len);
1068 if (dr == DMA_TO_DEVICE && buf != this->data_buffer_dma)
1069 memcpy(this->data_buffer_dma, buf, len);
1071 dma_map_sg(this->dev, sgl, 1, dr);
1093 struct gpmi_nand_data *this = nand_get_controller_data(chip);
1094 struct bch_geometry *geo = &this->bch_geometry;
1109 struct gpmi_nand_data *this = nand_get_controller_data(chip);
1110 struct bch_geometry *geo = &this->bch_geometry;
1181 static int acquire_register_block(struct gpmi_nand_data *this,
1184 struct platform_device *pdev = this->pdev;
1185 struct resources *res = &this->resources;
1197 dev_err(this->dev, "unknown resource name : %s\n", res_name);
1202 static int acquire_bch_irq(struct gpmi_nand_data *this, irq_handler_t irq_h)
1204 struct platform_device *pdev = this->pdev;
1212 err = devm_request_irq(this->dev, err, irq_h, 0, res_name, this);
1214 dev_err(this->dev, "error requesting BCH IRQ\n");
1219 static void release_dma_channels(struct gpmi_nand_data *this)
1223 if (this->dma_chans[i]) {
1224 dma_release_channel(this->dma_chans[i]);
1225 this->dma_chans[i] = NULL;
1229 static int acquire_dma_channels(struct gpmi_nand_data *this)
1231 struct platform_device *pdev = this->pdev;
1238 ret = dev_err_probe(this->dev, PTR_ERR(dma_chan),
1240 release_dma_channels(this);
1242 this->dma_chans[0] = dma_chan;
1248 static int gpmi_get_clks(struct gpmi_nand_data *this)
1250 struct resources *r = &this->resources;
1254 for (i = 0; i < this->devdata->clks_count; i++) {
1255 clk = devm_clk_get(this->dev, this->devdata->clks[i]);
1267 dev_dbg(this->dev, "failed in finding the clocks.\n");
1271 static int acquire_resources(struct gpmi_nand_data *this)
1275 ret = acquire_register_block(this, GPMI_NAND_GPMI_REGS_ADDR_RES_NAME);
1279 ret = acquire_register_block(this, GPMI_NAND_BCH_REGS_ADDR_RES_NAME);
1283 ret = acquire_bch_irq(this, bch_irq);
1287 ret = acquire_dma_channels(this);
1291 ret = gpmi_get_clks(this);
1297 release_dma_channels(this);
1302 static void release_resources(struct gpmi_nand_data *this)
1304 release_dma_channels(this);
1307 static void gpmi_free_dma_buffer(struct gpmi_nand_data *this)
1309 struct device *dev = this->dev;
1310 struct bch_geometry *geo = &this->bch_geometry;
1312 if (this->auxiliary_virt && virt_addr_valid(this->auxiliary_virt))
1314 this->auxiliary_virt,
1315 this->auxiliary_phys);
1316 kfree(this->data_buffer_dma);
1317 kfree(this->raw_buffer);
1319 this->data_buffer_dma = NULL;
1320 this->raw_buffer = NULL;
1324 static int gpmi_alloc_dma_buffer(struct gpmi_nand_data *this)
1326 struct bch_geometry *geo = &this->bch_geometry;
1327 struct device *dev = this->dev;
1328 struct mtd_info *mtd = nand_to_mtd(&this->nand);
1338 this->data_buffer_dma = kzalloc(mtd->writesize ?: PAGE_SIZE,
1340 if (this->data_buffer_dma == NULL)
1343 this->auxiliary_virt = dma_alloc_coherent(dev, geo->auxiliary_size,
1344 &this->auxiliary_phys, GFP_DMA);
1345 if (!this->auxiliary_virt)
1348 this->raw_buffer = kzalloc((mtd->writesize ?: PAGE_SIZE) + mtd->oobsize, GFP_KERNEL);
1349 if (!this->raw_buffer)
1355 gpmi_free_dma_buffer(this);
1364 static void block_mark_swapping(struct gpmi_nand_data *this,
1367 struct bch_geometry *nfc_geo = &this->bch_geometry;
1375 if (!this->swap_block_mark)
1410 struct gpmi_nand_data *this = nand_get_controller_data(chip);
1411 struct bch_geometry *nfc_geo = &this->bch_geometry;
1418 status = this->auxiliary_virt + ALIGN(meta, 4);
1426 u8 *eccbuf = this->raw_buffer;
1459 * nothing was written into this subpage the ECC is
1461 * at this point that we are reading an erased page and
1463 * ecc_strength bitflips. If this is a page with random
1464 * data, we exceed this number of bitflips and have a
1473 this->auxiliary_virt,
1503 static void gpmi_bch_layout_std(struct gpmi_nand_data *this)
1505 struct bch_geometry *geo = &this->bch_geometry;
1511 this->bch_flashlayout0 =
1514 BF_BCH_FLASH0LAYOUT0_ECC0(ecc_strength, this) |
1515 BF_BCH_FLASH0LAYOUT0_GF(gf_len, this) |
1516 BF_BCH_FLASH0LAYOUT0_DATA0_SIZE(block0_size, this);
1518 this->bch_flashlayout1 =
1520 BF_BCH_FLASH0LAYOUT1_ECCN(ecc_strength, this) |
1521 BF_BCH_FLASH0LAYOUT1_GF(gf_len, this) |
1522 BF_BCH_FLASH0LAYOUT1_DATAN_SIZE(blockn_size, this);
1528 struct gpmi_nand_data *this = nand_get_controller_data(chip);
1530 struct bch_geometry *geo = &this->bch_geometry;
1534 gpmi_bch_layout_std(this);
1535 this->bch = true;
1546 block_mark_swapping(this, buf, this->auxiliary_virt);
1560 chip->oob_poi[0] = ((uint8_t *)this->auxiliary_virt)[0];
1570 struct gpmi_nand_data *this = nand_get_controller_data(chip);
1571 struct bch_geometry *geo = &this->bch_geometry;
1588 if (this->swap_block_mark) {
1591 * If this chunk is in the range of [first, last],
1598 dev_dbg(this->dev,
1636 this->bch_flashlayout0 = BF_BCH_FLASH0LAYOUT0_NBLOCKS(
1639 BF_BCH_FLASH0LAYOUT0_ECC0(ecc_strength, this) |
1640 BF_BCH_FLASH0LAYOUT0_GF(geo->gf_len, this) |
1642 0 : geo->ecc0_chunk_size), this);
1644 this->bch_flashlayout1 = BF_BCH_FLASH0LAYOUT1_PAGE_SIZE(page_size) |
1645 BF_BCH_FLASH0LAYOUT1_ECCN(ecc_strength, this) |
1646 BF_BCH_FLASH0LAYOUT1_GF(geo->gf_len, this) |
1647 BF_BCH_FLASH0LAYOUT1_DATAN_SIZE(geo->eccn_chunk_size, this);
1649 this->bch = true;
1655 dev_dbg(this->dev, "page:%d(%d:%d)%d, chunk:(%d:%d), BCH PG size:%d\n",
1667 struct gpmi_nand_data *this = nand_get_controller_data(chip);
1668 struct bch_geometry *nfc_geo = &this->bch_geometry;
1670 dev_dbg(this->dev, "ecc write page.\n");
1672 gpmi_bch_layout_std(this);
1673 this->bch = true;
1675 memcpy(this->auxiliary_virt, chip->oob_poi, nfc_geo->auxiliary_size);
1677 if (this->swap_block_mark) {
1682 memcpy(this->data_buffer_dma, buf, mtd->writesize);
1683 buf = this->data_buffer_dma;
1684 block_mark_swapping(this, this->data_buffer_dma,
1685 this->auxiliary_virt);
1692 * There are several places in this driver where we have to handle the OOB and
1694 * this is where we try to explain it all. All the other places refer back to
1715 * What we do for this specific read operation depends on two questions:
1754 struct gpmi_nand_data *this = nand_get_controller_data(chip);
1771 if (GPMI_IS_MX23(this)) {
1814 struct gpmi_nand_data *this = nand_get_controller_data(chip);
1815 struct bch_geometry *nfc_geo = &this->bch_geometry;
1818 u8 *tmp_buf = this->raw_buffer;
1835 * See the layout description for a detailed explanation on why this
1838 if (this->swap_block_mark)
1842 * Copy the metadata section into the oob buffer (this section is
1899 struct gpmi_nand_data *this = nand_get_controller_data(chip);
1900 struct bch_geometry *nfc_geo = &this->bch_geometry;
1903 u8 *tmp_buf = this->raw_buffer;
1956 * See the layout description for a detailed explanation on why this
1959 if (this->swap_block_mark)
1979 struct gpmi_nand_data *this = nand_get_controller_data(chip);
1987 column = !GPMI_IS_MX23(this) ? mtd->writesize : 0;
1990 block_mark = this->data_buffer_dma;
2003 static int nand_boot_set_geometry(struct gpmi_nand_data *this)
2005 struct boot_rom_geometry *geometry = &this->rom_geometry;
2010 * In principle, we should be reading this from the OTP bits, since
2020 * In principle, we should be reading this from the OTP bits, since
2030 static int mx23_check_transcription_stamp(struct gpmi_nand_data *this)
2032 struct boot_rom_geometry *rom_geo = &this->rom_geometry;
2033 struct device *dev = this->dev;
2034 struct nand_chip *chip = &this->nand;
2085 static int mx23_write_transcription_stamp(struct gpmi_nand_data *this)
2087 struct device *dev = this->dev;
2088 struct boot_rom_geometry *rom_geo = &this->rom_geometry;
2089 struct nand_chip *chip = &this->nand;
2121 /* Erase this block. */
2151 static int mx23_boot_init(struct gpmi_nand_data *this)
2153 struct device *dev = this->dev;
2154 struct nand_chip *chip = &this->nand;
2170 if (mx23_check_transcription_stamp(this))
2188 * Compute the chip, page and byte addresses for this block's
2206 * again, but this time the result will be a mark in the
2220 mx23_write_transcription_stamp(this);
2224 static int nand_boot_init(struct gpmi_nand_data *this)
2226 nand_boot_set_geometry(this);
2229 if (GPMI_IS_MX23(this))
2230 return mx23_boot_init(this);
2234 static int gpmi_set_geometry(struct gpmi_nand_data *this)
2239 gpmi_free_dma_buffer(this);
2242 ret = bch_set_geometry(this);
2244 dev_err(this->dev, "Error setting BCH geometry : %d\n", ret);
2249 return gpmi_alloc_dma_buffer(this);
2252 static int gpmi_init_last(struct gpmi_nand_data *this)
2254 struct nand_chip *chip = &this->nand;
2257 struct bch_geometry *bch_geo = &this->bch_geometry;
2261 ret = gpmi_set_geometry(this);
2284 if (GPMI_IS_MX6(this) &&
2295 struct gpmi_nand_data *this = nand_get_controller_data(chip);
2301 if (of_property_read_bool(this->dev->of_node,
2303 this->swap_block_mark = false;
2305 dev_dbg(this->dev, "Blockmark swapping %sabled\n",
2306 this->swap_block_mark ? "en" : "dis");
2308 ret = gpmi_init_last(this);
2317 static struct gpmi_transfer *get_next_transfer(struct gpmi_nand_data *this)
2319 struct gpmi_transfer *transfer = &this->transfers[this->ntransfers];
2321 this->ntransfers++;
2323 if (this->ntransfers == GPMI_MAX_TRANSFERS)
2330 struct gpmi_nand_data *this, u8 cmd, const u8 *addr, int naddr)
2332 struct dma_chan *channel = get_dma_chan(this);
2335 int chip = this->nand.cur_cs;
2341 | BF_GPMI_CTRL0_CS(chip, this)
2342 | BF_GPMI_CTRL0_LOCK_CS(LOCK_CS_ENABLE, this)
2353 transfer = get_next_transfer(this);
2362 dma_map_sg(this->dev, &transfer->sgl, 1, DMA_TO_DEVICE);
2372 struct gpmi_nand_data *this)
2374 struct dma_chan *channel = get_dma_chan(this);
2379 | BF_GPMI_CTRL0_CS(this->nand.cur_cs, this)
2380 | BF_GPMI_CTRL0_LOCK_CS(LOCK_CS_ENABLE, this)
2390 struct gpmi_nand_data *this, void *buf, int raw_len, bool *direct)
2393 struct dma_chan *channel = get_dma_chan(this);
2397 transfer = get_next_transfer(this);
2403 *direct = prepare_data_dma(this, buf, raw_len, &transfer->sgl,
2408 | BF_GPMI_CTRL0_CS(this->nand.cur_cs, this)
2409 | BF_GPMI_CTRL0_LOCK_CS(LOCK_CS_ENABLE, this)
2413 if (this->bch) {
2420 pio[5] = this->auxiliary_phys;
2428 if (!this->bch)
2437 struct gpmi_nand_data *this, const void *buf, int raw_len)
2439 struct dma_chan *channel = get_dma_chan(this);
2444 transfer = get_next_transfer(this);
2450 prepare_data_dma(this, buf, raw_len, &transfer->sgl, DMA_TO_DEVICE);
2454 | BF_GPMI_CTRL0_CS(this->nand.cur_cs, this)
2455 | BF_GPMI_CTRL0_LOCK_CS(LOCK_CS_ENABLE, this)
2459 if (this->bch) {
2466 pio[5] = this->auxiliary_phys;
2471 (this->bch ? MXS_DMA_CTRL_WAIT4END : 0));
2475 if (!this->bch)
2488 struct gpmi_nand_data *this = nand_get_controller_data(chip);
2501 this->ntransfers = 0;
2503 this->transfers[i].direction = DMA_NONE;
2505 ret = pm_runtime_resume_and_get(this->dev);
2515 if (this->hw.must_apply_timings) {
2516 this->hw.must_apply_timings = false;
2517 ret = gpmi_nfc_apply_timings(this);
2522 dev_dbg(this->dev, "%s: %d instructions\n", __func__, op->ninstrs);
2531 desc = gpmi_chain_wait_ready(this);
2537 * When this command has an address cycle chain it
2544 desc = gpmi_chain_command(this, cmd, NULL, 0);
2548 desc = gpmi_chain_command(this, cmd, instr->ctx.addr.addrs,
2556 desc = gpmi_chain_data_write(this, buf_write, buf_len);
2566 desc = gpmi_chain_data_read(this, buf_read, buf_len,
2577 dev_dbg(this->dev, "%s setup done\n", __func__);
2580 dev_err(this->dev, "Multiple data instructions not supported\n");
2585 if (this->bch) {
2586 writel(this->bch_flashlayout0,
2587 this->resources.bch_regs + HW_BCH_FLASH0LAYOUT0);
2588 writel(this->bch_flashlayout1,
2589 this->resources.bch_regs + HW_BCH_FLASH0LAYOUT1);
2593 desc->callback_param = this;
2594 dma_completion = &this->dma_done;
2599 if (this->bch && buf_read) {
2601 this->resources.bch_regs + HW_BCH_CTRL_SET);
2602 bch_completion = &this->bch_done;
2607 dma_async_issue_pending(get_dma_chan(this));
2611 dev_err(this->dev, "DMA timeout, last DMA\n");
2612 gpmi_dump_info(this);
2617 if (this->bch && buf_read) {
2620 dev_err(this->dev, "BCH timeout, last DMA\n");
2621 gpmi_dump_info(this);
2628 this->resources.bch_regs + HW_BCH_CTRL_CLR);
2629 gpmi_clear_bch(this);
2634 for (i = 0; i < this->ntransfers; i++) {
2635 struct gpmi_transfer *transfer = &this->transfers[i];
2638 dma_unmap_sg(this->dev, &transfer->sgl, 1,
2643 memcpy(buf_read, this->data_buffer_dma,
2644 gpmi_raw_len_to_len(this, buf_len));
2646 this->bch = false;
2649 pm_runtime_mark_last_busy(this->dev);
2650 pm_runtime_put_autosuspend(this->dev);
2661 static int gpmi_nand_init(struct gpmi_nand_data *this)
2663 struct nand_chip *chip = &this->nand;
2669 mtd->dev.parent = this->dev;
2672 nand_set_controller_data(chip, this);
2673 nand_set_flash_node(chip, this->pdev->dev.of_node);
2679 this->swap_block_mark = !GPMI_IS_MX23(this);
2685 this->bch_geometry.payload_size = 1024;
2686 this->bch_geometry.auxiliary_size = 128;
2687 ret = gpmi_alloc_dma_buffer(this);
2691 nand_controller_init(&this->base);
2692 this->base.ops = &gpmi_nand_controller_ops;
2693 chip->controller = &this->base;
2695 ret = nand_scan(chip, GPMI_IS_MX6(this) ? 2 : 1);
2699 ret = nand_boot_init(this);
2714 gpmi_free_dma_buffer(this);
2730 struct gpmi_nand_data *this;
2733 this = devm_kzalloc(&pdev->dev, sizeof(*this), GFP_KERNEL);
2734 if (!this)
2737 this->devdata = of_device_get_match_data(&pdev->dev);
2738 platform_set_drvdata(pdev, this);
2739 this->pdev = pdev;
2740 this->dev = &pdev->dev;
2742 ret = acquire_resources(this);
2746 ret = __gpmi_enable_clk(this, true);
2756 ret = gpmi_init(this);
2760 ret = gpmi_nand_init(this);
2767 dev_info(this->dev, "driver registered.\n");
2774 release_resources(this);
2782 struct gpmi_nand_data *this = platform_get_drvdata(pdev);
2783 struct nand_chip *chip = &this->nand;
2792 gpmi_free_dma_buffer(this);
2793 release_resources(this);
2799 struct gpmi_nand_data *this = dev_get_drvdata(dev);
2801 release_dma_channels(this);
2807 struct gpmi_nand_data *this = dev_get_drvdata(dev);
2810 ret = acquire_dma_channels(this);
2815 ret = gpmi_init(this);
2817 dev_err(this->dev, "Error setting GPMI : %d\n", ret);
2822 if (this->hw.clk_rate)
2823 this->hw.must_apply_timings = true;
2826 ret = bch_set_geometry(this);
2828 dev_err(this->dev, "Error setting BCH : %d\n", ret);
2838 struct gpmi_nand_data *this = dev_get_drvdata(dev);
2840 return __gpmi_enable_clk(this, false);
2845 struct gpmi_nand_data *this = dev_get_drvdata(dev);
2847 return __gpmi_enable_clk(this, true);