From patchwork Mon Feb 26 12:53:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 129643 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp167144lja; Mon, 26 Feb 2018 04:54:10 -0800 (PST) X-Google-Smtp-Source: AH8x224hCjMh1h1kr7JEN1BFXSjb4LI/eMPFqvAnyXoBsW2nnp4zLR+yvuGp5Q2U0XDu4omVZlrY X-Received: by 10.98.10.219 with SMTP id 88mr10536464pfk.202.1519649650647; Mon, 26 Feb 2018 04:54:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519649650; cv=none; d=google.com; s=arc-20160816; b=VTQoipb87VatweAUZNck+uhxRbfJXLBPxBHrzuLNuTU+Mij1REcSny9EPb30qN6JPb Esj94rmhllZhEhyz1i/tYZYrjnQnTiF9SxKC7g6J5g728EnnH8ztN97Bp7xCUMQ5vpEE RhvIRxD9HX1kMLwaN87lEaITuYiYwZnNUU5jhC1+/bmrksfkpk/X+iAfCQE7+bjjxxvf /jw6cb1IS+q7235xBZrhhS2KuFvgJAfAzVJPpkDNdVZmH0ubW3cMJhoFA3JImI8gXe9c 6F8jdeuK1XeVQBcDoZnIX0HNuWcYzXr58NaggBU/lJ0S6R8xEv/tLgrOtrvu0qfIOTqB G9dQ== 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=d1Qu7NWAdN1mnTy5dp0rKIxD2DDY+M97FyjlWTG7S8E=; b=PiE/N0eQA2UVHMAxgk3TWy+wIPeSzWgKU2WYxS0J7zUslb5gtA/aXGVNf6tUGqhlG7 IGoBw00RpItHqbDW3qStITr3wQREBuz2t3WRWb3akoujUyd2oE8yUGBdnQHdvFwsnJ2E AL/gHb6K9U+p/njteRKB/6dp9BOT2AhZnKOZR9Rldgs81OL3WNqoTlb4+ecAkjrIFO7T 57g4a9Q1VNK9VT/Bgiw5O/WHRTsszOo6+RqmLNAbSENc78elK9io5yQXycSe7GWdHDjD ustV8ODWul3o4SewiyUX4i8DnjtjAyyqpWFq+FNRDJdJZRP7L5hrjyT8qSmAGSzX4Tk4 FjdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=SeBOpyTN; 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.10; Mon, 26 Feb 2018 04:54:10 -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=SeBOpyTN; 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 S1752667AbeBZMyJ (ORCPT + 3 others); Mon, 26 Feb 2018 07:54:09 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:39381 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752289AbeBZMyG (ORCPT ); Mon, 26 Feb 2018 07:54:06 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180226125404euoutp01a0403a75d3e9641f41eeb26c9e632bc2~W4Uzo1_E81566615666euoutp01L; Mon, 26 Feb 2018 12:54:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180226125404euoutp01a0403a75d3e9641f41eeb26c9e632bc2~W4Uzo1_E81566615666euoutp01L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1519649644; bh=AizvtLz2NBl+6eQdRcU7upiGQZ/Cvuzq0wl1Wsdvumc=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=SeBOpyTNN2Fl7yRZrTH2BxFHLQvnutw2yQnW3ryLsVO9sN5HOB8T416pUgQIZmt9J IZOeG37JoA0N2CZBGTvVCP+bHvdWtBWX6Tp+fyNPSPeee9F5K1qd06Hw/6apVD4WOz PbitP3YzF/yzPazSzvM5qZwYjcWj9+DZ9YrD7RWs= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180226125403eucas1p2bb3c774865c18460dc343002ad994760~W4UylRCo40419604196eucas1p2R; Mon, 26 Feb 2018 12:54:03 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id AB.12.17380.A63049A5; Mon, 26 Feb 2018 12:54:03 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180226125402eucas1p26624013733dcc44cf5f8d2818d0899c9~W4UxH9A330419604196eucas1p2O; Mon, 26 Feb 2018 12:54:02 +0000 (GMT) X-AuditID: cbfec7f4-6f9ff700000043e4-ac-5a94036a6a47 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 3F.FC.04183.963049A5; Mon, 26 Feb 2018 12:54:01 +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:01 +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 1/6] soc: samsung: pm_domains: Add blacklisting clock handling Date: Mon, 26 Feb 2018 13:53:50 +0100 Message-id: <20180226125355.9052-2-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+NgFtrEIsWRmVeSWpSXmKPExsWy7djP87rZzFOiDPZOYrbYOGM9q8X1L89Z LSbdn8Bicf78BnaLjz33WC1mnN/HZLH2yF12i8Nv2lkdODw2repk8+jbsorR4/MmuQDmKC6b lNSczLLUIn27BK6MmU0PGAsauCt+XHrO3MA4ibOLkZNDQsBE4uyBbYxdjFwcQgIrGCXaj31n hnA+M0q8/TCVBabq5IvHTBCJZYwS/46shqpqYJLY1vSbGaSKTcBQouttFxuILSLgIPH502uw ucwCbUxAS/YzgSSEBYIlHm0/CzSWg4NFQFWi57oCSJhXwEbi6vGrjBDb5CUWf98JNodTwFai 89Y0NpA5EgJ/WSX+3+xmgihykZi3vQvqPGGJV8e3sEPYMhKXJ3ezQDT0A536/yUThDODUWL9 x1aoKmuJw8cvsoLYzAJ8EpO2TWcGuUhCgFeio00IosRDouHIBagFjhJ7T82EhtIERolZ11Yz TmCUWsDIsIpRPLW0ODc9tdgoL7Vcrzgxt7g0L10vOT93EyMwJk//O/5lB+OuP0mHGAU4GJV4 eH/cmRwlxJpYVlyZe4hRgoNZSYR35WKgEG9KYmVValF+fFFpTmrxIUZpDhYlcd44jbooIYH0 xJLU7NTUgtQimCwTB6dUA6Pwgs1rShqEo41Xr3zhXrTgW3VBzpp/LjyrFf7J2lU8t59e8W+R 7OkHa2I/7s8QZ9rT3JH5RP258LH0bbF3G1knS9UlGH5YN8HzXtQz9f07ZgUfMm97pPd5Obev 3I8zcjMbJrVn+u3wKVMVPtUlF+l2qjOnz/DFrUdXspetmLJq8cMzqU6CnM5KLMUZiYZazEXF iQC/vPyaxQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpiluLIzCtJLcpLzFFi42I5/e/4Vd1M5ilRBr9O2FhsnLGe1eL6l+es FpPuT2CxOH9+A7vFx557rBYzzu9jslh75C67xeE37awOHB6bVnWyefRtWcXo8XmTXABzFJdN SmpOZllqkb5dAlfGzKYHjAUN3BU/Lj1nbmCcxNnFyMkhIWAicfLFY6YuRi4OIYEljBK33l5j hnCamCSWbj3FBlLFJmAo0fW2C8wWEXCQ+PzpNSNIEbNAB5PEnr0PwRLCAsESj7afZeli5OBg EVCV6LmuABLmFbCRuHr8KiPENnmJxd93gpVzCthKdN6aBmYLAdVs/7eFaQIjzwJGhlWMIqml xbnpucVGesWJucWleel6yfm5mxiBIbPt2M8tOxi73gUfYhTgYFTi4V3wc1KUEGtiWXFl7iFG CQ5mJRHelYsnRwnxpiRWVqUW5ccXleakFh9ilOZgURLnPW9QGSUkkJ5YkpqdmlqQWgSTZeLg lGpgvFKiM8mypzuHc4dEXU37x/u6kvzcMeKn5h+5vuyrre38nb+ezK500pg0U7lRnfVTkOjW JMkrrXsfli/89CXskpTIttTtk0t8sibGHyjUFL+96xVzuKVo7h878anxJ/ZOPFJ26HPiDPvL 0h8nTdJXbOy57Cl97iS3+BantR9mac2+bXo5zPhLhRJLcUaioRZzUXEiAAtz8/QVAgAA X-CMS-MailID: 20180226125402eucas1p26624013733dcc44cf5f8d2818d0899c9 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180226125402eucas1p26624013733dcc44cf5f8d2818d0899c9 X-RootMTR: 20180226125402eucas1p26624013733dcc44cf5f8d2818d0899c9 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 Handling of clock reparenting will be move to clock controller driver, so add possibility to blacklist clock handling on systems, where the clock controller already does all needed operations. This is needed to avoid potential deadlock on clock reparenting during power domain on/off procedure. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski --- drivers/soc/samsung/pm_domains.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 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/soc/samsung/pm_domains.c b/drivers/soc/samsung/pm_domains.c index b6a436594a19..cef30bdf19b1 100644 --- a/drivers/soc/samsung/pm_domains.c +++ b/drivers/soc/samsung/pm_domains.c @@ -147,6 +147,9 @@ static __init const char *exynos_get_domain_name(struct device_node *node) return kstrdup_const(name, GFP_KERNEL); } +static const char *soc_force_no_clk[] = { +}; + static __init int exynos4_pm_init_power_domain(void) { struct device_node *np; @@ -183,6 +186,11 @@ static __init int exynos4_pm_init_power_domain(void) pd->pd.power_on = exynos_pd_power_on; pd->local_pwr_cfg = pm_domain_cfg->local_pwr_cfg; + for (i = 0; i < ARRAY_SIZE(soc_force_no_clk); i++) + if (of_find_compatible_node(NULL, NULL, + soc_force_no_clk[i])) + goto no_clk; + for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { char clk_name[8]; From patchwork Mon Feb 26 12:53:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 129645 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp167176lja; Mon, 26 Feb 2018 04:54:13 -0800 (PST) X-Google-Smtp-Source: AH8x227pKnRrr0EvZPSkUIw7O8XiPCZKy8bkoNHNhEaaxRTIOeiGPI+wdbzDxe1jIFAVkvyaCKG2 X-Received: by 10.98.32.28 with SMTP id g28mr10557865pfg.182.1519649652944; Mon, 26 Feb 2018 04:54:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519649652; cv=none; d=google.com; s=arc-20160816; b=a5BOOWsQMa6yfzx9Wtg4uYNP3zi9ntvEzUDCc5GteR/+CnyRCs7joGqpK5co+I9EXS zdPGv90QaojjDknN6UmgtdnDbjIiXhmqXoivr7KjZSHyqVZKZVdd1Xi57BcpPB67VmIi wHwTnr/a5fYnqsaxfET/xZ0mU3LrLb+nyw0LgZEGCtur0pnNmSa1XxWAR0gQY0/6zTlT iMN6TVYrhgkK472u9SAR5UyFbGM7hyZgNhaccO/y7iXr0Kh+s7LrPPwHBGL1UeT1VHfe O5AC0Gl/fNHA2faW7131t/gUsk2hoYm5CIr0ptT7t4NkPpWO7+d8UBKN9agUg/CTFCH1 aMJw== 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=UCo8d7mZ6c3zcqIZDKF+gjB3pCw0f6ZRhMwrmCdVnaA=; b=jZTuvbryBk5UKn4D9YMGiMH3AzF6QW4MN/4PVCgJpBLzqWIB85p1sI/5SKIX+KhTPm RERTkxY9pGV/gGXBaMK/mmBB6C0EFWqmczlGcek1EGoh/s1FXJpF7JstVvUKuMtfvCiL yuR30hl0ZbqOGAYYYlCVeD/1A6avp1MwJv/ilhw0BzgSojw7d+fVD6io1lGVNQHr8373 derOxlmeXyOrA/DKFo18PcJ8QjyZkwXpnSEC97f7uTle7euXKmsh08KHt1miUcFG9b3R Ygi4hApeLo81mrTLOKMa0FnTqsyo5ZNeLoLZi7sCpCu0c+dTHBSUhfj4ufa7/f1r604h LaDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=bB2v2dGJ; 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.12; Mon, 26 Feb 2018 04:54:12 -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=bB2v2dGJ; 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 S1752420AbeBZMyL (ORCPT + 3 others); Mon, 26 Feb 2018 07:54:11 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:39384 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752451AbeBZMyH (ORCPT ); Mon, 26 Feb 2018 07:54:07 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180226125405euoutp01f0b83cc5152c32e7e408018db77b7105~W4U0ImUgy1566615666euoutp01M; Mon, 26 Feb 2018 12:54:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180226125405euoutp01f0b83cc5152c32e7e408018db77b7105~W4U0ImUgy1566615666euoutp01M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1519649645; bh=8NKUt4YdaPbxjrfEAty884Sf/aop/Nij/qE257W+mJg=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=bB2v2dGJZy18HjKmELdwKz8+ietdsSuxq1IlWVNrhpB4Gr+dA4GFgRGwr9sfdxxxX jRu7zsyGAcpQjg82Q7D8TutJRnF2W+ITTIsZUuOGWCUldV2o6Dgh4aNc2umCwDPSwa 87GAeVi06G2VRasmbxwoBIF0RiOOICHXGqFbouW0= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180226125404eucas1p2a7acc54b75ddb57c947d866bcd319f24~W4UzHBbRK0420404204eucas1p2Q; Mon, 26 Feb 2018 12:54:04 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 55.78.10409.B63049A5; Mon, 26 Feb 2018 12:54:03 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180226125402eucas1p1ac3e0a5853218cd77f469864f70ae89d~W4UxmDfhH0324403244eucas1p1E; Mon, 26 Feb 2018 12:54:02 +0000 (GMT) X-AuditID: cbfec7f5-f95739c0000028a9-db-5a94036bf202 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 23.9A.04178.A63049A5; Mon, 26 Feb 2018 12:54:02 +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:02 +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 2/6] clk: samsung: Add Exynos5 sub-CMU clock driver Date: Mon, 26 Feb 2018 13:53:51 +0100 Message-id: <20180226125355.9052-3-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+NgFtrIIsWRmVeSWpSXmKPExsWy7djPc7rZzFOiDE71ylhsnLGe1eL6l+es FpPuT2CxOH9+A7vFx557rBYzzu9jslh75C67xeE37awOHB6bVnWyefRtWcXo8XmTXABzFJdN SmpOZllqkb5dAldGz7kTrAWd1hXNj8+wNzDuMexi5OSQEDCR2Nj7i6WLkYtDSGAFo8TGU2fY IJzPjBIv7t5lganadfEPO0RiGaPErRvbWCGcBiaJKSua2EGq2AQMJbredrGB2CICDhKfP71m BCliFmhjkjh7YD9TFyMHh7CAm8TVp9IgNSwCqhL7Di0Fq+cVsJE4NrsVapu8xOLvO8HinAK2 Ep23poGdJCHQyCZx+ftmZpA5EgIuEjs7RCDqhSVeHd/CDmHLSHR2HGSCqO9nlPj3/yWUM4NR Yv3HVqgqa4nDxy+ygtjMAnwSk7ZNhxrKK9HRJgRR4iHxccdUNgjbUaLr3SJGiI8nMEos3TmB bQKj1AJGhlWM4qmlxbnpqcXGeanlesWJucWleel6yfm5mxiBEXn63/GvOxj3/Uk6xCjAwajE w/vjzuQoIdbEsuLK3EOMEhzMSiK8KxcDhXhTEiurUovy44tKc1KLDzFKc7AoifPGadRFCQmk J5akZqemFqQWwWSZODilGhiTl18tdI5VYf5W+G2H/0qHbXc4/2dXXSubXfQldlbKZGb7LyeW epadVBNxv3P7g92jnZE3GN/s6/MvezhtwqorMfMX/FZwigxqLvx3ZYHy8ZMp1l+UuURiO+ot 95+Iiigz3Bbq/USqLPgEp+L9jJydnGm7ZpVsD/WvEwha7lm0V0p7ys69m/SUWIozEg21mIuK EwHB3i6kxAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkluLIzCtJLcpLzFFi42I5/e/4Vd0s5ilRBrP3SVlsnLGe1eL6l+es FpPuT2CxOH9+A7vFx557rBYzzu9jslh75C67xeE37awOHB6bVnWyefRtWcXo8XmTXABzFJdN SmpOZllqkb5dAldGz7kTrAWd1hXNj8+wNzDuMexi5OSQEDCR2HXxD3sXIxeHkMASRomJzRvY QRJCAk1MEhuaFUFsNgFDia63XWwgtoiAg8TnT68ZQRqYBTqYJPbsfQiU4OAQFnCTuPpUGqSG RUBVYt+hpWD1vAI2Esdmt7JALJOXWPx9J1icU8BWovPWNDaIXTYS2/9tYZrAyLOAkWEVo0hq aXFuem6xoV5xYm5xaV66XnJ+7iZGYMBsO/Zz8w7GSxuDDzEKcDAq8fAu+DkpSog1say4MvcQ owQHs5II78rFk6OEeFMSK6tSi/Lji0pzUosPMUpzsCiJ8543qIwSEkhPLEnNTk0tSC2CyTJx cEo1MM6Mkrq50toq/61rbXnnj0t5/JdECpfo9iZHPEmqs9i/3in99cyC6PmPVrTW+HuZTzdc bmgz13DinUWXTwRob1Ngna7yPXp/2Aqm88e5vy+8Ebu8bNJuT9MTIktlrk5dkHg1d53suYrk WGO5jqqD29UbWb6u0FKT1rj74/j+L9waEx/b66zI7lBiKc5INNRiLipOBAAWoaBxFAIAAA== X-CMS-MailID: 20180226125402eucas1p1ac3e0a5853218cd77f469864f70ae89d X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180226125402eucas1p1ac3e0a5853218cd77f469864f70ae89d X-RootMTR: 20180226125402eucas1p1ac3e0a5853218cd77f469864f70ae89d 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 Exynos5250/5420/5800 have only one clock constroller, but some of their clock depends on respective power domains. Handling integration of clock controller and power domain can be done using runtime PM feature of CCF framework. This however needs a separate struct device for each power domain. This patch adds such separate driver for a group of such clocks, which can be instantiated more than once, each time for a different power domain. Signed-off-by: Marek Szyprowski --- drivers/clk/samsung/clk-exynos5-subcmu.c | 185 +++++++++++++++++++++++++++++++ drivers/clk/samsung/clk-exynos5-subcmu.h | 26 +++++ 2 files changed, 211 insertions(+) create mode 100644 drivers/clk/samsung/clk-exynos5-subcmu.c create mode 100644 drivers/clk/samsung/clk-exynos5-subcmu.h -- 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 Reviewed-by: Krzysztof Kozlowski diff --git a/drivers/clk/samsung/clk-exynos5-subcmu.c b/drivers/clk/samsung/clk-exynos5-subcmu.c new file mode 100644 index 000000000000..41bf5c3cf178 --- /dev/null +++ b/drivers/clk/samsung/clk-exynos5-subcmu.c @@ -0,0 +1,185 @@ +// SPDX-License-Identifier: GPL-2.0 +// +// Copyright (c) 2018 Samsung Electronics Co., Ltd. +// Author: Marek Szyprowski +// Common Clock Framework support for Exynos5 power-domain dependent clocks + +#include +#include +#include +#include + +#include "clk.h" +#include "clk-exynos5-subcmu.h" + +static struct samsung_clk_provider *ctx; +static const struct exynos5_subcmu_info *cmu; +static int nr_cmus; + +static void samsung_ext_clk_save(void __iomem *base, + struct samsung_clk_ext_reg_dump *rd, + unsigned int num_regs) +{ + for (; num_regs > 0; --num_regs, ++rd) { + rd->save = readl(base + rd->offset); + writel((rd->save & ~rd->mask) | rd->value, base + rd->offset); + rd->save &= rd->mask; + } +}; + +static void samsung_ext_clk_restore(void __iomem *base, + struct samsung_clk_ext_reg_dump *rd, + unsigned int num_regs) +{ + for (; num_regs > 0; --num_regs, ++rd) + writel((readl(base + rd->offset) & ~rd->mask) | rd->save, + base + rd->offset); +} + +static void samsung_clk_defer_gate(struct samsung_clk_provider *ctx, + const struct samsung_gate_clock *list, int nr_clk) +{ + while (nr_clk--) + samsung_clk_add_lookup(ctx, ERR_PTR(-EPROBE_DEFER), list++->id); +} + +/* + * Pass the needed clock provider context and register sub-CMU clocks + * + * NOTE: This function has to be called from the main, OF_CLK_DECLARE- + * initialized clock provider driver. This happens very early during boot + * process. Then this driver, during core_initcall registers two platform + * drivers: one which binds to the same device-tree node as OF_CLK_DECLARE + * driver and second, for handling its per-domain child-devices. Those + * platform drivers are bound to their devices a bit later in arch_initcall, + * when OF-core populates all device-tree nodes. + */ +void exynos5_subcmus_init(struct samsung_clk_provider *_ctx, int _nr_cmus, + const struct exynos5_subcmu_info *_cmu) +{ + ctx = _ctx; + cmu = _cmu; + nr_cmus = _nr_cmus; + + for (; _nr_cmus--; _cmu++) { + samsung_clk_defer_gate(ctx, _cmu->gate_clks, _cmu->nr_gate_clks); + samsung_ext_clk_save(ctx->reg_base, _cmu->suspend_regs, + _cmu->nr_suspend_regs); + } +} + +static int __maybe_unused exynos5_clk_subcmu_suspend(struct device *dev) +{ + struct exynos5_subcmu_info *info = dev_get_drvdata(dev); + unsigned long flags; + + spin_lock_irqsave(&ctx->lock, flags); + samsung_ext_clk_save(ctx->reg_base, info->suspend_regs, + info->nr_suspend_regs); + spin_unlock_irqrestore(&ctx->lock, flags); + + return 0; +} + +static int __maybe_unused exynos5_clk_subcmu_resume(struct device *dev) +{ + struct exynos5_subcmu_info *info = dev_get_drvdata(dev); + unsigned long flags; + + spin_lock_irqsave(&ctx->lock, flags); + samsung_ext_clk_restore(ctx->reg_base, info->suspend_regs, + info->nr_suspend_regs); + spin_unlock_irqrestore(&ctx->lock, flags); + + return 0; +} + +static int __init exynos5_clk_subcmu_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct exynos5_subcmu_info *info = dev_get_drvdata(dev); + + pm_runtime_set_suspended(dev); + pm_runtime_enable(dev); + pm_runtime_get(dev); + + ctx->dev = dev; + samsung_clk_register_div(ctx, info->div_clks, info->nr_div_clks); + samsung_clk_register_gate(ctx, info->gate_clks, info->nr_gate_clks); + ctx->dev = NULL; + + pm_runtime_put_sync(dev); + + return 0; +} + +static const struct dev_pm_ops exynos5_clk_subcmu_pm_ops = { + SET_RUNTIME_PM_OPS(exynos5_clk_subcmu_suspend, + exynos5_clk_subcmu_resume, NULL) + SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) +}; + +static struct platform_driver exynos5_clk_subcmu_driver __refdata = { + .driver = { + .name = "exynos5-clock-subcmu", + .suppress_bind_attrs = true, + .pm = &exynos5_clk_subcmu_pm_ops, + }, + .probe = exynos5_clk_subcmu_probe, +}; + +static int __init exynos5_clk_register_subcmu_drv(struct device *parent, + const struct exynos5_subcmu_info *info, + struct device_node *pd_node) +{ + struct of_phandle_args genpdspec = { .np = pd_node }; + struct platform_device *pdev; + + pdev = platform_device_alloc(info->pd_name, -1); + pdev->dev.parent = parent; + pdev->driver_override = "exynos5-clock-subcmu"; + platform_set_drvdata(pdev, (void *)info); + of_genpd_add_device(&genpdspec, &pdev->dev); + platform_device_add(pdev); + + return 0; +} + +static int __init exynos5_clk_probe(struct platform_device *pdev) +{ + struct device_node *np; + const char *name; + int i; + + for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") { + if (of_property_read_string(np, "label", &name) < 0) + continue; + for (i = 0; i < nr_cmus; i++) + if (strcmp(cmu[i].pd_name, name) == 0) + exynos5_clk_register_subcmu_drv(&pdev->dev, + &cmu[i], np); + } + return 0; +} + +static const struct of_device_id exynos5_clk_of_match[] = { + { }, +}; + +static struct platform_driver exynos5_clk_driver __refdata = { + .driver = { + .name = "exynos5-clock", + .of_match_table = exynos5_clk_of_match, + .suppress_bind_attrs = true, + }, + .probe = exynos5_clk_probe, +}; + +static int __init exynos5_clk_drv_init(void) +{ + platform_driver_register(&exynos5_clk_driver); + platform_driver_register(&exynos5_clk_subcmu_driver); + return 0; +} +core_initcall(exynos5_clk_drv_init); diff --git a/drivers/clk/samsung/clk-exynos5-subcmu.h b/drivers/clk/samsung/clk-exynos5-subcmu.h new file mode 100644 index 000000000000..364ca4051d9e --- /dev/null +++ b/drivers/clk/samsung/clk-exynos5-subcmu.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef __CLK_EXYNOS5_SUBCMU_H +#define __CLK_EXYNOS5_SUBCMU_H + +struct samsung_clk_ext_reg_dump { + u32 offset; + u32 value; + u32 mask; + u32 save; +}; + +struct exynos5_subcmu_info { + const struct samsung_div_clock *div_clks; + unsigned int nr_div_clks; + const struct samsung_gate_clock *gate_clks; + unsigned int nr_gate_clks; + struct samsung_clk_ext_reg_dump *suspend_regs; + unsigned int nr_suspend_regs; + const char *pd_name; +}; + +void exynos5_subcmus_init(struct samsung_clk_provider *ctx, int nr_cmus, + const struct exynos5_subcmu_info *cmu); + +#endif From patchwork Mon Feb 26 12:53:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 129646 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp167200lja; Mon, 26 Feb 2018 04:54:14 -0800 (PST) X-Google-Smtp-Source: AH8x224BvTVIlB10Nj1UkKJbosaqC/3Zq0PAxMTOiEg8O7Gaeej+dAv2SsO1LIXnIYW0LXNxHicS X-Received: by 2002:a17:902:71c9:: with SMTP id t9-v6mr10482248plm.107.1519649654699; Mon, 26 Feb 2018 04:54:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519649654; cv=none; d=google.com; s=arc-20160816; b=pUUD/WSCELfEyM4YQjmETlo1tmc1+2DLyhD65ZSMN7ZKVH+4hDlB1YeiVUVabab0Qa 4W15UM9kTFLhAVnA4dP06Xr0U/jug/33SJVvRLRpSEabA5Is+Pwin3qm9n6o+BGQnUVm UiL7IQFoihNK26gytVjt8411bPf2ghf+Bkf6uGV2v0upCJplxvYuWoNMjMymTMNoFC8z R9zVqmnsFL1BeC+s4TA+M2EolC+bwp6zK7GX2l6EyKhbvvIC4gYkcQ3/eDAEKgiGFAhZ QhUf7s3lADBqhZK0jzzwyyrj4OZx0k0wl6iELAam4499IF0SCfqR/64cr8qbbc94Fj0e devA== 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=idvgpd9Yjmi6nvNF4iB+vhGCsoiOgHjx+FyO2xNkIhk=; b=fG2tYf6vX9tAfDJRdDUmvEdMIUEhCZcspU7zwXKRF/hRtavcTCRVb8fKoU61Ni5G7X D4iHR4A6I4kKUe5aWyD2JQvlxUvN3dLdq5qF3OGGDzsX5jlcx6KLKjCst5D8t0GSfDb8 Dspcxv/qpgCc0t/faRg0DLlCnIXV/RElTkIz6exc8pNUeXBHnwmot06HMMmir5s4Nk0m okBb5OVyp2DFeQX4EaKMkdCiHktvH7zfnVJjLOIw8Wf7NV56lN3n7vH5J6YgRssk4in3 TtHhmiMdLdXdhbvRrYy9zxQ6pwrXl3a1SvLKdXUCAUZJgXJaiVpc5lDRx/fDLmGE/4FD yCXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=C9D+V4G7; 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.14; Mon, 26 Feb 2018 04:54:14 -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=C9D+V4G7; 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 S1752668AbeBZMyN (ORCPT + 3 others); Mon, 26 Feb 2018 07:54:13 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:41079 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752506AbeBZMyI (ORCPT ); Mon, 26 Feb 2018 07:54:08 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180226125406euoutp0217cb0a66135c06b7be58f792497ceaa7~W4U06IoZ_1775017750euoutp02h; Mon, 26 Feb 2018 12:54:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180226125406euoutp0217cb0a66135c06b7be58f792497ceaa7~W4U06IoZ_1775017750euoutp02h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1519649646; bh=qsFEKquv7HNwt5ZhELeV58uPYTnwrJ8vx30BoV4T8nM=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=C9D+V4G7cp067yYLovyfS3GPddTyvyfeRlrRS97ojMZwsxOkMQ9WqFRHeXa0SkgHq CwvxSBv2FZXLkvRQR0kgoy9rj4W++7OZlIo7dSe8hxcHLuOkMYLXaN/q77oLWGxdDS 2v4UO0ydz7QYL9qUjFQmiJ7yQwX4G+fdfSLA8YRk= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180226125404eucas1p27532404019d02cd68c32fc230fd0a959~W4UzfQanL0419604196eucas1p2T; Mon, 26 Feb 2018 12:54:04 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 16.78.10409.B63049A5; Mon, 26 Feb 2018 12:54:03 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180226125402eucas1p251f0cd4ca7971cda08ad62c358ea0e24~W4Ux7VKb80418404184eucas1p2M; Mon, 26 Feb 2018 12:54:02 +0000 (GMT) X-AuditID: cbfec7f5-b45ff700000028a9-dd-5a94036b95b4 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 80.0D.04183.A63049A5; Mon, 26 Feb 2018 12:54:02 +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:02 +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 3/6] clk: samsung: exynos5420: Move PD-dependent clocks to Exynos5 sub-CMU driver Date: Mon, 26 Feb 2018 13:53:52 +0100 Message-id: <20180226125355.9052-4-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+NgFtrEIsWRmVeSWpSXmKPExsWy7djP87rZzFOiDLZ8VbfYOGM9q8X1L89Z LSbdn8Bicf78BnaLjz33WC1mnN/HZLH2yF12i8Nv2lkdODw2repk8+jbsorR4/MmuQDmKC6b lNSczLLUIn27BK6M57fXshR0R1bcWNrB1MDY4tPFyMkhIWAi8eBGG2MXIxeHkMAKRomtm/ez QjifGSUOLrrG3sXIAVZ16YsKRHwZo8SNqz0sEE4Dk8SUFU3sIKPYBAwlut52sYHYIgIOEp8/ vQYbyyzQxiRx9sB+JpCEsECaxPlnT1lBbBYBVYmPFzczgti8AjYSi182MEHcJC+x+PtOsEGc ArYSnbemsYEMkhD4yyoxe80mdogiF4lJU46xQNjCEq+Ob4GKy0hcntzNAtHQzyjx7/9LJghn BqPE+o+tUFXWEoePXwQ7g1mAT2LStunMEI/ySnS0CUGUeEjMfg6zwFFiZ8MOJoifJzBKtL1q Yp/AKLWAkWEVo3hqaXFuemqxcV5quV5xYm5xaV66XnJ+7iZGYEye/nf86w7GfX+SDjEKcDAq 8fD+uDM5Sog1say4MvcQowQHs5II78rFQCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8cRp1UUIC 6YklqdmpqQWpRTBZJg5OqQbG5stXTpbsPnKWWZvXhtcl6Xv4ns7b8vXed4WYP719uyFeZ19r B7eL3Ha99ZdOXqz/qyrL/u+tz91TiWavTlx22+Y2L4gvT7nYP2rV/FuhC9o+KfMxFvi+mdex zKP893PdJMc8rk/OMc2nXE7+5sh2ECn4WS5mfWzBJRFthgtGpmcyT9x7uzZMiaU4I9FQi7mo OBEAjogCqcUCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkluLIzCtJLcpLzFFi42I5/e/4Vd0s5ilRBq23TCw2zljPanH9y3NW i0n3J7BYnD+/gd3iY889VosZ5/cxWaw9cpfd4vCbdlYHDo9NqzrZPPq2rGL0+LxJLoA5issm JTUnsyy1SN8ugSvj+e21LAXdkRU3lnYwNTC2+HQxcnBICJhIXPqi0sXIxSEksIRR4vKrBpYu Rk4gp4lJYkOzIojNJmAo0fW2iw3EFhFwkPj86TUjSAOzQAeTxJ69D8ESwgJpEgcubgNrZhFQ lfh4cTMjiM0rYCOx+GUDE4gtISAvsfj7TrB6TgFbic5b09ggltlIbP+3hWkCI88CRoZVjCKp pcW56bnFRnrFibnFpXnpesn5uZsYgQGz7djPLTsYu94FH2IU4GBU4uFd8HNSlBBrYllxZe4h RgkOZiUR3pWLJ0cJ8aYkVlalFuXHF5XmpBYfYpTmYFES5z1vUBklJJCeWJKanZpakFoEk2Xi 4JRqYPS4ZFK/Wv+1lGGUr9PE1dITvt3jPbxb61yT54Ekpx1N70SWS8ztt2do6lvZ//XA5Trn 3FSx2rZnVVvOfT+dtu9qz1MHsRlVH6b21mSHHA9bfF9H22ZKtewlBtGFLCwPpsUaf1t9SlM1 5uXEGbxOGjvnxQg6ZNuqzEy4+qZzDsfjkLkOnLK1KUosxRmJhlrMRcWJACg/tI8UAgAA X-CMS-MailID: 20180226125402eucas1p251f0cd4ca7971cda08ad62c358ea0e24 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180226125402eucas1p251f0cd4ca7971cda08ad62c358ea0e24 X-RootMTR: 20180226125402eucas1p251f0cd4ca7971cda08ad62c358ea0e24 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 DISP, GSC and MFC blocks 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 Exynos5420 driver. Signed-off-by: Marek Szyprowski Acked-by: Krzysztof Kozlowski --- drivers/clk/samsung/Makefile | 1 + drivers/clk/samsung/clk-exynos5-subcmu.c | 2 + drivers/clk/samsung/clk-exynos5420.c | 121 ++++++++++++++++++++++++------- drivers/soc/samsung/pm_domains.c | 2 + 4 files changed, 100 insertions(+), 26 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 ef8900bc077f..b23d6cfac723 100644 --- a/drivers/clk/samsung/Makefile +++ b/drivers/clk/samsung/Makefile @@ -11,6 +11,7 @@ obj-$(CONFIG_SOC_EXYNOS5250) += clk-exynos5250.o obj-$(CONFIG_SOC_EXYNOS5260) += clk-exynos5260.o obj-$(CONFIG_SOC_EXYNOS5410) += clk-exynos5410.o obj-$(CONFIG_SOC_EXYNOS5420) += clk-exynos5420.o +obj-$(CONFIG_SOC_EXYNOS5420) += clk-exynos5-subcmu.o obj-$(CONFIG_EXYNOS_ARM64_COMMON_CLK) += clk-exynos5433.o obj-$(CONFIG_SOC_EXYNOS5440) += clk-exynos5440.o obj-$(CONFIG_EXYNOS_AUDSS_CLK_CON) += clk-exynos-audss.o diff --git a/drivers/clk/samsung/clk-exynos5-subcmu.c b/drivers/clk/samsung/clk-exynos5-subcmu.c index 41bf5c3cf178..dd278e33688b 100644 --- a/drivers/clk/samsung/clk-exynos5-subcmu.c +++ b/drivers/clk/samsung/clk-exynos5-subcmu.c @@ -164,6 +164,8 @@ static int __init exynos5_clk_probe(struct platform_device *pdev) } static const struct of_device_id exynos5_clk_of_match[] = { + { .compatible = "samsung,exynos5420-clock", }, + { .compatible = "samsung,exynos5800-clock", }, { }, }; diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c index 45d34f601e9e..b5c72b3b77ba 100644 --- a/drivers/clk/samsung/clk-exynos5420.c +++ b/drivers/clk/samsung/clk-exynos5420.c @@ -19,6 +19,7 @@ #include "clk.h" #include "clk-cpu.h" +#include "clk-exynos5-subcmu.h" #define APLL_LOCK 0x0 #define APLL_CON0 0x100 @@ -863,7 +864,6 @@ static const struct samsung_div_clock exynos5x_div_clks[] __initconst = { DIV(0, "dout_mipi1", "mout_mipi1", DIV_DISP10, 16, 8), DIV(0, "dout_dp1", "mout_dp1", DIV_DISP10, 24, 4), DIV(CLK_DOUT_PIXEL, "dout_hdmi_pixel", "mout_pixel", DIV_DISP10, 28, 4), - DIV(0, "dout_disp1_blk", "aclk200_disp1", DIV2_RATIO0, 16, 2), DIV(CLK_DOUT_ACLK400_DISP1, "dout_aclk400_disp1", "mout_aclk400_disp1", DIV_TOP2, 4, 3), @@ -912,8 +912,6 @@ static const struct samsung_div_clock exynos5x_div_clks[] __initconst = { DIV(0, "dout_spi1", "mout_spi1", DIV_PERIC1, 24, 4), DIV(0, "dout_spi2", "mout_spi2", DIV_PERIC1, 28, 4), - /* Mfc Block */ - DIV(0, "dout_mfc_blk", "mout_user_aclk333", DIV4_RATIO, 0, 2), /* PCM */ DIV(0, "dout_pcm1", "dout_audio1", DIV_PERIC2, 16, 8), @@ -932,8 +930,6 @@ static const struct samsung_div_clock exynos5x_div_clks[] __initconst = { DIV(0, "dout_spi2_pre", "dout_spi2", DIV_PERIC4, 24, 8), /* GSCL Block */ - DIV(0, "dout_gscl_blk_300", "mout_user_aclk300_gscl", - DIV2_RATIO0, 4, 2), DIV(0, "dout_gscl_blk_333", "aclk333_432_gscl", DIV2_RATIO0, 6, 2), /* MSCL Block */ @@ -1190,8 +1186,6 @@ static const struct samsung_gate_clock exynos5x_gate_clks[] __initconst = { GATE(CLK_SCLK_GSCL_WB, "sclk_gscl_wb", "mout_user_aclk333_432_gscl", GATE_TOP_SCLK_GSCL, 7, 0, 0), - GATE(CLK_GSCL0, "gscl0", "aclk300_gscl", GATE_IP_GSCL0, 0, 0, 0), - GATE(CLK_GSCL1, "gscl1", "aclk300_gscl", GATE_IP_GSCL0, 1, 0, 0), GATE(CLK_FIMC_3AA, "fimc_3aa", "aclk333_432_gscl", GATE_IP_GSCL0, 4, 0, 0), GATE(CLK_FIMC_LITE0, "fimc_lite0", "aclk333_432_gscl", @@ -1205,10 +1199,6 @@ static const struct samsung_gate_clock exynos5x_gate_clks[] __initconst = { GATE_IP_GSCL1, 3, 0, 0), GATE(CLK_SMMU_FIMCL1, "smmu_fimcl1", "dout_gscl_blk_333", GATE_IP_GSCL1, 4, 0, 0), - GATE(CLK_SMMU_GSCL0, "smmu_gscl0", "dout_gscl_blk_300", - GATE_IP_GSCL1, 6, 0, 0), - GATE(CLK_SMMU_GSCL1, "smmu_gscl1", "dout_gscl_blk_300", - GATE_IP_GSCL1, 7, 0, 0), GATE(CLK_GSCL_WA, "gscl_wa", "sclk_gscl_wa", GATE_IP_GSCL1, 12, 0, 0), GATE(CLK_GSCL_WB, "gscl_wb", "sclk_gscl_wb", GATE_IP_GSCL1, 13, 0, 0), GATE(CLK_SMMU_FIMCL3, "smmu_fimcl3,", "dout_gscl_blk_333", @@ -1227,18 +1217,6 @@ static const struct samsung_gate_clock exynos5x_gate_clks[] __initconst = { GATE(CLK_SMMU_MSCL2, "smmu_mscl2", "dout_mscl_blk", GATE_IP_MSCL, 10, 0, 0), - GATE(CLK_FIMD1, "fimd1", "aclk300_disp1", GATE_IP_DISP1, 0, 0, 0), - GATE(CLK_DSIM1, "dsim1", "aclk200_disp1", GATE_IP_DISP1, 3, 0, 0), - GATE(CLK_DP1, "dp1", "aclk200_disp1", GATE_IP_DISP1, 4, 0, 0), - GATE(CLK_MIXER, "mixer", "aclk200_disp1", GATE_IP_DISP1, 5, 0, 0), - GATE(CLK_HDMI, "hdmi", "aclk200_disp1", GATE_IP_DISP1, 6, 0, 0), - GATE(CLK_SMMU_FIMD1M0, "smmu_fimd1m0", "dout_disp1_blk", - GATE_IP_DISP1, 7, 0, 0), - GATE(CLK_SMMU_FIMD1M1, "smmu_fimd1m1", "dout_disp1_blk", - GATE_IP_DISP1, 8, 0, 0), - GATE(CLK_SMMU_MIXER, "smmu_mixer", "aclk200_disp1", - GATE_IP_DISP1, 9, 0, 0), - /* ISP */ GATE(CLK_SCLK_UART_ISP, "sclk_uart_isp", "dout_uart_isp", GATE_TOP_SCLK_ISP, 0, CLK_SET_RATE_PARENT, 0), @@ -1255,11 +1233,98 @@ 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), +}; + +static const struct samsung_div_clock exynos5x_disp_div_clks[] __initconst = { + DIV(0, "dout_disp1_blk", "aclk200_disp1", DIV2_RATIO0, 16, 2), +}; + +static const struct samsung_gate_clock exynos5x_disp_gate_clks[] __initconst = { + GATE(CLK_FIMD1, "fimd1", "aclk300_disp1", GATE_IP_DISP1, 0, 0, 0), + GATE(CLK_DSIM1, "dsim1", "aclk200_disp1", GATE_IP_DISP1, 3, 0, 0), + GATE(CLK_DP1, "dp1", "aclk200_disp1", GATE_IP_DISP1, 4, 0, 0), + GATE(CLK_MIXER, "mixer", "aclk200_disp1", GATE_IP_DISP1, 5, 0, 0), + GATE(CLK_HDMI, "hdmi", "aclk200_disp1", GATE_IP_DISP1, 6, 0, 0), + GATE(CLK_SMMU_FIMD1M0, "smmu_fimd1m0", "dout_disp1_blk", + GATE_IP_DISP1, 7, 0, 0), + GATE(CLK_SMMU_FIMD1M1, "smmu_fimd1m1", "dout_disp1_blk", + GATE_IP_DISP1, 8, 0, 0), + GATE(CLK_SMMU_MIXER, "smmu_mixer", "aclk200_disp1", + GATE_IP_DISP1, 9, 0, 0), +}; + +static struct samsung_clk_ext_reg_dump exynos5x_disp_suspend_regs[] = { + { GATE_IP_DISP1, 0xffffffff, 0xffffffff }, /* DISP1 gates */ + { SRC_TOP5, 0, BIT(0) }, /* MUX mout_user_aclk400_disp1 */ + { SRC_TOP5, 0, BIT(24) }, /* MUX mout_user_aclk300_disp1 */ + { SRC_TOP3, 0, BIT(8) }, /* MUX mout_user_aclk200_disp1 */ + { DIV2_RATIO0, 0, 0x30000 }, /* DIV dout_disp1_blk */ +}; + +static const struct samsung_div_clock exynos5x_gsc_div_clks[] __initconst = { + DIV(0, "dout_gscl_blk_300", "mout_user_aclk300_gscl", + DIV2_RATIO0, 4, 2), +}; + +static const struct samsung_gate_clock exynos5x_gsc_gate_clks[] __initconst = { + GATE(CLK_GSCL0, "gscl0", "aclk300_gscl", GATE_IP_GSCL0, 0, 0, 0), + GATE(CLK_GSCL1, "gscl1", "aclk300_gscl", GATE_IP_GSCL0, 1, 0, 0), + GATE(CLK_SMMU_GSCL0, "smmu_gscl0", "dout_gscl_blk_300", + GATE_IP_GSCL1, 6, 0, 0), + GATE(CLK_SMMU_GSCL1, "smmu_gscl1", "dout_gscl_blk_300", + GATE_IP_GSCL1, 7, 0, 0), +}; + +static struct samsung_clk_ext_reg_dump exynos5x_gsc_suspend_regs[] = { + { GATE_IP_GSCL0, 0x3, 0x3 }, /* GSC gates */ + { GATE_IP_GSCL1, 0xc0, 0xc0 }, /* GSC gates */ + { SRC_TOP5, 0, BIT(28) }, /* MUX mout_user_aclk300_gscl */ + { DIV2_RATIO0, 0, 0x30 }, /* DIV dout_gscl_blk_300 */ +}; + +static const struct samsung_div_clock exynos5x_mfc_div_clks[] __initconst = { + DIV(0, "dout_mfc_blk", "mout_user_aclk333", DIV4_RATIO, 0, 2), +}; + +static const struct samsung_gate_clock exynos5x_mfc_gate_clks[] __initconst = { GATE(CLK_MFC, "mfc", "aclk333", GATE_IP_MFC, 0, 0, 0), GATE(CLK_SMMU_MFCL, "smmu_mfcl", "dout_mfc_blk", GATE_IP_MFC, 1, 0, 0), GATE(CLK_SMMU_MFCR, "smmu_mfcr", "dout_mfc_blk", GATE_IP_MFC, 2, 0, 0), +}; - GATE(CLK_G3D, "g3d", "mout_user_aclk_g3d", GATE_IP_G3D, 9, 0, 0), +static struct samsung_clk_ext_reg_dump exynos5x_mfc_suspend_regs[] = { + { GATE_IP_MFC, 0xffffffff, 0xffffffff }, /* MFC gates */ + { SRC_TOP4, 0, BIT(28) }, /* MUX mout_user_aclk333 */ + { DIV4_RATIO, 0, 0x3 }, /* DIV dout_mfc_blk */ +}; + +static const struct exynos5_subcmu_info exynos5x_subcmus[] = { + { + .div_clks = exynos5x_disp_div_clks, + .nr_div_clks = ARRAY_SIZE(exynos5x_disp_div_clks), + .gate_clks = exynos5x_disp_gate_clks, + .nr_gate_clks = ARRAY_SIZE(exynos5x_disp_gate_clks), + .suspend_regs = exynos5x_disp_suspend_regs, + .nr_suspend_regs = ARRAY_SIZE(exynos5x_disp_suspend_regs), + .pd_name = "DISP", + }, { + .div_clks = exynos5x_gsc_div_clks, + .nr_div_clks = ARRAY_SIZE(exynos5x_gsc_div_clks), + .gate_clks = exynos5x_gsc_gate_clks, + .nr_gate_clks = ARRAY_SIZE(exynos5x_gsc_gate_clks), + .suspend_regs = exynos5x_gsc_suspend_regs, + .nr_suspend_regs = ARRAY_SIZE(exynos5x_gsc_suspend_regs), + .pd_name = "GSC", + }, { + .div_clks = exynos5x_mfc_div_clks, + .nr_div_clks = ARRAY_SIZE(exynos5x_mfc_div_clks), + .gate_clks = exynos5x_mfc_gate_clks, + .nr_gate_clks = ARRAY_SIZE(exynos5x_mfc_gate_clks), + .suspend_regs = exynos5x_mfc_suspend_regs, + .nr_suspend_regs = ARRAY_SIZE(exynos5x_mfc_suspend_regs), + .pd_name = "MFC", + }, }; static const struct samsung_pll_rate_table exynos5420_pll2550x_24mhz_tbl[] __initconst = { @@ -1472,6 +1537,8 @@ static void __init exynos5x_clk_init(struct device_node *np, exynos5420_kfcclk_d, ARRAY_SIZE(exynos5420_kfcclk_d), 0); exynos5420_clk_sleep_init(); + exynos5_subcmus_init(ctx, ARRAY_SIZE(exynos5x_subcmus), + exynos5x_subcmus); samsung_clk_of_add_provider(np, ctx); } @@ -1480,10 +1547,12 @@ static void __init exynos5420_clk_init(struct device_node *np) { exynos5x_clk_init(np, EXYNOS5420); } -CLK_OF_DECLARE(exynos5420_clk, "samsung,exynos5420-clock", exynos5420_clk_init); +CLK_OF_DECLARE_DRIVER(exynos5420_clk, "samsung,exynos5420-clock", + exynos5420_clk_init); static void __init exynos5800_clk_init(struct device_node *np) { exynos5x_clk_init(np, EXYNOS5800); } -CLK_OF_DECLARE(exynos5800_clk, "samsung,exynos5800-clock", exynos5800_clk_init); +CLK_OF_DECLARE_DRIVER(exynos5800_clk, "samsung,exynos5800-clock", + exynos5800_clk_init); diff --git a/drivers/soc/samsung/pm_domains.c b/drivers/soc/samsung/pm_domains.c index cef30bdf19b1..f2d6d7a09c16 100644 --- a/drivers/soc/samsung/pm_domains.c +++ b/drivers/soc/samsung/pm_domains.c @@ -148,6 +148,8 @@ static __init const char *exynos_get_domain_name(struct device_node *node) } static const char *soc_force_no_clk[] = { + "samsung,exynos5420-clock", + "samsung,exynos5800-clock", }; static __init int exynos4_pm_init_power_domain(void) 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", }; From patchwork Mon Feb 26 12:53:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 129649 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp167248lja; Mon, 26 Feb 2018 04:54:18 -0800 (PST) X-Google-Smtp-Source: AH8x224OI4BEVe2MyIjLqL1+i3p98z1JRydbnZeItV4/WRZ9+DbZxLqX9WkPlfNllzBmIpdvAAQv X-Received: by 10.99.117.76 with SMTP id f12mr8602757pgn.410.1519649658074; Mon, 26 Feb 2018 04:54:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519649658; cv=none; d=google.com; s=arc-20160816; b=Qfitnrvfj4jjTqT7DO7756KLe5r5RWukjEHe7JFe0J59dIgkLJJUvfzQxaySHCqqAd o8lwokbE2oPYLKD6KdmEe05wyHy0a2/rNRLUukNKuuF6qKDg8QdnhE6QdU/kKtZK3WZE 4edlv6Z0bUomlSFQ4BJfEKBxMxsZb0k1juiwSX93w21OlY9gMWNMOA66sI7JD+xiqpv+ U2D4EV5IpupyiyJIegJzVS59/RoqGQs/YuwhPU8QJfuqHtHTI4Ya8SxrLBnwvpHvlfYL p0+D+R6C9gJbfUc//Q5oXfqiYTbu4d9Tsm8dYIPI3TyKy9EvkTOvOH0OszXHiinX5zOP hRIg== 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=y0WlrmEe9UH3sgIIpwLeXur8o0BKbWA7XD4caFA9AsY=; b=xGrMMfdEQ79grMMoOCoYToqPDCz2wCORkcp42U79Egux8pwQqQd1ncV2JcI9wGNrKc BnAkZ15nGptkEF7Bn8kczzRoXQqZZr8/qFO/2bI+D5rYn345CrkfENQg76waO8tepg3Z PCnz+McbrgVdOp/+E3o4VEWOJ3/IIPo0vNrwMDThNsijnSMdLcaog9rgTbdI/6wZUVBP l6mQPz8UKp2siDbsjBABEuOFc9FRticWWb+wY74JyjQyzIOHSFOGjMpQRdpew+TMp7C6 UYsuXQsd+DoiHKh8+I7NrYg/AppCGVWSmgpHhJKIKJisbdVpW+X9VklDVFApJFG5hev5 2rZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=hCmzK5gu; 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:18 -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=hCmzK5gu; 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 S1752726AbeBZMyR (ORCPT + 3 others); Mon, 26 Feb 2018 07:54:17 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:39395 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752622AbeBZMyI (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 20180226125406euoutp0146993bd93ffed451b4eb4a0d02b174ce~W4U1vPRHI1566615666euoutp01O; Mon, 26 Feb 2018 12:54:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180226125406euoutp0146993bd93ffed451b4eb4a0d02b174ce~W4U1vPRHI1566615666euoutp01O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1519649647; bh=Bgbkobz3+Jy97HYKNm2qnFl14Qy/o9VOsJa2Z4p/vwk=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=hCmzK5gupqM2sTwRIcVBT8NoJ0wTE/CL1HYjthNTs8uyC5bbNke/6EKtEPAEYZ2hz mtAbrqN3P6HEnh2XshXrMblITPV2SgXj/RYQXeODy+pvduSZW3OtOLVs3tJ/6w3Zg5 7bzE4U4ZRniDosoRwr7HIh/QV0IqVxjFFs0jB53Y= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180226125405eucas1p2f8975095e763224aa98d7b7f4b8bc4c7~W4U0P0W6Z0417104171eucas1p2d; Mon, 26 Feb 2018 12:54:05 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id BD.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 20180226125403eucas1p27d32d02417f3cda5b809e62bf894bef8~W4UyvG0Gt0417104171eucas1p2a; Mon, 26 Feb 2018 12:54:03 +0000 (GMT) X-AuditID: cbfec7f4-b4fc79c0000043e4-b4-5a94036c59ce Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 02.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 5/6] soc: samsung: pm_domains: Deprecate support for clocks Date: Mon, 26 Feb 2018 13:53:54 +0100 Message-id: <20180226125355.9052-6-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+NgFtrAIsWRmVeSWpSXmKPExsWy7djPc7o5zFOiDLoWq1lsnLGe1eL6l+es FpPuT2CxOH9+A7vFx557rBYzzu9jslh75C67xeE37awOHB6bVnWyefRtWcXo8XmTXABzFJdN SmpOZllqkb5dAlfGn6M+BVfMKiau3sHWwNim08XIySEhYCLR/XoSC4gtJLCCUeJVi3wXIxeQ /ZlR4s6Zm8wwRT+6VjNDFC1jlDjx1RmiqIFJYv+CaWwgCTYBQ4mut11gtoiAg8TnT68ZQYqY BdqYJM4e2M8EkhAWCJCY9Oo0K4jNIqAqsefJRkYQm1fARuJOxz5WiG3yEou/7wQbxClgK9F5 C2QBF1D8L6vEuasfWCCKXCS+3nsHZQtLvDq+hR3ClpG4PLmbBaKhn1Hi3/+XTBDODEaJ9R9b oaqsJQ4fvwi2jlmAT2LStulAz3EAxXklOtqEIEo8JCbvuc4EYTtKNJ9cxQ7x8wRGieadG5km MEotYGRYxSieWlqcm55abJSXWq5XnJhbXJqXrpecn7uJERiPp/8d/7KDcdefpEOMAhyMSjy8 P+5MjhJiTSwrrsw9xCjBwawkwrtyMVCINyWxsiq1KD++qDQntfgQozQHi5I4b5xGXZSQQHpi SWp2ampBahFMlomDU6qBcaf/3z8mGSG+xx5FbEjY3cN67Bzz8nmuq8wilEI1uP5PEXySfsb0 SOl0z499777qCix+KmWiZrDwkYMAo1PdBildF+5JrZHnD1ru5t5deELKfWtKPFPG9PUZnKs2 f7VY1ferNFzrxu8PDE/7rhyMt/Oz8OU4udRj0qpTqwW9Be98jsrpy3XXV2Ipzkg01GIuKk4E AEjC0qHDAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpiluLIzCtJLcpLzFFi42I5/e/4Vd1s5ilRBtMXqVtsnLGe1eL6l+es FpPuT2CxOH9+A7vFx557rBYzzu9jslh75C67xeE37awOHB6bVnWyefRtWcXo8XmTXABzFJdN SmpOZllqkb5dAlfGn6M+BVfMKiau3sHWwNim08XIySEhYCLxo2s1cxcjF4eQwBJGiaYlb9kg nCYmid1bZzKBVLEJGEp0ve1iA7FFBBwkPn96zQhSxCzQwSSxZ+9DsISwgJ/EsZlbWUFsFgFV iT1PNjKC2LwCNhJ3OvaxQqyTl1j8fSdYPaeArUTnrWlgthBQzfZ/W5gmMPIsYGRYxSiSWlqc m55bbKRXnJhbXJqXrpecn7uJERgy24793LKDsetd8CFGAQ5GJR7eBT8nRQmxJpYVV+YeYpTg YFYS4V25eHKUEG9KYmVValF+fFFpTmrxIUZpDhYlcd7zBpVRQgLpiSWp2ampBalFMFkmDk6p BsaC4zyL3aoKTzqqbV7TKDeF+yOXk6bW3nKTmap+aQV3D0xeeHRJNPdCBlctwV12b31TPavC nlhLP1l+gHOJ0q7vd8sk+u6tmcpQcnnrSrbSTfVPjwVfSHw0v+y23MtFu9uWXhdvO1zv9/0L 89TFr+c95Z+2QuE98zHGc19fC/00OMv58+NVVT4hJZbijERDLeai4kQA1HZyhBUCAAA= X-CMS-MailID: 20180226125403eucas1p27d32d02417f3cda5b809e62bf894bef8 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180226125403eucas1p27d32d02417f3cda5b809e62bf894bef8 X-RootMTR: 20180226125403eucas1p27d32d02417f3cda5b809e62bf894bef8 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 Handling of special clock operations on power domain on/off sequences has been moved to respective Exynos clock controller drivers, so there is no need to keep the duplicated (and conflicting) code in Exynos power domain driver. Mark clock related properties in Exynos power domain bindings as deprecated. This change has no inpact on backwards-compatibility, as the new drivers properly work with old DTBs (deprecated properties are ignored). Signed-off-by: Marek Szyprowski --- .../devicetree/bindings/power/pd-samsung.txt | 20 +---- drivers/soc/samsung/pm_domains.c | 90 +--------------------- 2 files changed, 5 insertions(+), 105 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/Documentation/devicetree/bindings/power/pd-samsung.txt b/Documentation/devicetree/bindings/power/pd-samsung.txt index 549f7dee9b9d..92ef355e8f64 100644 --- a/Documentation/devicetree/bindings/power/pd-samsung.txt +++ b/Documentation/devicetree/bindings/power/pd-samsung.txt @@ -15,23 +15,13 @@ Required Properties: Optional Properties: - label: Human readable string with domain name. Will be visible in userspace to let user to distinguish between multiple domains in SoC. -- clocks: List of clock handles. The parent clocks of the input clocks to the - devices in this power domain are set to oscclk before power gating - and restored back after powering on a domain. This is required for - all domains which are powered on and off and not required for unused - domains. -- clock-names: The following clocks can be specified: - - oscclk: Oscillator clock. - - clkN: Input clocks to the devices in this power domain. These clocks - will be reparented to oscclk before switching power domain off. - Their original parent will be brought back after turning on - the domain. Maximum of 4 clocks (N = 0 to 3) are supported. - - asbN: Clocks required by asynchronous bridges (ASB) present in - the power domain. These clock should be enabled during power - domain on/off operations. - power-domains: phandle pointing to the parent power domain, for more details see Documentation/devicetree/bindings/power/power_domain.txt +Deprecated Properties: +- clocks +- clock-names + Node of a device using power domains must have a power-domains property defined with a phandle to respective power domain. @@ -47,8 +37,6 @@ Example: mfc_pd: power-domain@10044060 { compatible = "samsung,exynos4210-pd"; reg = <0x10044060 0x20>; - clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_USER_ACLK333>; - clock-names = "oscclk", "clk0"; #power-domain-cells = <0>; label = "MFC"; }; diff --git a/drivers/soc/samsung/pm_domains.c b/drivers/soc/samsung/pm_domains.c index caf45cf7aa8e..ab8582971bfc 100644 --- a/drivers/soc/samsung/pm_domains.c +++ b/drivers/soc/samsung/pm_domains.c @@ -13,14 +13,11 @@ #include #include #include -#include #include #include #include #include -#define MAX_CLK_PER_DOMAIN 4 - struct exynos_pm_domain_config { /* Value for LOCAL_PWR_CFG and STATUS fields for each domain */ u32 local_pwr_cfg; @@ -33,10 +30,6 @@ struct exynos_pm_domain { void __iomem *base; bool is_off; struct generic_pm_domain pd; - struct clk *oscclk; - struct clk *clk[MAX_CLK_PER_DOMAIN]; - struct clk *pclk[MAX_CLK_PER_DOMAIN]; - struct clk *asb_clk[MAX_CLK_PER_DOMAIN]; u32 local_pwr_cfg; }; @@ -46,29 +39,10 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) void __iomem *base; u32 timeout, pwr; char *op; - int i; pd = container_of(domain, struct exynos_pm_domain, pd); base = pd->base; - for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { - if (IS_ERR(pd->asb_clk[i])) - break; - clk_prepare_enable(pd->asb_clk[i]); - } - - /* Set oscclk before powering off a domain*/ - if (!power_on) { - for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { - if (IS_ERR(pd->clk[i])) - break; - pd->pclk[i] = clk_get_parent(pd->clk[i]); - if (clk_set_parent(pd->clk[i], pd->oscclk)) - pr_err("%s: error setting oscclk as parent to clock %d\n", - domain->name, i); - } - } - pwr = power_on ? pd->local_pwr_cfg : 0; writel_relaxed(pwr, base); @@ -86,26 +60,6 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) usleep_range(80, 100); } - /* Restore clocks after powering on a domain*/ - if (power_on) { - for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { - if (IS_ERR(pd->clk[i])) - break; - - if (IS_ERR(pd->pclk[i])) - continue; /* Skip on first power up */ - if (clk_set_parent(pd->clk[i], pd->pclk[i])) - pr_err("%s: error setting parent to clock%d\n", - domain->name, i); - } - } - - for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { - if (IS_ERR(pd->asb_clk[i])) - break; - clk_disable_unprepare(pd->asb_clk[i]); - } - return 0; } @@ -147,12 +101,6 @@ static __init const char *exynos_get_domain_name(struct device_node *node) return kstrdup_const(name, GFP_KERNEL); } -static const char *soc_force_no_clk[] = { - "samsung,exynos5250-clock", - "samsung,exynos5420-clock", - "samsung,exynos5800-clock", -}; - static __init int exynos4_pm_init_power_domain(void) { struct device_node *np; @@ -161,7 +109,7 @@ static __init int exynos4_pm_init_power_domain(void) for_each_matching_node_and_match(np, exynos_pm_domain_of_match, &match) { const struct exynos_pm_domain_config *pm_domain_cfg; struct exynos_pm_domain *pd; - int on, i; + int on; pm_domain_cfg = match->data; @@ -189,42 +137,6 @@ static __init int exynos4_pm_init_power_domain(void) pd->pd.power_on = exynos_pd_power_on; pd->local_pwr_cfg = pm_domain_cfg->local_pwr_cfg; - for (i = 0; i < ARRAY_SIZE(soc_force_no_clk); i++) - if (of_find_compatible_node(NULL, NULL, - soc_force_no_clk[i])) - goto no_clk; - - for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { - char clk_name[8]; - - snprintf(clk_name, sizeof(clk_name), "asb%d", i); - pd->asb_clk[i] = of_clk_get_by_name(np, clk_name); - if (IS_ERR(pd->asb_clk[i])) - break; - } - - pd->oscclk = of_clk_get_by_name(np, "oscclk"); - if (IS_ERR(pd->oscclk)) - goto no_clk; - - for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { - char clk_name[8]; - - snprintf(clk_name, sizeof(clk_name), "clk%d", i); - pd->clk[i] = of_clk_get_by_name(np, clk_name); - if (IS_ERR(pd->clk[i])) - break; - /* - * Skip setting parent on first power up. - * The parent at this time may not be useful at all. - */ - pd->pclk[i] = ERR_PTR(-EINVAL); - } - - if (IS_ERR(pd->clk[0])) - clk_put(pd->oscclk); - -no_clk: on = readl_relaxed(pd->base + 0x4) & pd->local_pwr_cfg; pm_genpd_init(&pd->pd, NULL, !on); From patchwork Mon Feb 26 12:53:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 129647 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp167215lja; Mon, 26 Feb 2018 04:54:16 -0800 (PST) X-Google-Smtp-Source: AH8x224WhXkbVuiaz0JcQY8HiCYrsM4tUJw/jgQ5mVqqXcTKaJi5ll099uQ/k2hqCc+WO4gWVAbK X-Received: by 10.167.130.12 with SMTP id k12mr10528253pfi.73.1519649655937; Mon, 26 Feb 2018 04:54:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519649655; cv=none; d=google.com; s=arc-20160816; b=nn0bhd/HlUQk5J4ZwxSiHSEBnAk3N7s9YWZ0T4CqQLkSJNMkaeoKPiAfyMAkkesB5i bxVx5kTdzct8C4LHS1GDB56VsWSMT+3T1DCEKR1SJ7rCWLuLETgCnKlVOsMtl6Mr2NuT KVVooqJel8+SLXpjgUDtFZj/AKphcvlcOBq433Ueu42EcvQQT0/cY6JySyUqmE9DC6p7 i0J26/1DwIeMWIRcsi3hGdbzgbQIE+CnNk0aB2Z9tX+/cU+dDBJt15ZCoevyfAXR55Vx Z5CothMkWn4oweAu7fHVIj790vqhuziG3fj6LvMrqcUJXu648A6gZl7ifR8mNPcAjn/D sirg== 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=nr/J46LSMqIO8iIkbDxoOrE8SJTYR7m1iTlY9p/8hps=; b=CM+S4GmTwRvRtpQGoQcaKNwrP+cyHfPflmI6AXTjFJr7J97JhIy9yGbKIs7NyaFy5i jqQGi1djwAK6awDHeD/bccQ6GnC/i7uNI3ctTG9OA9H3Y8QXYVDPNK5BkkA007P6QNRK OQg8czxTWILvU2Pdj8G29XtNSo7eTz2/9cq9cgWhqpKmwpj+V5gt3fyagfymInrOOd3j dxjxBrB9qMgOgjLQV7LUAe8sABjEbscIqk4PcHiAK11p+ekVzeHyjeSqZSGvuU12T4zR YdG+YjJZY1Y2jpKP/FS4Je2QARHn9yacOkbLvQDALlyAAU6PbKpioaASQ6Mu4sVyoGJe hvEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=Y1xt29NR; 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.15; Mon, 26 Feb 2018 04:54:15 -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=Y1xt29NR; 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 S1752715AbeBZMyP (ORCPT + 3 others); Mon, 26 Feb 2018 07:54:15 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:41081 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752538AbeBZMyI (ORCPT ); Mon, 26 Feb 2018 07:54:08 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180226125406euoutp0241fee4e7aec9ce5b6b8d73413b2c5c6e~W4U1OeE501809018090euoutp02U; Mon, 26 Feb 2018 12:54:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180226125406euoutp0241fee4e7aec9ce5b6b8d73413b2c5c6e~W4U1OeE501809018090euoutp02U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1519649646; bh=Qa5dnUS4EJ7Cdw4qe3R9+FX6yEnLa4gSb24QfYlZEwU=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=Y1xt29NRq5oSaUCDL0Tjg+zvptjB0WjtcdE2yk3LIUAltNVvf3guXI0Hgee1T0SNG lnVTm7Ws4PL/2JX2MjwcXUC85Vr3aIYRfVzOupfnPBiUfZJu/dBymbmZZba/MxFl9v Nkc4ks18+yYbLyNjjFcV05OGdEbDTJ71cUsDNVfk= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180226125405eucas1p1a065a27b88da9b19242066475817eac4~W4U0Om_Pr0324403244eucas1p1L; Mon, 26 Feb 2018 12:54:05 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 27.78.10409.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 20180226125404eucas1p235469ad425d99e51cfa4163124f66b26~W4UzA2rzn1716617166eucas1p2U; Mon, 26 Feb 2018 12:54:04 +0000 (GMT) X-AuditID: cbfec7f5-f95739c0000028a9-e2-5a94036cc8eb Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 92.0D.04183.C63049A5; Mon, 26 Feb 2018 12:54:04 +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:04 +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 6/6] ARM: dts: exynos: Remove obsolete clock properties from power domains Date: Mon, 26 Feb 2018 13:53:55 +0100 Message-id: <20180226125355.9052-7-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+NgFtrAIsWRmVeSWpSXmKPExsWy7djPc7o5zFOiDN6dM7TYOGM9q8X1L89Z LSbdn8Bicf78BnaLjz33WC1mnN/HZLH2yF12i8Nv2lkdODw2repk8+jbsorR4/MmuQDmKC6b lNSczLLUIn27BK6MWZeesRSsFqo4vuMRUwPjE74uRk4OCQETiSePPrF1MXJxCAmsYJTo/97C COF8ZpTY8H8XG0zV7fuTWSESyxgleqZvgnIamCRaWg+wglSxCRhKdL3tAusQEXCQ+PzpNdgo ZoE2JomzB/YzgSSEBeIl1q3aBdTAwcEioCrxrc0LJMwrYCNxemsfM8Q2eYnF33eCzeEUsJXo vDUN7D4JgUY2iWsnzkMVuUgsn34T6jxhiVfHt7BD2DISlyd3s0A09DNK/Pv/kgnCmcEosf5j K1SVtcTh4xfBzmYW4JOYtG06M8hFEgK8Eh1tQhCmh8SU/74QpqPE5hdaEA9PYJT4s2Ye0wRG qQWMDKsYxVNLi3PTU4uN81LL9YoTc4tL89L1kvNzNzEC4/H0v+NfdzDu+5N0iFGAg1GJh/fH nclRQqyJZcWVuYcYJTiYlUR4Vy4GCvGmJFZWpRblxxeV5qQWH2KU5mBREueN06iLEhJITyxJ zU5NLUgtgskycXBKNTC6ypUyPtiZ4231Z9n8aT/v7bpRzfOUZXGq5NWugDZXsay2BrXtNhrz SiXs8/j5D707M7PyZdK0kKn7Nk/dEtDSq/z/9co9b9wl7RYf3P98k9TV7CMe4qs2s/DK35jf bvqW5wLTrEffP6rrnN/XE3xpOdcOQd0I/aOfDx17/eLJ4hwFDZN9qQ8/K7EUZyQaajEXFScC AGCYC8HDAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkluLIzCtJLcpLzFFi42I5/e/4Vd0c5ilRBttPMVlsnLGe1eL6l+es FpPuT2CxOH9+A7vFx557rBYzzu9jslh75C67xeE37awOHB6bVnWyefRtWcXo8XmTXABzFJdN SmpOZllqkb5dAlfGrEvPWApWC1Uc3/GIqYHxCV8XIyeHhICJxO37k1m7GLk4hASWMErs72xk B0kICTQxSWyfIQpiswkYSnS97WIDsUUEHCQ+f3rNCNLALNDBJLFn70OwhLBAvMTNtl9MXYwc HCwCqhLf2rxAwrwCNhKnt/YxQyyTl1j8fSdYOaeArUTnrWlsELtsJLb/28I0gZFnASPDKkaR 1NLi3PTcYiO94sTc4tK8dL3k/NxNjMCA2Xbs55YdjF3vgg8xCnAwKvHwLvg5KUqINbGsuDL3 EKMEB7OSCO/KxZOjhHhTEiurUovy44tKc1KLDzFKc7AoifOeN6iMEhJITyxJzU5NLUgtgsky cXBKNTB2d/5XWupRuEhYS8jyw4fqr59ZrcJD9e7rXZ+2nm/ZiSN2C04mxm/m8V4vPUfqwIJX bV6dtWYfH+iz3t/wbHpR2fPs34EViR+mTXq2dtPtJbN/7/+dUx87029jZGq+7zFdjePOeZOP 2a85cfkT2/boo6L2WxPXVerFJD3d4OQRE8VnWLKKX7dViaU4I9FQi7moOBEAOW8iJBQCAAA= X-CMS-MailID: 20180226125404eucas1p235469ad425d99e51cfa4163124f66b26 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180226125404eucas1p235469ad425d99e51cfa4163124f66b26 X-RootMTR: 20180226125404eucas1p235469ad425d99e51cfa4163124f66b26 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 Handling of special clock operations on power domain on/off sequences has been moved to respective Exynos clock controller drivers and clock properties have been marked as deprecated. Remove all clock properties from existing Exynos power domain nodes, as they are no longer used. Signed-off-by: Marek Szyprowski --- arch/arm/boot/dts/exynos5250.dtsi | 4 ---- arch/arm/boot/dts/exynos5420.dtsi | 14 -------------- 2 files changed, 18 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/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi index 56626d1a4235..38f216f9f5ad 100644 --- a/arch/arm/boot/dts/exynos5250.dtsi +++ b/arch/arm/boot/dts/exynos5250.dtsi @@ -134,10 +134,6 @@ reg = <0x100440A0 0x20>; #power-domain-cells = <0>; label = "DISP1"; - clocks = <&clock CLK_FIN_PLL>, - <&clock CLK_MOUT_ACLK200_DISP1_SUB>, - <&clock CLK_MOUT_ACLK300_DISP1_SUB>; - clock-names = "oscclk", "clk0", "clk1"; }; pd_mau: power-domain@100440c0 { diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi index 2f3cb2a97f71..9672d0e51f69 100644 --- a/arch/arm/boot/dts/exynos5420.dtsi +++ b/arch/arm/boot/dts/exynos5420.dtsi @@ -276,10 +276,6 @@ reg = <0x10044000 0x20>; #power-domain-cells = <0>; label = "GSC"; - clocks = <&clock CLK_FIN_PLL>, - <&clock CLK_MOUT_USER_ACLK300_GSCL>, - <&clock CLK_GSCL0>, <&clock CLK_GSCL1>; - clock-names = "oscclk", "clk0", "asb0", "asb1"; }; isp_pd: power-domain@10044020 { @@ -292,10 +288,6 @@ mfc_pd: power-domain@10044060 { compatible = "samsung,exynos4210-pd"; reg = <0x10044060 0x20>; - clocks = <&clock CLK_FIN_PLL>, - <&clock CLK_MOUT_USER_ACLK333>, - <&clock CLK_ACLK333>; - clock-names = "oscclk", "clk0","asb0"; #power-domain-cells = <0>; label = "MFC"; }; @@ -312,12 +304,6 @@ reg = <0x100440C0 0x20>; #power-domain-cells = <0>; label = "DISP"; - clocks = <&clock CLK_FIN_PLL>, - <&clock CLK_MOUT_USER_ACLK200_DISP1>, - <&clock CLK_MOUT_USER_ACLK300_DISP1>, - <&clock CLK_MOUT_USER_ACLK400_DISP1>, - <&clock CLK_FIMD1>, <&clock CLK_MIXER>; - clock-names = "oscclk", "clk0", "clk1", "clk2", "asb0", "asb1"; }; mau_pd: power-domain@100440e0 {