From patchwork Fri Oct 28 05:32:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 12083 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp641923wru; Thu, 27 Oct 2022 22:59:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6dFRygo8FgdjsSei8HcBPGMyxXBF+j+LojNnkofouAJAiSD6jlXw9zeZ2yYUu5FI2WGq02 X-Received: by 2002:a63:5a50:0:b0:429:8580:fc61 with SMTP id k16-20020a635a50000000b004298580fc61mr46690776pgm.215.1666936775513; Thu, 27 Oct 2022 22:59:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666936775; cv=none; d=google.com; s=arc-20160816; b=HMg2ijR22/94tVUOCXUhOL9Z9uVcWUXJ9MAsEQ0k2zjCeFZbmF1xXnCwLmyLZKqeOg fNrjL4cIqeBWdkIl8WC1f1kl7jOqZd1WfpcmkJaK7CbnB7cmc0QrmHmtl4+h0MFpMShe UNldqp/15Z9yBISNJuQARY2J7Cnelans4HnhNT60q5yHmbGGCUGV/57wW6zQKto8s2Qa wmwnLhw2f50kLId2+G8ZjdUZXFdMUUnhLvXo8A7VEaRJeom+SqW3Ky1A+wq7UkuzddSP sDmmdwUC/sfQLuABoJqEFcomLvhdxyjp8TxTP1QiFiaTbxg1RR7Qo5U2cSz0E79ts2Y3 KNCA== 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=wt8wahn6P7ldxe9PxueuLtknGvrn/bmNumLZFOOBfOo=; b=cWMgY2fPdwu5PbRBbdsYC5XNFM+wq1XkFvq75Bq+YGxvmsgao0sFirJVYrYQ+folMk 76P3q7kKn6AwFrO8OL858dxOReuTgkMvd4PqvRt78rMBDTD65CpWTGZYS4FkIDfrO05y ySdN26PHkJAA88CTkw78ahg0OOjLLduFPW0g/zPt7DeOAokZkVudtGXLgIk95Y0wS++6 pY7F9cbB691j12HXUtvD/1Y80WcA3T4Ix2d+mYx9sxb/uptLB5URcNnFlfsHGZcVWmx1 9bp+SAJJFouMSEvwra3TpV8TmLJ8/iXavdsWdEZk6NnN7sloQZSGwSTFqPceTN73qwWR +y/g== 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 c7-20020aa78c07000000b0053ef8a89c71si4004788pfd.194.2022.10.27.22.59.22; Thu, 27 Oct 2022 22:59:35 -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 S229828AbiJ1FxE (ORCPT + 99 others); Fri, 28 Oct 2022 01:53:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbiJ1FxD (ORCPT ); Fri, 28 Oct 2022 01:53:03 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5AA81B6C89; Thu, 27 Oct 2022 22:53:02 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 886481A0BED; Fri, 28 Oct 2022 07:53:01 +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 4CFD21A0C56; Fri, 28 Oct 2022 07:53:01 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id C8702183486B; Fri, 28 Oct 2022 13:52:58 +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 v4 1/2] dt-bindings: clock: imx8mp: Add ids for the audio shared gate Date: Fri, 28 Oct 2022 13:32:23 +0800 Message-Id: <1666935144-7364-2-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1666935144-7364-1-git-send-email-shengjiu.wang@nxp.com> References: <1666935144-7364-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?1747909896120303966?= X-GMAIL-MSGID: =?utf-8?q?1747909896120303966?= 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 Reviewed-by: Abel Vesa --- 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 Fri Oct 28 05:32:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 12084 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp642489wru; Thu, 27 Oct 2022 23:00:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6AXsDkgCv4Z4lcd63fltba7diDPJ9v74X2vOCOG9l0pqX+zgrqEETAUsvts6JCdrC5D7A6 X-Received: by 2002:a17:907:c15:b0:78d:af58:4274 with SMTP id ga21-20020a1709070c1500b0078daf584274mr45965720ejc.150.1666936853863; Thu, 27 Oct 2022 23:00:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666936853; cv=none; d=google.com; s=arc-20160816; b=ZwzhPuqz+ig+sLB8Ni95XwXrOaoJKBjYY9a8/FfwkpNY0bOHEvFBO0MOtN+IN97Pyx cgHPY4mE+CcLzcrx3a58XcaQEz1HmeBxPtXD8Q/Kc8etNv3M/f28ib0LXmG/vETflK+a SksO47+LNcC/ZxajRH2Rl86ZfgUU8jaUrQH9eetYFjHAJ1ujGwRbKTe+0/DYS3piFh3j HclAesDhj2p8cjg22Ph1O9738NOhhYxFW84ngOQRcnfdCHfpij1j0yOLUp6UWhNDhYak uQQORFPE46ZL+dGSW9VulK0UWqKh7sgDJfOq1O/8OrXVUIAA4CRxI5UpEfM9R7LQ/rTc nvPQ== 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=3JBttE+nJ0URUMhwON1Bbj+/mxXl5xH21D5+8qcnIOk=; b=Oy7hEejzxKej+4m7PGuVZTIXeRpo3rf5FGRmFGNR9TEHWMUpSLEuR7qDjA57uQ44F1 OCTgIUiot30GTHHA4Wb7FyJKRz3n2OQVCZPklDQtq9FkS6ep1+/WXEwyRfoGtlWAnk2G D3hbthHlpy73c4otzUZlELKGSucVGtaEJWkziQ0fVmmIsOQSrWGHrL6NAe6nwYxYmdHc oI+EWE9rAD7P1Qrvop+L8I/3uear2EH9L/OBtJV/fmcx5nShJj1ieA0nMxhzETVdNAfP uBrAZERjnKyKXujEmoMdSNL/v1hdyoTzKTxU530bGpYh9n60ThmlJ2okwwWGXH0b7EsW lVEg== 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 mc3-20020a170906eb4300b007ad8140c60asi3186254ejb.492.2022.10.27.23.00.30; Thu, 27 Oct 2022 23:00:53 -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 S229838AbiJ1FxJ (ORCPT + 99 others); Fri, 28 Oct 2022 01:53:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbiJ1FxG (ORCPT ); Fri, 28 Oct 2022 01:53:06 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D21501B6C8A; Thu, 27 Oct 2022 22:53:05 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 7AD391A0C56; Fri, 28 Oct 2022 07:53:04 +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 11DD61A0C19; Fri, 28 Oct 2022 07:53:04 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id DD3CB180327D; Fri, 28 Oct 2022 13:53:00 +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 v4 2/2] clk: imx8mp: Add audio shared gate Date: Fri, 28 Oct 2022 13:32:24 +0800 Message-Id: <1666935144-7364-3-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1666935144-7364-1-git-send-email-shengjiu.wang@nxp.com> References: <1666935144-7364-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?1747895799753178756?= X-GMAIL-MSGID: =?utf-8?q?1747909978251651946?= 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 still keep MX8MP_CLK_AUDIO_ROOT clock, even it is duplicate with AUDIO_AHB_CLK_ROOT, that is to avoid break any users. Signed-off-by: Abel Vesa Signed-off-by: Shengjiu Wang Reviewed-by: Peng Fan --- drivers/clk/imx/clk-imx8mp.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c index 652ae58c2735..d9ad09877990 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,21 @@ 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); + + /* + * IMX8MP_CLK_AUDIO_ROOT is same as IMX8MP_CLK_AUDIO_AHB_ROOT. + * In order to avoid break any users, still keep it. + */ + hws[IMX8MP_CLK_AUDIO_ROOT] = imx_clk_hw_gate2_shared2("audio_root_clk", "audio_ahb", ccm_base + 0x4650, 0, &share_count_audio); + 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,