From patchwork Wed May 31 01:45:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 9755683 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 68A1D602F0 for ; Wed, 31 May 2017 01:46:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5493227569 for ; Wed, 31 May 2017 01:46:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4871D2847F; Wed, 31 May 2017 01:46:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C4E8227569 for ; Wed, 31 May 2017 01:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=4ATlYvxx+2ANYafoL6I/Ot1X/k7mc6QYmsUsvJH1gDM=; b=eOp 44wDX7jz4chehiMbewyhHqWIBF/a+zsF2FU+CeJFMsXDBQ3nlmTfNBE1nhZuizeJLkKrUh7GKREmy RtiB1sgJeLkJv/CrOYgAwfS+Z3k5izX/mzOtqUF9pgl/sA/dfJwYYHGXkanUZ2OQsUUOCnRRE9LLW QKp3PqGmJuUd99dzsEFbe/GCBD4CXzhjZddsjm1nAQ506d42iRW4l7SMH7OtWTFOF47FBIgjgD8Rs 51TME0s2GJam8toBcpqzbniXvJIUIq7cbAidUWQ2IraqlPDbpii1mM7BeVs9idDFi+Bb1qTpddDor x6df/2TzDtcJXgH5gYbh+t7Js1DpyMA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dFsiW-0001tv-Rz; Wed, 31 May 2017 01:46:32 +0000 Received: from mail-pg0-x22b.google.com ([2607:f8b0:400e:c05::22b]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dFsiT-0001pX-EE for linux-arm-kernel@lists.infradead.org; Wed, 31 May 2017 01:46:31 +0000 Received: by mail-pg0-x22b.google.com with SMTP id u187so394695pgb.0 for ; Tue, 30 May 2017 18:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=h5Uzb1JFq2gAEWFvRbACP69gM6zwd2BxyfvjNAZ9DWY=; b=QPRhVwudZpmLDkQMOBs68tJEJoeGJEqKdBg8cdsuCD4IijrQKGlX+EnDQEvpdEoHeB elg1N00hxEaN3XeR4eifNmyHsKwlIZ9x4UiXYAJKXJLluEc76nNS13u7FJfXzDPDC4td EtK673hPRMW4JF+fiw/JTsbwNWYQbSAJS1QNk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=h5Uzb1JFq2gAEWFvRbACP69gM6zwd2BxyfvjNAZ9DWY=; b=LlCAn5W4WVVNQ4M0CWuhfTww9Ev5f6ZsD/yCbrIrYq9KimJUvJLUPcpWimVnIBO8Fv rsnTcFcJYAle/IKvmqYDYpX8az62moje+PdyheCHL0xuROmCZySiri1X6XhLtY7+HBCm 5aTM5+IBakEXMru6WFDRdosiumR2GM3eLLfoW3i5/XDpbMjZxBdKPJ6P65/x2AGGIOyn EF3O/o2Obx2cYC1L3VtbkAi63bDeCxZQqFHJXQfjxOHAIFVwIe6lpEnGiW0b5mSb4XUH zteRvItqtFYgbpLZbQYy7lmxGz7dToh9QMgpiF2/tEHDN4Lok4uyJjquftjPPA7i4Xr7 f60A== X-Gm-Message-State: AODbwcBpTUgm2j2fwCIpk7C0lc57yjhAGGVyepHS032KP4xSrFNN9/7+ Rm0Ikjjoq5HlY2ut X-Received: by 10.98.13.220 with SMTP id 89mr27056962pfn.112.1496195167377; Tue, 30 May 2017 18:46:07 -0700 (PDT) Received: from localhost.localdomain ([36.5.161.58]) by smtp.gmail.com with ESMTPSA id r90sm24229395pfl.82.2017.05.30.18.46.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 May 2017 18:46:06 -0700 (PDT) From: Zhangfei Gao To: Stephen Boyd , Rob Herring , guodong Xu , xuwei5@hisilicon.com Subject: [Resend PATCH 1/2] clk: hi6220: add acpu clock Date: Wed, 31 May 2017 09:45:38 +0800 Message-Id: <1496195139-16687-1-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170530_184629_520121_FDA1F21F X-CRM114-Status: GOOD ( 12.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Li Pengcheng , linux-arm-kernel@lists.infradead.org, Zhangfei Gao MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add acpu clock, including sft clock controlling hi6220 coresight module Signed-off-by: Zhangfei Gao Signed-off-by: Li Pengcheng Acked-by: Rob Herring --- Verified on clk-next, v.12-rc1 .../devicetree/bindings/clock/hi6220-clock.txt | 1 + drivers/clk/hisilicon/clk-hi6220.c | 23 ++++++++++++++++++++++ include/dt-bindings/clock/hi6220-clock.h | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/Documentation/devicetree/bindings/clock/hi6220-clock.txt b/Documentation/devicetree/bindings/clock/hi6220-clock.txt index e4d5fea..ef3deb7 100644 --- a/Documentation/devicetree/bindings/clock/hi6220-clock.txt +++ b/Documentation/devicetree/bindings/clock/hi6220-clock.txt @@ -11,6 +11,7 @@ Required Properties: - compatible: the compatible should be one of the following strings to indicate the clock controller functionality. + - "hisilicon,hi6220-acpu-sctrl" - "hisilicon,hi6220-aoctrl" - "hisilicon,hi6220-sysctrl" - "hisilicon,hi6220-mediactrl" diff --git a/drivers/clk/hisilicon/clk-hi6220.c b/drivers/clk/hisilicon/clk-hi6220.c index 2ae151c..fc8813f 100644 --- a/drivers/clk/hisilicon/clk-hi6220.c +++ b/drivers/clk/hisilicon/clk-hi6220.c @@ -285,3 +285,26 @@ static void __init hi6220_clk_power_init(struct device_node *np) ARRAY_SIZE(hi6220_div_clks_power), clk_data); } CLK_OF_DECLARE(hi6220_clk_power, "hisilicon,hi6220-pmctrl", hi6220_clk_power_init); + + +/* clocks in acpu */ +static const struct hisi_gate_clock hi6220_acpu_sc_gate_sep_clks[] = { + { HI6220_ACPU_SFT_AT_S, "sft_at_s", "cs_atb", + CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0xc, 11, 0, }, +}; + +static void __init hi6220_clk_acpu_init(struct device_node *np) +{ + struct hisi_clock_data *clk_data; + int nr = ARRAY_SIZE(hi6220_acpu_sc_gate_sep_clks); + + clk_data = hisi_clk_init(np, nr); + if (!clk_data) + return; + + hisi_clk_register_gate_sep(hi6220_acpu_sc_gate_sep_clks, + ARRAY_SIZE(hi6220_acpu_sc_gate_sep_clks), + clk_data); +} + +CLK_OF_DECLARE(hi6220_clk_acpu, "hisilicon,hi6220-acpu-sctrl", hi6220_clk_acpu_init); diff --git a/include/dt-bindings/clock/hi6220-clock.h b/include/dt-bindings/clock/hi6220-clock.h index b8ba665..409cc02 100644 --- a/include/dt-bindings/clock/hi6220-clock.h +++ b/include/dt-bindings/clock/hi6220-clock.h @@ -174,4 +174,8 @@ #define HI6220_DDRC_AXI1 7 #define HI6220_POWER_NR_CLKS 8 + +/* clk in Hi6220 acpu sctrl */ +#define HI6220_ACPU_SFT_AT_S 0 + #endif