Lines Matching refs:nfc_op

272 static void anfc_trigger_op(struct arasan_nfc *nfc, struct anfc_op *nfc_op)
274 writel_relaxed(nfc_op->pkt_reg, nfc->base + PKT_REG);
275 writel_relaxed(nfc_op->addr1_reg, nfc->base + MEM_ADDR1_REG);
276 writel_relaxed(nfc_op->addr2_reg, nfc->base + MEM_ADDR2_REG);
277 writel_relaxed(nfc_op->cmd_reg, nfc->base + CMD_REG);
278 writel_relaxed(nfc_op->prog_reg, nfc->base + PROG_REG);
402 struct anfc_op nfc_op = {
432 anfc_trigger_op(nfc, &nfc_op);
520 struct anfc_op nfc_op = {
556 anfc_trigger_op(nfc, &nfc_op);
597 struct anfc_op *nfc_op)
606 memset(nfc_op, 0, sizeof(*nfc_op));
607 nfc_op->addr2_reg = ADDR2_CS(nfc->native_cs);
608 nfc_op->cmd_reg = CMD_PAGE_SIZE(anand->page_sz);
620 nfc_op->cmd_reg |= CMD_1(instr->ctx.cmd.opcode);
622 nfc_op->cmd_reg |= CMD_2(instr->ctx.cmd.opcode);
631 nfc_op->cmd_reg |= CMD_NADDRS(naddrs);
635 nfc_op->addr1_reg |= (u32)addrs[i] << i * 8;
637 nfc_op->addr2_reg |= addrs[i];
642 nfc_op->read = true;
647 nfc_op->buf = &buf[offset];
648 nfc_op->len = nand_subop_get_data_len(subop, op_id);
649 ret = anfc_pkt_len_config(nfc_op->len, &nfc_op->steps,
668 nfc_op->pkt_reg |= PKT_SIZE(round_up(pktsize, 4)) |
669 PKT_STEPS(nfc_op->steps);
672 nfc_op->rdy_timeout_ms = instr->ctx.waitrdy.timeout_ms;
680 static int anfc_rw_pio_op(struct arasan_nfc *nfc, struct anfc_op *nfc_op)
682 unsigned int dwords = (nfc_op->len / 4) / nfc_op->steps;
683 unsigned int last_len = nfc_op->len % 4;
685 u8 *buf = nfc_op->buf;
688 for (i = 0; i < nfc_op->steps; i++) {
689 dir = nfc_op->read ? READ_READY : WRITE_READY;
693 nfc_op->read ? "Read" : "Write");
698 if (nfc_op->read)
709 offset = nfc_op->len - last_len;
711 if (nfc_op->read) {
728 struct anfc_op nfc_op = {};
731 ret = anfc_parse_instructions(chip, subop, &nfc_op);
735 nfc_op.prog_reg = prog_reg;
736 anfc_trigger_op(nfc, &nfc_op);
738 if (nfc_op.rdy_timeout_ms) {
739 ret = anfc_wait_for_rb(nfc, chip, nfc_op.rdy_timeout_ms);
744 return anfc_rw_pio_op(nfc, &nfc_op);
792 struct anfc_op nfc_op = {};
795 ret = anfc_parse_instructions(chip, subop, &nfc_op);
799 nfc_op.prog_reg = prog_reg;
800 anfc_trigger_op(nfc, &nfc_op);
806 if (nfc_op.rdy_timeout_ms)
807 ret = anfc_wait_for_rb(nfc, chip, nfc_op.rdy_timeout_ms);
849 struct anfc_op nfc_op = {};
852 ret = anfc_parse_instructions(chip, subop, &nfc_op);
856 return anfc_wait_for_rb(nfc, chip, nfc_op.rdy_timeout_ms);