From patchwork Wed Oct 23 07:41:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 177245 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp356832ill; Wed, 23 Oct 2019 00:41:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiPeje8001HE4GKoC7y+3lsOiNsuUeE/rDKNCvVx5W7VEicx8vVXIanZVV4wamhltlIGl0 X-Received: by 2002:a17:906:615:: with SMTP id s21mr31856931ejb.276.1571816504293; Wed, 23 Oct 2019 00:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571816504; cv=none; d=google.com; s=arc-20160816; b=KRH7hCAMq1ZwQMsj4KKcFrlWTkqU+MCvVNL4RKwzq2O59VPpA7bJhcuvagrg+8dw0i de63JMFyNEe/ZpmKkSIo/Z7vAImRx9FbB1C1LOVApnFH6p80Ju2u260ghRVTpwnAsfbi dGupWxVTj0cN7M8JBTq4Cf0eY8CGWu1brtray6bGUJgdidWlY0CoaTwf9uTREaZ8iHYS ZOBByE/SMbCRDefCVVLo0zZecWGpdiMqZBY9Da3HXKH7A4SEUX3Hh/VydVmdx5hXkO/g VKb2w4bCFRW9SL1d0G4Rs6miRRVVFFOPbL/Xrhr6x/sXT18bd1ExmMLHTV6fDBioyl3v EEdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=iE5kVB5Of0jxC8Vo7qHZ39FklcEMsMNsY+5+nrQZITE=; b=CruiilDy6okIclsGm0KkXCvfN7ZMNPYLhtluhRuMpdVw5d7qHSjjyrx1xFGAq2AjE8 tpkHSdOeVjFzsX42APrIp506msy6NtDlwmJ8J1fxiIqHzDve4JAH/1J2vQ9+yAkMm8dq WIeNW5ykDG9F5YGAyY4QN0f9E1dtwuc5CVih4B3Qjw1pJnYIG/mwC1UM8jKk59mh8m1D PbblT2HDsmiA0kkhUtCqliNmoX13z0cObRkPy5SwXH53MdyqrI0wis/c5R1zi4+LzHmA 41OahwJcwd/I3dia2JiD6TgVykhEmB4SDgEugpbjcJk3ccDt95ZWIt6qh8fzot0MPQU7 eFxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=lQoysMkv; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si13122177ejr.383.2019.10.23.00.41.44; Wed, 23 Oct 2019 00:41:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=lQoysMkv; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389889AbfJWHln (ORCPT + 3 others); Wed, 23 Oct 2019 03:41:43 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:58563 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389484AbfJWHln (ORCPT ); Wed, 23 Oct 2019 03:41:43 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20191023074141euoutp01ad9c39769c7c154d8d0a4ad14977ae88~QNsfKl9Zw1834918349euoutp01C for ; Wed, 23 Oct 2019 07:41:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20191023074141euoutp01ad9c39769c7c154d8d0a4ad14977ae88~QNsfKl9Zw1834918349euoutp01C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1571816501; bh=iE5kVB5Of0jxC8Vo7qHZ39FklcEMsMNsY+5+nrQZITE=; h=From:To:Cc:Subject:Date:References:From; b=lQoysMkvVwyrQZlkRMQ3+kGvLg7IQlG9/WNAK5djTtbdcXTx+lMFMWuv3cCVHAs4b vt10d7Kl6i6upYPwvtXufh2imcNNXlbYn2GwfvL9GM4Xa49AQ4V0J8aoDtnsuqYY5q gudMOBm9b5t1z2QUG7AhMFnGJS/qvh6Isqjznvh0= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20191023074141eucas1p2c736db6af2458a57fd2c444f0e3e16de~QNse8EtYv1509315093eucas1p24; Wed, 23 Oct 2019 07:41:41 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 3D.FB.04309.53400BD5; Wed, 23 Oct 2019 08:41:41 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20191023074140eucas1p2c236bde672f33d4fe32ed61545515cc3~QNsefTxNT2439624396eucas1p2b; Wed, 23 Oct 2019 07:41:40 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20191023074140eusmtrp220543a2fc1b70a37b0fe6e36a6e291bd~QNseejUW01871118711eusmtrp2f; Wed, 23 Oct 2019 07:41:40 +0000 (GMT) X-AuditID: cbfec7f4-ae1ff700000010d5-f5-5db004355bb1 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 97.09.04166.43400BD5; Wed, 23 Oct 2019 08:41:40 +0100 (BST) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20191023074140eusmtip208d505d4659fd85f38dc408fb7d5efef~QNseBZUHx0550505505eusmtip2L; Wed, 23 Oct 2019 07:41:40 +0000 (GMT) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Marian Mihailescu Subject: [PATCH] clk: samsung: exynos542x: Move G3D subsystem clocks to its sub-CMU Date: Wed, 23 Oct 2019 09:41:18 +0200 Message-Id: <20191023074118.3012-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPIsWRmVeSWpSXmKPExsWy7djPc7qmLBtiDeYfFbPYOGM9q8X1L89Z Lc6f38Bu8bHnHqvFjPP7mCzWHrnLbrF+2k9Wi/anL5kdODx2zrrL7rFpVSebR9+WVYwenzfJ BbBEcdmkpOZklqUW6dslcGUsPXyMteCIVMWlq7PYGhjPiHUxcnJICJhI/O+Yx9jFyMUhJLCC UeLk3HNMEM4XRonNx3eyQTifGSUa7j9mh2lp29LCDGILCSxnlLg1RwKu48qjmSwgCTYBQ4mu t11sILaIgIPE50+vwXYwC/QzSfT1XQXrFhYIlVhwdB9YEYuAqsSbrXeBijg4eAVsJGatYoJY Ji+xesMBZpBeCYHbbBJnp35ihUi4SHw58JENwhaWeHV8C9R1MhL/d85ngmhoZpR4eG4tO4TT wyhxuWkGI0SVtcTh4xdZQbYxC2hKrN+lDxF2lDh75D0LSFhCgE/ixltBkDAzkDlp23RmiDCv REebEES1msSs4+vg1h68cIkZwvaQeH7jJiskgGIlPs9fxzKBUW4Wwq4FjIyrGMVTS4tz01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K5OXHv7Q6jinYSy I1q26btXS32RSTxhOuPNo6igw9Gn7/4vfH4q+ddHsZAWhlan3wx6BeJPlFiKMxINtZiLihMB Adc7AlgCAAA= X-CMS-MailID: 20191023074140eucas1p2c236bde672f33d4fe32ed61545515cc3 X-Msg-Generator: CA X-RootMTR: 20191023074140eucas1p2c236bde672f33d4fe32ed61545515cc3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20191023074140eucas1p2c236bde672f33d4fe32ed61545515cc3 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org G3D clocks require special handling of their parent bus clock during power domain on/off sequences. Those clocks were not initially added to the sub-CMU handler, because that time there was no open-source driver for the G3D (MALI Panfrost) hardware module and it was not possible to test it. This patch fixes this issue. Parent clock for G3D hardware block is now properly preserved during G3D power domain on/off sequence. This restores proper MALI Panfrost performance broken by commit 8686764fc071 ("ARM: dts: exynos: Add G3D power domain to Exynos542x"). Reported-by: Marian Mihailescu Fixes: b06a532bf1fa ("clk: samsung: Add Exynos5 sub-CMU clock driver") Signed-off-by: Marek Szyprowski Tested-by: Marian Mihailescu --- drivers/clk/samsung/clk-exynos5420.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) -- 2.17.1 Acked-by: Krzysztof Kozlowski diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c index 7670cc596c74..dfa862d55246 100644 --- a/drivers/clk/samsung/clk-exynos5420.c +++ b/drivers/clk/samsung/clk-exynos5420.c @@ -1172,8 +1172,6 @@ static const struct samsung_gate_clock exynos5x_gate_clks[] __initconst = { GATE(CLK_SCLK_ISP_SENSOR2, "sclk_isp_sensor2", "dout_isp_sensor2", GATE_TOP_SCLK_ISP, 12, CLK_SET_RATE_PARENT, 0), - GATE(CLK_G3D, "g3d", "mout_user_aclk_g3d", GATE_IP_G3D, 9, 0, 0), - /* CDREX */ GATE(CLK_CLKM_PHY0, "clkm_phy0", "dout_sclk_cdrex", GATE_BUS_CDREX0, 0, 0, 0), @@ -1248,6 +1246,15 @@ static struct exynos5_subcmu_reg_dump exynos5x_gsc_suspend_regs[] = { { DIV2_RATIO0, 0, 0x30 }, /* DIV dout_gscl_blk_300 */ }; +static const struct samsung_gate_clock exynos5x_g3d_gate_clks[] __initconst = { + GATE(CLK_G3D, "g3d", "mout_user_aclk_g3d", GATE_IP_G3D, 9, 0, 0), +}; + +static struct exynos5_subcmu_reg_dump exynos5x_g3d_suspend_regs[] = { + { GATE_IP_G3D, 0x3ff, 0x3ff }, /* G3D gates */ + { SRC_TOP5, 0, BIT(16) }, /* MUX mout_user_aclk_g3d */ +}; + static const struct samsung_div_clock exynos5x_mfc_div_clks[] __initconst = { DIV(0, "dout_mfc_blk", "mout_user_aclk333", DIV4_RATIO, 0, 2), }; @@ -1320,6 +1327,14 @@ static const struct exynos5_subcmu_info exynos5x_gsc_subcmu = { .pd_name = "GSC", }; +static const struct exynos5_subcmu_info exynos5x_g3d_subcmu = { + .gate_clks = exynos5x_g3d_gate_clks, + .nr_gate_clks = ARRAY_SIZE(exynos5x_g3d_gate_clks), + .suspend_regs = exynos5x_g3d_suspend_regs, + .nr_suspend_regs = ARRAY_SIZE(exynos5x_g3d_suspend_regs), + .pd_name = "G3D", +}; + static const struct exynos5_subcmu_info exynos5x_mfc_subcmu = { .div_clks = exynos5x_mfc_div_clks, .nr_div_clks = ARRAY_SIZE(exynos5x_mfc_div_clks), @@ -1351,6 +1366,7 @@ static const struct exynos5_subcmu_info exynos5800_mau_subcmu = { static const struct exynos5_subcmu_info *exynos5x_subcmus[] = { &exynos5x_disp_subcmu, &exynos5x_gsc_subcmu, + &exynos5x_g3d_subcmu, &exynos5x_mfc_subcmu, &exynos5x_mscl_subcmu, }; @@ -1358,6 +1374,7 @@ static const struct exynos5_subcmu_info *exynos5x_subcmus[] = { static const struct exynos5_subcmu_info *exynos5800_subcmus[] = { &exynos5x_disp_subcmu, &exynos5x_gsc_subcmu, + &exynos5x_g3d_subcmu, &exynos5x_mfc_subcmu, &exynos5x_mscl_subcmu, &exynos5800_mau_subcmu,