From patchwork Tue Aug 13 10:37:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 11091691 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 288871398 for ; Tue, 13 Aug 2019 10:38:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15919285BD for ; Tue, 13 Aug 2019 10:38:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0407428607; Tue, 13 Aug 2019 10:38:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SBL_CSS autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A62FD285BD for ; Tue, 13 Aug 2019 10:38:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=owoJJOVbdmLymr4WD/8ZREUuAcfAoEcpOFirnjSfM7k=; b=o/tua0xBHWXCCT qTKBAcvDixaUEHd/abE1uK4O3YX2PU+sAgNXkNZ/B11oy/5fJ9mwmtNgKTd73mcso1NLx0rDgSjcK VMDyKEiV49bvzU8731oVb64GmIKYbmB1Y/qG9RoQAM048aYn9OWxji4ObHJxy62UGjb0KJh0Q2uuM ER4qVpomMweK+QbSJthD2Pi9ia57bSbpQ2R9zJHYkbhlCFqK8YYd9oGrCYX2xRQkEBRD/97ZiveSr knrwksuRD+NzSj+2esX5NKa9HlL9TdIw75aT44B1Ga3nHYefMD/Z8km8bHYmJ8KX9f7uyiU6hZbnf Kin+Jx4R1xrC3PDFhX7g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hxUC7-00037c-RQ; Tue, 13 Aug 2019 10:38:24 +0000 Received: from mail-wm1-f66.google.com ([209.85.128.66]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hxUBo-0002v5-N6 for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2019 10:38:07 +0000 Received: by mail-wm1-f66.google.com with SMTP id g67so1012436wme.1 for ; Tue, 13 Aug 2019 03:38:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IRI9xzFxMKHfeehDsl2GFQBy7QLiUvO6l2kHk0UQE0g=; b=itZiGZSl4g+r6fV1f6AO1H1fpftKAT6QEt7YrJLgeSdSRMC9+KD38dO1VoLwrjkUlG wNINeCRTAPnrmN0J/uLpUqi3DhEqPxk93i4fu5PPqqNZnEKivXYdbi28NOoMkG0jo7Eu crZPm8MjSf9r2ppzhnNLrMBHNYJguKWQZ1KBdVO5f6gEapo1dGQuPOHIGfjtTovADft1 MvI6zlwCHNspDqpgdlqJYXVRCMwNLV2FflHWxsVxBPYTGjxKCq124mjvDK4JPCTu3gdJ i0ZoetqGfptwcisSm1B1hhvPZ9dhckaBUlORxgeVWmM2j2XhorhTAsrIto1iAv0S+MwK AALA== X-Gm-Message-State: APjAAAUFjpceX1fci+9diyHnIVJhH2i+auoi8nmm+T6QcRqYQqo034gh gwa4c72GRbH/R8YLJC0MICdAiYBBdbMsrQ== X-Google-Smtp-Source: APXvYqykijlq6kdHHcALNJ7kMDqWm4cQ80tA6EmpKRsiGVizuQU+0b4coATfODqCKbQAlhZg4Rcazw== X-Received: by 2002:a1c:f409:: with SMTP id z9mr2408158wma.176.1565692682962; Tue, 13 Aug 2019 03:38:02 -0700 (PDT) Received: from 1aq-andre.garage.tyco.com ([77.107.218.170]) by smtp.gmail.com with ESMTPSA id f70sm1484635wme.22.2019.08.13.03.38.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2019 03:38:02 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= To: linux-kernel@vger.kernel.org Subject: [PATCH 1/2] PCIe: imx6: imx7d: add support for internal phy refclk source Date: Tue, 13 Aug 2019 11:37:58 +0100 Message-Id: <20190813103759.38358-1-git@andred.net> X-Mailer: git-send-email 2.23.0.rc1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190813_033804_751385_899AB0AD X-CRM114-Status: GOOD ( 12.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Richard Zhu , =?utf-8?q?Andr=C3=A9_Draszik?= , Sascha Hauer , Fabio Estevam , NXP Linux Team , Pengutronix Kernel Team , linux-pci@vger.kernel.org, Bjorn Helgaas , Shawn Guo , linux-arm-kernel@lists.infradead.org, Lucas Stach Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The i.MX7D variant of the IP can use either an external crystal oscillator input or an internal clock input as a reference clock input for the PCIe PHY. Add support for an optional property 'fsl,pcie-phy-refclk-internal' If present then the internal clock input is used as PCIe PHY reference clock source. The previous default of using an external ocsillator input (if the property doesn't exist), doesn't change. Signed-off-by: André Draszik Cc: Richard Zhu Cc: Lucas Stach Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/pci/controller/dwc/pci-imx6.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 9b5cb5b70389..bb3700c9157c 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -63,6 +63,7 @@ struct imx6_pcie { struct dw_pcie *pci; int reset_gpio; bool gpio_active_high; + bool phy_refclk_internal; struct clk *pcie_bus; struct clk *pcie_phy; struct clk *pcie_inbound_axi; @@ -635,7 +636,10 @@ static void imx6_pcie_init_phy(struct imx6_pcie *imx6_pcie) break; case IMX7D: regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, - IMX7D_GPR12_PCIE_PHY_REFCLK_SEL, 0); + IMX7D_GPR12_PCIE_PHY_REFCLK_SEL, + imx6_pcie->phy_refclk_internal + ? IMX7D_GPR12_PCIE_PHY_REFCLK_SEL + : 0); break; case IMX6SX: regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, @@ -1171,6 +1175,9 @@ static int imx6_pcie_probe(struct platform_device *pdev) if (ret) imx6_pcie->link_gen = 1; + imx6_pcie->phy_refclk_internal = + of_property_read_bool(node, "fsl,pcie-phy-refclk-internal"); + imx6_pcie->vpcie = devm_regulator_get_optional(&pdev->dev, "vpcie"); if (IS_ERR(imx6_pcie->vpcie)) { if (PTR_ERR(imx6_pcie->vpcie) == -EPROBE_DEFER) From patchwork Tue Aug 13 10:37:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 11091689 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 720B8112C for ; Tue, 13 Aug 2019 10:38:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62B2D285BD for ; Tue, 13 Aug 2019 10:38:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55ECF28607; Tue, 13 Aug 2019 10:38:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SBL_CSS autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0ADEE285BD for ; Tue, 13 Aug 2019 10:38:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CsMhVs1wSYScu0W/ifE/V82KpCF25mFLWpTuTTWcmwY=; b=qfgspityaRP5jA ZhISeuCPmpuvKFbqHYJ8KAk/bKqdI6ip47G17njEd5Dq7Ht+khKKPslg2jLK+ubV2Kx7ttRG7O3Ml H/9PouclwPtzcJorckpo24T3mgR7Z9skLNAyVcYz4Oh1OueZaXTOb+HowhgUa0ZJ2S1vNiXstzavp R3DoSx3tqZ3Vw8uGc6m2cPamYYTfIXvfgmKfXBat2PYwi9k3muhAG0NqEBtQUvUO6OD0VINB08sRx OHaDFmBrnKwbtJX2NKY671QUluyTfW5R2gfygJqhNvxRRl/12kcpZMMnvxNNUj+akP/W3yBa6phO0 Q7MQG4ZZg3bJ6AzbWpdg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hxUBt-0002wG-2d; Tue, 13 Aug 2019 10:38:09 +0000 Received: from mail-wr1-f68.google.com ([209.85.221.68]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hxUBp-0002v7-KV for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2019 10:38:07 +0000 Received: by mail-wr1-f68.google.com with SMTP id j16so5016061wrr.8 for ; Tue, 13 Aug 2019 03:38:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7fA4ImgTXDy54WkrrWpZEbCCgZQJp3nUMqu6kivAEHE=; b=WG2yJbmZcOnU109AetmBtLP8qkHYLCIUdBLFpH5O9Fb26hQOvHTI2mW1U15e1IVNNn 4yHgUS3XdSfhCABINkuljDEhDH3CiA+bJlwAeMdTTHdku0i1epCOLm5dqSIxzeLW9+3F GXNGOWNWLqPiRGBjpDtvGtQ3jw8G4CUWF0KRBdhdeygkS7fOyWWxOqHGRgkD9vdUGXnX ZN+Hz8+nhMjknwHh2XU7ZxkAQFAPmH6IZKzSYn9G9sFYwBQl7Y3Ps29fHYVdKydTfUJf hw6iU+knLrh0j/PzZg4VDxBy3jVxKfFpQdbCkwM/qqPofRYuOWWnNLivgN4aRkdjV4LF QeaA== X-Gm-Message-State: APjAAAWBhgNZ840oxVzucnQrT79YhRMZM9Zud5xhVsa9URO9X3iAY3y6 W3PO7VRKqIvtKVrKi79OBEw= X-Google-Smtp-Source: APXvYqwJhQAcPo3ERBZnabP8qqSJfaIMlg+cCQT9+ITjd2tPgcv7HbOe4c56c7ufaMOznaURXCPzuw== X-Received: by 2002:a5d:610d:: with SMTP id v13mr36286575wrt.249.1565692684135; Tue, 13 Aug 2019 03:38:04 -0700 (PDT) Received: from 1aq-andre.garage.tyco.com ([77.107.218.170]) by smtp.gmail.com with ESMTPSA id f70sm1484635wme.22.2019.08.13.03.38.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2019 03:38:03 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= To: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] dt-bindings: imx6q-pcie: add "fsl, pcie-phy-refclk-internal" for i.MX7D Date: Tue, 13 Aug 2019 11:37:59 +0100 Message-Id: <20190813103759.38358-2-git@andred.net> X-Mailer: git-send-email 2.23.0.rc1 In-Reply-To: <20190813103759.38358-1-git@andred.net> References: <20190813103759.38358-1-git@andred.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190813_033805_667463_49F17195 X-CRM114-Status: GOOD ( 11.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Fabio Estevam , Richard Zhu , =?utf-8?q?Andr=C3=A9_Draszik?= , Sascha Hauer , Rob Herring , NXP Linux Team , Pengutronix Kernel Team , linux-pci@vger.kernel.org, Bjorn Helgaas , Shawn Guo , linux-arm-kernel@lists.infradead.org, Lucas Stach Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The i.MX7D variant of the IP can use either an external crystal oscillator input or an internal clock input as a reference clock input for the PCIe PHY. Document the optional property 'fsl,pcie-phy-refclk-internal' Signed-off-by: André Draszik Cc: Richard Zhu Cc: Lucas Stach Cc: Bjorn Helgaas Cc: Rob Herring Cc: Mark Rutland Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt index a7f5f5afa0e6..985d7083df9f 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt @@ -56,6 +56,11 @@ Additional required properties for imx7d-pcie and imx8mq-pcie: - "turnoff" - fsl,imx7d-pcie-phy: A phandle to an fsl,imx7d-pcie-phy node. +Additional optional properties for imx7d-pcie: +- fsl,pcie-phy-refclk-internal: If present then an internal PLL input is used + as PCIe PHY reference clock source. By default an external ocsillator input + is used. + Additional required properties for imx8mq-pcie: - clock-names: Must include the following additional entries: - "pcie_aux"