From patchwork Mon Nov 16 07:55:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tretter X-Patchwork-Id: 11907619 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=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 7D1DCC4742C for ; Mon, 16 Nov 2020 07:58:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 1D8BC2137B for ; Mon, 16 Nov 2020 07:58:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WOtyRiEY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D8BC2137B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date: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=q5VODdzRWsALYoGs5wVPL7hiK4Lb2hzINRxS3H+C7KY=; b=WOtyRiEYCvUoMK8ZRVAOeetb8J uJohyRjll6sCOIgLiyakB2VlUsvcV/kL1PJGXmBWg++gA4928JSZaUoZK9gmvbTyKVJQ2VQLVFn9v 1jDMNlxEcJQyk9Upmfps3ADLR/FbWOPOHtZMryIkzZOnlpkcmCTfzTj2QIsHHQ6Cnk6a2uGisdnvD v+DImGpvEpIBUvJyqmnlqf9zSG4sZr39DE/72wvFHk/956UbNDkQVrfgF4L7Pm7Dnkpz3fvL7VgRI hDOVGIvjqG2rE5VciP59DgzunxFIVfMYZ4uSy+CFJL7Jiy6mYJKCjpr5t+c356sGyboCdsw7PSJO1 peC8crJQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1keZP9-00083O-Jn; Mon, 16 Nov 2020 07:58:27 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1keZMW-0006kP-4C for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2020 07:55:49 +0000 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1keZMO-0007YL-0W; Mon, 16 Nov 2020 08:55:37 +0100 Received: from mtr by dude03.red.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1keZMM-00GrbL-Px; Mon, 16 Nov 2020 08:55:34 +0100 From: Michael Tretter To: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org Date: Mon, 16 Nov 2020 08:55:20 +0100 Message-Id: <20201116075532.4019252-1-m.tretter@pengutronix.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::39 X-SA-Exim-Mail-From: mtr@pengutronix.de Subject: [PATCH 00/12] soc: xilinx: vcu: Convert driver to clock provider X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.ext.pengutronix.de) X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201116_025544_369659_54D09EAC X-CRM114-Status: GOOD ( 16.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: dshah@xilinx.com, tejasp@xilinx.com, sboyd@kernel.org, mturquette@baylibre.com, Michael Tretter , rajanv@xilinx.com, robh+dt@kernel.org, michals@xilinx.com, kernel@pengutronix.de, rvisaval@xilinx.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello, the xlnx_vcu soc driver is actually a clock provider of a PLL and four output clocks created from the PLL via dividers. This series reworks the xlnx_vcu driver to use the common clock framework to enable other drivers to use the clocks. I originally posted a series to expose the output clocks as fixed clocks [0]. This series now implements the full tree from the PLL to the output clocks. Therefore, I am sending a separate series that focuses on the clocks, but it depends on v4 of the previous series [1]. Possible consumers for the clocks are the allegro-dvt video encoder driver or the Xilinx Video Codec Unit [2] out of tree driver. Patch 1 defines the identifiers that shall be used by clock consumers in the device tree. Patch 2 fixes the generic clk-divider to correctly use parents that are passed via struct clk_hw instead of the clock name. Patches 3-6 refactor the existing driver and split the function to configure the PLL into smaller helper functions. Patch 7 registers a fixed rate clock for the PLL. The driver calculated and set the PLL configuration during probe, and exposing a fixed rate clock for that rate allows to use the existing configuration with output clocks from the common clock framework. Patches 8-10 switch the driver to the common clock framework and register the clock provider. Patches 11-12 are cleanup patches. Michael [0] https://lore.kernel.org/linux-arm-kernel/20200619075913.18900-1-m.tretter@pengutronix.de/ [1] https://lore.kernel.org/linux-arm-kernel/20201109134818.4159342-3-m.tretter@pengutronix.de/ [2] https://github.com/Xilinx/vcu-modules Michael Tretter (12): ARM: dts: define indexes for output clocks clk: divider: fix initialization with parent_hw soc: xilinx: vcu: drop coreclk from struct xlnx_vcu soc: xilinx: vcu: add helper to wait for PLL locked soc: xilinx: vcu: add helpers for configuring PLL soc: xilinx: vcu: implement PLL disable soc: xilinx: vcu: register PLL as fixed rate clock soc: xilinx: vcu: implement clock provider for output clocks soc: xilinx: vcu: make pll post divider explicit soc: xilinx: vcu: make the PLL configurable soc: xilinx: vcu: remove calculation of PLL configuration soc: xilinx: vcu: use bitfields for register definition drivers/clk/clk-divider.c | 9 +- drivers/soc/xilinx/Kconfig | 2 +- drivers/soc/xilinx/xlnx_vcu.c | 613 ++++++++++++++++----------- include/dt-bindings/clock/xlnx-vcu.h | 15 + 4 files changed, 383 insertions(+), 256 deletions(-) create mode 100644 include/dt-bindings/clock/xlnx-vcu.h