From patchwork Thu Oct 27 01:34:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 11519 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp587127wru; Wed, 26 Oct 2022 18:56:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4jzcNSFNwqEb3/NM9os6NP32JF09gQXfoOaYeu1whlDOrAY1+xtSb9J/89Uqbp89Q3U/jb X-Received: by 2002:a05:6a00:a21:b0:562:99d6:c30a with SMTP id p33-20020a056a000a2100b0056299d6c30amr45185201pfh.35.1666835726784; Wed, 26 Oct 2022 18:55:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666835726; cv=none; d=google.com; s=arc-20160816; b=pi8yGkgr4cRq75WpNVS+SlAE1PliqnccH5XCQwph1fRfh5J9Wy4M7GM0oGsLfKCMaL uxjK4ZCuS8TqVkTUZ2KbtVEhVwtVZhZfpobJfvvw6hz7XpgRnNJfqmGuVn9RCHUnI5Nm JEjh8Yfjo7RulKjq2FL1lUcYD3P9GHCiiB2IU1UInCTHM/mN7wyuc+EpvdAWncY/j1mJ esUt8nbSthW6imVJEnDMgtkLLWatg+1Xbg98PLpj5HQbC6xT3y2bygg+uNNgZlX6LB0o ++Me4e9o7OefiXOba/olTAS1OBlh2Uoaeo2pqyPS+VTTkARAGwG1spuyQiPQY2gJ1rJd ia9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from; bh=KpBmw1OgFiuNs7s3Dj9hQYgNhGlvcWw3et4620YCNz0=; b=WJ9sismdjmoA6F7eoR7blEHcmzMxcL0V36C1wZaobmbII0ykoYiFtOVmFTqBFDF6vG rFYsD5WPc+zAgqW3j6mKZeEQyOdQ4eN60b5SG9CWNxpWdcDxOwxrHM0yEjxLZdWNd6j5 U/Ag3sHDa5kpSvRJamSuMJsHHbSqSKkXU/5kG3TVaNiTCWw6ArAh9j4cc9Ce8zQbVlWA ocGqkOfelV/kZ3b+cw0U6b6bDA9qUSE9GOf/MDKNg+c2bOsiVxa5tYyDQmBKx1CR1ItL NTHV+BEqO4yZ5BLIHzvq9RP4wQQY0Yvx8MrVxiIbwB9qx8tlMI2lZ1742JEUlrWdHatd cCFw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jc22-20020a17090325d600b0017d2bb81273si7640927plb.600.2022.10.26.18.55.10; Wed, 26 Oct 2022 18:55:26 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233452AbiJ0Byq (ORCPT + 99 others); Wed, 26 Oct 2022 21:54:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbiJ0Byk (ORCPT ); Wed, 26 Oct 2022 21:54:40 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDBFC402D3; Wed, 26 Oct 2022 18:54:38 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B28751AB23A; Thu, 27 Oct 2022 03:54:36 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 7CE4F1AB237; Thu, 27 Oct 2022 03:54:36 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 08353183486C; Thu, 27 Oct 2022 09:54:34 +0800 (+08) From: Shengjiu Wang To: shengjiu.wang@gmail.com, abelvesa@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, marex@denx.de Subject: [PATCH v2 1/2] dt-bindings: clock: imx8mp: Add ids for the audio shared gate Date: Thu, 27 Oct 2022 09:34:01 +0800 Message-Id: <1666834442-5609-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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?1747803939085933551?= X-GMAIL-MSGID: =?utf-8?q?1747803939085933551?= From: Abel Vesa All these IDs are for one single HW gate (CCGR101) that is shared between these root clocks. Signed-off-by: Abel Vesa Signed-off-by: Shengjiu Wang Reviewed-by: Peng Fan Acked-by: Krzysztof Kozlowski --- changes in v2: - split dt-binding to separate patch include/dt-bindings/clock/imx8mp-clock.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/dt-bindings/clock/imx8mp-clock.h b/include/dt-bindings/clock/imx8mp-clock.h index 9d5cc2ddde89..2f6fec299662 100644 --- a/include/dt-bindings/clock/imx8mp-clock.h +++ b/include/dt-bindings/clock/imx8mp-clock.h @@ -324,8 +324,17 @@ #define IMX8MP_CLK_CLKOUT2_SEL 317 #define IMX8MP_CLK_CLKOUT2_DIV 318 #define IMX8MP_CLK_CLKOUT2 319 +#define IMX8MP_CLK_AUDIO_AHB_ROOT 320 +#define IMX8MP_CLK_AUDIO_AXI_ROOT 321 +#define IMX8MP_CLK_SAI1_ROOT 322 +#define IMX8MP_CLK_SAI2_ROOT 323 +#define IMX8MP_CLK_SAI3_ROOT 324 +#define IMX8MP_CLK_SAI5_ROOT 325 +#define IMX8MP_CLK_SAI6_ROOT 326 +#define IMX8MP_CLK_SAI7_ROOT 327 +#define IMX8MP_CLK_PDM_ROOT 328 -#define IMX8MP_CLK_END 320 +#define IMX8MP_CLK_END 329 #define IMX8MP_CLK_AUDIOMIX_SAI1_IPG 0 #define IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1 1 From patchwork Thu Oct 27 01:34:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 11517 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp586755wru; Wed, 26 Oct 2022 18:55:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ID7VUOJYU7QMyyc1QgjspwBHEcHvwcaUX/6KYdbsolDfpLJQd2fEE1YO7LltplakeYHVi X-Received: by 2002:a17:90b:4c02:b0:20a:7d26:149 with SMTP id na2-20020a17090b4c0200b0020a7d260149mr7661432pjb.134.1666835736355; Wed, 26 Oct 2022 18:55:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666835736; cv=none; d=google.com; s=arc-20160816; b=0gxvKeUaBjMnf+DHbPn9I/Rtrp7vc8r6jD+qcW0ilQZvMbPvHAcBcKlvy/KPdjgtB9 mVLtcJLGr7kIvNBjryaE0Wd56sDSu2XEoUPFTwOkXl307MDWlWDva8e8SsRYlQy7FrnY eA01GD5EjhBa7/idhNP8KFcq9h9X7QdbC1C6QhDFBJ/yFLT40K3z+G8JbZe9QvJObGbH eAlGSZjuqdyJW79HxFG+s8etUzuPcuUpRHOHMkVdOmVEaenTS8ooMzphaiOCp8p+ckd8 LDcsBP8TStOcZuaCyhKrejRF5Q8dyMEYxGBw+P2rotyRmkppmemisOrDueNyYHs3Vde/ sj0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from; bh=24BjhL2ro8IAR68llkcQxqdAR/TQkZIMVW9dtVFBL8E=; b=teaG7kyFZiYHKyM3Mn1m6Lzu+wyBfy8mmVMMk7w5HowmjBspXSc+SyxrTXPuFbArbG mqimXUtP+iVYCnRMYmAbTFUasZVBYKtOkjGAMpWgWbasQijmCas35t8+fssh7QMalM5J 9bPYLRI9lL0FSFQzmgoDp3BF1FQgWR95Z7t4nFOzuze9/zzj+ZEepKYDqr23glf3lrBh wQS3tMvfHrCaERuDDl27dCLEtVY0zH0k+inBM2A9zPfl/Q0jZSkrqai5rUovatDkIzUQ NOlMUeIDP6IsV38SqC0IbQFfxXzguG0TFrxJr7O5kozezLtVzdwbuLdkE3D8o4EX05/f jqwQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f17-20020a637551000000b0041b67131e27si9296935pgn.309.2022.10.26.18.55.22; Wed, 26 Oct 2022 18:55:36 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233473AbiJ0Byw (ORCPT + 99 others); Wed, 26 Oct 2022 21:54:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233166AbiJ0Bym (ORCPT ); Wed, 26 Oct 2022 21:54:42 -0400 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B09B24AD71; Wed, 26 Oct 2022 18:54:40 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 5DBFF20AB98; Thu, 27 Oct 2022 03:54:38 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 268A620ABB2; Thu, 27 Oct 2022 03:54:38 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 5F2FF1820F76; Thu, 27 Oct 2022 09:54:36 +0800 (+08) From: Shengjiu Wang To: shengjiu.wang@gmail.com, abelvesa@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, marex@denx.de Subject: [PATCH v2 2/2] clk: imx8mp: Add audio shared gate Date: Thu, 27 Oct 2022 09:34:02 +0800 Message-Id: <1666834442-5609-2-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1666834442-5609-1-git-send-email-shengjiu.wang@nxp.com> References: <1666834442-5609-1-git-send-email-shengjiu.wang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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?1747803949269640999?= X-GMAIL-MSGID: =?utf-8?q?1747803949269640999?= From: Abel Vesa According to the RM, the CCGR101 is shared for the following root clocks: - AUDIO_AHB_CLK_ROOT - AUDIO_AXI_CLK_ROOT - SAI1_CLK_ROOT - SAI2_CLK_ROOT - SAI3_CLK_ROOT - SAI5_CLK_ROOT - SAI6_CLK_ROOT - SAI7_CLK_ROOT - PDM_CLK_ROOT And correct clock MX8MP_CLK_AUDIO_ROOT to be IMX8MP_CLK_AUDIO_AHB_ROOT. Signed-off-by: Abel Vesa Signed-off-by: Shengjiu Wang Reviewed-by: Peng Fan --- changes in v2: - split dt-binding to separate patch drivers/clk/imx/clk-imx8mp.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c index 652ae58c2735..0ae3bc7bf8a1 100644 --- a/drivers/clk/imx/clk-imx8mp.c +++ b/drivers/clk/imx/clk-imx8mp.c @@ -17,6 +17,7 @@ static u32 share_count_nand; static u32 share_count_media; +static u32 share_count_audio; static const char * const pll_ref_sels[] = { "osc_24m", "dummy", "dummy", "dummy", }; static const char * const audio_pll1_bypass_sels[] = {"audio_pll1", "audio_pll1_ref_sel", }; @@ -699,7 +700,15 @@ static int imx8mp_clocks_probe(struct platform_device *pdev) hws[IMX8MP_CLK_HDMI_ROOT] = imx_clk_hw_gate4("hdmi_root_clk", "hdmi_axi", ccm_base + 0x45f0, 0); hws[IMX8MP_CLK_TSENSOR_ROOT] = imx_clk_hw_gate4("tsensor_root_clk", "ipg_root", ccm_base + 0x4620, 0); hws[IMX8MP_CLK_VPU_ROOT] = imx_clk_hw_gate4("vpu_root_clk", "vpu_bus", ccm_base + 0x4630, 0); - hws[IMX8MP_CLK_AUDIO_ROOT] = imx_clk_hw_gate4("audio_root_clk", "audio_ahb", ccm_base + 0x4650, 0); + hws[IMX8MP_CLK_AUDIO_AHB_ROOT] = imx_clk_hw_gate2_shared2("audio_ahb_root", "audio_ahb", ccm_base + 0x4650, 0, &share_count_audio); + hws[IMX8MP_CLK_AUDIO_AXI_ROOT] = imx_clk_hw_gate2_shared2("audio_axi_root", "audio_axi", ccm_base + 0x4650, 0, &share_count_audio); + hws[IMX8MP_CLK_SAI1_ROOT] = imx_clk_hw_gate2_shared2("sai1_root", "sai1", ccm_base + 0x4650, 0, &share_count_audio); + hws[IMX8MP_CLK_SAI2_ROOT] = imx_clk_hw_gate2_shared2("sai2_root", "sai2", ccm_base + 0x4650, 0, &share_count_audio); + hws[IMX8MP_CLK_SAI3_ROOT] = imx_clk_hw_gate2_shared2("sai3_root", "sai3", ccm_base + 0x4650, 0, &share_count_audio); + hws[IMX8MP_CLK_SAI5_ROOT] = imx_clk_hw_gate2_shared2("sai5_root", "sai5", ccm_base + 0x4650, 0, &share_count_audio); + hws[IMX8MP_CLK_SAI6_ROOT] = imx_clk_hw_gate2_shared2("sai6_root", "sai6", ccm_base + 0x4650, 0, &share_count_audio); + hws[IMX8MP_CLK_SAI7_ROOT] = imx_clk_hw_gate2_shared2("sai7_root", "sai7", ccm_base + 0x4650, 0, &share_count_audio); + hws[IMX8MP_CLK_PDM_ROOT] = imx_clk_hw_gate2_shared2("pdm_root", "pdm", ccm_base + 0x4650, 0, &share_count_audio); hws[IMX8MP_CLK_ARM] = imx_clk_hw_cpu("arm", "arm_a53_core", hws[IMX8MP_CLK_A53_CORE]->clk,