Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Decode link control2's Compliance Preset/De-emph...



details:   https://anonhg.NetBSD.org/src/rev/992853499082
branches:  trunk
changeset: 1029234:992853499082
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Dec 28 09:16:05 2021 +0000

description:
Decode link control2's Compliance Preset/De-emphasis more. Fix typo.

diffstat:

 sys/dev/pci/pci_subr.c |  43 +++++++++++++++++++++++++++++++++++++++----
 sys/dev/pci/pcireg.h   |   4 ++--
 2 files changed, 41 insertions(+), 6 deletions(-)

diffs (89 lines):

diff -r 7079e5c6a03f -r 992853499082 sys/dev/pci/pci_subr.c
--- a/sys/dev/pci/pci_subr.c    Tue Dec 28 06:36:29 2021 +0000
+++ b/sys/dev/pci/pci_subr.c    Tue Dec 28 09:16:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_subr.c,v 1.233 2021/12/03 13:27:38 andvar Exp $    */
+/*     $NetBSD: pci_subr.c,v 1.234 2021/12/28 09:16:05 msaitoh Exp $   */
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.233 2021/12/03 13:27:38 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.234 2021/12/28 09:16:05 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -1833,6 +1833,41 @@
        }
 }
 
+static const struct _pcie_link_compliance_preset_deemphasis {
+       const char *preshoot;
+       const char *deemphasis;
+} pcie_link_compliance_preset_deemphasis[] = {
+       { "0.0",        "-6.0+-1.5" },  /* P0 */
+       { "0.0",        "-3.5+-1" },    /* P1 */
+       { "0.0",        "-4.4+-1.5" },  /* P2 */
+       { "0.0",        "-2.5+-1" },    /* P3 */
+       { "0.0",        "0.0" },        /* P4 */
+       { "1.9+-1",     "0.0" },        /* P5 */
+       { "2.5+-1",     "0.0" },        /* P6 */
+       { "3.5+-1",     "-6.0+-1.5" },  /* P7 */
+       { "3.5+-1",     "-3.5+-1" },    /* P8 */
+       { "3.5+-1",     "0.0" },        /* P9 */
+       { "0.0",        NULL }          /* P10 */
+};
+
+static void
+pci_print_pcie_link_compliance_preset_deemphasis(pcireg_t val)
+{
+       const char *deemphasis;
+
+       if (val >= __arraycount(pcie_link_compliance_preset_deemphasis)) {
+               printf("unknown value (0x%hhx)", val);
+               return;
+       }
+
+       printf("Preshoot %sdB",
+           pcie_link_compliance_preset_deemphasis[val].preshoot);
+       deemphasis = pcie_link_compliance_preset_deemphasis[val].deemphasis;
+
+       if (deemphasis != NULL)
+               printf(", De-emphasis %sdB", deemphasis);
+}
+
 static void
 pci_conf_print_pcie_cap(const pcireg_t *regs, int capoff)
 {
@@ -2366,8 +2401,8 @@
                    PCIREG_SHIFTOUT(reg,  PCIE_LCSR2_TX_MARGIN));
                onoff("Enter Modified Compliance", reg, PCIE_LCSR2_EN_MCOMP);
                onoff("Compliance SOS", reg, PCIE_LCSR2_COMP_SOS);
-               printf("      Compliance Present/De-emphasis: ");
-               pci_print_pcie_link_deemphasis(
+               printf("      Compliance Preset/De-emphasis: ");
+               pci_print_pcie_link_compliance_preset_deemphasis(
                        PCIREG_SHIFTOUT(reg, PCIE_LCSR2_COMP_DEEMP));
                printf("\n");
 
diff -r 7079e5c6a03f -r 992853499082 sys/dev/pci/pcireg.h
--- a/sys/dev/pci/pcireg.h      Tue Dec 28 06:36:29 2021 +0000
+++ b/sys/dev/pci/pcireg.h      Tue Dec 28 09:16:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcireg.h,v 1.161 2021/10/10 23:28:36 msaitoh Exp $     */
+/*     $NetBSD: pcireg.h,v 1.162 2021/12/28 09:16:05 msaitoh Exp $     */
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -1174,7 +1174,7 @@
 #define PCIE_LCSR2_TX_MARGIN   __BITS(9, 7)   /* Transmit Margin */
 #define PCIE_LCSR2_EN_MCOMP    __BIT(10)      /* Enter Modified Compliance */
 #define PCIE_LCSR2_COMP_SOS    __BIT(11)      /* Compliance SOS */
-#define PCIE_LCSR2_COMP_DEEMP  __BITS(15, 12) /* Compliance Present/De-emph */
+#define PCIE_LCSR2_COMP_DEEMP  __BITS(15, 12) /* Compliance Preset/De-emph */
 #define PCIE_LCSR2_DEEMP_LVL   __BIT(0 + 16)  /* Current De-emphasis Level */
 #define PCIE_LCSR2_EQ_COMPL    __BIT(1 + 16)  /* Equalization Complete */
 #define PCIE_LCSR2_EQP1_SUC    __BIT(2 + 16)  /* Equaliz Phase 1 Successful */



Home | Main Index | Thread Index | Old Index