Lines Matching refs:rknand
211 struct rk_nfc_nand_chip *rknand = rk_nfc_to_rknand(chip); in rk_nfc_buf_to_oob_ecc_ptr() local
214 poi = chip->oob_poi + rknand->metadata_size + chip->ecc.bytes * i; in rk_nfc_buf_to_oob_ecc_ptr()
264 struct rk_nfc_nand_chip *rknand = rk_nfc_to_rknand(chip); in rk_nfc_select_chip() local
277 nfc->selected_bank = rknand->sels[cs]; in rk_nfc_select_chip()
290 if (nfc->cur_timing != rknand->timing) { in rk_nfc_select_chip()
291 writel(rknand->timing, nfc->regs + NFC_FMWAIT); in rk_nfc_select_chip()
292 nfc->cur_timing = rknand->timing; in rk_nfc_select_chip()
417 struct rk_nfc_nand_chip *rknand = rk_nfc_to_rknand(chip); in rk_nfc_setup_interface() local
463 rknand->timing = ACCTIMING(tc2rw, trwpw, trw2c); in rk_nfc_setup_interface()
509 struct rk_nfc_nand_chip *rknand = rk_nfc_to_rknand(chip); in rk_nfc_write_page_raw() local
517 (page < (pages_per_blk * rknand->boot_blks)) && in rk_nfc_write_page_raw()
518 rknand->boot_ecc != ecc->strength) { in rk_nfc_write_page_raw()
593 struct rk_nfc_nand_chip *rknand = rk_nfc_to_rknand(chip); in rk_nfc_write_page_hwecc() local
636 if ((page < (pages_per_blk * rknand->boot_blks)) && in rk_nfc_write_page_hwecc()
639 if (rknand->boot_ecc != ecc->strength) in rk_nfc_write_page_hwecc()
640 rk_nfc_hw_ecc_setup(chip, rknand->boot_ecc); in rk_nfc_write_page_hwecc()
684 if (boot_rom_mode && rknand->boot_ecc != ecc->strength) in rk_nfc_write_page_hwecc()
703 struct rk_nfc_nand_chip *rknand = rk_nfc_to_rknand(chip); in rk_nfc_read_page_raw() local
711 (page < (pages_per_blk * rknand->boot_blks)) && in rk_nfc_read_page_raw()
712 rknand->boot_ecc != ecc->strength) { in rk_nfc_read_page_raw()
759 struct rk_nfc_nand_chip *rknand = rk_nfc_to_rknand(chip); in rk_nfc_read_page_hwecc() local
784 if ((page < (pages_per_blk * rknand->boot_blks)) && in rk_nfc_read_page_hwecc()
787 if (rknand->boot_ecc != ecc->strength) in rk_nfc_read_page_hwecc()
788 rk_nfc_hw_ecc_setup(chip, rknand->boot_ecc); in rk_nfc_read_page_hwecc()
856 if (boot_rom_mode && rknand->boot_ecc != ecc->strength) in rk_nfc_read_page_hwecc()
939 struct rk_nfc_nand_chip *rknand = rk_nfc_to_rknand(chip); in rk_nfc_ooblayout_free() local
944 oob_region->length = rknand->metadata_size - NFC_SYS_DATA_SIZE - 2; in rk_nfc_ooblayout_free()
954 struct rk_nfc_nand_chip *rknand = rk_nfc_to_rknand(chip); in rk_nfc_ooblayout_ecc() local
959 oob_region->length = mtd->oobsize - rknand->metadata_size; in rk_nfc_ooblayout_ecc()
960 oob_region->offset = rknand->metadata_size; in rk_nfc_ooblayout_ecc()
1018 struct rk_nfc_nand_chip *rknand = rk_nfc_to_rknand(chip); in rk_nfc_attach_chip() local
1036 rknand->metadata_size = NFC_SYS_DATA_SIZE * ecc->steps; in rk_nfc_attach_chip()
1038 if (rknand->metadata_size < NFC_SYS_DATA_SIZE + 2) { in rk_nfc_attach_chip()
1106 struct rk_nfc_nand_chip *rknand; in rk_nfc_nand_chip_init() local
1122 rknand = devm_kzalloc(dev, struct_size(rknand, sels, nsels), in rk_nfc_nand_chip_init()
1124 if (!rknand) in rk_nfc_nand_chip_init()
1127 rknand->nsels = nsels; in rk_nfc_nand_chip_init()
1145 rknand->sels[i] = tmp; in rk_nfc_nand_chip_init()
1148 chip = &rknand->chip; in rk_nfc_nand_chip_init()
1178 rknand->boot_blks = ret ? 0 : tmp; in rk_nfc_nand_chip_init()
1182 rknand->boot_ecc = ret ? chip->ecc.strength : tmp; in rk_nfc_nand_chip_init()
1192 list_add_tail(&rknand->node, &nfc->chips); in rk_nfc_nand_chip_init()
1199 struct rk_nfc_nand_chip *rknand, *tmp; in rk_nfc_chips_cleanup() local
1203 list_for_each_entry_safe(rknand, tmp, &nfc->chips, node) { in rk_nfc_chips_cleanup()
1204 chip = &rknand->chip; in rk_nfc_chips_cleanup()
1208 list_del(&rknand->node); in rk_nfc_chips_cleanup()
1455 struct rk_nfc_nand_chip *rknand; in rk_nfc_resume() local
1465 list_for_each_entry(rknand, &nfc->chips, node) { in rk_nfc_resume()
1466 chip = &rknand->chip; in rk_nfc_resume()
1467 for (i = 0; i < rknand->nsels; i++) in rk_nfc_resume()