From patchwork Wed Jun 23 13:23:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 12339837 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA5E0C4743C for ; Wed, 23 Jun 2021 13:25:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9922560FEE for ; Wed, 23 Jun 2021 13:25:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9922560FEE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IRUf4nOWNTP/0o7mCAgWonF2h1BErbmz5pmgd/5rz+c=; b=gK7M2hX58P+oZn 1V8l7y+VJvXNgiOBDCGOr8EukLVtPV94fNwN5X8QvyjeDAY1P/eCSMYseOInPeG581GsgTNFSDnOx tj3VWfjqdvayf2aVepVSUFvXGEdLcJ+Ef1dxH1U6O1sHNpZu2ieGyk+u8JbK33WtaAQY3gLNFzQMs I6c0Gy5iIkc96OZ1yviF3BNiMrQHSd584ccNFyp2RVA1rMNUK2KbR3/Ow9REF0IGOcbCdHnSjtffF QnCsdtE9461dO3T48HBtHwbXNm5YFweD0TKwakx+4od9fom5sJlxob7b8BLUehAI9SwKnY1SuSnYx nvng+/vDZcQ/00IDLU6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lw2r6-00Am6O-1e; Wed, 23 Jun 2021 13:23:48 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lw2qt-00Am2x-9u for linux-arm-kernel@lists.infradead.org; Wed, 23 Jun 2021 13:23:36 +0000 Received: by mail-ed1-x534.google.com with SMTP id m14so3451188edp.9 for ; Wed, 23 Jun 2021 06:23:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1Ipe1UfyfsMz5Tp2uesrFumfBRfdDn/SKw07Neys5JM=; b=AzFflTP1qrMoV15yRgQe4efB9nQLGcaq0JHTiiE1LBFD9T5+3rtRtI+jbHIUdxz2Vb OZEOEPnXEzlr+lc34zq1PcKGR/7dK+NW7YlJuxlLd3AGjozZEK9x6qqsjQjt9KN4Mnw4 JFK/sYZrcXykaQLWL23owFgYkkH4KJfV0n5Ks1fQDU1xzDjmSAiyegOuPow7sPwTCmRm k/GXKbxVFMC6FarfBhBvX0wKXAaQfhVAGyYx921qJXVov232q1CUomzOScA9PRijyjbr ZROxgGtaJeI6NryELu/igf3jT4gUDm6N83GxoauM8Nbqii+EXGZjaQ5S01AAdRFFE+0c Rz4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=1Ipe1UfyfsMz5Tp2uesrFumfBRfdDn/SKw07Neys5JM=; b=UYQUlAd5rvVWx2ljBN9Wojhzn7T+1e9tr0R/2TLb8RjKgfVKgZtHGs+wkzoJsfm/Kb uMI0lfq5an0lNQ4S7OTwtTYYmc/GUBUWUPdyiucj2GGXKh7Jk/I/betBiDsndoqmGBvF nDTQw1I4vGLI53aquS2VjEN0iwfBbNC9K1XxdEHijfuuen9L+V/4GGHENfDTrWdsOg4D JA/AmcsLzTuge8otYA2WOl1AKyME7l7K/PdtpQVGx2tWEbKjxzRnT4AF0g6WHHJ/+LQl x6xKfdid1x1u/CvkmnTy43KKVJID4j8g2ThAkwS5nCtpOgl+5yzpFL81WceTTDCG6WS9 Wg7w== X-Gm-Message-State: AOAM532A5nWOB9J7E3DLdPcgULAce4zlI4NyZmhgC3vnD2zSdga1jBBG sULcibpAUG1ltXBwrnpG+lxwfg== X-Google-Smtp-Source: ABdhPJwTCUMKJmH6C+6CtpDyxmNysxEbBh63HTOIE+uQYOcxZSyhQqqamHWgCC/vqGUEjGnJSrSc3Q== X-Received: by 2002:a05:6402:40d2:: with SMTP id z18mr12485708edb.366.1624454613833; Wed, 23 Jun 2021 06:23:33 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f666:9af6:3fed:e53b]) by smtp.gmail.com with ESMTPSA id q15sm3273edr.84.2021.06.23.06.23.33 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Jun 2021 06:23:33 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, git@xilinx.com, bharat.kumar.gogada@xilinx.com, kw@linux.com Cc: Bjorn Helgaas , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org Subject: [PATCH v2 1/2] dt-bindings: pci: xilinx-nwl: Document optional clock property Date: Wed, 23 Jun 2021 15:23:29 +0200 Message-Id: <67aa2c189337181bb2d7721fb616db5640587d2a.1624454607.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210623_062335_427306_DBCBF1C4 X-CRM114-Status: GOOD ( 12.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Clock property hasn't been documented in binding document but it is used for quite a long time where clock was specified by commit 9c8a47b484ed ("arm64: dts: xilinx: Add the clock nodes for zynqmp"). Signed-off-by: Michal Simek --- Changes in v2: - new patch in this series because I found that it has never been sent Bharat: Can you please start to work on converting it to yaml? --- Documentation/devicetree/bindings/pci/xilinx-nwl-pcie.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/pci/xilinx-nwl-pcie.txt b/Documentation/devicetree/bindings/pci/xilinx-nwl-pcie.txt index 2d677e90a7e2..f56f8c58c5d9 100644 --- a/Documentation/devicetree/bindings/pci/xilinx-nwl-pcie.txt +++ b/Documentation/devicetree/bindings/pci/xilinx-nwl-pcie.txt @@ -35,6 +35,7 @@ Required properties: Optional properties: - dma-coherent: present if DMA operations are coherent +- clocks: Input clock specifier. Refer to common clock bindings Example: ++++++++ From patchwork Wed Jun 23 13:23:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 12339839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0359C4743C for ; Wed, 23 Jun 2021 13:25:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 91C9260FEE for ; Wed, 23 Jun 2021 13:25:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91C9260FEE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=r8oOqVKiO/NlXiuUSMxjOgpZ2ydz9t6yH1AXgsC98HI=; b=DPMADgLlJfBhZZ DKHZy1VfL5xVAmidkL3sBmxGymOtq/hWtU9ppf1EDoaAaDaWRCA5GueV7Gni3YSeJmsDJqi0IKYZN MrHYqAo9bWy1N5sG5XXGGZFuX8OFkF5ECloH3MOdgGNpSBZovOI8rVy1HU3ixht+jYl4n98Km2ufc TCNtjTUs2LUbjDyOzCdjGCsLhaRM0bKz8XTiaq3HhwTeDeEguXGlxYQblVsZyjKLTv9VXqlt0xu+3 QfH4koEdtoQDNI3isWlK8OWHNRiUOXBXP3Lr76jkkw1nC1ahNu8b3le8nJZlOcsUGO259toiNZ8d2 fwX9sUHUW4DYkMBHYUCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lw2rH-00Am8J-Bs; Wed, 23 Jun 2021 13:23:59 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lw2qu-00Am3S-P1 for linux-arm-kernel@lists.infradead.org; Wed, 23 Jun 2021 13:23:38 +0000 Received: by mail-ed1-x52e.google.com with SMTP id m14so3451299edp.9 for ; Wed, 23 Jun 2021 06:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sU2PjGEWCZ6p9REJDqxsU1/Bx6ufu3H69HOZKZG7O/o=; b=UCMvs7T6LglSDEVEHetpgrckvcGhBuq33yujZkz8EmBV08pEe8HxMFgrnzCmgBgaLn qc4ue3gpkOKavg5ZBg2DhvbWCSPemVD9NeyAXq8FB0CvpdRnCk645IfE9ROgK+EItULr 1MdeK/XdD0fW6ZqdnSyJ4hc1yuvos/yvDwtlzwX+SN0WuW/UurttXyvtpv8zkzK1g7Wj 21e9tjJdK2jNaUE7HeYJC8ygmmq5nUy57i3k/i1p8JhGU5gFqZdBi2tRWz34aJj7DtPy cSnp1yN+Cs5c0faZcdaxpQ7xb/0EkNtSTuk4d4iD0gXuis3HK12wTP9mvQeFEsWJ5ADt UDnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=sU2PjGEWCZ6p9REJDqxsU1/Bx6ufu3H69HOZKZG7O/o=; b=fv6V7qD8KUuj+O9O6qcoBMtheJBkokXGV0ITCHv6od0P6Qw0qyxh4QwBx5bYg4WZx1 gz85+FG83RKTObs5D49dSV5BeTcA5Ilc+XNHosmU4KCzV5w+YgE1EPYCraR7QRQGmbpO 0GSAZ9/sBbCmTWGyz36TyUIg/6xyK5401ZzS1aFD7B5U+KVxt1AgGRaNgetlzQKOYTnq GyzK/bjWyiTrPs5nFFzsmiahRDjrDX/IJ/BP5d+4yzGJCeB+8NtXiyv+MDEVwhcgiYqF K4T8zZWCA1golKfQnvhmObYwxdXv81ui1+AdQ/glI9b7ePtn7NLrsMoG4kh5aeg5B12k qA2A== X-Gm-Message-State: AOAM532Ldpqxp2Ld1BNd2rChIRDrvJpCmNrK48H94+J9IgkcuiK03MJy T07we75RV/gKO2bLwv9Xfxq5vQ== X-Google-Smtp-Source: ABdhPJxBXwhpnsDk4vGkm1oHbYosJ1sYshqtefU8piT3JnF1ANjAmJQrE4ECvh7GlyGRtopnMwnl8g== X-Received: by 2002:a05:6402:c03:: with SMTP id co3mr12380973edb.21.1624454615247; Wed, 23 Jun 2021 06:23:35 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f666:9af6:3fed:e53b]) by smtp.gmail.com with ESMTPSA id h20sm7090846ejl.7.2021.06.23.06.23.34 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Jun 2021 06:23:34 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, git@xilinx.com, bharat.kumar.gogada@xilinx.com, kw@linux.com Cc: Hyun Kwon , Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Ravi Kiran Gummaluri , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org Subject: [PATCH v2 2/2] PCI: xilinx-nwl: Enable the clock through CCF Date: Wed, 23 Jun 2021 15:23:30 +0200 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210623_062336_930763_1DE909D8 X-CRM114-Status: GOOD ( 15.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Hyun Kwon Enable PCIE reference clock. There is no remove function that's why this should be enough for simple operation. Normally this clock is enabled by default by firmware but there are usecases where this clock should be enabled by driver itself. It is also good that clock user is recorded in clock framework. Fixes: ab597d35ef11 ("PCI: xilinx-nwl: Add support for Xilinx NWL PCIe Host Controller") Signed-off-by: Hyun Kwon Signed-off-by: Bharat Kumar Gogada Signed-off-by: Michal Simek --- Changes in v2: - Update commit message - reported by Krzysztof - Check return value from clk_prepare_enable() - reported by Krzysztof drivers/pci/controller/pcie-xilinx-nwl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/controller/pcie-xilinx-nwl.c index 8689311c5ef6..67639f5a5e79 100644 --- a/drivers/pci/controller/pcie-xilinx-nwl.c +++ b/drivers/pci/controller/pcie-xilinx-nwl.c @@ -6,6 +6,7 @@ * (C) Copyright 2014 - 2015, Xilinx, Inc. */ +#include #include #include #include @@ -169,6 +170,7 @@ struct nwl_pcie { u8 last_busno; struct nwl_msi msi; struct irq_domain *legacy_irq_domain; + struct clk *clk; raw_spinlock_t leg_mask_lock; }; @@ -823,6 +825,16 @@ static int nwl_pcie_probe(struct platform_device *pdev) return err; } + pcie->clk = devm_clk_get(dev, NULL); + if (IS_ERR(pcie->clk)) + return PTR_ERR(pcie->clk); + + err = clk_prepare_enable(pcie->clk); + if (err) { + dev_err(dev, "can't enable pcie ref clock\n"); + return err; + } + err = nwl_pcie_bridge_init(pcie); if (err) { dev_err(dev, "HW Initialization failed\n");