*
* Copyright (c) 1997--2018 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
b = get_conf_byte(d, where + PCI_PM_PPB_EXTENSIONS);
if (b)
printf("\t\tBridge: PM%c B3%c\n",
- FLAG(t, PCI_PM_BPCC_ENABLE),
- FLAG(~t, PCI_PM_PPB_B2_B3));
+ FLAG(b, PCI_PM_BPCC_ENABLE),
+ FLAG(~b, PCI_PM_PPB_B2_B3));
}
static void
static void show_power_limit(int value, int scale)
{
static const float scales[4] = { 1.0, 0.1, 0.01, 0.001 };
- static const int scale0_values[3] = { 250, 275, 300 };
- if (scale == 0 && value >= 0xF0)
+ if (scale == 0 && value == 0xFF)
{
- /* F3h to FFh = Reserved for Slot Power Limit values above 300 W */
- if (value >= 0xF3)
- {
- printf(">300W");
- return;
- }
- value = scale0_values[value - 0xF0];
+ printf(">600W");
+ return;
}
+
+ if (scale == 0 && value >= 0xF0 && value <= 0xFE)
+ value = 250 + 25 * (value - 0xF0);
+
printf("%gW", value * scales[scale]);
}
int i, found = 0;
for (i=0; i<6; i++)
- if (p->base_addr[i] && p->size[i])
+ if (p->base_addr[i] || p->size[i])
{
if (!(p->base_addr[i] & PCI_BASE_ADDRESS_SPACE_IO))
{
}
w = get_conf_word(d, where + PCI_EXP_DEVCTL2);
- printf("\t\tDevCtl2: Completion Timeout: %s, TimeoutDis%c LTR%c 10BitTagReq%c OBFF %s,",
+ printf("\t\tDevCtl2: Completion Timeout: %s, TimeoutDis%c",
cap_express_dev2_timeout_value(PCI_EXP_DEVCTL2_TIMEOUT_VALUE(w)),
- FLAG(w, PCI_EXP_DEVCTL2_TIMEOUT_DIS),
- FLAG(w, PCI_EXP_DEVCTL2_LTR),
- FLAG(w, PCI_EXP_DEVCTL2_10BIT_TAG_REQ),
- cap_express_devctl2_obff(PCI_EXP_DEVCTL2_OBFF(w)));
+ FLAG(w, PCI_EXP_DEVCTL2_TIMEOUT_DIS));
if (type == PCI_EXP_TYPE_ROOT_PORT || type == PCI_EXP_TYPE_DOWNSTREAM)
printf(" ARIFwd%c\n", FLAG(w, PCI_EXP_DEVCTL2_ARI));
else
printf(" EgressBlck%c", FLAG(w, PCI_EXP_DEVCTL2_ATOMICOP_EGRESS_BLOCK));
printf("\n");
}
+ printf("\t\t\t IDOReq%c IDOCompl%c LTR%c 10BitTagReq%c OBFF %s\n",
+ FLAG(w, PCI_EXP_DEVCTL2_IDO_REQ_EN),
+ FLAG(w, PCI_EXP_DEVCTL2_IDO_CMP_EN),
+ FLAG(w, PCI_EXP_DEVCTL2_LTR),
+ FLAG(w, PCI_EXP_DEVCTL2_10BIT_TAG_REQ),
+ cap_express_devctl2_obff(PCI_EXP_DEVCTL2_OBFF(w)));
}
static const char *cap_express_link2_speed_cap(int vector)