type == PCI_EXP_TYPE_PCIE_BRIDGE; /* PCI/PCI-X to PCIe Bridge */
}
-static float power_limit(int value, int scale)
+static void show_power_limit(int value, int scale)
{
static const float scales[4] = { 1.0, 0.1, 0.01, 0.001 };
- return value * scales[scale];
+ static const int scale0_values[3] = { 250, 275, 300 };
+
+ if (scale == 0 && value >= 0xF0)
+ {
+ /* F3h to FFh = Reserved for Slot Power Limit values above 300 W */
+ if (value >= 0xF3)
+ {
+ printf(">300W");
+ return;
+ }
+ value = scale0_values[value - 0xF0];
+ }
+ printf("%gW", value * scales[scale]);
}
static const char *latency_l0s(int value)
FLAG(t, PCI_EXP_DEVCAP_FLRESET));
if ((type == PCI_EXP_TYPE_ENDPOINT) || (type == PCI_EXP_TYPE_UPSTREAM) ||
(type == PCI_EXP_TYPE_PCI_BRIDGE))
- printf(" SlotPowerLimit %.3fW",
- power_limit((t & PCI_EXP_DEVCAP_PWR_VAL) >> 18,
- (t & PCI_EXP_DEVCAP_PWR_SCL) >> 26));
+ {
+ printf(" SlotPowerLimit ");
+ show_power_limit((t & PCI_EXP_DEVCAP_PWR_VAL) >> 18, (t & PCI_EXP_DEVCAP_PWR_SCL) >> 26);
+ }
printf("\n");
w = get_conf_word(d, where + PCI_EXP_DEVCTL);
return "16GT/s";
case 5:
return "32GT/s";
+ case 6:
+ return "64GT/s";
default:
return "unknown";
}
}
-static char *link_compare(int sta, int cap)
+static char *link_compare(int type, int sta, int cap)
{
- if (sta < cap)
- return "downgraded";
if (sta > cap)
- return "strange";
- return "ok";
+ return " (overdriven)";
+ if (sta == cap)
+ return "";
+ if ((type == PCI_EXP_TYPE_ROOT_PORT) || (type == PCI_EXP_TYPE_DOWNSTREAM) ||
+ (type == PCI_EXP_TYPE_PCIE_BRIDGE))
+ return "";
+ return " (downgraded)";
}
static char *aspm_support(int code)
w = get_conf_word(d, where + PCI_EXP_LNKSTA);
sta_speed = w & PCI_EXP_LNKSTA_SPEED;
sta_width = (w & PCI_EXP_LNKSTA_WIDTH) >> 4;
- printf("\t\tLnkSta:\tSpeed %s (%s), Width x%d (%s)\n",
+ printf("\t\tLnkSta:\tSpeed %s%s, Width x%d%s\n",
link_speed(sta_speed),
- link_compare(sta_speed, cap_speed),
+ link_compare(type, sta_speed, cap_speed),
sta_width,
- link_compare(sta_width, cap_width));
+ link_compare(type, sta_width, cap_width));
printf("\t\t\tTrErr%c Train%c SlotClk%c DLActive%c BWMgmt%c ABWMgmt%c\n",
FLAG(w, PCI_EXP_LNKSTA_TR_ERR),
FLAG(w, PCI_EXP_LNKSTA_TRAIN),
FLAG(t, PCI_EXP_SLTCAP_PWRI),
FLAG(t, PCI_EXP_SLTCAP_HPC),
FLAG(t, PCI_EXP_SLTCAP_HPS));
- printf("\t\t\tSlot #%d, PowerLimit %.3fW; Interlock%c NoCompl%c\n",
- (t & PCI_EXP_SLTCAP_PSN) >> 19,
- power_limit((t & PCI_EXP_SLTCAP_PWR_VAL) >> 7, (t & PCI_EXP_SLTCAP_PWR_SCL) >> 15),
+ printf("\t\t\tSlot #%d, PowerLimit ",
+ (t & PCI_EXP_SLTCAP_PSN) >> 19);
+ show_power_limit((t & PCI_EXP_SLTCAP_PWR_VAL) >> 7, (t & PCI_EXP_SLTCAP_PWR_SCL) >> 15);
+ printf("; Interlock%c NoCompl%c\n",
FLAG(t, PCI_EXP_SLTCAP_INTERLOCK),
FLAG(t, PCI_EXP_SLTCAP_NOCMDCOMP));
return "16GT/s";
case 5:
return "32GT/s";
+ case 6:
+ return "64GT/s";
default:
return "Unknown";
}
}
}
+static const char *cap_express_link2_compliance_preset(int type)
+{
+ switch (type)
+ {
+ case 0:
+ return "-6dB de-emphasis, 0dB preshoot";
+ case 1:
+ return "-3.5dB de-emphasis, 0dB preshoot";
+ case 2:
+ return "-4.4dB de-emphasis, 0dB preshoot";
+ case 3:
+ return "-2.5dB de-emphasis, 0dB preshoot";
+ case 4:
+ return "0dB de-emphasis, 0dB preshoot";
+ case 5:
+ return "0dB de-emphasis, 1.9dB preshoot";
+ case 6:
+ return "0dB de-emphasis, 2.5dB preshoot";
+ case 7:
+ return "-6.0dB de-emphasis, 3.5dB preshoot";
+ case 8:
+ return "-3.5dB de-emphasis, 3.5dB preshoot";
+ case 9:
+ return "0dB de-emphasis, 3.5dB preshoot";
+ default:
+ return "Unknown";
+ }
+}
+
static const char *cap_express_link2_transmargin(int type)
{
switch (type)
cap_express_link2_deemphasis(PCI_EXP_LNKCTL2_DEEMPHASIS(w)));
printf("\n"
"\t\t\t Transmit Margin: %s, EnterModifiedCompliance%c ComplianceSOS%c\n"
- "\t\t\t Compliance De-emphasis: %s\n",
+ "\t\t\t Compliance Preset/De-emphasis: %s\n",
cap_express_link2_transmargin(PCI_EXP_LNKCTL2_MARGIN(w)),
FLAG(w, PCI_EXP_LNKCTL2_MOD_CMPLNC),
FLAG(w, PCI_EXP_LNKCTL2_CMPLNC_SOS),
- cap_express_link2_deemphasis(PCI_EXP_LNKCTL2_COM_DEEMPHASIS(w)));
+ cap_express_link2_compliance_preset(PCI_EXP_LNKCTL2_COM_DEEMPHASIS(w)));
}
w = get_conf_word(d, where + PCI_EXP_LNKSTA2);