From patchwork Mon Sep 22 10:45:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 4947331 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AEA83BEEA5 for ; Mon, 22 Sep 2014 11:12:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7770A20219 for ; Mon, 22 Sep 2014 11:12:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D857201C0 for ; Mon, 22 Sep 2014 11:12:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753084AbaIVLMw (ORCPT ); Mon, 22 Sep 2014 07:12:52 -0400 Received: from mail-bl2on0143.outbound.protection.outlook.com ([65.55.169.143]:2102 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753225AbaIVLMw (ORCPT ); Mon, 22 Sep 2014 07:12:52 -0400 X-Greylist: delayed 5356 seconds by postgrey-1.27 at vger.kernel.org; Mon, 22 Sep 2014 07:12:51 EDT Received: from BN3PR0301CA0058.namprd03.prod.outlook.com (25.160.152.154) by DM2PR0301MB0862.namprd03.prod.outlook.com (25.160.215.148) with Microsoft SMTP Server (TLS) id 15.0.1029.13; Mon, 22 Sep 2014 11:13:03 +0000 Received: from BN1AFFO11FD039.protection.gbl (2a01:111:f400:7c10::133) by BN3PR0301CA0058.outlook.office365.com (2a01:111:e400:401e::26) with Microsoft SMTP Server (TLS) id 15.0.1034.13 via Frontend Transport; Mon, 22 Sep 2014 11:12:48 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD039.mail.protection.outlook.com (10.58.52.243) with Microsoft SMTP Server (TLS) id 15.0.1029.15 via Frontend Transport; Mon, 22 Sep 2014 11:12:47 +0000 Received: from shlinux1.ap.freescale.net (shlinux1.ap.freescale.net [10.192.225.216]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s8MBCiBQ004161; Mon, 22 Sep 2014 04:12:45 -0700 Received: by shlinux1.ap.freescale.net (Postfix, from userid 1003) id 124771AE1FC; Mon, 22 Sep 2014 18:45:06 +0800 (CST) From: Richard Zhu To: CC: , , , , Richard Zhu Subject: [PATCH v1 1/4] PCI: imx6: enable pcie on imx6qdl sabreauto Date: Mon, 22 Sep 2014 18:45:02 +0800 Message-ID: <1411382705-15301-2-git-send-email-r65037@freescale.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1411382705-15301-1-git-send-email-r65037@freescale.com> References: <1411382705-15301-1-git-send-email-r65037@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(428002)(199003)(189002)(45336002)(99396002)(77156001)(229853001)(97736003)(83072002)(46386002)(101416001)(83322001)(21056001)(42186005)(102836001)(85306004)(64706001)(87286001)(81156004)(88136002)(16796002)(105586002)(120916001)(19580405001)(90102001)(47776003)(69596002)(74502003)(50986999)(110136001)(19580395003)(106466001)(44976005)(80022003)(84676001)(104166001)(92726001)(81342003)(36756003)(92566001)(95666004)(31966008)(81542003)(74662003)(103686003)(52956003)(68736004)(79102003)(76482002)(93916002)(77982003)(87936001)(50466002)(50226001)(77096002)(76176999)(85852003)(4396001)(26826002)(2351001)(89996001)(20776003)(46102003)(6806004)(62966002)(107046002)(48376002)(33646002)(32563001)(90966001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB0862; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; A:0; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;UriScan:; X-Forefront-PRVS: 034215E98F Received-SPF: None (protection.outlook.com: shlinux1.ap.freescale.net does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is 192.88.158.2) smtp.mailfrom=r65037@shlinux1.ap.freescale.net; X-OriginatorOrg: freescale.com Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - enable pcie on imx6qdl sabreauto boards. - wait the clocks to stabilize after the pcie_ref_en (IMX6Q_GPR1_PCIE_REF_CLK_EN) is set. Signed-off-by: Richard Zhu --- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 4 ++++ drivers/pci/host/pci-imx6.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi index 009abd6..d6040a5 100644 --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi @@ -410,6 +410,10 @@ }; }; +&pcie { + status = "okay"; +}; + &pwm3 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pwm3>; diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index 233fe8a..bc4222b 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c @@ -275,15 +275,15 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp) goto err_pcie; } - /* allow the clocks to stabilize */ - usleep_range(200, 500); - /* power up core phy and enable ref clock */ regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, IMX6Q_GPR1_PCIE_TEST_PD, 0 << 18); regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, IMX6Q_GPR1_PCIE_REF_CLK_EN, 1 << 16); + /* allow the clocks to stabilize */ + usleep_range(200, 500); + /* Some boards don't have PCIe reset GPIO. */ if (gpio_is_valid(imx6_pcie->reset_gpio)) { gpio_set_value(imx6_pcie->reset_gpio, 0);