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: 2581 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8C1613F18E for ; Sat, 31 Dec 2022 11:47:51 +0100 (CET) Received: by mail-ed1-f72.google.com with SMTP id t17-20020a056402525100b00478b85eecedsf15730648edd.18 for ; Sat, 31 Dec 2022 02:47:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672483671; cv=pass; d=google.com; s=arc-20160816; b=nm4ILqxM+izF6QtWifT/20Y9y5IVeRpJGn5p+W/edK5NoTLR0IiU1VvnbRchEZAjbT L2gvPXcI747MLHVqwdFTtmhtsI3dpYBFOqEtmYsPU5/PbJwhKWOguniXWDEsKUAhKTFv E/G2/FUTKzSQz7EWoVqR5o3UwNh9tpl3/lQXnSdGjK3q4tE5UsUSuZeqIui4Fu09ok5z d9gv4ALQ/eo7/DgVUeSJ+xnntqE4TWVRmE7ALixuud+yAl9eVXMJMqwfu44PnH21Ipb2 mJvcJmD9cfjIKtMPDh+gWItvGBdB0NfuAFgWLkw7UPnhtouoWnAPL0JW5zrztmMi1y6U m6IA== 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=7FPT0cJOHkDqvYphKG6KBAyGhGcrJsMFrPPIshLlGXM=; b=tgSNomoXDC4waYThqRmtj+FuFrtTt8TKVWTi1PzZWqj+NfVobkkQ38Or8OsaUSgh9o E7UURwk75D8chessYIrAE79zQw8Uhsu/L8qmwMT6uYqOPzAXg21huGQzXcIzyqxAAN8M 7/UUDvx/q+qcpxxoSrpaXR4eHUk6khZJeQwJ/BSD7xEuc4v4eYwDK2pHCn15GjSCaut+ wB9AOW8BQjFJqHp9ZfYtT1O9keSsmPlDf7+xmLCe81XOkt5z0qvIk1SbrRC/n9VrHdou l9yqdUTrxKwKa5LV7IfINRHrZn0hA46G9kooLndBghxchuXG76NHqXfIM8HRzvWfWEXX kjFQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Q7ihk4LO; 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=7FPT0cJOHkDqvYphKG6KBAyGhGcrJsMFrPPIshLlGXM=; b=V/0z5BDesGRtGOuoVH3nb1roMM4rRqxGDmg6IgavYuvRnY4CPq0ru2FJaw4O3OnIX+ XxwqYdxHVoymXHOwji8RB678MX1w1KlUtR1V6vIddtuCh/pMan3VktRSbnFYZ7YLxTxQ 2DvIw9Bd+VNYoNYutLI1uuvmQtSQuxK/le5QQ= 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=7FPT0cJOHkDqvYphKG6KBAyGhGcrJsMFrPPIshLlGXM=; b=fRh5qHTxv3PVxISEbdrGrSvd2fvgFZpNf7E/hpywV5j8/97n9R9T4u4RST1pRdSv+b /fosY9pFWPLej9KVWXokjlt7DWPOgCky+i0m5OvYIz1PPH55gWamBJ0jH6MxvanvHgCh M9Gf8UH0F4Ccdi2QYYAvirVZ0UjD+l5Or4Qvktciwvz1Adn/tX24h+oxgeu3Bj+J2Dvn VeiWY6rElMGVk4emfH2N/xYEtb6p/acPJJxDKtEopHSufF/MFsM/wIR92gkVzZHDZs5R wjGRdkRtXn5nVsNzBb0neAMizH3WH58AnErwRSEATKC62Q49haC1ktkCMHQ7eGLVaLwY OaqQ== X-Gm-Message-State: AFqh2koyfzag8kjgjT5UccLxEnL3wTJBVpenHTIZMqu9tvN7WY13BY6G 80mmC6bnCS8kkjW9jdNTGwpWzKdu X-Google-Smtp-Source: AMrXdXuKR8zPW6cDX9Wmw8a714TtCFb5oxyNla2md/cR1h5Dm4n08QuvPBE0uhB/aimwF57rpOzvDw== X-Received: by 2002:a17:906:3bd7:b0:7c0:ab1e:e361 with SMTP id v23-20020a1709063bd700b007c0ab1ee361mr3135814ejf.579.1672483671115; Sat, 31 Dec 2022 02:47:51 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:906:36d7:b0:7c1:381b:406d with SMTP id b23-20020a17090636d700b007c1381b406dls951468ejc.11.-pod-prod-gmail; Sat, 31 Dec 2022 02:47:50 -0800 (PST) X-Received: by 2002:a17:906:380e:b0:7c0:be5d:59a9 with SMTP id v14-20020a170906380e00b007c0be5d59a9mr32894133ejc.20.1672483669864; Sat, 31 Dec 2022 02:47:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672483669; cv=none; d=google.com; s=arc-20160816; b=HmRpA5tZl3IFICmDJhqQf/KbKuIvuFlOwga5btMmruZteuRbAtSR85XRksexo85KPY Jr7+lh8psQeC/cFdj3c5x/PMvjPt0KSWqYafrRRLjhFYmEOjtUTUiSncWZ5siLTuqYMN c+7mcIaDmzsZ6jpxOVznfgiqG2gQ5B/RgzUVmPzrLWUMu8Pv3tFsJfXsmX4ii85SnnYS 0OcdClImspTEz/53dC5DhwndOFDBbGrwwnDN2WqDziftMX2Pttob24V/ey0qLj6ZYfZu gWbbkbTbcgwtENDWb33JpiISkUy/+YQS/G6qz1o7ZdW+KIRVirnN58J82qVzzd4tuzYP NKUw== 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=mEyhDLjUotgmC3JtXt/RMPu+Hko7HSi75jUhaPS/Wts=; b=do5MoqFBZlg8YhAbuPbuVrQnPfglVpf+J9KfkQp2lTvWmIYDXBQnPeIcGzdp7neTqW N8YIsetL+wSF0pIrbdNfTGks1r6dZHAdVxMOSHWjBlAqXkLOfc+YbH/9xAD83oBFbCus vXNepcPGqOWwBEkDCD68czOqC1e56O8VUHvKzt2p5+pDlvP+85rUBXENdsvucbwQSnK7 XF8gf9uhPnQU39qPu8jehWfO6jEHL1Ohg4kBR4vRGl6C5tsBky9c1mxJe//t6cchISZz qLfIKqF9+pjvtILlXSFe9knfsOqd8XzkpOAuxJgMy3BbY/UBqr3LH859OJsgzyNiRUXP un1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Q7ihk4LO; 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 tg8-20020a1709078dc800b0084c88c25227sor3482604ejc.48.2022.12.31.02.47.49 for (Google Transport Security); Sat, 31 Dec 2022 02:47:49 -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: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-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Q7ihk4LO; 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 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