From patchwork Tue Apr 18 01:17:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 9684789 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 0E28F60375 for ; Tue, 18 Apr 2017 01:18:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 002B3269A3 for ; Tue, 18 Apr 2017 01:18:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E925027CF9; Tue, 18 Apr 2017 01:18:26 +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 797D0269A3 for ; Tue, 18 Apr 2017 01:18:26 +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=PMdvcGcL6zA6XvfTNz0Nw5JqBnys59iG1pWj7M01tV4=; b=iCq fS5dODvCHkvC950pW2eGSmfz4+gZDemUnaA3JwE9nQ9XSAAAs6E9DEvfyCWivXqUUuWKw0cZ4b8W2 cYai+WBj31mZDxU1s3KVnULGaW+4HhHUif/fNEN6KjVgCwd508edCr0O7NGZmuHUrWLz5CB1enO8c fufRR6GaCyLyAav2XO4QniD9sTZvX64pPQ24S4Bsu2yp1BRNM15L1mnjf9lF7j9SFvbj0vjEfQpFg oejxCsZj7P2uXqeE22KS+rDiWxcnqUzOmRky21fp6v+GC0zRZtdHWqUvyMb0tZGUkUxzrbLdJrPPS jCRinhEuHm4yFh+IHfqr0f5Yoh8oR/A==; 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 1d0Hmk-0008Ci-2J; Tue, 18 Apr 2017 01:18:26 +0000 Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d0HmT-0007tm-Ut for linux-arm-kernel@lists.infradead.org; Tue, 18 Apr 2017 01:18:13 +0000 Received: by mail-pf0-x22f.google.com with SMTP id i5so72956023pfc.2 for ; Mon, 17 Apr 2017 18:17:49 -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=ojB6MCXNye04oE1iW905ReAszJG/hi5aIOSEKLX79vw=; b=FSXXMmw4Jt5Ry7OP6Wvb1DpOJ8R3cjvTELttY1QDUanoiLtQSsoVOlLxRgF8HLXi36 S8PaNNO9mWffVUrNTBN4WV/pbNkp+KUFGArK6jHtXkO4bTYH1W9H1mDwzksLdYUqldS4 Zc2GUlThkjDuAsJXdrgCzuUX+MflsT41s4AZg= 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=ojB6MCXNye04oE1iW905ReAszJG/hi5aIOSEKLX79vw=; b=hfd8AIzx2eD1dy/ap0AihOYtAFuX3kET8IxcWyMmfRBn7f4C6NeH0dJAqBnVTRKB4T yfHDQHEQI++BRjYcIpUOos5O9kwKuB/iVuwTBdcj1KjDPD23oHQpke/+tJGTkXcWcU19 PQ7HEq97WS+wFGEer1e0VyQ/gME10m3GW+ozUhPvBwJcJDwhglG8qTSY12Xx6wbRF3UY pin6gyG69gidNYGify/EWmyfV0TKDVLIPBtKQGa+fss2QGuUIyj/zssjGc90wvz9UMl3 NnEg1UVuUtGFVhgflJjJWYMvEz3sDrGUJ0RFtyWwaU2rGN/efMrbSkzqfSNaT7pmNxFd jy5g== X-Gm-Message-State: AN3rC/7fEgUYw7Y/Xi9cLfq9A++Qkx3sQSZRfvtR88EvMaqahrG4H6I7 dj9fz6qG32QSuYaE X-Received: by 10.84.232.197 with SMTP id x5mr19241542plm.85.1492478268686; Mon, 17 Apr 2017 18:17:48 -0700 (PDT) Received: from localhost.localdomain ([104.237.91.92]) by smtp.gmail.com with ESMTPSA id t5sm20163049pgb.58.2017.04.17.18.17.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Apr 2017 18:17:47 -0700 (PDT) From: Zhangfei Gao To: Stephen Boyd , Rob Herring , guodong Xu , xuwei5@hisilicon.com Subject: [PATCH 1/2] clk: hi6220: add acpu clock Date: Tue, 18 Apr 2017 09:17:21 +0800 Message-Id: <1492478242-16146-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-20170417_181810_025773_5A70B039 X-CRM114-Status: GOOD ( 12.73 ) 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 --- .../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