summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2019-01-12 14:43:08 +0800
committerIru Cai <mytbk920423@gmail.com>2019-11-17 15:10:47 +0800
commit800673f9e97722cf7c0fe6c0eefb4fb12585e5f6 (patch)
treecdc600888ad75ddcb758caa4e6fb14f478148e15
parentf9655b29c5f32eb204eb2eb32f5b375585310b21 (diff)
downloadcoreboot-800673f9e97722cf7c0fe6c0eefb4fb12585e5f6.tar.xz
fix EHCI PDO setting code
-rw-r--r--src/northbridge/intel/haswell/pei_usb.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/northbridge/intel/haswell/pei_usb.c b/src/northbridge/intel/haswell/pei_usb.c
index 626a6c4971..e88e42afd2 100644
--- a/src/northbridge/intel/haswell/pei_usb.c
+++ b/src/northbridge/intel/haswell/pei_usb.c
@@ -416,7 +416,7 @@ static void frag_usb_fffaf7d8(PEI_USB *upd)
for (int i = 0; i < nb_usb2_ports(); i++) {
if (i <= 7 && (upd->xhci_resume_info[0] & 1)) {
- if (upd->ehci_settings[i].enable & 1) {
+ if ((upd->ehci_settings[i].enable & 1) == 0) {
pci_or_config8(PCI_DEV(0, 0x1d, 0), 0x64, (1 << i));
} else {
pci_update_config8(PCI_DEV(0, 0x1d, 0), 0x64, (~(1 << i)), 0);
@@ -430,7 +430,7 @@ static void frag_usb_fffaf7d8(PEI_USB *upd)
if ((upd->xhci_resume_info[1] & 1) == 0)
continue;
- if (upd->ehci_settings[i].enable & 1) {
+ if ((upd->ehci_settings[i].enable & 1) == 0) {
pci_or_config8(PCI_DEV(0, 0x1a, 0), 0x64, 1 << (i - 8));
} else {
pci_update_config8(PCI_DEV(0, 0x1a, 0), 0x64, ~(1 << (i - 8)), 0);
@@ -471,11 +471,8 @@ static void set_usb_pdo(PEI_USB *upd, u8 ppiv)
} else {
shifts = i;
}
- /* if usb2 port is enabled, prevents it from
- * reporting a device connection to the xHC,
- * otherwise allows the reporting
- */
- if (upd->ehci_settings[i].enable & 1) {
+
+ if ((upd->ehci_settings[i].enable & 1) == 0) {
usb2pdo |= (1 << shifts);
} else {
usb2pdo &= ~(1 << shifts);