Add a way to force PCI to negotiate gen1 (setting flags 1 in the config file).

This commit is contained in:
matt 2012-10-12 17:18:02 +00:00
parent d68ae996dd
commit 5bb4e8d617
2 changed files with 10 additions and 3 deletions

View File

@ -34,7 +34,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(1, "$NetBSD: bcm53xx_pax.c,v 1.5 2012/09/27 00:25:26 matt Exp $");
__KERNEL_RCSID(1, "$NetBSD: bcm53xx_pax.c,v 1.6 2012/10/12 17:18:02 matt Exp $");
#include <sys/bus.h>
#include <sys/device.h>
@ -218,8 +218,6 @@ bcmpax_ccb_attach(device_t parent, device_t self, void *aux)
bcmpax_write_4(sc, PCIE_CLK_CONTROL, 3);
delay(250);
bcmpax_write_4(sc, PCIE_CLK_CONTROL, 1);
// delay(100*1000);
uint32_t v = bcmpax_read_4(sc, PCIE_STRAP_STATUS);
const bool enabled = (v & STRAP_PCIE_IF_ENABLE) != 0;
@ -291,6 +289,13 @@ bcmpax_ccb_attach(device_t parent, device_t self, void *aux)
&offset, NULL);
KASSERT(ok);
/*
* This will force the device to negotiate to a max of gen1.
*/
if (device_cfdata(self)->cf_flags & 1) {
bcmpax_conf_write(sc, 0, offset + PCI_PCIE_LCSR2, 1);
}
/*
* Now we wait (.25 sec) for the link to come up.
*/

View File

@ -443,6 +443,8 @@
#define PCIE_SYS_RC_INTX_EN 0x330
#define PCIE_SYS_RC_INTX_CSR 0x334
#define PCIE_CFG000_BASE 0x400
#define PCIE_FUNC0_IMAP0_0 0xc00
#define PCIE_FUNC0_IMAP0_1 0xc04
#define PCIE_FUNC0_IMAP0_2 0xc08