From patchwork Tue Feb 21 14:11:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xingyu Wu X-Patchwork-Id: 5685 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp34844wrd; Tue, 21 Feb 2023 06:21:37 -0800 (PST) X-Google-Smtp-Source: AK7set92OyWi7bbgGBnuuaWNhGQijuU/YUC5HlX+/oa9mHPyoh6cOQbYYCHoDLS0QvqskV8fVoD9 X-Received: by 2002:aa7:d5c6:0:b0:4ac:b614:dd00 with SMTP id d6-20020aa7d5c6000000b004acb614dd00mr5084697eds.30.1676989297505; Tue, 21 Feb 2023 06:21:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676989297; cv=none; d=google.com; s=arc-20160816; b=Cl+AdWS08G2E0HwyEKnmJ9aJf9poLbe6nGsZPG5blkoXkLv0EYlsWUbh9RHd3ywxtu te9VVQPoYUI13EFf8SlasKHr93terYkM9bkGpkweoPIo1QKsaA+zKETwrDgiLcVKRT4t CwJLlRV2pr4lZ08tME4gaJXvzsUqPTlePU8gwSj5eu5R0IU4B/GkICMyovJ3o9no92dR ZDi3sEY1YzIkp/iWnn3CdM0jhZZP6/64ICyot1NBOr6Cxb/55Umnw84p7KuXn8VSl1Kt 9FEBnctl4eShjOJ8mdB4maJa8hhMwonzRxDz1dLt7jEwISS0DBIhUvwN9g6RED/i+xc3 HCGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=OCvW/w6TXD29/n29wF1bQWMRbIf1MwmUIweIp3NhJEY=; b=YL5/ODyUOfCHCtpZZ6ZZvCUrA7EodEU0loJWY3wMKA4OnGyJnbFLkWLWbJT04+S+LK dG6I+LUGRL++7ZH+f5f7vLINN8NdEuw6k7l3PizSUSPok+M83oEPkiADZwEIQ7fkBCf9 UFanzghHoQHvd/q4PMY5Y72d/DCA7Q1NmU0KZuBqLvHTX3MuxpbHdLU0ONXMsxpWu9/u 8GWbCMyyhPvfbtAOjWwZ4KgZbBuUMtsBlqz0A5zZQi1PvB9wke2wEB/IZYrCnNwi9m51 SmB9LM3YSquakV1/H7xAJMlpk0f+1OmQo8hD5Fmc8DUCCpg4nBTlhAU1C/Qz8PwKv28r dpCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u4-20020aa7d0c4000000b004aef6266c6bsi7296771edo.325.2023.02.21.06.21.14; Tue, 21 Feb 2023 06:21:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234052AbjBUOL7 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 21 Feb 2023 09:11:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233346AbjBUOL5 (ORCPT ); Tue, 21 Feb 2023 09:11:57 -0500 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25659279B7; Tue, 21 Feb 2023 06:11:53 -0800 (PST) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id F0ADC24E01A; Tue, 21 Feb 2023 22:11:51 +0800 (CST) Received: from EXMBX061.cuchost.com (172.16.6.61) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 21 Feb 2023 22:11:51 +0800 Received: from localhost.localdomain (183.27.98.67) by EXMBX061.cuchost.com (172.16.6.61) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 21 Feb 2023 22:11:50 +0800 From: Xingyu Wu To: , , "Michael Turquette" , Stephen Boyd , Krzysztof Kozlowski , Philipp Zabel , Emil Renner Berthing CC: Rob Herring , Conor Dooley , "Paul Walmsley" , Palmer Dabbelt , Albert Ou , Hal Feng , Xingyu Wu , , Subject: [PATCH v1 0/3] Add PLL clocks driver for StarFive JH7110 Date: Tue, 21 Feb 2023 22:11:44 +0800 Message-ID: <20230221141147.303642-1-xingyu.wu@starfivetech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [183.27.98.67] X-ClientProxiedBy: EXCAS064.cuchost.com (172.16.6.24) To EXMBX061.cuchost.com (172.16.6.61) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758450729458289024?= X-GMAIL-MSGID: =?utf-8?q?1758450729458289024?= This patch serises are to add PLL clocks driver and modify the system clock driver to depend on PLL clocks driver for the StarFive JH7110 RISC-V SoC. PLL are high speed, low jitter frequency synthesizers in JH7110. Each PLL clocks work in integer mode or fraction mode by some dividers, and the dividers are set in several syscon registers. The formula for calculating frequency is: Fvco = Fref * (NI + NF) / M / Q1 The first patch adds docunmentation to describe PLL clock bindings, and the second patch adds driver to support PLL clocks for JH7110 and modifies the system clock driver. This patchset should be applied after this patchset about JH71x0 clock driver: https://lore.kernel.org/all/20230221024645.127922-1-hal.feng@starfivetech.com/ Xingyu Wu (3): dt-bindings: clock: Add StarFive JH7110 PLL clock generator clk: starfive: Add StarFive JH7110 PLL clock driver riscv: dts: starfive: jh7110: Add PLL clock node .../bindings/clock/starfive,jh7110-pll.yaml | 45 ++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 15 +- drivers/clk/starfive/Kconfig | 9 + drivers/clk/starfive/Makefile | 1 + .../clk/starfive/clk-starfive-jh7110-pll.c | 433 ++++++++++++++++++ .../clk/starfive/clk-starfive-jh7110-pll.h | 286 ++++++++++++ .../clk/starfive/clk-starfive-jh7110-sys.c | 40 +- .../dt-bindings/clock/starfive,jh7110-crg.h | 12 +- 8 files changed, 807 insertions(+), 34 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh7110-pll.yaml create mode 100644 drivers/clk/starfive/clk-starfive-jh7110-pll.c create mode 100644 drivers/clk/starfive/clk-starfive-jh7110-pll.h base-commit: c9c3395d5e3dcc6daee66c6908354d47bf98cb0c prerequisite-patch-id: 4dc515731ce237184553c1606ffb3afaeb51c3d8 prerequisite-patch-id: ac150a8c622e858e088df8121093d448df49c245 prerequisite-patch-id: a4255724d4698f1238663443024de56de38d717b prerequisite-patch-id: a798370d170dc2bcc79ed86f741c21c1e6d87c78 prerequisite-patch-id: 203d2500cadc112bd20fefc56eabf1470d3d2d2d prerequisite-patch-id: 315303931e4b6499de7127a88113763f86e97e16 prerequisite-patch-id: 40cb8212ddb024c20593f73d8b87d9894877e172 prerequisite-patch-id: a1673a9e9f19d6fab5a51abb721e54e36636f067 prerequisite-patch-id: 94860423c7acc9025249d4bb36652a585bd0a797 prerequisite-patch-id: b5084253283929d9a6d0e66c350400c7c85d034d prerequisite-patch-id: a428ed7a2aa45abab86923dc467e1e6b08427e85 prerequisite-patch-id: d4f80829fca7ce370a6fad766593cdcb502fa245 prerequisite-patch-id: e3490e19e089fe284334db300ee189b619a61628 prerequisite-patch-id: 34298e3882261bc2d72955b1570cc9612ab7d662 prerequisite-patch-id: 377c5c282a0776feee9acd10b565adbd5275a67e prerequisite-patch-id: 3ccee718de0750adbf8d0b77d553a2778a344f64 prerequisite-patch-id: 4710f2ac22dca0bdd9ff5d744d2c37cab3c74515 prerequisite-patch-id: 65f2aed865d88e6fa468d2923527b523d4313857 prerequisite-patch-id: 258ea5f9b8bf41b6981345dcc81795f25865d38f prerequisite-patch-id: 8b6f2c9660c0ac0ee4e73e4c21aca8e6b75e81b9 prerequisite-patch-id: e3b986b9c60b2b93b7812ec174c9e1b4cfb14c97 prerequisite-patch-id: a2b3a9cff8a683422eb0ccf3a0850091401812d4 prerequisite-patch-id: dbb0c0151b8bdf093e6ce79fd2fe3f60791a6e0b prerequisite-patch-id: ea9a6d0313dd3936c8de0239dc2072c3360a2f6b prerequisite-patch-id: d57e95d31686772abc4c4d5aa1cadc344dc293cd prerequisite-patch-id: 29aab7148bf56a20acddcb8a11f290705fcc97f6 prerequisite-patch-id: 8adbb4af2c71fde6b8c795bde028157a69c51c31 prerequisite-patch-id: a4689a8a4cc56984b5845b59f5a84e5214d91543