From patchwork Mon Nov 6 08:55:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xianwei Zhao X-Patchwork-Id: 16284 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2523368vqu; Mon, 6 Nov 2023 00:56:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNgEPX19slqJkeFuVThxXBn/PBw3eomEOoDxHTmIYKxmR9/4WLL6AjGXoHZXqciNZAfuoQ X-Received: by 2002:a05:6a00:1ca6:b0:6c2:c5b6:3963 with SMTP id y38-20020a056a001ca600b006c2c5b63963mr17548340pfw.0.1699260983240; Mon, 06 Nov 2023 00:56:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699260983; cv=none; d=google.com; s=arc-20160816; b=HLgA9vqlJsHv08Npehwcvf6t0hM3y+fLqhZjCTngQu0AwqpNv4E+umSiyKjYJ70XBL eArRCNrS0CpObpC6xU5pVChxFUnlzRr6QA63lvj1k+RARfZpch4skR8yTDceSIwMzZPw 5xhysRBkmS5mO/R5HxT3vD4DAtpkdA74XIOv5+c611njqweF1AaVM3Nue8BiqUEqxG1Y CaXviWs/lETjImtIQt8HzMh59NjjYbOk43UjBJJEwE594x3oT9gRbAb3AIfAClYZZ+Y0 CNzHGGiBhzid63mPB/Vzz+V3s8cu2EPeDXs0Cy23Hnwr40gf4o2PKZ8hPQKpV2/HQzOS ztjQ== 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=uSNe8F21EvaUq+QWB/ptM2Okgkha8vDmLaHpPM+fpsA=; fh=oBbb0mPe52rzzTIwtg9Xc2rZ0LejYIA322XCn8vhPVE=; b=f5w8omwNYw4ueTgGnHHAQukurq3RQbRM2NbjQ8LiW17JXCEpAMZyXzSSi/KFHA7Np0 5VXnC6zXqBXWlysuipTSG2PZj6GLc9PSjNphl16EKIxPIcvSnG+t0BlorKsZg4yQVGRd zGckS1IdFhe9SLRWNBPkxqFcVlSo9udXPW6O9qHx4vfB4ofiPzHdKAu5GeUBsAeifN4V rTcIzUc0fxYyVs1s7gynV7Ru7kzakXbAz7ygJn0JvcZcjC6feAYd2mwmv+l5GmIedh6a M2yrB24coRICZMKZqF3AIqX0cSju3IVVmnob4YYcTcEk6Qk7d5IsMbq7k9MbVeS9gt/i lpkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=amlogic.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id f9-20020a056a00238900b0068fce4338bdsi7864620pfc.62.2023.11.06.00.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 00:56:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=amlogic.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id AD0108048C09; Mon, 6 Nov 2023 00:56:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231200AbjKFI4I (ORCPT + 35 others); Mon, 6 Nov 2023 03:56:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231181AbjKFI4H (ORCPT ); Mon, 6 Nov 2023 03:56:07 -0500 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D66F83; Mon, 6 Nov 2023 00:56:02 -0800 (PST) Received: from droid01-cd.amlogic.com (10.98.11.200) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.13; Mon, 6 Nov 2023 16:55:59 +0800 From: Xianwei Zhao To: , , , , CC: Neil Armstrong , Jerome Brunet , Michael Turquette , "Stephen Boyd" , Rob Herring , "Krzysztof Kozlowski" , Kevin Hilman , Martin Blumenstingl , Chuan Liu , Xianwei Zhao Subject: [PATCH V6 0/4] Add C3 SoC PLLs and Peripheral clock Date: Mon, 6 Nov 2023 16:55:50 +0800 Message-ID: <20231106085554.3237511-1-xianwei.zhao@amlogic.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-Originating-IP: [10.98.11.200] X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 06 Nov 2023 00:56:19 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781804284369162145 X-GMAIL-MSGID: 1781804284369162145 The patchset adds support for the peripheral and PLL clock controller found on the Amlogic C3 SoC family, such as C302X or C308L. Changes since V5 [3]: - Fix some typo and modify formart for MARCO. Suggested by Jerome. - Add pad clock for peripheral input clock in bindings. - Add some description for explaining why ddr_dpll_pt_clk and cts_msr_clk are out of tree. Changes since V4 [10]: - Change some fw_name of clocks. Suggested by Jerome. - Delete minItem of clocks. - Add CLk_GET_RATE_NOCACHE flags for gp1_pll - Fix some format. and fix width as 8 for mclk_pll_dco. - exchange gate and divder for fclk_50m clock. - add CLK_SET_RATE_PARENT for axi_a_divder & axi_b_divder. - add CLK_IS_CRITICAL for axi_clk - Optimized macro define for pwm clk. - add cts_oscin_clk mux between 24M and 32k - add some missing gate clock, such as ddr_pll. Changes since V3 [7]: - Modify Kconfig desc and PLL yaml clk desc. - Fix some format.Suggested by Yixun and Jerome. - Add flag CLK_GET_RATE_NOCACHE for sys_clk. - Optimized macro define for pwm clk. - Use flag CLK_IS_CRITICAL for axi_clk. - Add some description for some clocks. - Use FCLK_50M instead of FCLK_DIV40. Changes since V2 [4]: - Modify some format, include clk name & inline, and so on. - Define marco for pwm clock. - Add GP1_PLL clock. - Modify yaml use raw instead of macro. Changes since V1 [2]: - Fix errors when check binding by using "make dt_binding_check". - Delete macro definition. Xianwei Zhao (4): dt-bindings: clock: add Amlogic C3 PLL clock controller bindings dt-bindings: clock: add Amlogic C3 peripherals clock controller bindings clk: meson: c3: add support for the C3 SoC PLL clock clk: meson: c3: add c3 clock peripherals controller driver .../clock/amlogic,c3-peripherals-clkc.yaml | 104 + .../bindings/clock/amlogic,c3-pll-clkc.yaml | 59 + drivers/clk/meson/Kconfig | 26 + drivers/clk/meson/Makefile | 2 + drivers/clk/meson/c3-peripherals.c | 2745 +++++++++++++++++ drivers/clk/meson/c3-pll.c | 895 ++++++ .../clock/amlogic,c3-peripherals-clkc.h | 237 ++ .../dt-bindings/clock/amlogic,c3-pll-clkc.h | 44 + 8 files changed, 4112 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/amlogic,c3-peripherals-clkc.yaml create mode 100644 Documentation/devicetree/bindings/clock/amlogic,c3-pll-clkc.yaml create mode 100644 drivers/clk/meson/c3-peripherals.c create mode 100644 drivers/clk/meson/c3-pll.c create mode 100644 include/dt-bindings/clock/amlogic,c3-peripherals-clkc.h create mode 100644 include/dt-bindings/clock/amlogic,c3-pll-clkc.h base-commit: 57b55c76aaf1ba50ecc6dcee5cd6843dc4d85239