Lines Matching refs:ndfc

45 	struct ndfc_controller *ndfc = nand_get_controller_data(nchip);  in ndfc_select_chip()  local
47 ccr = in_be32(ndfc->ndfcbase + NDFC_CCR); in ndfc_select_chip()
50 ccr |= NDFC_CCR_BS(chip + ndfc->chip_select); in ndfc_select_chip()
53 out_be32(ndfc->ndfcbase + NDFC_CCR, ccr); in ndfc_select_chip()
58 struct ndfc_controller *ndfc = nand_get_controller_data(chip); in ndfc_hwcontrol() local
64 writel(cmd & 0xFF, ndfc->ndfcbase + NDFC_CMD); in ndfc_hwcontrol()
66 writel(cmd & 0xFF, ndfc->ndfcbase + NDFC_ALE); in ndfc_hwcontrol()
71 struct ndfc_controller *ndfc = nand_get_controller_data(chip); in ndfc_ready() local
73 return in_be32(ndfc->ndfcbase + NDFC_STAT) & NDFC_STAT_IS_READY; in ndfc_ready()
79 struct ndfc_controller *ndfc = nand_get_controller_data(chip); in ndfc_enable_hwecc() local
81 ccr = in_be32(ndfc->ndfcbase + NDFC_CCR); in ndfc_enable_hwecc()
83 out_be32(ndfc->ndfcbase + NDFC_CCR, ccr); in ndfc_enable_hwecc()
90 struct ndfc_controller *ndfc = nand_get_controller_data(chip); in ndfc_calculate_ecc() local
95 ecc = in_be32(ndfc->ndfcbase + NDFC_ECC); in ndfc_calculate_ecc()
113 struct ndfc_controller *ndfc = nand_get_controller_data(chip); in ndfc_read_buf() local
117 *p++ = in_be32(ndfc->ndfcbase + NDFC_DATA); in ndfc_read_buf()
122 struct ndfc_controller *ndfc = nand_get_controller_data(chip); in ndfc_write_buf() local
126 out_be32(ndfc->ndfcbase + NDFC_DATA, *p++); in ndfc_write_buf()
132 static int ndfc_chip_init(struct ndfc_controller *ndfc, in ndfc_chip_init() argument
136 struct nand_chip *chip = &ndfc->chip; in ndfc_chip_init()
140 chip->legacy.IO_ADDR_R = ndfc->ndfcbase + NDFC_DATA; in ndfc_chip_init()
141 chip->legacy.IO_ADDR_W = ndfc->ndfcbase + NDFC_DATA; in ndfc_chip_init()
146 chip->controller = &ndfc->ndfc_control; in ndfc_chip_init()
156 nand_set_controller_data(chip, ndfc); in ndfc_chip_init()
158 mtd->dev.parent = &ndfc->ofdev->dev; in ndfc_chip_init()
165 mtd->name = kasprintf(GFP_KERNEL, "%s.%pOFn", dev_name(&ndfc->ofdev->dev), in ndfc_chip_init()
187 struct ndfc_controller *ndfc; in ndfc_probe() local
206 ndfc = &ndfc_ctrl[cs]; in ndfc_probe()
207 ndfc->chip_select = cs; in ndfc_probe()
209 nand_controller_init(&ndfc->ndfc_control); in ndfc_probe()
210 ndfc->ofdev = ofdev; in ndfc_probe()
211 dev_set_drvdata(&ofdev->dev, ndfc); in ndfc_probe()
213 ndfc->ndfcbase = of_iomap(ofdev->dev.of_node, 0); in ndfc_probe()
214 if (!ndfc->ndfcbase) { in ndfc_probe()
219 ccr = NDFC_CCR_BS(ndfc->chip_select); in ndfc_probe()
226 out_be32(ndfc->ndfcbase + NDFC_CCR, ccr); in ndfc_probe()
231 int offset = NDFC_BCFG0 + (ndfc->chip_select << 2); in ndfc_probe()
232 out_be32(ndfc->ndfcbase + offset, be32_to_cpup(reg)); in ndfc_probe()
235 err = ndfc_chip_init(ndfc, ofdev->dev.of_node); in ndfc_probe()
237 iounmap(ndfc->ndfcbase); in ndfc_probe()
246 struct ndfc_controller *ndfc = dev_get_drvdata(&ofdev->dev); in ndfc_remove() local
247 struct nand_chip *chip = &ndfc->chip; in ndfc_remove()