From patchwork Sun Jan 22 15:41:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 4375 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1203079wrn; Sun, 22 Jan 2023 07:48:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXuQdwJoKRwmWs5MhMniUzS8XxBMrHCZAYZuGRA/1Zg2mgRMpMTG0N183Acs48dCs+z9pnAN X-Received: by 2002:a17:906:16c5:b0:7be:e26a:6104 with SMTP id t5-20020a17090616c500b007bee26a6104mr21713301ejd.52.1674402483062; Sun, 22 Jan 2023 07:48:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674402483; cv=none; d=google.com; s=arc-20160816; b=jnQ10dBOZbly3skofq4/RPrp9Ryz3VWhc0s7VEGBscUgO3PNmFbvUdDbHJeXFhexr2 7olOubN5PoW2cJBq9E5c5//0ZvI8mvAVwIh/rjy6zCaXFp8NGupEPvtG5uLfrugrDCUj yqbC4samzR7l4L318HpTLRClFrZtGPyv2xhgRGgPO1BKT1eicizGXkiEjkfBjn2nYDIU vstIDT3H2npBE7yNZrb/0UPaKQ4JTGVwNjR6dE0zX9AEFLGJHUbstbR7ZcFnHOl2bhUv /gQDjnpbbXQZGmyOahn2YG2t48Rqe8kFuWEEuDEePi38ZB53AOJzAqShcplZYblSYoSv m52A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date; bh=4nCvT0Cf5TQKYOzU0jQog1mmWgcIKKQkmUkqQ30EEz8=; b=qGzT6o6C7eL3KT8x6Ikiye4fwwVIAvjnzJg8KvetrqrGTLf0dt0s1/O/RwgWSG9Ie9 OIJe9c31zTR8XPwEZx378rAhRTA+1UbiPAQHqfKqFnGKvCeHk58UAZJ79yeBD7CC/x2U /XwIozxsw/vkJSikYmo+JPgPyvmgV/CdYUyqr6Am3/ZHbyHYVR+1Q/KwHHLfoxf5hjw8 lQlMunLFH06BBeHBfhjIRzc23Qkbe+6SarhGTx7vga3DlAe947CyfP8CqA3viCwfa7j9 LmWw1UZfYeveIShM9sTFEgUirYfpymX0cbYfihPv63ifnPxAszYcX+UJQ0E9YvRUVrx8 tDrw== 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 sd35-20020a1709076e2300b008776a7302e2si14461895ejc.402.2023.01.22.07.47.39; Sun, 22 Jan 2023 07:48:03 -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 S231484AbjAVPlh (ORCPT + 99 others); Sun, 22 Jan 2023 10:41:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbjAVPlg (ORCPT ); Sun, 22 Jan 2023 10:41:36 -0500 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F1A717168; Sun, 22 Jan 2023 07:41:34 -0800 (PST) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1pJcTH-0002fr-0n; Sun, 22 Jan 2023 16:41:27 +0100 Date: Sun, 22 Jan 2023 15:41:16 +0000 From: Daniel Golle To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, AngeloGioacchino Del Regno , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Matthias Brugger Cc: Chen-Yu Tsai , Miles Chen , Edward-JW Yang , Johnson Wang , Fabien Parent , Chun-Jie Chen , Sam Shih , Jianhui Zhao Subject: [PATCH v4 0/3] add support for clocks on MT7981 SoC Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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?1755738258156002443?= X-GMAIL-MSGID: =?utf-8?q?1755738258156002443?= The MediaTek MT7981 SoC is quite similar to its big sibling, the MT7986. Hence most drivers can be reused and not much is missing the get also this SoC working on mainline Linux. Start with a cleaned-up version of the clock drivers, based on what can also be found in MediaTek's SDK[1]. Upon request of AngeloGioacchino Del Regno this series has been rebased and adapted to be applied on top of the pending series "MediaTek clocks cleanups and improvements"[2] The complete tree used for testing (with still some to-be-cleaned-up changes, esp. for the Ethernet driver) can be found on Github[3]. [1]: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/refs/heads/master/target/linux/mediatek/files-5.4/drivers/clk/mediatek/clk-mt7981.c [2]: https://patchwork.kernel.org/project/linux-clk/list/?series=714057 [3]: https://github.com/dangowrt/linux Changes since v3: * fixed typos in commit descriptions Changes since v2: * rebase on top of next-20230120 with v4 of AngeloGioacchino's series[2] * fix titles of dt-bindings commits (this time for real) * convert clk-mt7981-infracfg to use mtk_clk_simple_probe * make use of PLL_AO flag in clk-mt7981-apmixed * convert clk-mt7981-ethsys into platform driver, also using the generic probe function, allow building as module Changes since v1: * rebase and adapt on top of [2] * split-off addition of dt-bindings header, fix filename * changed commit title as requested Daniel Golle (3): dt-bindings: clock: Add apmixedsys/topckgen compatibles for MT7981 dt-bindings: clock: mediatek: add mt7981 clock IDs clk: mediatek: add MT7981 clock support .../bindings/clock/mediatek,apmixedsys.yaml | 1 + .../bindings/clock/mediatek,topckgen.yaml | 1 + drivers/clk/mediatek/Kconfig | 17 + drivers/clk/mediatek/Makefile | 4 + drivers/clk/mediatek/clk-mt7981-apmixed.c | 102 +++++ drivers/clk/mediatek/clk-mt7981-eth.c | 117 +++++ drivers/clk/mediatek/clk-mt7981-infracfg.c | 207 +++++++++ drivers/clk/mediatek/clk-mt7981-topckgen.c | 422 ++++++++++++++++++ .../dt-bindings/clock/mediatek,mt7981-clk.h | 215 +++++++++ 9 files changed, 1086 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt7981-apmixed.c create mode 100644 drivers/clk/mediatek/clk-mt7981-eth.c create mode 100644 drivers/clk/mediatek/clk-mt7981-infracfg.c create mode 100644 drivers/clk/mediatek/clk-mt7981-topckgen.c create mode 100644 include/dt-bindings/clock/mediatek,mt7981-clk.h