From 800673f9e97722cf7c0fe6c0eefb4fb12585e5f6 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Sat, 12 Jan 2019 14:43:08 +0800 Subject: fix EHCI PDO setting code --- src/northbridge/intel/haswell/pei_usb.c | 11 ++++------- 1 file 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); -- cgit v1.2.3