From patchwork Sun Jan 1 17:57:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2593 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5798F3F9E8 for ; Sun, 1 Jan 2023 18:57:48 +0100 (CET) Received: by mail-ed1-f69.google.com with SMTP id y21-20020a056402359500b0048123f0f8desf15065616edc.23 for ; Sun, 01 Jan 2023 09:57:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672595868; cv=pass; d=google.com; s=arc-20160816; b=rMyZNMlpT2u3qbyzBst3RrvCjL8W4vk1ry2ZkDAI0w+j0GKHKvdCgYbPsIbPNRHPm1 uJcfL8YEwTKLhK3vpmHCgbgIjOHM3PnFSfyaT0oTQLRw5ls9HxiKFTFFGg88rFq/YvWe acRi82qywZBLoI1RAeaWH4TJ04GWsTc6wWGvFYLeqgHjACJ8bxFAWVo1VX/QQphIlzXM SBihpElXNKXE6OgIJXMV93m6lZFszb5ma3GWphxPTsXuejWnei4GtfW7wzaaVFcC1TqA XgTm/9mZ8PhMBXR0VMc7GhWnwwAZ0q79zeg2VFXPHyrXalOlBILunCDlV/kmHiM6rvjA sADw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=hB1ix8YKRRt6l/LKHgK8MYMVD7zpkXezzBw2K/iEs+E=; b=a6f1Kd+JH3a8S9xs7YnKMNjmivC+dOhZLxQbajAXHMdOCtQSuCDuJhFtwtaSjg0Ksh 9ia1qcbrXMDgC+C5gNvB4KPZOCHy7Rn14lGTUtF/3RxpOr3XknA2ogzPv3zLQ1Ybsxa1 LtGo659VAZeurni3Pn5A592ubL9u7j6OMmFtqdXVYXHeQ6FGpeDqpzGteuzMQ0fgP07r TeHSx38k7DrS6jApRFT5IGbXNRyYnb8YaKhtRK2D8/Z5DDfGgNhK5wx7fPjnMpnqdEe4 egj2rXKnFtJjc/fwX9xEoUC4jJItHV/zg81ATBUpyISW6GNIOfYJC3Zk+VufQTD+J80w nFOg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gHsBdSkn; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=hB1ix8YKRRt6l/LKHgK8MYMVD7zpkXezzBw2K/iEs+E=; b=AbcUuN6DJZbIJI3H6v85O06Id8X4q7FrLgg3iBKa0f1atybrwqY2H4GDTSr638ge/0 HR5r9NgdHYufnbxsf27THXpy/XCh4dfz1i5EDHqyzpePtTZxRyB/SUvSjrEPH3ATV8lj snBHYuvPu3CwAR/CnYEtI/jy8OGQE/x0DcZqQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hB1ix8YKRRt6l/LKHgK8MYMVD7zpkXezzBw2K/iEs+E=; b=tU2Iz3Aqcv6YykuFLuSjKJLvra8YVo+xDlB2PBxGR6NzgYVJXzbtjL6rOLCprpQr4d f9i444f1qdKNAG16eLQPRm53Lvs+1mWldQeXw0F2ZUslBscpXvSOyYK/F7wfgd22eUyY 2POUDnSjTeL2nDU24u7zd3VdB5f/sOaUk9anLDjfkTwzR6wCikU1FA6/1AuJLUrC+le7 /UkZaVY8Rx6nQ/TESUVLES8BoUH2ztBaE3yqZjQjpUuAaYHtf3DiKJggry8t21qmdO28 A6SQd5kOL2OWJuWfJSevyRmc+llSip4huQpaHTnSAk46TuOyTsjJgFEmEa9z1mZbTAqR ef7Q== X-Gm-Message-State: AFqh2kolJCGh7rwSXA3CKVV8QN71p9VDG0pgU8hbWvkZF7hQDK9dhSv/ dj951DfuiKk2qkxbgz3rFpvLxM0W X-Google-Smtp-Source: AMrXdXv+GrdG1wkmZqqDjNvVGIWxLiOAE3SeTEaHcvGvUZYDdtbWRNg3BDRbOTy1Y1/iJf1dXn+q5w== X-Received: by 2002:a17:906:d04e:b0:818:4095:3dcb with SMTP id bo14-20020a170906d04e00b0081840953dcbmr2365063ejb.62.1672595867958; Sun, 01 Jan 2023 09:57:47 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:906:3d62:b0:7ad:9efd:4692 with SMTP id r2-20020a1709063d6200b007ad9efd4692ls2015947ejf.4.-pod-prod-gmail; Sun, 01 Jan 2023 09:57:47 -0800 (PST) X-Received: by 2002:a17:907:c203:b0:7ad:84c7:503a with SMTP id ti3-20020a170907c20300b007ad84c7503amr32058464ejc.72.1672595866690; Sun, 01 Jan 2023 09:57:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672595866; cv=none; d=google.com; s=arc-20160816; b=RpAAkKnNwhMRzdKvmPIhxeHNhxsO9E1/ZmtnmgjCs3FFZJ+UbV4PUaKcWcmjo3ltKg 4oXHx7hB3DMhB2ZhBdGkBXt5jUsvs/26E/Sj83ooIiTIkuB7FLRaDWc8KVTy9ckREJQ0 XSt6cAbbJxJbgBjF84xtFE9N4xuyGFOy8Rn+lmOrd9N/s9kJlQn/aJ5OARyDyq8M+Fth SRg+ln3JHsVcdFt/anSyeMQMYePrRGaDfUzhmrKkxOJn0EbJNgLoIkQKweIjJWAnk3Mp jUC7436P7wD5gjXOMWqkwTV5IRzUviRMgcB4aOtd6299uV9JbM0Ovuelo676TyXdllK1 sMtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=ALuH1lvp2knJtHcYW+i1s8ZvzexDo4P1ZGTmQCOOx0Q=; b=Fok7MGdcvoCrwPlyYac5+d/AJBJ/Rx6xuIVBZQIQrUpCMZ0pSiSN/1kawYJ+UL6KCq 74tvB9nOWPgCcfqVR32MP5DJgd3/ygcp1pYwl7chG8UKvgCNdYUsfWfQXaKUQaAS0trA 5SRr/p1UY/aVtsagxrVDNfApReLHmPcrXBxFMurIYnMxGtWlT9dOuBt9HpQhNFNz/VR/ SsS61l6DJGQMnQ47IMuKtRuUbPfid+uZk+0t5bbD2nAWG16zoEghwy5NTzUCaeRf4WwX M7fJnDVflXfvkl71kQ2E3XHI3iFUp4aa9mFw6eRA4aBrWxYg6/PE1OimMRj2pueNQ0TS esWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gHsBdSkn; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id qo5-20020a170907874500b007ad7e81a306sor11616760ejc.53.2023.01.01.09.57.46 for (Google Transport Security); Sun, 01 Jan 2023 09:57:46 -0800 (PST) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:907:d602:b0:7c1:286a:d87c with SMTP id wd2-20020a170907d60200b007c1286ad87cmr32679732ejc.65.1672595866417; Sun, 01 Jan 2023 09:57:46 -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 q2-20020a1709063d4200b0082ddfb47d06sm12273018ejf.148.2023.01.01.09.57.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Jan 2023 09:57:46 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: angelo@amarulasolutions.com, michael@amarulasolutions.com, tommaso.merciai@amarulasolutions.com, Chen-Yu Tsai , linux-amarula@amarulasolutions.com, anthony@amarulasolutions.com, jagan@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 v2 00/11] clk: imx8mn: setup clocks from the device tree Date: Sun, 1 Jan 2023 18:57:29 +0100 Message-Id: <20230101175740.1010258-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gHsBdSkn; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Changes in v2: - Fix compiler warnings reported by kernel test robot. 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 | 84 + 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, 3177 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