From patchwork Fri Feb 2 14:03:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel FERNANDEZ X-Patchwork-Id: 10196723 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 998546037D for ; Fri, 2 Feb 2018 14:04:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8722928BFE for ; Fri, 2 Feb 2018 14:04:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7BF0928E65; Fri, 2 Feb 2018 14:04:54 +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 0B61228E67 for ; Fri, 2 Feb 2018 14:04:53 +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=CDetTiUxW2EdZ6f1Pf2iPJeyjoeC+Sgf65vfGjIssCk=; b=FjA5qcipQFB13h QBYZHwLCiY7sva4pEaSqeCPxvccdloO92KHg7EquVwXwkAUJKlYrb9LqOSpOTMxt0OfqRkucai2hp R1G9ADcGTSGOqKy25ReZ7yFLjdN0YMEXIOgD/aZfL+bvl1v+UrANHPSAp82LFo9DZBB+lVi4YaKm4 3scpizsfE7vPE7OZLVXAMmgyoO2R5zTOTY4ex5LUKYyUIkAimUx5LUxVZb+ozA7DpAhWUeersBMi0 NCLHOEgUbSAtaVfJ0xgwT5HKK0V3LNuL4zaHdoP9+cv4d+r75rrEetdNgB1i3BbHlfsVJjzb8kE7n kASXANDR91FgqpUWoFLw==; 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 1ehbxR-0004ND-A5; Fri, 02 Feb 2018 14:04:49 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ehbxI-0004DB-SC for linux-arm-kernel@bombadil.infradead.org; Fri, 02 Feb 2018 14:04:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=0ThZcE3+grl3LOaYi/u2RSNulS2ZjfnQ5KzOhfCX8T8=; b=PV69W8e3jZckkT1BL6aamOgwR DIMOn3Qkp3ISlyXfswd+LO9AT23HP9DaR2sczvIy0AEqFAwd/1RlxdU8ykZrXAg4h53QfqtT5Q9mq /Li+C9KYTVb8Z/EWv4mmiofXrW3sWCU9kT5Ont8pBO/ACMOo2PGlpiQhhrL1CNKoCJfZZkyFkKFRU 9+xu9CjsoV5+Bg9S/elVAS2m2YyiVb9ejhEI99RbBYW3/KZAGM9PLauZUkfCdjRT93PTknJ3pQQCW iDohJ9stojREoHwWOWDPBNM0RY3Lu251O/+HTHNJTSguSNkwtJFuOQNkfax3SC2M91qioOAxlz2Zz QmtWaZiYg==; Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by merlin.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ehbxE-0002Y1-9Y for linux-arm-kernel@lists.infradead.org; Fri, 02 Feb 2018 14:04:38 +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 w12DxVqn004731; Fri, 2 Feb 2018 15:04:21 +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 2fvr4u0fs9-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 02 Feb 2018 15:04:21 +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 7D71F31; Fri, 2 Feb 2018 14:04:20 +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 5AA925228; Fri, 2 Feb 2018 14:04:20 +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:19 +0100 From: To: Rob Herring , Mark Rutland , Lee Jones , Maxime Coquelin , Alexandre Torgue , Michael Turquette , Stephen Boyd , Gabriel Fernandez Subject: [PATCH 14/14] clk: stm32mp1: add Debug clocks Date: Fri, 2 Feb 2018 15:03:42 +0100 Message-ID: <1517580222-23301-15-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: SFHDAG8NODE3.st.com (10.75.127.24) 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-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 RCC manages clock for debug and trace. 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 0402a0e..eafc95a 100644 --- a/drivers/clk/clk-stm32mp1.c +++ b/drivers/clk/clk-stm32mp1.c @@ -352,6 +352,12 @@ { 0 }, }; +static const struct clk_div_table ck_trace_div_table[] = { + { 0, 1 }, { 1, 2 }, { 2, 4 }, { 3, 8 }, + { 4, 16 }, { 5, 16 }, { 6, 16 }, { 7, 16 }, + { 0 }, +}; + struct clock_config { u32 id; const char *name; @@ -1566,6 +1572,17 @@ static struct clk_hw *_clk_register_cktim(struct device *dev, _GATEMUXDIV(RCC_MCO2CFGR, 12, RCC_MCO2CFGR, 0, 3, RCC_MCO2CFGR, 4, 4)), + + /* Debug clocks */ + FIXED_FACTOR(NO_ID, "ck_axi_div2", "ck_axi", 0, 1, 2), + + GATE(DBG, "ck_apb_dbg", "ck_axi_div2", 0, RCC_DBGCFGR, 8, 0), + + GATE(CK_DBG, "ck_sys_dbg", "ck_axi", 0, RCC_DBGCFGR, 8, 0), + + COMPOSITE(CK_TRACE, "ck_trace", ck_trace_src, CLK_OPS_PARENT_ENABLE, + _GATEDIV(RCC_DBGCFGR, 9, + RCC_DBGCFGR, 0, 3, ck_trace_div_table)), }; struct stm32_clock_match_data {