Received: by 10.223.176.46 with SMTP id f43csp1031099wra; Sat, 20 Jan 2018 09:20:38 -0800 (PST) X-Google-Smtp-Source: AH8x227H6hu+GesBvaIpHYY5A3u/3yJBYDZduXDHGONodn0ry+BjRPFejv6Mpe7PrC7uazrtV5jJ X-Received: by 10.99.116.22 with SMTP id p22mr2509835pgc.182.1516468837969; Sat, 20 Jan 2018 09:20:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516468837; cv=none; d=google.com; s=arc-20160816; b=WQStHo2atd3s9yy3VQXROLMIRrAjAfmFR3UgvLCyOoNiPwfgzJiJmM2Bklpbxja/Ji yGgl8YDjlAH6hReK1VlQ55qIucszG1nHQMupF9SB7uCszIja1cl3V2vKFdtSVBEuhLuo f9ykgGRozTRrthhHVPVyb5ZLLlXAlRRHFdDe6SWzyXgjGk/nKyoiXnq1uO/GdFQQwCgz AwbK+yZnWl2Pln4h4PSyx9FPq8YIQTZ551I6GU6RTpDD0NQiC0JryRGMNBdg9rLLJ6yC KaIh462l4ZH5wV7U4JRIQUCuO2hR5nDSCAeg4S6AYbXKihvKMATqPqn/CPMZJ0edB358 HuHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=U/q3zN0oUSKsM7utElPGo1Dr4lf/+b9+usL1ews8Qps=; b=KHXnXxa3W0kyh4W5uJ9vpm37pPUqCBl5wXh5U+T2Ai97yqgakJovCEl1sJ/AKj347C j6UeiOuMMvtAZZ4de7uJ67Q41unmhN12nOER9RPpu/I37TRIJnIdb1y5R6UWR/x+ZbXl Lh46UDC+BayEWb9xbVr53i1lp+s6EgFa6OAFIXCbyxn+ZYrAmSbvOVK7xVhe/XngtxaW wj2jvD+JrnmcWQJeRnatdL1xL6F3x5mL4f6h3KlxReP+SaDFVCRKRTW/S7l/KDGfmdoM CpAUhzvZA65deaOYvmwwQPptepTv5YcgRHjTuP/UaLHX0/gXpbUZfZqRMcqlKu+xWrTZ Axog== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=tgoWgVbr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e62si10045471pfa.7.2018.01.20.09.20.24; Sat, 20 Jan 2018 09:20:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=tgoWgVbr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756819AbeATRTk (ORCPT + 99 others); Sat, 20 Jan 2018 12:19:40 -0500 Received: from vern.gendns.com ([206.190.152.46]:42781 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756644AbeATRPk (ORCPT ); Sat, 20 Jan 2018 12:15:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject :Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: 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=U/q3zN0oUSKsM7utElPGo1Dr4lf/+b9+usL1ews8Qps=; b=tgoWgVbrzVJ2hAXEImNo2E3b8 pu0vvYyDJqhCPLO5GlU4r0eo9ihEhCYcKdWl/vAJlnTtS+RvanATubKici2BPx86ynBPCXQaU69kk bTqG8Q0LhReClXbC07OR+MHN/Vr/czhIuusItpoj6FFTf649ihA6KyN3itOUGO3rU89UHCKvh1y+l WU51ojQX9wgBnRMcPlFEew8D+DEBGU6fsySpNIAUGw3I9tPbCawX3seTDFO6j1tyYvJwxw7iRvgKf C96hA8ZHtrp/jl7jll9GWkhVFIva9NKHBQLb2f4av43kB1OosDwh68EfRolMz7VhXQMMUz3SHjZQ2 Crc4XInMg==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:53590 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1ecwjW-00059q-67; Sat, 20 Jan 2018 12:15:10 -0500 From: David Lechner To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , Sekhar Nori , Kevin Hilman , Bartosz Golaszewski , Adam Ford , linux-kernel@vger.kernel.org, David Lechner Subject: [PATCH v6 23/41] ARM: dm365: add new clock init using common clock framework Date: Sat, 20 Jan 2018 11:14:02 -0600 Message-Id: <1516468460-4908-24-git-send-email-david@lechnology.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516468460-4908-1-git-send-email-david@lechnology.com> References: <1516468460-4908-1-git-send-email-david@lechnology.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds the new board-specific clock init in mach-davinci/dm365.c using the new common clock framework drivers. The #ifdefs are needed to prevent compile errors until the entire ARCH_DAVINCI is converted. Also clean up the #includes since we are adding some here. Signed-off-by: David Lechner --- v6 changes: - add blank lines between function calls arch/arm/mach-davinci/dm365.c | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 1e3df9d..ff79bb0 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -12,32 +12,38 @@ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ -#include +#include #include -#include -#include +#include +#include #include #include -#include +#include #include #include #include #include +#include +#include +#include #include +#include #include -#include "psc.h" -#include #include -#include +#include #include -#include +#include +#include "asp.h" #include "davinci.h" -#include "clock.h" #include "mux.h" -#include "asp.h" + +#ifndef CONFIG_COMMON_CLK +#include "clock.h" +#include "psc.h" +#endif #define DM365_REF_FREQ 24000000 /* 24 MHz on the DM365 EVM */ #define DM365_RTC_BASE 0x01c69000 @@ -54,6 +60,7 @@ #define DM365_EMAC_CNTRL_RAM_OFFSET 0x1000 #define DM365_EMAC_CNTRL_RAM_SIZE 0x2000 +#ifndef CONFIG_COMMON_CLK static struct pll_data pll1_data = { .num = 1, .phys_base = DAVINCI_PLL1_BASE, @@ -485,7 +492,7 @@ static struct clk_lookup dm365_clks[] = { CLK(NULL, "mjcp", &mjcp_clk), CLK(NULL, NULL, NULL), }; - +#endif /*----------------------------------------------------------------------*/ #define INTMUX 0x18 @@ -1171,7 +1178,21 @@ void __init dm365_init(void) void __init dm365_init_time(void) { +#ifdef CONFIG_COMMON_CLK + void __iomem *pll1, *pll2, *psc; + + pll1 = ioremap(DAVINCI_PLL1_BASE, SZ_4K); + pll2 = ioremap(DAVINCI_PLL2_BASE, SZ_4K); + psc = ioremap(DAVINCI_PWR_SLEEP_CNTRL_BASE, SZ_4K); + + clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DM365_REF_FREQ); + + dm365_pll_clk_init(pll1, pll2); + + dm365_psc_clk_init(psc); +#else davinci_clk_init(dm365_clks); +#endif davinci_timer_init(); } -- 2.7.4