1 From 4bb1d09fe48f51efac2f51b9280796e2d00a6c4a Mon Sep 17 00:00:00 2001
2 From: Tim Harvey <tharvey@gateworks.com>
3 Date: Tue, 22 Oct 2013 21:51:28 -0700
4 Subject: [PATCH] ARM: imx: add PCI fixup for PEX860X on Gateworks board
6 The PEX860X has GPIO's which are used for PCI Reset lines on the
7 Gateworks Ventana boards. The GPIO's need to be set as output
8 level high so as to allow the PCIe devices to come out of reset.
10 Signed-off-by: Tim Harvey <tharvey@gateworks.com>
11 Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
13 arch/arm/mach-imx/mach-imx6q.c | 30 ++++++++++++++++++++++++++++++
14 1 file changed, 30 insertions(+)
16 --- a/arch/arm/mach-imx/mach-imx6q.c
17 +++ b/arch/arm/mach-imx/mach-imx6q.c
19 #include <linux/clk.h>
20 #include <linux/clkdev.h>
21 #include <linux/cpu.h>
22 +#include <linux/delay.h>
23 #include <linux/export.h>
24 #include <linux/init.h>
27 #include <linux/of_irq.h>
28 #include <linux/of_platform.h>
29 #include <linux/pm_opp.h>
30 +#include <linux/pci.h>
31 #include <linux/phy.h>
32 #include <linux/reboot.h>
33 #include <linux/regmap.h>
34 @@ -78,6 +80,34 @@ static int ksz9031rn_phy_fixup(struct ph
39 + * fixup for PLX PEX8909 bridge to configure GPIO1-7 as output High
40 + * as they are used for slots1-7 PERST#
42 +static void ventana_pciesw_early_fixup(struct pci_dev *dev)
46 + if (!of_machine_is_compatible("gw,ventana"))
49 + if (dev->devfn != 0)
52 + pci_read_config_dword(dev, 0x62c, &dw);
53 + dw |= 0xaaa8; // GPIO1-7 outputs
54 + pci_write_config_dword(dev, 0x62c, dw);
56 + pci_read_config_dword(dev, 0x644, &dw);
57 + dw |= 0xfe; // GPIO1-7 output high
58 + pci_write_config_dword(dev, 0x644, dw);
62 +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8609, ventana_pciesw_early_fixup);
63 +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8606, ventana_pciesw_early_fixup);
64 +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8604, ventana_pciesw_early_fixup);
66 static int ar8031_phy_fixup(struct phy_device *dev)