From patchwork Mon Feb 26 12:53:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 129648 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp167238lja; Mon, 26 Feb 2018 04:54:17 -0800 (PST) X-Google-Smtp-Source: AH8x224fSo0XdXi7XnJFYfvebGotU1CydcCap1qyFQyZvisdf6llXhfK7yLq7LtmnsJh/aRCGcL7 X-Received: by 10.101.76.71 with SMTP id l7mr8453024pgr.192.1519649657317; Mon, 26 Feb 2018 04:54:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519649657; cv=none; d=google.com; s=arc-20160816; b=GA3Iy0pVcda2YjuJpIB3ZFewY+wESnrMoblfhaE3CTZCBZ0bHKijCFIk4aoYmRAfK3 kFrgUwP4CH6hSpo8Rzmp28ElY1QKzBK/fRzwbRNdlVu0eiYUDdanLS4/WfttvJxOJaUK 0jeFudy7WonsM5V4cR4hkGkdEhpYGE7E9kLuqjNuoQgWCcTUmuOF1OUNx/nuZRhu3Dpx B0++ETkJkq6gtNPw2XfiH9OQHOPfihAcoM5BPZDcNC53GgOKrb2V72xgvZuIvktmRWgW LwAU6FNzjEslj5t/aLeN1fHF/aDBf8G8sUZrAyalqDSwfNQmcR531T3rCPeCJrjkye34 4JGw== 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:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=uBboUkcY75ucIjMSdF0DbA8PRWOR0lSUHIhT76pKJtw=; b=O0Q29HIQXZPxrNtYDqaVY+phtjinhdu9EsxsXopIK2AD3iCZ99Gl4DcizgX6eQrbm+ QE8V1UB1fL0YuwqrKE0uw+xNZl4nq+4HABkf4m25qOtAhdZ+KH0nkc2XxKcio2xrxyBJ 6rgy8kwCVDM+frLZ9E96FCE+dBpzfTuPTD1syqnL3rhMmZhqc+UhbRniUDgxLAW0MNmj vaoGdaVo7LTuJ3J2+7by1HiILUcSe2WGbaz+4gWo6FrP0YdobELTIN7N9s+ec1NvJlky TwJQ4aitJhgTLZA/frj3OEOj3bpIJCgUJBKG47MGfR6p8EBXmWeoS7yK6EpukO1m73U4 WYYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=IjNmjn1Q; 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=fail (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 b2si5504382pgt.458.2018.02.26.04.54.17; Mon, 26 Feb 2018 04:54:17 -0800 (PST) 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=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=IjNmjn1Q; 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=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752722AbeBZMyQ (ORCPT + 3 others); Mon, 26 Feb 2018 07:54:16 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:39392 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752547AbeBZMyI (ORCPT ); Mon, 26 Feb 2018 07:54:08 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180226125406euoutp01948033b7f86830019148b1d3b9bb54d4~W4U1ftR9V1566615666euoutp01N; Mon, 26 Feb 2018 12:54:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180226125406euoutp01948033b7f86830019148b1d3b9bb54d4~W4U1ftR9V1566615666euoutp01N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1519649646; bh=n72UHlYFpa81VNoA62ABwBs1deQWsW1lbdJcPFxjXVQ=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=IjNmjn1Q7X74YF+5QPceXzIZv+yaNI/SqvIme7XKvAfZR5k7JSFNevKW1+Lh8cUep VENnFnQfBvG0ndmkerTzj5dRW+K6sYiVGp+dsth0qCLCBwjw7oOTtEUiaJBbQGFtGh SHoz/tYmh4uQw/sVstErcThrGcPq8FpLXDzQ36i0= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180226125404eucas1p1e232c281fa1d79e4fed8bf82dafa3608~W4UzummdZ0048100481eucas1p1e; Mon, 26 Feb 2018 12:54:04 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 2D.12.17380.C63049A5; Mon, 26 Feb 2018 12:54:04 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180226125403eucas1p29b1850f658e17912be0b1fa6ed3a8a83~W4UyXBNko1716717167eucas1p2U; Mon, 26 Feb 2018 12:54:03 +0000 (GMT) X-AuditID: cbfec7f4-6f9ff700000043e4-b3-5a94036c61ca Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 71.0D.04183.B63049A5; Mon, 26 Feb 2018 12:54:03 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P4R0055KD5X67D0@eusync3.samsung.com>; Mon, 26 Feb 2018 12:54:03 +0000 (GMT) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Chanwoo Choi , Inki Dae , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 4/6] clk: samsung: exynos5250: Move PD-dependent clocks to Exynos5 sub-CMU driver Date: Mon, 26 Feb 2018 13:53:53 +0100 Message-id: <20180226125355.9052-5-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.15.0 In-reply-to: <20180226125355.9052-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsWy7djP87o5zFOiDObP57HYOGM9q8X1L89Z LSbdn8Bicf78BnaLjz33WC1mnN/HZLH2yF12i8Nv2lkdODw2repk8+jbsorR4/MmuQDmKC6b lNSczLLUIn27BK6MZW1n2AtajSs2fbvL2MD4WruLkZNDQsBE4l//RdYuRi4OIYEVjBLrfx1n g3A+M0o8WTeZEaaq4/gTRojEMkaJYycuM0M4DUwS+xdMYwOpYhMwlOh62wVmiwg4SHz+9Bqs g1mgjUni7IH9TCAJYYE0ifUN78CKWARUJWZdfgUW5xWwkZi6cD4rxDp5icXfd4LVcArYSnTe mgZ2k4TAX1aJb1OPQd3kInHk6UpmCFtY4tXxLewQtozE5cndLBAN/YwS//6/ZIJwZgC997EV qspa4vDxi2DrmAX4JCZtmw40iQMozivR0SYEUeIhsfLwLKiLHCX2H3oM9fMERok1O+axTmCU WsDIsIpRPLW0ODc9tdgoL7Vcrzgxt7g0L10vOT93EyMwKk//O/5lB+OuP0mHGAU4GJV4eH/c mRwlxJpYVlyZe4hRgoNZSYR35WKgEG9KYmVValF+fFFpTmrxIUZpDhYlcd44jbooIYH0xJLU 7NTUgtQimCwTB6dUA6O3qFfiPzvrk8Ul6fcm5nnWyez/d2JpyAf1BG2bx/8uRPjzeV77uOLS q+o3zyWv/pzOerTZcY5LfMSn9c2F016nnTvaN/9y3e0LS/5ltPvmP+8t+3OVvUx96U2dFd2h MQdmdMpxmk3r3LpYdX/3nO9afYePcPuGJcavzeJf59e9q8TBefFKSV0lluKMREMt5qLiRAC7 IV+DxgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpiluLIzCtJLcpLzFFi42I5/e/4Vd1s5ilRBjPe8llsnLGe1eL6l+es FpPuT2CxOH9+A7vFx557rBYzzu9jslh75C67xeE37awOHB6bVnWyefRtWcXo8XmTXABzFJdN SmpOZllqkb5dAlfGsrYz7AWtxhWbvt1lbGB8rd3FyMkhIWAi0XH8CWMXIxeHkMASRomWrV2s EE4Tk8TurTOZQKrYBAwlut52sYHYIgIOEp8/vQbrYBboYJLYs/chUIKDQ1ggTWJRWzFIDYuA qsSsy6/AenkFbCSmLpzPCrFNXmLx951gczgFbCU6b00Ds4WAarb/28I0gZFnASPDKkaR1NLi 3PTcYiO94sTc4tK8dL3k/NxNjMCQ2Xbs55YdjF3vgg8xCnAwKvHwLvg5KUqINbGsuDL3EKME B7OSCO/KxZOjhHhTEiurUovy44tKc1KLDzFKc7AoifOeN6iMEhJITyxJzU5NLUgtgskycXBK NTD2Hg+c99Y7i2cXxwL1Q37FWXuPqJy+25Njv+LO2VVRD27nLUj/On1X05HlUtd/KJ88eXDt 7X8bJ2nVxh0x4/i+jvVawMvZ08JXam2Z/rHpY9e1uAeFe7vWPT9XZR0nuDpAWbtVR9X0/rN/ DQyzf0pqxq5auyXeb7IG+3T9JxWbT9r4hfac7fkbqcRSnJFoqMVcVJwIAOI1OokVAgAA X-CMS-MailID: 20180226125403eucas1p29b1850f658e17912be0b1fa6ed3a8a83 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180226125403eucas1p29b1850f658e17912be0b1fa6ed3a8a83 X-RootMTR: 20180226125403eucas1p29b1850f658e17912be0b1fa6ed3a8a83 References: <20180226125355.9052-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Clocks related to DISP1 block require special handling for power domain turn on/off sequences. Till now this was handled by Exynos power domain driver, but that approach was limited only to some special cases. This patch moves handling of those operations to clock controller driver. This gives more flexibility and allows fine tune values of some clock-specific registers. This patch moves handling of those mentioned clocks to Exynos5 sub-CMU driver instantiated from Exynos5250 driver. Signed-off-by: Marek Szyprowski Acked-by: Krzysztof Kozlowski --- drivers/clk/samsung/Makefile | 1 + drivers/clk/samsung/clk-exynos5-subcmu.c | 1 + drivers/clk/samsung/clk-exynos5250.c | 51 ++++++++++++++++++++++---------- drivers/soc/samsung/pm_domains.c | 1 + 4 files changed, 38 insertions(+), 16 deletions(-) -- 2.15.0 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clk/samsung/Makefile b/drivers/clk/samsung/Makefile index b23d6cfac723..513826393158 100644 --- a/drivers/clk/samsung/Makefile +++ b/drivers/clk/samsung/Makefile @@ -8,6 +8,7 @@ obj-$(CONFIG_SOC_EXYNOS3250) += clk-exynos3250.o obj-$(CONFIG_ARCH_EXYNOS4) += clk-exynos4.o obj-$(CONFIG_ARCH_EXYNOS4) += clk-exynos4412-isp.o obj-$(CONFIG_SOC_EXYNOS5250) += clk-exynos5250.o +obj-$(CONFIG_SOC_EXYNOS5250) += clk-exynos5-subcmu.o obj-$(CONFIG_SOC_EXYNOS5260) += clk-exynos5260.o obj-$(CONFIG_SOC_EXYNOS5410) += clk-exynos5410.o obj-$(CONFIG_SOC_EXYNOS5420) += clk-exynos5420.o diff --git a/drivers/clk/samsung/clk-exynos5-subcmu.c b/drivers/clk/samsung/clk-exynos5-subcmu.c index dd278e33688b..b0bd9eb67b83 100644 --- a/drivers/clk/samsung/clk-exynos5-subcmu.c +++ b/drivers/clk/samsung/clk-exynos5-subcmu.c @@ -164,6 +164,7 @@ static int __init exynos5_clk_probe(struct platform_device *pdev) } static const struct of_device_id exynos5_clk_of_match[] = { + { .compatible = "samsung,exynos5250-clock", }, { .compatible = "samsung,exynos5420-clock", }, { .compatible = "samsung,exynos5800-clock", }, { }, diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c index 9b073c98a891..44da35d939be 100644 --- a/drivers/clk/samsung/clk-exynos5250.c +++ b/drivers/clk/samsung/clk-exynos5250.c @@ -18,6 +18,7 @@ #include "clk.h" #include "clk-cpu.h" +#include "clk-exynos5-subcmu.h" #define APLL_LOCK 0x0 #define APLL_CON0 0x100 @@ -571,17 +572,6 @@ static const struct samsung_gate_clock exynos5250_gate_clks[] __initconst = { GATE(CLK_SMMU_GSCL3, "smmu_gscl3", "mout_aclk266_gscl_sub", GATE_IP_GSCL, 10, 0, 0), - GATE(CLK_FIMD1, "fimd1", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 0, 0, - 0), - GATE(CLK_MIE1, "mie1", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 1, 0, - 0), - GATE(CLK_DSIM0, "dsim0", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 3, 0, - 0), - GATE(CLK_DP, "dp", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 4, 0, 0), - GATE(CLK_MIXER, "mixer", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 5, 0, - 0), - GATE(CLK_HDMI, "hdmi", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 6, 0, - 0), GATE(CLK_MFC, "mfc", "mout_aclk333_sub", GATE_IP_MFC, 0, 0, 0), GATE(CLK_SMMU_MFCR, "smmu_mfcr", "mout_aclk333_sub", GATE_IP_MFC, 1, 0, @@ -671,10 +661,6 @@ static const struct samsung_gate_clock exynos5250_gate_clks[] __initconst = { GATE(CLK_WDT, "wdt", "div_aclk66", GATE_IP_PERIS, 19, 0, 0), GATE(CLK_RTC, "rtc", "div_aclk66", GATE_IP_PERIS, 20, 0, 0), GATE(CLK_TMU, "tmu", "div_aclk66", GATE_IP_PERIS, 21, 0, 0), - GATE(CLK_SMMU_TV, "smmu_tv", "mout_aclk200_disp1_sub", - GATE_IP_DISP1, 9, 0, 0), - GATE(CLK_SMMU_FIMD1, "smmu_fimd1", "mout_aclk200_disp1_sub", - GATE_IP_DISP1, 8, 0, 0), GATE(CLK_SMMU_2D, "smmu_2d", "div_aclk200", GATE_IP_ACP, 7, 0, 0), GATE(CLK_SMMU_FIMC_ISP, "smmu_fimc_isp", "mout_aclk_266_isp_sub", GATE_IP_ISP0, 8, 0, 0), @@ -698,6 +684,38 @@ static const struct samsung_gate_clock exynos5250_gate_clks[] __initconst = { GATE_IP_ISP1, 7, 0, 0), }; +static const struct samsung_gate_clock exynos5250_disp_gate_clks[] __initconst = { + GATE(CLK_FIMD1, "fimd1", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 0, 0, + 0), + GATE(CLK_MIE1, "mie1", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 1, 0, + 0), + GATE(CLK_DSIM0, "dsim0", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 3, 0, + 0), + GATE(CLK_DP, "dp", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 4, 0, 0), + GATE(CLK_MIXER, "mixer", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 5, 0, + 0), + GATE(CLK_HDMI, "hdmi", "mout_aclk200_disp1_sub", GATE_IP_DISP1, 6, 0, + 0), + GATE(CLK_SMMU_TV, "smmu_tv", "mout_aclk200_disp1_sub", + GATE_IP_DISP1, 9, 0, 0), + GATE(CLK_SMMU_FIMD1, "smmu_fimd1", "mout_aclk200_disp1_sub", + GATE_IP_DISP1, 8, 0, 0), +}; + +static struct samsung_clk_ext_reg_dump exynos5250_disp_suspend_regs[] = { + { GATE_IP_DISP1, 0xffffffff, 0xffffffff }, /* DISP1 gates */ + { SRC_TOP3, 0, BIT(4) }, /* MUX mout_aclk200_disp1_sub */ + { SRC_TOP3, 0, BIT(6) }, /* MUX mout_aclk300_disp1_sub */ +}; + +static const struct exynos5_subcmu_info exynos5250_disp_subcmu = { + .gate_clks = exynos5250_disp_gate_clks, + .nr_gate_clks = ARRAY_SIZE(exynos5250_disp_gate_clks), + .suspend_regs = exynos5250_disp_suspend_regs, + .nr_suspend_regs = ARRAY_SIZE(exynos5250_disp_suspend_regs), + .pd_name = "DISP1", +}; + static const struct samsung_pll_rate_table vpll_24mhz_tbl[] __initconst = { /* sorted in descending order */ /* PLL_36XX_RATE(rate, m, p, s, k) */ @@ -859,10 +877,11 @@ static void __init exynos5250_clk_init(struct device_node *np) __raw_writel(tmp, reg_base + PWR_CTRL2); exynos5250_clk_sleep_init(); + exynos5_subcmus_init(ctx, 1, &exynos5250_disp_subcmu); samsung_clk_of_add_provider(np, ctx); pr_info("Exynos5250: clock setup completed, armclk=%ld\n", _get_rate("div_arm2")); } -CLK_OF_DECLARE(exynos5250_clk, "samsung,exynos5250-clock", exynos5250_clk_init); +CLK_OF_DECLARE_DRIVER(exynos5250_clk, "samsung,exynos5250-clock", exynos5250_clk_init); diff --git a/drivers/soc/samsung/pm_domains.c b/drivers/soc/samsung/pm_domains.c index f2d6d7a09c16..caf45cf7aa8e 100644 --- a/drivers/soc/samsung/pm_domains.c +++ b/drivers/soc/samsung/pm_domains.c @@ -148,6 +148,7 @@ static __init const char *exynos_get_domain_name(struct device_node *node) } static const char *soc_force_no_clk[] = { + "samsung,exynos5250-clock", "samsung,exynos5420-clock", "samsung,exynos5800-clock", };