Lines Matching refs:spec_csr
214 static bool nfp_csr_spec_valid(struct nfp_dumpspec_csr *spec_csr) in nfp_csr_spec_valid() argument
216 u32 required_read_sz = sizeof(*spec_csr) - sizeof(spec_csr->tl); in nfp_csr_spec_valid()
217 u32 available_sz = be32_to_cpu(spec_csr->tl.length); in nfp_csr_spec_valid()
223 reg_width = be32_to_cpu(spec_csr->register_width); in nfp_csr_spec_valid()
253 struct nfp_dumpspec_csr *spec_csr; in nfp_add_tlv_size() local
264 spec_csr = (struct nfp_dumpspec_csr *)tl; in nfp_add_tlv_size()
265 if (!nfp_csr_spec_valid(spec_csr)) in nfp_add_tlv_size()
269 ALIGN8(be32_to_cpu(spec_csr->cpp.dump_length)); in nfp_add_tlv_size()
272 spec_csr = (struct nfp_dumpspec_csr *)tl; in nfp_add_tlv_size()
273 if (!nfp_csr_spec_valid(spec_csr)) in nfp_add_tlv_size()
277 ALIGN8(be32_to_cpu(spec_csr->cpp.dump_length) * in nfp_add_tlv_size()
449 nfp_dump_csr_range(struct nfp_pf *pf, struct nfp_dumpspec_csr *spec_csr, in nfp_dump_csr_range() argument
460 if (!nfp_csr_spec_valid(spec_csr)) in nfp_dump_csr_range()
461 return nfp_dump_error_tlv(&spec_csr->tl, -EINVAL, dump); in nfp_dump_csr_range()
463 reg_sz = be32_to_cpu(spec_csr->register_width) / BITS_PER_BYTE; in nfp_dump_csr_range()
466 ALIGN8(be32_to_cpu(spec_csr->cpp.dump_length)); in nfp_dump_csr_range()
469 err = nfp_add_tlv(be32_to_cpu(spec_csr->tl.type), total_size, dump); in nfp_dump_csr_range()
473 dump_header->cpp = spec_csr->cpp; in nfp_dump_csr_range()
474 dump_header->register_width = spec_csr->register_width; in nfp_dump_csr_range()
476 cpp_id = nfp_get_numeric_cpp_id(&spec_csr->cpp.cpp_id); in nfp_dump_csr_range()
477 cpp_rd_addr = be32_to_cpu(spec_csr->cpp.offset); in nfp_dump_csr_range()
478 max_rd_addr = cpp_rd_addr + be32_to_cpu(spec_csr->cpp.dump_length); in nfp_dump_csr_range()
481 if (is_xpb_read(&spec_csr->cpp.cpp_id)) { in nfp_dump_csr_range()
534 struct nfp_dumpspec_csr *spec_csr, u32 address, in nfp_read_all_indirect_csr_ctx() argument
541 err = nfp_read_indirect_csr(cpp, spec_csr->cpp.cpp_id, address, in nfp_read_all_indirect_csr_ctx()
552 struct nfp_dumpspec_csr *spec_csr, in nfp_dump_indirect_csr_range() argument
562 if (!nfp_csr_spec_valid(spec_csr)) in nfp_dump_indirect_csr_range()
563 return nfp_dump_error_tlv(&spec_csr->tl, -EINVAL, dump); in nfp_dump_indirect_csr_range()
565 reg_sz = be32_to_cpu(spec_csr->register_width) / BITS_PER_BYTE; in nfp_dump_indirect_csr_range()
567 reg_data_length = be32_to_cpu(spec_csr->cpp.dump_length) * in nfp_dump_indirect_csr_range()
572 err = nfp_add_tlv(be32_to_cpu(spec_csr->tl.type), total_size, dump); in nfp_dump_indirect_csr_range()
576 dump_header->cpp = spec_csr->cpp; in nfp_dump_indirect_csr_range()
577 dump_header->register_width = spec_csr->register_width; in nfp_dump_indirect_csr_range()
579 cpp_rd_addr = be32_to_cpu(spec_csr->cpp.offset); in nfp_dump_indirect_csr_range()
580 max_rd_addr = cpp_rd_addr + be32_to_cpu(spec_csr->cpp.dump_length); in nfp_dump_indirect_csr_range()
582 err = nfp_read_all_indirect_csr_ctx(pf->cpp, spec_csr, in nfp_dump_indirect_csr_range()
658 struct nfp_dumpspec_csr *spec_csr; in nfp_dump_for_tlv() local
670 spec_csr = (struct nfp_dumpspec_csr *)tl; in nfp_dump_for_tlv()
671 err = nfp_dump_csr_range(pf, spec_csr, dump); in nfp_dump_for_tlv()
676 spec_csr = (struct nfp_dumpspec_csr *)tl; in nfp_dump_for_tlv()
677 err = nfp_dump_indirect_csr_range(pf, spec_csr, dump); in nfp_dump_for_tlv()