From patchwork Wed Oct 11 09:25:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 115528 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp531616qgn; Wed, 11 Oct 2017 02:25:32 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBkT3Rr5n99O+BY2GaeEkcPfbDaIOZvJjTssR8t/oOX+zl8Sv13kKJ2ex1QzXCEOy/eDYMv X-Received: by 10.98.26.203 with SMTP id a194mr13207564pfa.113.1507713932572; Wed, 11 Oct 2017 02:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507713932; cv=none; d=google.com; s=arc-20160816; b=T1Y3P1DQ2h/2TqpLb5bYXZGugdrlYHIUEivt83HBGNygnVFLjYjlR+xUEYu/hH/7sS PT2DDxhOFiFwp8UhLfFwgltvvtqWQyZqMmjrPpvT/hzKgVrnCzH5mc2bIUFngbY+41Uq L7Ey1NUIvlHJAtHIGS/f1oFjNY3xbD3CkVTa5VnNuq4Q76l/6J4PqjvpQTqR52Oevd4E oICZ6QNA8H4O+vlgLR8/plO6pq+9DU8Lv/qi5sf44a50CMVT2HjlW76MmvAwEXlb8ez9 6YP/bwwMMx5i5X1LKqzF4P6o2VrM2NTfDf3aj3JfocQTfej2m0DGfOs7isPubguXuBXb P1iQ== 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:arc-authentication-results; bh=NTEQd0vNDT1FgAMkd2b0bLTtn/hLE2xWHZGsKoCoxa0=; b=xRbruUE2MzfWcvZqjGsj4Tl+UEUI7RJXpQE/WQvNI+KLarryXy791r3tX5h7heiMeZ M7Q+Ki64Q/dVXgAI195oxwtWdbcAbr3QGRzwB3yxrnsyQj0y2Wrwv2vAMms2khRBBHl7 +1fSMfIF5n77FShTaozQiOHUv0trDbtvjsA8tyfGAWGX+mMQPv8UqXLqOVM9nQ+yF1gs fKaeU5rgOfNlMciZXbZIVb5W+NQuoBc38VTv14kUa11qSZczQgjdG3MQRoEU7Cck+9DL xJetkcyiDiwCUbMuef+Yds3DNND5f2zeNkF5KmARbaMuy/HyP6luAfFRCW2tIlNZsSTt fTtw== ARC-Authentication-Results: i=1; mx.google.com; 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 u18si6011954pfk.328.2017.10.11.02.25.32; Wed, 11 Oct 2017 02:25:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; 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 S1753376AbdJKJZb (ORCPT + 4 others); Wed, 11 Oct 2017 05:25:31 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:47576 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753140AbdJKJZZ (ORCPT ); Wed, 11 Oct 2017 05:25:25 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20171011092522euoutp01d19bfff5557989ec44185fa04d1d1efd~sedLwn4Od2585025850euoutp01t; Wed, 11 Oct 2017 09:25:22 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20171011092521eucas1p27c821eabd831fe1ef4ffc257a2b200dc~sedLHhhVN0206602066eucas1p2P; Wed, 11 Oct 2017 09:25:21 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3.samsung.com (EUCPMTA) with SMTP id AA.B3.12867.183EDD95; Wed, 11 Oct 2017 10:25:21 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20171011092520eucas1p2a86dcd52a7c0c4b329563e5eaad3fd76~sedKhrCGw2124821248eucas1p2i; Wed, 11 Oct 2017 09:25:20 +0000 (GMT) X-AuditID: cbfec7f2-f793b6d000003243-ee-59dde3815437 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id CD.FD.20118.083EDD95; Wed, 11 Oct 2017 10:25:20 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OXN00BGOJI4PG80@eusync4.samsung.com>; Wed, 11 Oct 2017 10:25:20 +0100 (BST) 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 v3 1/5] clk: samsung: Instantiate Exynos4412 ISP clocks only when available Date: Wed, 11 Oct 2017 11:25:11 +0200 Message-id: <20171011092515.1698-2-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.14.2 In-reply-to: <20171011092515.1698-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBIsWRmVeSWpSXmKPExsWy7djP87qNj+9GGuzs4rHYOGM9q8X1L89Z LSbdn8Bicf78BnaLjz33WC1mnN/HZLH2yF12i8Nv2lk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SKgKnFsUgM7iM0rYCNx//Yrdoh18hLvF9xnBLE5BWwlXr1oA6sXAqp5vm0b2wRG3gWM DKsYRVJLi3PTc4uN9IoTc4tL89L1kvNzNzECg2nbsZ9bdjB2vQs+xCjAwajEwytw/U6kEGti WXFl7iFGCQ5mJRHeczfuRgrxpiRWVqUW5ccXleakFh9ilOZgURLn7d2zOlJIID2xJDU7NbUg tQgmy8TBKdXAOHnaWYdKK+fZ/hFmVYInrs6y/7pkQVBsfJHNtybNpBVym8y2fnqZXaZsd9N1 /qkNgjvabN5/fdzwZsXZ/zbt81nurthxlUk68dUqlbB8iTt5dambOpuyp8jzKu6/cFTjwC7+ KadXzHi+fGe0j4NUwmOPj9fqufiX/epib81ibQnmSDmoPUPmjRJLcUaioRZzUXEiACttcXci AgAA X-CMS-MailID: 20171011092520eucas1p2a86dcd52a7c0c4b329563e5eaad3fd76 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-CMS-RootMailID: 20171011092520eucas1p2a86dcd52a7c0c4b329563e5eaad3fd76 X-RootMTR: 20171011092520eucas1p2a86dcd52a7c0c4b329563e5eaad3fd76 References: <20171011092515.1698-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 Some registers for the Exynos 4412 ISP (Camera subsystem) clocks are located in the ISP power domain. Istatiate those clocks only when provided clock registers resource covers those registers. This is a preparation for adding a separate clock driver for ISP clocks, which will be intergated with power domain using runtime PM feature. Signed-off-by: Marek Szyprowski Acked-by: Krzysztof Kozlowski --- drivers/clk/samsung/clk-exynos4.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) -- 2.14.2 -- 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/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c index e40b77583c47..bdd68247e054 100644 --- a/drivers/clk/samsung/clk-exynos4.c +++ b/drivers/clk/samsung/clk-exynos4.c @@ -822,6 +822,12 @@ static const struct samsung_div_clock exynos4x12_div_clks[] __initconst = { DIV(0, "div_spi1_isp", "mout_spi1_isp", E4X12_DIV_ISP, 16, 4), DIV(0, "div_spi1_isp_pre", "div_spi1_isp", E4X12_DIV_ISP, 20, 8), DIV(0, "div_uart_isp", "mout_uart_isp", E4X12_DIV_ISP, 28, 4), + DIV(CLK_SCLK_FIMG2D, "sclk_fimg2d", "mout_g2d", DIV_DMC1, 0, 4), + DIV(CLK_DIV_C2C, "div_c2c", "mout_c2c", DIV_DMC1, 4, 3), + DIV(0, "div_c2c_aclk", "div_c2c", DIV_DMC1, 12, 3), +}; + +static struct samsung_div_clock exynos4x12_isp_div_clks[] = { DIV_F(CLK_DIV_ISP0, "div_isp0", "aclk200", E4X12_DIV_ISP0, 0, 3, CLK_GET_RATE_NOCACHE, 0), DIV_F(CLK_DIV_ISP1, "div_isp1", "aclk200", E4X12_DIV_ISP0, 4, 3, @@ -831,9 +837,6 @@ static const struct samsung_div_clock exynos4x12_div_clks[] __initconst = { 4, 3, CLK_GET_RATE_NOCACHE, 0), DIV_F(CLK_DIV_MCUISP1, "div_mcuisp1", "div_mcuisp0", E4X12_DIV_ISP1, 8, 3, CLK_GET_RATE_NOCACHE, 0), - DIV(CLK_SCLK_FIMG2D, "sclk_fimg2d", "mout_g2d", DIV_DMC1, 0, 4), - DIV(CLK_DIV_C2C, "div_c2c", "mout_c2c", DIV_DMC1, 4, 3), - DIV(0, "div_c2c_aclk", "div_c2c", DIV_DMC1, 12, 3), }; /* list of gate clocks supported in all exynos4 soc's */ @@ -1132,6 +1135,13 @@ static const struct samsung_gate_clock exynos4x12_gate_clks[] __initconst = { 0, 0), GATE(CLK_I2S0, "i2s0", "aclk100", E4X12_GATE_IP_MAUDIO, 3, 0, 0), + GATE(CLK_G2D, "g2d", "aclk200", GATE_IP_DMC, 23, 0, 0), + GATE(CLK_SMMU_G2D, "smmu_g2d", "aclk200", GATE_IP_DMC, 24, 0, 0), + GATE(CLK_TMU_APBIF, "tmu_apbif", "aclk100", E4X12_GATE_IP_PERIR, 17, 0, + 0), +}; + +static struct samsung_gate_clock exynos4x12_isp_gate_clks[] = { GATE(CLK_FIMC_ISP, "isp", "aclk200", E4X12_GATE_ISP0, 0, CLK_IGNORE_UNUSED | CLK_GET_RATE_NOCACHE, 0), GATE(CLK_FIMC_DRC, "drc", "aclk200", E4X12_GATE_ISP0, 1, @@ -1184,10 +1194,6 @@ static const struct samsung_gate_clock exynos4x12_gate_clks[] __initconst = { CLK_IGNORE_UNUSED | CLK_GET_RATE_NOCACHE, 0), GATE(CLK_SPI1_ISP, "spi1_isp", "aclk200", E4X12_GATE_ISP1, 13, CLK_IGNORE_UNUSED | CLK_GET_RATE_NOCACHE, 0), - GATE(CLK_G2D, "g2d", "aclk200", GATE_IP_DMC, 23, 0, 0), - GATE(CLK_SMMU_G2D, "smmu_g2d", "aclk200", GATE_IP_DMC, 24, 0, 0), - GATE(CLK_TMU_APBIF, "tmu_apbif", "aclk100", E4X12_GATE_IP_PERIR, 17, 0, - 0), }; static const struct samsung_clock_alias exynos4_aliases[] __initconst = { @@ -1522,6 +1528,8 @@ static void __init exynos4_clk_init(struct device_node *np, e4210_armclk_d, ARRAY_SIZE(e4210_armclk_d), CLK_CPU_NEEDS_DEBUG_ALT_DIV | CLK_CPU_HAS_DIV1); } else { + struct resource res; + samsung_clk_register_mux(ctx, exynos4x12_mux_clks, ARRAY_SIZE(exynos4x12_mux_clks)); samsung_clk_register_div(ctx, exynos4x12_div_clks, @@ -1533,6 +1541,15 @@ static void __init exynos4_clk_init(struct device_node *np, samsung_clk_register_fixed_factor(ctx, exynos4x12_fixed_factor_clks, ARRAY_SIZE(exynos4x12_fixed_factor_clks)); + + of_address_to_resource(np, 0, &res); + if (resource_size(&res) > 0x18000) { + samsung_clk_register_div(ctx, exynos4x12_isp_div_clks, + ARRAY_SIZE(exynos4x12_isp_div_clks)); + samsung_clk_register_gate(ctx, exynos4x12_isp_gate_clks, + ARRAY_SIZE(exynos4x12_isp_gate_clks)); + } + if (of_machine_is_compatible("samsung,exynos4412")) { exynos_register_cpu_clock(ctx, CLK_ARM_CLK, "armclk", mout_core_p4x12[0], mout_core_p4x12[1], 0x14200,