From patchwork Tue Aug 26 14:57:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 4782801 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DD2399F2A9 for ; Tue, 26 Aug 2014 14:58:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F03F32011D for ; Tue, 26 Aug 2014 14:58:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 546C6200FE for ; Tue, 26 Aug 2014 14:58:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934595AbaHZO6j (ORCPT ); Tue, 26 Aug 2014 10:58:39 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:58000 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934497AbaHZO6A (ORCPT ); Tue, 26 Aug 2014 10:58:00 -0400 Received: by mail-we0-f174.google.com with SMTP id x48so14925047wes.33 for ; Tue, 26 Aug 2014 07:57:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TZAO2UU+YDhSB44MxsQCeNOBDqcbg2/E/uM6l2K5eZ4=; b=ftDCJNojAEipAY08ngYiciqJ9DCyHc7cBHah7jagVAg4B9K8bwqgRXWsmrIhVqjV09 /mNmhc3cisE6W/4YQ1uHUiS0KeoTNv6C6kYvGOIU0j4Ez9Qbl2pXLlLz+uhOJlk2hajZ wU/VPCJ46JKkI/EmAieJBMDs6XO1rIbNF+PeaddX+vcHd7wF3QgNTVs4VmtuOaAo8TuS 4vkCHCCrSBy57wy4oZBrBe3OADSmJ6gNxQxO/DH3154buHXr4N/LozA4GcIZoWlzgu1l 6OJJ9fksJnl9u/jiAV8eVlrv9RIy3DpRw/Lf/WNxaQ0ri4CzfYcERkfYYKwcsa9RmaKD YemA== X-Received: by 10.194.90.4 with SMTP id bs4mr30985836wjb.71.1409065078052; Tue, 26 Aug 2014 07:57:58 -0700 (PDT) Received: from localhost (port-7111.pppoe.wtnet.de. [84.46.27.226]) by mx.google.com with ESMTPSA id lh11sm3211241wic.17.2014.08.26.07.57.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Aug 2014 07:57:57 -0700 (PDT) From: Thierry Reding To: Bjorn Helgaas Cc: Stephen Warren , linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/6] PCI: tegra: Make sure the PCIe PLL is really reset Date: Tue, 26 Aug 2014 16:57:43 +0200 Message-Id: <1409065064-17617-6-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1409065064-17617-1-git-send-email-thierry.reding@gmail.com> References: <1409065064-17617-1-git-send-email-thierry.reding@gmail.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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Eric Yuen Depending on the prior state of the controller, the PLL reset may not be pulsed. Clear the register bit and set it after a small delay to ensure that the PLL is really reset. Signed-off-by: Eric Yuen Signed-off-by: Thierry Reding --- drivers/pci/host/pci-tegra.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c index 8264bce77750..0ce43764dd36 100644 --- a/drivers/pci/host/pci-tegra.c +++ b/drivers/pci/host/pci-tegra.c @@ -849,6 +849,13 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie) value |= PADS_PLL_CTL_REFCLK_INTERNAL_CML | soc->tx_ref_sel; pads_writel(pcie, value, soc->pads_pll_ctl); + /* reset PLL */ + value = pads_readl(pcie, soc->pads_pll_ctl); + value &= ~PADS_PLL_CTL_RST_B4SM; + pads_writel(pcie, value, soc->pads_pll_ctl); + + usleep_range(20, 100); + /* take PLL out of reset */ value = pads_readl(pcie, soc->pads_pll_ctl); value |= PADS_PLL_CTL_RST_B4SM;