Lines Matching refs:hdl

60 getmcprops(struct mcamd_hdl *hdl, mcamd_node_t *mc, const char *caller,  in getmcprops()  argument
63 if (!mcamd_get_numprops(hdl, in getmcprops()
77 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "%s: failed to read mc " in getmcprops()
79 return (mcamd_set_errno(hdl, EMCAMD_TREEINVALID)); in getmcprops()
86 getcsprops(struct mcamd_hdl *hdl, mcamd_node_t *cs, const char *caller, in getcsprops() argument
89 if (!mcamd_get_numprops(hdl, in getcsprops()
96 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "%s: failed to read cs " in getcsprops()
98 return (mcamd_set_errno(hdl, EMCAMD_TREEINVALID)); in getcsprops()
105 gettbls(struct mcamd_hdl *hdl, uint_t csmode, struct mcprops *mcpp, in gettbls() argument
114 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "%s: no bank address mode " in gettbls()
116 return (mcamd_set_errno(hdl, EMCAMD_NOTSUP)); in gettbls()
120 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "%s: no dram address map " in gettbls()
123 return (mcamd_set_errno(hdl, EMCAMD_NOTSUP)); in gettbls()
127 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "%s: no bank swizzling " in gettbls()
129 return (mcamd_set_errno(hdl, EMCAMD_NOTSUP)); in gettbls()
137 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "%s: " in gettbls()
143 return (mcamd_set_errno(hdl, EMCAMD_NOTSUP)); in gettbls()
154 iaddr_add(struct mcamd_hdl *hdl, uint64_t in, uint64_t add, const char *what) in iaddr_add() argument
158 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "%s: 0x%llx | 0x%llx --> 0x%llx", in iaddr_add()
170 iaddr_to_row(struct mcamd_hdl *hdl, const struct rct_bnkaddrmode *bamp, in iaddr_to_row() argument
188 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "iaddr_to_row: iaddr 0x%llx --> " in iaddr_to_row()
196 row_to_iaddr(struct mcamd_hdl *hdl, const struct rct_bnkaddrmode *bamp, in row_to_iaddr() argument
218 iaddr_to_col(struct mcamd_hdl *hdl, const struct rct_bnkaddrmode *bamp, in iaddr_to_col() argument
241 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "iaddr_to_col: iaddr 0x%llx --> " in iaddr_to_col()
249 col_to_iaddr(struct mcamd_hdl *hdl, const struct rct_bnkaddrmode *bamp, in col_to_iaddr() argument
280 iaddr_to_bank(struct mcamd_hdl *hdl, const struct rct_rcbmap *rcbm, in iaddr_to_bank() argument
311 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "iaddr_to_bank: iaddr 0x%llx --> " in iaddr_to_bank()
327 bank_to_iaddr(struct mcamd_hdl *hdl, const struct rct_rcbmap *rcbm, in bank_to_iaddr() argument
349 iaddr_to_rcb(struct mcamd_hdl *hdl, uint_t csmode, struct mcprops *mcpp, in iaddr_to_rcb() argument
357 if (gettbls(hdl, csmode, mcpp, &bamp, &rcbmp, in iaddr_to_rcb()
362 *rowp = iaddr_to_row(hdl, bamp, rcbmp, &csi, iaddr); in iaddr_to_rcb()
363 *colp = iaddr_to_col(hdl, bamp, rcbmp, iaddr); in iaddr_to_rcb()
364 *bankp = iaddr_to_bank(hdl, rcbmp, swzlp, iaddr); in iaddr_to_rcb()
375 iaddr_unnormalize(struct mcamd_hdl *hdl, struct mcprops *mcpp, uint64_t iaddr, in iaddr_unnormalize() argument
395 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "iaddr_unnormalize: " in iaddr_unnormalize()
398 return (mcamd_set_errno(hdl, EMCAMD_TREEINVALID)); in iaddr_unnormalize()
423 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "iaddr_unnormalize: iaddr 0x%llx " in iaddr_unnormalize()
432 mc_pa_to_offset(struct mcamd_hdl *hdl, mcamd_node_t *mc, mcamd_node_t *cs, in mc_pa_to_offset() argument
443 if (getmcprops(hdl, mc, "mc_dimm_offset", &mcp) < 0 || in mc_pa_to_offset()
444 getcsprops(hdl, cs, "mc_dimm_offset", &csp) < 0) in mc_pa_to_offset()
449 if (iaddr_to_rcb(hdl, csmode, &mcp, iaddr, &rowaddr, in mc_pa_to_offset()
479 mc_offset_to_pa(struct mcamd_hdl *hdl, mcamd_node_t *mc, mcamd_node_t *dimm, in mc_offset_to_pa() argument
501 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "mc_offset_to_pa: offset 0x%llx " in mc_offset_to_pa()
505 if (getmcprops(hdl, mc, "mc_offset_to_pa", &mcp) < 0) in mc_offset_to_pa()
516 for (cs = mcamd_cs_next(hdl, dimm, NULL); cs != NULL; in mc_offset_to_pa()
517 cs = mcamd_cs_next(hdl, dimm, cs)) { in mc_offset_to_pa()
518 if (getcsprops(hdl, cs, "mc_offset_to_pa", &csp) < 0) in mc_offset_to_pa()
526 mcamd_dprintf(hdl, MCAMD_DBG_FLOW, "mc_offset_to_pa: Current " in mc_offset_to_pa()
529 return (mcamd_set_errno(hdl, EMCAMD_NOADDR)); in mc_offset_to_pa()
544 return (mcamd_set_errno(hdl, EMCAMD_NOADDR)); in mc_offset_to_pa()
546 return (mcamd_set_errno(hdl, EMCAMD_NOADDR)); in mc_offset_to_pa()
554 for (cs = mcamd_cs_next(hdl, mc, NULL); cs != NULL; in mc_offset_to_pa()
555 cs = mcamd_cs_next(hdl, mc, cs)) { in mc_offset_to_pa()
558 if (!mcamd_get_numprop(hdl, cs, MCAMD_PROP_NUM, in mc_offset_to_pa()
560 mcamd_dprintf(hdl, MCAMD_DBG_ERR, in mc_offset_to_pa()
563 return (mcamd_set_errno(hdl, in mc_offset_to_pa()
571 mcamd_dprintf(hdl, MCAMD_DBG_ERR, "mcamd_offset_to_pa: " in mc_offset_to_pa()
573 return (mcamd_set_errno(hdl, EMCAMD_TREEINVALID)); in mc_offset_to_pa()
577 if (getcsprops(hdl, cs, "mc_offset_to_pa", &csp) < 0) in mc_offset_to_pa()
583 if (gettbls(hdl, csmode, &mcp, &bamp, &rcbmp, in mc_offset_to_pa()
593 iaddr |= iaddr_add(hdl, iaddr, in mc_offset_to_pa()
602 iaddr |= iaddr_add(hdl, iaddr, in mc_offset_to_pa()
612 iaddr |= iaddr_add(hdl, iaddr, in mc_offset_to_pa()
621 iaddr |= iaddr_add(hdl, iaddr, in mc_offset_to_pa()
622 row_to_iaddr(hdl, bamp, rcbmp, &csi, rowaddr), in mc_offset_to_pa()
628 iaddr |= iaddr_add(hdl, iaddr, in mc_offset_to_pa()
629 col_to_iaddr(hdl, bamp, rcbmp, coladdr), in mc_offset_to_pa()
635 iaddr |= iaddr_add(hdl, iaddr, in mc_offset_to_pa()
636 bank_to_iaddr(hdl, rcbmp, swzlp, iaddr, bankaddr), in mc_offset_to_pa()
643 if (iaddr_unnormalize(hdl, &mcp, iaddr, pap) < 0) in mc_offset_to_pa()
650 mcamd_cs_size(struct mcamd_hdl *hdl, mcamd_node_t *mc, int csnum, size_t *szp) in mcamd_cs_size() argument
656 if (getmcprops(hdl, mc, "mcamd_cs_size", &mcp) < 0) in mcamd_cs_size()
661 if (gettbls(hdl, csmode, &mcp, &bamp, NULL, NULL, NULL, in mcamd_cs_size()