From patchwork Wed Oct 23 04:51:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Harvey X-Patchwork-Id: 285518 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CE91B2C008C for ; Wed, 23 Oct 2013 15:54:17 +1100 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYqRE-0001ja-4r; Wed, 23 Oct 2013 04:52:56 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYqQy-0003Vd-NH; Wed, 23 Oct 2013 04:52:40 +0000 Received: from mail-pb0-f43.google.com ([209.85.160.43]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYqQT-0003Sm-Gf for linux-arm-kernel@lists.infradead.org; Wed, 23 Oct 2013 04:52:11 +0000 Received: by mail-pb0-f43.google.com with SMTP id md12so79205pbc.2 for ; Tue, 22 Oct 2013 21:51:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lxYvchgvfRrujCXWjbU0spqVbHZVwPtEfXuUR2xIl+Y=; b=FQVgWi4aNJhAQVgtl7WteENAyWCs9Vo+36DKwlALOllP9mu6EuUtpZBNZHiEVrPwPc UnxHf+CIAn54dar1FN+BnQxKiLFQCm9ERTNLkqppledm6J0l7USyjdOZBa0z3TqfrBb+ 4dL2IQ3vFxmk+OZ98RhfCBjRnRo9SwLlv6+2PQHkSNyu4wqHCKWc7Tl67A3mUGEN7cLy PbRq6G6lDcw0iG2qmo42VbvoAiG5Gemh7p4soEQpCfek3L/I4DXrASMqb7xWd7qb5ov9 FLEhCao7lpXjwBFSQhjXoYYtGDz8QCWZQuMTHPp+Hb82jUrex57Q3DGmWQm/UbVVFC4Z CXzQ== X-Gm-Message-State: ALoCoQlvOoXqb1ocy4B8XeRC9PeDB2ATzCwbFcRLHsRtKuhJj8HmwuPDdKcIylcmtyaG7jD12GLZ X-Received: by 10.68.169.161 with SMTP id af1mr1360837pbc.22.1382503907941; Tue, 22 Oct 2013 21:51:47 -0700 (PDT) Received: from localhost.localdomain (68-189-91-139.static.snlo.ca.charter.com. [68.189.91.139]) by mx.google.com with ESMTPSA id y5sm1532681pbs.18.2013.10.22.21.51.46 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Oct 2013 21:51:47 -0700 (PDT) From: Tim Harvey To: devicetree@vger.kernel.org, Shawn Guo , Grant Likely , Rob Herring Subject: [PATCH 4/4] imx: add PCI fixup for PEX860X on Gateworks board Date: Tue, 22 Oct 2013 21:51:28 -0700 Message-Id: <1382503888-3962-5-git-send-email-tharvey@gateworks.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1382503888-3962-1-git-send-email-tharvey@gateworks.com> References: <1382503888-3962-1-git-send-email-tharvey@gateworks.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131023_005209_839505_76922D6B X-CRM114-Status: GOOD ( 12.66 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.43 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org The PEX860X has GPIO's which are used for PCI Reset lines on the Gateworks Ventana boards. The GPIO's need to be set as output level high so as to allow the PCIe devices to come out of reset. Signed-off-by: Tim Harvey --- arch/arm/mach-imx/mach-imx6q.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 0f9f241..eb5747f 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -23,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -78,6 +80,37 @@ static int ksz9031rn_phy_fixup(struct phy_device *dev) return 0; } +/* + * fixup for PLX PEX8909 bridge to configure GPIO1-7 as output High + * as they are used for slots1-7 PERST# + */ +static void mx6_ventana_pciesw_early_fixup(struct pci_dev *dev) +{ + u32 dw; + + if (!of_machine_is_compatible("gw,ventana")) + return; + + if (dev->devfn != 0) + return; + + 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, + mx6_ventana_pciesw_early_fixup); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8606, + mx6_ventana_pciesw_early_fixup); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8604, + mx6_ventana_pciesw_early_fixup); + static int ar8031_phy_fixup(struct phy_device *dev) { u16 val;