Lines Matching refs:spec_csr

219 static bool nfp_csr_spec_valid(struct nfp_dumpspec_csr *spec_csr)  in nfp_csr_spec_valid()  argument
221 u32 required_read_sz = sizeof(*spec_csr) - sizeof(spec_csr->tl); in nfp_csr_spec_valid()
222 u32 available_sz = be32_to_cpu(spec_csr->tl.length); in nfp_csr_spec_valid()
228 reg_width = be32_to_cpu(spec_csr->register_width); in nfp_csr_spec_valid()
258 struct nfp_dumpspec_csr *spec_csr; in nfp_add_tlv_size() local
269 spec_csr = (struct nfp_dumpspec_csr *)tl; in nfp_add_tlv_size()
270 if (!nfp_csr_spec_valid(spec_csr)) in nfp_add_tlv_size()
274 ALIGN8(be32_to_cpu(spec_csr->cpp.dump_length)); in nfp_add_tlv_size()
277 spec_csr = (struct nfp_dumpspec_csr *)tl; in nfp_add_tlv_size()
278 if (!nfp_csr_spec_valid(spec_csr)) in nfp_add_tlv_size()
282 ALIGN8(be32_to_cpu(spec_csr->cpp.dump_length) * in nfp_add_tlv_size()
454 nfp_dump_csr_range(struct nfp_pf *pf, struct nfp_dumpspec_csr *spec_csr, in nfp_dump_csr_range() argument
458 container_of(&spec_csr->tl, struct nfp_dump_tl, hdr); in nfp_dump_csr_range()
467 if (!nfp_csr_spec_valid(spec_csr)) in nfp_dump_csr_range()
470 reg_sz = be32_to_cpu(spec_csr->register_width) / BITS_PER_BYTE; in nfp_dump_csr_range()
473 ALIGN8(be32_to_cpu(spec_csr->cpp.dump_length)); in nfp_dump_csr_range()
480 dump_header->cpp = spec_csr->cpp; in nfp_dump_csr_range()
481 dump_header->register_width = spec_csr->register_width; in nfp_dump_csr_range()
483 cpp_id = nfp_get_numeric_cpp_id(&spec_csr->cpp.cpp_id); in nfp_dump_csr_range()
484 cpp_rd_addr = be32_to_cpu(spec_csr->cpp.offset); in nfp_dump_csr_range()
485 max_rd_addr = cpp_rd_addr + be32_to_cpu(spec_csr->cpp.dump_length); in nfp_dump_csr_range()
488 if (is_xpb_read(&spec_csr->cpp.cpp_id)) { in nfp_dump_csr_range()
541 struct nfp_dumpspec_csr *spec_csr, u32 address, in nfp_read_all_indirect_csr_ctx() argument
548 err = nfp_read_indirect_csr(cpp, spec_csr->cpp.cpp_id, address, in nfp_read_all_indirect_csr_ctx()
559 struct nfp_dumpspec_csr *spec_csr, in nfp_dump_indirect_csr_range() argument
563 container_of(&spec_csr->tl, struct nfp_dump_tl, hdr); in nfp_dump_indirect_csr_range()
571 if (!nfp_csr_spec_valid(spec_csr)) in nfp_dump_indirect_csr_range()
574 reg_sz = be32_to_cpu(spec_csr->register_width) / BITS_PER_BYTE; in nfp_dump_indirect_csr_range()
576 reg_data_length = be32_to_cpu(spec_csr->cpp.dump_length) * in nfp_dump_indirect_csr_range()
585 dump_header->cpp = spec_csr->cpp; in nfp_dump_indirect_csr_range()
586 dump_header->register_width = spec_csr->register_width; in nfp_dump_indirect_csr_range()
588 cpp_rd_addr = be32_to_cpu(spec_csr->cpp.offset); in nfp_dump_indirect_csr_range()
589 max_rd_addr = cpp_rd_addr + be32_to_cpu(spec_csr->cpp.dump_length); in nfp_dump_indirect_csr_range()
591 err = nfp_read_all_indirect_csr_ctx(pf->cpp, spec_csr, in nfp_dump_indirect_csr_range()
669 struct nfp_dumpspec_csr *spec_csr; in nfp_dump_for_tlv() local
681 spec_csr = (struct nfp_dumpspec_csr *)tl; in nfp_dump_for_tlv()
682 err = nfp_dump_csr_range(pf, spec_csr, dump); in nfp_dump_for_tlv()
687 spec_csr = (struct nfp_dumpspec_csr *)tl; in nfp_dump_for_tlv()
688 err = nfp_dump_indirect_csr_range(pf, spec_csr, dump); in nfp_dump_for_tlv()