From patchwork Sat Dec 31 10:47:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13086002 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0DE9BC3DA7D for ; Sat, 31 Dec 2022 10:49:25 +0000 (UTC) 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: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:In-Reply-To:References: List-Owner; bh=vc4NL6OZxHrwYnO4KSdS0F4zZFXrOEljhDx8JNr56tg=; b=jLfYXtwmA7f3jU pKGodX2ivHVgjxEfYGheXTwX86YAMa+HQC8zXJ+Ig1a9oGrsji1vw5yMC/NnRu6YGHhSLJQObDVwM 0hnw0jujQwUYTzkGeHB+wBfsUjg3zd3JpMIhg74SsWoBvlos3hPNRBRp/K6/AsYzNFRjbuK5Y8bA9 tpKnnWMGp7wHv0j3RwFpmHgDJHuvOCdlkOfVMtcqaz8vGRb3P4xh86Dz66m3FjB2XBCtJz+Y0Kow8 As0cu+CM25fIsZNcqtCHokB5uXFwRk3KDewY0DPqCPtK9zwgyz5gd4J0LLySygx3k3f0tD0xp8wQh LSy5sK/xVA2KV9uxbRLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pBZPE-0042Yk-4U; Sat, 31 Dec 2022 10:48:00 +0000 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pBZP5-0042Oz-EG for linux-arm-kernel@lists.infradead.org; Sat, 31 Dec 2022 10:47:53 +0000 Received: by mail-ej1-x644.google.com with SMTP id m18so56312515eji.5 for ; Sat, 31 Dec 2022 02:47:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mEyhDLjUotgmC3JtXt/RMPu+Hko7HSi75jUhaPS/Wts=; b=Q7ihk4LOj4p8w+nLZjeNXShVWZ67NNNje/AuDd5IQufoP47QxJgIuldn+X+o46xQ8i AhWSy7tf636P11d11KqtmI5tCp4Iwo99zJefOwSN+8AcHLwzpvhESQL23dUDvLQDZflj xm9+6T7RR3Wy4n9WKFoit7oXGUDhNvjZO2OnU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mEyhDLjUotgmC3JtXt/RMPu+Hko7HSi75jUhaPS/Wts=; b=2A42+V8XzqwB+pI+OrpQMpOc3g0IX9ygfEtBmZRia2lcNZ6dZSGkataUPP1HaoiXHp deR0MI6rpkol/QKmsn1LWywpMXq8oN0HRNTLPKJ4SaqLSm8qczViqTe7FLc9nVk5wd+S 5fei6RfC/tmSJmhHMxC1+E5dpKGpRhotZjfE5RduSlUmz9wIaUmv7ri0CkQYX3B7BIlM 4wno0taEL6lKDObCoM8fI5XWK7XH8LSfy2zifdCxJ14Jm0Bk8PgKhVw7EgJd5rhupq+v 3W6YUI5Kcd2OQ1HwMCRFvdSCk5OF4eV13HPq7DRZEdlai2fVKpCHKRC6vb5wCkT5Tfb/ zaBQ== X-Gm-Message-State: AFqh2kqKcdQnlQC48SUZyE7k9zTvQcdDN4/D/H+rdsXLLKkkivlVU969 w8d/oOmDI78mgEO1j0Ua02hNog== X-Google-Smtp-Source: AMrXdXu1x8liAPz491BtUIf6hj5bm8qPI+F9cy8Jl1JSxQW5vdTGZNokloNsBS4HQ5CBnhvuMsfdxQ== X-Received: by 2002:a17:907:2918:b0:818:3f54:8db6 with SMTP id eq24-20020a170907291800b008183f548db6mr27872605ejc.6.1672483669569; Sat, 31 Dec 2022 02:47:49 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-80-180-23-57.retail.telecomitalia.it. [80.180.23.57]) by smtp.gmail.com with ESMTPSA id z4-20020a17090655c400b0083ffb81f01esm10765438ejp.136.2022.12.31.02.47.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Dec 2022 02:47:49 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: tommaso.merciai@amarulasolutions.com, linux-amarula@amarulasolutions.com, Chen-Yu Tsai , jagan@amarulasolutions.com, angelo@amarulasolutions.com, anthony@amarulasolutions.com, michael@amarulasolutions.com, Dario Binacchi , Abel Vesa , Adam Ford , Fabio Estevam , Krzysztof Kozlowski , Li Jun , Lucas Stach , Marek Vasut , Markus Niebel , Michael Turquette , NXP Linux Team , Pengutronix Kernel Team , Rob Herring , Sascha Hauer , Shawn Guo , Stephen Boyd , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org Subject: [RFC PATCH 00/11] clk: imx8mn: setup clocks from the device tree Date: Sat, 31 Dec 2022 11:47:25 +0100 Message-Id: <20221231104736.12635-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221231_024751_574269_5549AF2E X-CRM114-Status: GOOD ( 15.62 ) 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 The idea for this series was born back from Dublin (ELCE 2022) after having attended the talk entitled "Updating and Modernizing Clock Drivers" held by Chen-Yu Tsai and the availability of a board with imx8mn SOC. This series aims to setup all imx8mn's clocks from the device tree and remove the legacy setup code with hardwired parameters. I am well aware that the series lacks patches for the DT bindings. The effort up to this point has been important and so I thought I'd ask for feedback from the community before proceeding to implement them. If it is positive I will add the DT binding patches starting from version 2. The series has been tested on the BSH SystemMaster (SMM) S2 board: https://www.apertis.org/reference_hardware/imx8mn_bsh_smm_s2pro_setup Dario Binacchi (11): clk: imx: add structure to extend register accesses clk: imx: add clk_hw based API imx_get_clk_hw_from_dt() clk: imx8mn: add gate driver clk: imx8mn: add mux driver clk: imx8mn: add divider driver clk: imx: pll14xx: add device tree support clk: imx: composite-8m: add device tree support clk: imx: gate2: add device tree support clk: imx: cpu: add device tree support arm64: dts: imx8mn: add dumy clock arm64: dts: imx8mn: add clocks description .../boot/dts/freescale/imx8mn-clocks.dtsi | 1885 +++++++++++++++++ arch/arm64/boot/dts/freescale/imx8mn.dtsi | 51 +- drivers/clk/imx/Makefile | 3 + drivers/clk/imx/clk-composite-8m.c | 83 + drivers/clk/imx/clk-cpu.c | 54 + drivers/clk/imx/clk-divider.c | 235 ++ drivers/clk/imx/clk-gate.c | 156 ++ drivers/clk/imx/clk-gate2.c | 86 + drivers/clk/imx/clk-imx8mn.c | 716 ++----- drivers/clk/imx/clk-mux.c | 258 +++ drivers/clk/imx/clk-pll14xx.c | 220 +- drivers/clk/imx/clk.c | 21 + drivers/clk/imx/clk.h | 15 + 13 files changed, 3176 insertions(+), 607 deletions(-) create mode 100644 arch/arm64/boot/dts/freescale/imx8mn-clocks.dtsi create mode 100644 drivers/clk/imx/clk-divider.c create mode 100644 drivers/clk/imx/clk-gate.c create mode 100644 drivers/clk/imx/clk-mux.c