1 Many of the Gateworks Ventana boards use a PLX PEX860X PCIe Switch
2 and utilize its GPIO outputs as PERST# for downstream ports. This
3 patch configures them appropriately during enumeration.
5 Additionally many of the Ventana boards use CKO1 as the clock input for
6 an analog audio codec which is setup here.
8 --- a/arch/arm/mach-imx/mach-imx6q.c
9 +++ b/arch/arm/mach-imx/mach-imx6q.c
11 #include <linux/of_irq.h>
12 #include <linux/of_platform.h>
13 #include <linux/opp.h>
14 +#include <linux/pci.h>
15 #include <linux/phy.h>
16 #include <linux/regmap.h>
17 #include <linux/micrel_phy.h>
18 @@ -145,6 +146,42 @@ static void __init imx6q_sabrelite_init(
19 imx6q_sabrelite_cko1_setup();
23 + * fixup for PEX 8909 bridge to configure GPIO1-7 as output High
24 + * as they are used for slots1-7 PERST#
26 +static void mx6_ventana_pciesw_early_fixup(struct pci_dev *dev)
30 + if (!of_machine_is_compatible("gw,ventana"))
33 + if (dev->devfn != 0)
36 + pci_read_config_dword(dev, 0x62c, &dw);
37 + dw |= 0xaaa8; // GPIO1-7 outputs
38 + pci_write_config_dword(dev, 0x62c, dw);
40 + pci_read_config_dword(dev, 0x644, &dw);
41 + dw |= 0xfe; // GPIO1-7 output high
42 + pci_write_config_dword(dev, 0x644, dw);
46 +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8609,
47 + mx6_ventana_pciesw_early_fixup);
48 +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8606,
49 + mx6_ventana_pciesw_early_fixup);
50 +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8604,
51 + mx6_ventana_pciesw_early_fixup);
53 +static void __init imx6q_ventana_init(void)
55 + imx6q_sabrelite_cko1_setup();
58 static void __init imx6q_1588_init(void)
61 @@ -163,6 +200,9 @@ static void __init imx6q_usb_init(void)
63 static void __init imx6q_init_machine(void)
65 + if (of_machine_is_compatible("gw,ventana"))
66 + imx6q_ventana_init();
68 if (of_machine_is_compatible("fsl,imx6q-sabrelite"))
69 imx6q_sabrelite_init();