From patchwork Fri Feb 2 14:03:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel FERNANDEZ X-Patchwork-Id: 10196897 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 5CC4460362 for ; Fri, 2 Feb 2018 14:21:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B13D28E66 for ; Fri, 2 Feb 2018 14:21:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FD0D28E73; Fri, 2 Feb 2018 14:21:51 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED 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 D032528E66 for ; Fri, 2 Feb 2018 14:21:50 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=+uua8sK/Az0ZNmxRDvBKEf9bGs+R7zBdTD9DteeIsx4=; b=m/a4ANw129gisJ +5crll/D2Yz3S5WEzQlLa5hAZs/1BfSMFsLQBSKmd1tomP+tQ0QrEwD7pPWzPAVz8R29xIEke3Ey0 uSDYPvIeIjzslr4yeHCUCGiRzwwwQ+x04HNvqXbWgCXDqXyfsv9nWtvw+yOpitDlIsAgB5byZ/gO+ rL4EpWO2dx2GfHEHw1IntOsDgZ6HynaYPTca0Q8PbcOFgVW9O/XyHzEWz6mc7BVeOAseWBY5WaeyI vPXhP/EPDJOixwboNqOpdcXMKEqCTkd3k55RIbtg49ypBfbbJwy91mfIR6YeJRKKZKCBHovDswG5k iraXcH6MBdDezKcRompA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ehcDs-0006Xf-4v; Fri, 02 Feb 2018 14:21:48 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ehcCm-0005Gb-1Z for linux-arm-kernel@bombadil.infradead.org; Fri, 02 Feb 2018 14:20:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MZKuahMDuCS2MPREwBL9sy12VHxJDltCrMNtwdJlkWI=; b=eyNzkSLJH2zTzxqlU8LZ2TA7W WepiBRpmywAstmz1k4oDmLj9s8KczBDkFSrfoFBeELjlp7hsaWsuFbRlG1K2JcwTUubyNMWvaQteb pln1mMA5/K5zcJdvnIWgql1Zz9GX/r8BxdlEw3nzHdH0qaGApSa+sNZQME2utRWfE22S4dwsb2MCP FfppBw4MXKxiNTeLAdw/IBgnJDtVt6ltj3ZPRUUAd90n8rI0tgVRjpeoxA9yrE8xsQ8MxeobT1Gfp 6rzQE6lTuM3pEhvFTFG6k+HHGjn1e6SC5MynFha4sc8ETSkAWXKmuqXfLN66AoIIdeUqrKPrnKqi9 MYKE66hUA==; Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ehbxB-0000Zs-53 for linux-arm-kernel@lists.infradead.org; Fri, 02 Feb 2018 14:04:42 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w12DxVqm004731; Fri, 2 Feb 2018 15:04:19 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2fvr4u0fs3-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 02 Feb 2018 15:04:19 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DDEFF31; Fri, 2 Feb 2018 14:04:18 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag4node2.st.com [10.75.127.11]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id BF1725228; Fri, 2 Feb 2018 14:04:18 +0000 (GMT) Received: from localhost (10.75.127.51) by SFHDAG4NODE2.st.com (10.75.127.11) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 2 Feb 2018 15:04:18 +0100 From: To: Rob Herring , Mark Rutland , Lee Jones , Maxime Coquelin , Alexandre Torgue , Michael Turquette , Stephen Boyd , Gabriel Fernandez Subject: [PATCH 12/14] clk: stm32mp1: add RTC clock Date: Fri, 2 Feb 2018 15:03:40 +0100 Message-ID: <1517580222-23301-13-git-send-email-gabriel.fernandez@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1517580222-23301-1-git-send-email-gabriel.fernandez@st.com> References: <1517580222-23301-1-git-send-email-gabriel.fernandez@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG5NODE2.st.com (10.75.127.14) To SFHDAG4NODE2.st.com (10.75.127.11) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-02_04:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180202_140433_445565_59DA8853 X-CRM114-Status: GOOD ( 11.26 ) 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, olivier.bideau@st.com, linux-kernel@vger.kernel.org, gabriel.fernandez.st@gmail.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 From: Gabriel Fernandez This patch adds the RTC clock. Signed-off-by: Gabriel Fernandez --- drivers/clk/clk-stm32mp1.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c index 5a1142c..1cb06b0 100644 --- a/drivers/clk/clk-stm32mp1.c +++ b/drivers/clk/clk-stm32mp1.c @@ -1179,6 +1179,15 @@ static struct clk_hw *_clk_register_cktim(struct device *dev, _MUX(_mux_offset, _mux_bit, _mux_width, 0),\ } +#define _GATEMUX(_gate_offset,\ + _bit_idx,\ + _mux_offset, _mux_bit, _mux_width)\ +{\ + _NO_DIV,\ + _GATE(_gate_offset, _bit_idx, 0),\ + _MUX(_mux_offset, _mux_bit, _mux_width, 0),\ +} + #define _MP1_GATE(_gate_offset, _bit_idx, _flags)\ _GATE_OPS(_gate_offset, _bit_idx, _flags, &mp1_gate_clk_ops) @@ -1526,6 +1535,14 @@ static struct clk_hw *_clk_register_cktim(struct device *dev, RCC_APB4ENSETR, 0, 0), MP1_GATE(GPU_K, "gpu_k", "pll2_q", 0, RCC_AHB6ENSETR, 5, 0), + + /* RTC clock */ + DIV(NO_ID, "ck_hse_rtc", "ck_hse", 0, RCC_RTCDIVR, 0, 7, + CLK_DIVIDER_ALLOW_ZERO), + + COMPOSITE(RTC, "ck_rtc", rtc_src, CLK_OPS_PARENT_ENABLE | + CLK_SET_RATE_PARENT, + _GATEMUX(RCC_BDCR, 20, RCC_BDCR, 16, 2)), }; struct stm32_clock_match_data {