aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ntb/hw
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2015-06-18 05:17:30 -0400
committerJon Mason <jdmason@kudzu.us>2015-07-04 14:09:32 -0400
commitbf44fe4671f97ee17d178e08c2d3b346188d062b (patch)
tree5ae734e7eb21f60266555efffb55082013a9e694 /drivers/ntb/hw
parentfd839bf88485878ec602dbb3146fd44769eb3784 (diff)
NTB: Add split BAR output for debugfs stats
When split BAR is enabled, the driver needs to dump out the split BAR registers rather than the original 64bit BAR registers. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
Diffstat (limited to 'drivers/ntb/hw')
-rw-r--r--drivers/ntb/hw/intel/ntb_hw_intel.c83
1 files changed, 68 insertions, 15 deletions
diff --git a/drivers/ntb/hw/intel/ntb_hw_intel.c b/drivers/ntb/hw/intel/ntb_hw_intel.c
index ba4dc0d7e1f3..87751cfd6f4f 100644
--- a/drivers/ntb/hw/intel/ntb_hw_intel.c
+++ b/drivers/ntb/hw/intel/ntb_hw_intel.c
@@ -632,17 +632,36 @@ static ssize_t ndev_debugfs_read(struct file *filp, char __user *ubuf,
632 off += scnprintf(buf + off, buf_size - off, 632 off += scnprintf(buf + off, buf_size - off,
633 "XLAT23 -\t\t%#018llx\n", u.v64); 633 "XLAT23 -\t\t%#018llx\n", u.v64);
634 634
635 u.v64 = ioread64(mmio + bar2_off(ndev->xlat_reg->bar2_xlat, 4)); 635 if (ndev->bar4_split) {
636 off += scnprintf(buf + off, buf_size - off, 636 u.v32 = ioread32(mmio + bar2_off(ndev->xlat_reg->bar2_xlat, 4));
637 "XLAT45 -\t\t%#018llx\n", u.v64); 637 off += scnprintf(buf + off, buf_size - off,
638 "XLAT4 -\t\t\t%#06x\n", u.v32);
639
640 u.v32 = ioread32(mmio + bar2_off(ndev->xlat_reg->bar2_xlat, 5));
641 off += scnprintf(buf + off, buf_size - off,
642 "XLAT5 -\t\t\t%#06x\n", u.v32);
643 } else {
644 u.v64 = ioread64(mmio + bar2_off(ndev->xlat_reg->bar2_xlat, 4));
645 off += scnprintf(buf + off, buf_size - off,
646 "XLAT45 -\t\t%#018llx\n", u.v64);
647 }
638 648
639 u.v64 = ioread64(mmio + bar2_off(ndev->xlat_reg->bar2_limit, 2)); 649 u.v64 = ioread64(mmio + bar2_off(ndev->xlat_reg->bar2_limit, 2));
640 off += scnprintf(buf + off, buf_size - off, 650 off += scnprintf(buf + off, buf_size - off,
641 "LMT23 -\t\t\t%#018llx\n", u.v64); 651 "LMT23 -\t\t\t%#018llx\n", u.v64);
642 652
643 u.v64 = ioread64(mmio + bar2_off(ndev->xlat_reg->bar2_limit, 4)); 653 if (ndev->bar4_split) {
644 off += scnprintf(buf + off, buf_size - off, 654 u.v32 = ioread32(mmio + bar2_off(ndev->xlat_reg->bar2_limit, 4));
645 "LMT45 -\t\t\t%#018llx\n", u.v64); 655 off += scnprintf(buf + off, buf_size - off,
656 "LMT4 -\t\t\t%#06x\n", u.v32);
657 u.v32 = ioread32(mmio + bar2_off(ndev->xlat_reg->bar2_limit, 5));
658 off += scnprintf(buf + off, buf_size - off,
659 "LMT5 -\t\t\t%#06x\n", u.v32);
660 } else {
661 u.v64 = ioread64(mmio + bar2_off(ndev->xlat_reg->bar2_limit, 4));
662 off += scnprintf(buf + off, buf_size - off,
663 "LMT45 -\t\t\t%#018llx\n", u.v64);
664 }
646 665
647 if (pdev_is_xeon(ndev->ntb.pdev)) { 666 if (pdev_is_xeon(ndev->ntb.pdev)) {
648 if (ntb_topo_is_b2b(ndev->ntb.topo)) { 667 if (ntb_topo_is_b2b(ndev->ntb.topo)) {
@@ -653,17 +672,41 @@ static ssize_t ndev_debugfs_read(struct file *filp, char __user *ubuf,
653 off += scnprintf(buf + off, buf_size - off, 672 off += scnprintf(buf + off, buf_size - off,
654 "B2B XLAT23 -\t\t%#018llx\n", u.v64); 673 "B2B XLAT23 -\t\t%#018llx\n", u.v64);
655 674
656 u.v64 = ioread64(mmio + XEON_PBAR45XLAT_OFFSET); 675 if (ndev->bar4_split) {
657 off += scnprintf(buf + off, buf_size - off, 676 u.v32 = ioread32(mmio + XEON_PBAR4XLAT_OFFSET);
658 "B2B XLAT45 -\t\t%#018llx\n", u.v64); 677 off += scnprintf(buf + off, buf_size - off,
678 "B2B XLAT4 -\t\t%#06x\n",
679 u.v32);
680 u.v32 = ioread32(mmio + XEON_PBAR5XLAT_OFFSET);
681 off += scnprintf(buf + off, buf_size - off,
682 "B2B XLAT5 -\t\t%#06x\n",
683 u.v32);
684 } else {
685 u.v64 = ioread64(mmio + XEON_PBAR45XLAT_OFFSET);
686 off += scnprintf(buf + off, buf_size - off,
687 "B2B XLAT45 -\t\t%#018llx\n",
688 u.v64);
689 }
659 690
660 u.v64 = ioread64(mmio + XEON_PBAR23LMT_OFFSET); 691 u.v64 = ioread64(mmio + XEON_PBAR23LMT_OFFSET);
661 off += scnprintf(buf + off, buf_size - off, 692 off += scnprintf(buf + off, buf_size - off,
662 "B2B LMT23 -\t\t%#018llx\n", u.v64); 693 "B2B LMT23 -\t\t%#018llx\n", u.v64);
663 694
664 u.v64 = ioread64(mmio + XEON_PBAR45LMT_OFFSET); 695 if (ndev->bar4_split) {
665 off += scnprintf(buf + off, buf_size - off, 696 u.v32 = ioread32(mmio + XEON_PBAR4LMT_OFFSET);
666 "B2B LMT45 -\t\t%#018llx\n", u.v64); 697 off += scnprintf(buf + off, buf_size - off,
698 "B2B LMT4 -\t\t%#06x\n",
699 u.v32);
700 u.v32 = ioread32(mmio + XEON_PBAR5LMT_OFFSET);
701 off += scnprintf(buf + off, buf_size - off,
702 "B2B LMT5 -\t\t%#06x\n",
703 u.v32);
704 } else {
705 u.v64 = ioread64(mmio + XEON_PBAR45LMT_OFFSET);
706 off += scnprintf(buf + off, buf_size - off,
707 "B2B LMT45 -\t\t%#018llx\n",
708 u.v64);
709 }
667 710
668 off += scnprintf(buf + off, buf_size - off, 711 off += scnprintf(buf + off, buf_size - off,
669 "\nNTB Secondary BAR:\n"); 712 "\nNTB Secondary BAR:\n");
@@ -676,9 +719,19 @@ static ssize_t ndev_debugfs_read(struct file *filp, char __user *ubuf,
676 off += scnprintf(buf + off, buf_size - off, 719 off += scnprintf(buf + off, buf_size - off,
677 "SBAR23 -\t\t%#018llx\n", u.v64); 720 "SBAR23 -\t\t%#018llx\n", u.v64);
678 721
679 u.v64 = ioread64(mmio + XEON_SBAR45BASE_OFFSET); 722 if (ndev->bar4_split) {
680 off += scnprintf(buf + off, buf_size - off, 723 u.v32 = ioread32(mmio + XEON_SBAR4BASE_OFFSET);
681 "SBAR45 -\t\t%#018llx\n", u.v64); 724 off += scnprintf(buf + off, buf_size - off,
725 "SBAR4 -\t\t\t%#06x\n", u.v32);
726 u.v32 = ioread32(mmio + XEON_SBAR5BASE_OFFSET);
727 off += scnprintf(buf + off, buf_size - off,
728 "SBAR5 -\t\t\t%#06x\n", u.v32);
729 } else {
730 u.v64 = ioread64(mmio + XEON_SBAR45BASE_OFFSET);
731 off += scnprintf(buf + off, buf_size - off,
732 "SBAR45 -\t\t%#018llx\n",
733 u.v64);
734 }
682 } 735 }
683 736
684 off += scnprintf(buf + off, buf_size - off, 737 off += scnprintf(buf + off, buf_size - off,