[coreboot-gerrit] Patch set updated for coreboot: [NEEDS TEST] nb/intel/sandybridge: start PEG link training

Patrick Rudolph (siro@das-labor.org) gerrit at coreboot.org
Wed Oct 21 18:19:53 CEST 2015


Patrick Rudolph (siro at das-labor.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11917

-gerrit

commit 061b03f5287265d718a03f9b8e4431142ec12d83
Author: Patrick Rudolph <siro at das-labor.org>
Date:   Thu Oct 15 11:09:15 2015 +0200

    [NEEDS TEST] nb/intel/sandybridge: start PEG link training
    
    Issue observed:
    The PCIe Root port shows up in GNU/Linux but no device.
    
    Test system:
    * Gigabyte GA-B75M-D3H (Intel Pentium CPU G2130)
    * Lenovo T530 (Intel Core i5-3320M CPU)
    
    Problem description:
    The PEG Root port link training on Ivy Bridge needs to be started by hand.
    (The PEG Root port on Sandy Bridge works out of the box.)
    
    Problem solution:
    The bits are set in early_init to meet PCIe reset timeout of 100msec.
    The bits should be set in PCI device enable function, but this causes the
    PCI enumeration to not detect the card, as it's still booting. Adding
    a fixed delay of 100msec resolves this problem, but this would
    increase boot time.
    
    Tested with:
    * Nvidia NVS 5400M (PCIe2)
    * ATI Radeon HD4780 (PCIe2)
    * Nvidia GeForce 8600 GT (PCIe1)
    
    Untested:
    * PCIe3 devices
    
    Final test results:
    The PEG device shows up under GNU/Linux and can be used without issues.
    
    Change-Id: Id8cfc43e5c4630b0ac217d98bb857c3308e6015b
    Signed-off-by: Patrick Rudolph <siro at das-labor.org>
---
 src/northbridge/intel/sandybridge/early_init.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/northbridge/intel/sandybridge/early_init.c b/src/northbridge/intel/sandybridge/early_init.c
index 7b60ec7..2109d4f 100644
--- a/src/northbridge/intel/sandybridge/early_init.c
+++ b/src/northbridge/intel/sandybridge/early_init.c
@@ -177,6 +177,29 @@ void sandybridge_early_initialization(int chipset_type)
 	deven = pci_read_config32(PCI_DEV(0, 0, 0), DEVEN) | DEVEN_IGD;
 	pci_write_config32(PCI_DEV(0, 0, 0), DEVEN, deven);
 
+	if ((pci_read_config16(PCI_DEV(0, 0, 0), PCI_DEVICE_ID) &
+			BASE_REV_MASK) == BASE_REV_IVB) {
+		/* Write magic value to start PEG link training.
+		 * This should be done in PCI device enumeration, but
+		 * the PCIe specification requires to wait at least 100msec
+		 * after reset for devices to come up.
+		 * As we don't want to increase boot time, enable it early and
+		 * assume the PEG is up as soon as PCI enumeration starts.
+		 * TODO: use time stamps to ensure the timings are met */
+		u32 tmp;
+		tmp = pci_read_config32(PCI_DEV(0, 1, 0), 0xC24) & ~(1 << 16);
+		pci_write_config32(PCI_DEV(0, 1, 0), 0xC24, tmp | (1 << 5));
+
+		tmp = pci_read_config32(PCI_DEV(0, 1, 1), 0xC24) & ~(1 << 16);
+		pci_write_config32(PCI_DEV(0, 1, 1), 0xC24, tmp | (1 << 5));
+
+		tmp = pci_read_config32(PCI_DEV(0, 1, 2), 0xC24) & ~(1 << 16);
+		pci_write_config32(PCI_DEV(0, 1, 2), 0xC24, tmp | (1 << 5));
+
+		tmp = pci_read_config32(PCI_DEV(0, 6, 0), 0xC24) & ~(1 << 16);
+		pci_write_config32(PCI_DEV(0, 6, 0), 0xC24, tmp | (1 << 5));
+	}
+
 	sandybridge_setup_graphics();
 }
 



More information about the coreboot-gerrit mailing list