Skip to content

Commit

Permalink
PCI: add quirk for Gateworks PLX PEX860x switch with GPIO PERST#
Browse files Browse the repository at this point in the history
Gateworks boards use PLX PEX860x switches where downstream ports
have their PERST# driven from the PEX GPIO.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
  • Loading branch information
Gateworks committed Apr 13, 2019
1 parent 84a2e20 commit ffe6822
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions drivers/pci/quirks.c
Expand Up @@ -26,6 +26,7 @@
#include <linux/sched.h>
#include <linux/ktime.h>
#include <linux/mm.h>
#include <linux/of.h>
#include <linux/platform_data/x86/apple.h>
#include <asm/dma.h> /* isa_dma_bridge_buggy */
#include "pci.h"
Expand Down Expand Up @@ -4815,3 +4816,34 @@ static void quirk_no_ats(struct pci_dev *pdev)
/* AMD Stoney platform GPU */
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x98e4, quirk_no_ats);
#endif /* CONFIG_PCI_ATS */

#ifdef CONFIG_PCI_HOST_THUNDER_PEM
/*
* fixup for PLX PEX8909 bridge to configure GPIO1-7 as output High
* as they are used for slots1-7 PERST#
*/
static void newport_pciesw_early_fixup(struct pci_dev *dev)
{
u32 dw;

if (!of_machine_is_compatible("gw,newport"))
return;

if (dev->devfn != 0)
return;

dev_info(&dev->dev, "de-asserting PERST#\n");
pci_read_config_dword(dev, 0x62c, &dw);
dw |= 0xaaa8; /* GPIO1-7 outputs */
pci_write_config_dword(dev, 0x62c, dw);

pci_read_config_dword(dev, 0x644, &dw);
dw |= 0xfe; /* GPIO1-7 output high */
pci_write_config_dword(dev, 0x644, dw);

msleep(100);
}
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8609, newport_pciesw_early_fixup);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8606, newport_pciesw_early_fixup);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8604, newport_pciesw_early_fixup);
#endif /* CONFIG_PCI_HOST_THUNDER_PEM */

0 comments on commit ffe6822

Please sign in to comment.