Received: by 10.223.176.46 with SMTP id f43csp1031838wra; Sat, 20 Jan 2018 09:21:27 -0800 (PST) X-Google-Smtp-Source: AH8x2266zGtx5tdlF/OG319gP8Gp6q9xPndtoLSgjpEGzTmo4t17xWC69X9HyoIUxZHOgEOJzWHj X-Received: by 10.98.70.194 with SMTP id o63mr3042176pfi.58.1516468887489; Sat, 20 Jan 2018 09:21:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516468887; cv=none; d=google.com; s=arc-20160816; b=zHSqZuYwKHpyKG/+Reo4tx4b+evGcvsns4wu8WVRpPPFP5VA59mG7xb1gP812cuAF5 azEHR1wM5knX6plh/QrqtkL2PRDNcqFXp0sT5MVw1SItGsN28AXPBSMGdYaRkuCZO5yI LQlJDeV61o/Uy9g7KLLez3vIOdbvufAV6rxMMH/d/kC8oXNeZzJD/NLiQY6qjF22nRjU 4dydeyLFmgiHoNTyXUUUMOeRoiiDv7eRliTujX2TiF7v31H6eKR7IajC0GdT2OfsFhs9 DJ/J4FLlTg8X0RgPO9k+dKI1AErw+74vqjV1lETLhsIMqdGZM4gTU//H7hSNuryVDXRp uIuA== 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=RvjmwOe1gqvPzZMJwZWdSwcabQOMR/1Ma9oOAY1U0i8=; b=uMT2tuygKESqT7H7fvAXnb7hVh8L/6uIpkhLVONkApiQxsxLpXTU/3nFTX/wjv73P/ vlKDguvfaSNrAWQ5OTnbWypJVpyi/boq+xo0PKVujneJqBFE3QA+FmPVkjCfGUiWYYJr mkZhkh06Mh3ENj7LucCXjYDFWF8YvZA7tdMuWAv/RcP/QcqMSzfXc/wn/vFtQMgzBO36 2NUYqIp9s5JdeWCFxjZCGabmHVPFVJuQD5Agqh/Me8idwkLbSEUDItYmGnWEIgXuW+Ur 8ZUSGwRylaXEYMGBnxBk/higbmZrjOLcQcMovsdu9Q2B53PyecWh2KN3qnBca0S4o0kg +1mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=tQ6vtXux; 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 15-v6si1857328pla.23.2018.01.20.09.21.13; Sat, 20 Jan 2018 09:21:27 -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=tQ6vtXux; 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 S1756431AbeATRTM (ORCPT + 99 others); Sat, 20 Jan 2018 12:19:12 -0500 Received: from vern.gendns.com ([206.190.152.46]:42810 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756279AbeATRPp (ORCPT ); Sat, 20 Jan 2018 12:15:45 -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=RvjmwOe1gqvPzZMJwZWdSwcabQOMR/1Ma9oOAY1U0i8=; b=tQ6vtXuxBOmlJkBLhe7jP/lNU oXn/Rp66D5B0D1i7nnwp0GqVmrWRlHJcR+Z3U5DxwK+zmImRF/ELEQEQNi/IsRLQ61aC3SRdmhLlB xMqZ5UoNiuh2N1LsIKILsg2G+5oDsD5YuBxsVm4Cd1LtFAhOrGpSUIl2McAVSfMAQY5rTM6l1MlRO S/BUq5556LPZXxYF6RcvIASQeP77S213XeXFPrltwsgGly/Hh0oGreH/fbBB3eoG97vF7GU1ocWwv +XpJruo5bhg+STIRY8zMYWmhuWIy/uijJJWM5071LAT9uYHLEmzhYgRgeolSsgF3AWkpOvKMQshv8 UfB5dh2cA==; 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 1ecwjZ-00059q-GX; Sat, 20 Jan 2018 12:15:13 -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 25/41] ARM: dm646x: add new clock init using common clock framework Date: Sat, 20 Jan 2018 11:14:04 -0600 Message-Id: <1516468460-4908-26-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/dm646x.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/dm646x.c | 44 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 109ab1f..ee07e41 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -8,29 +8,35 @@ * is licensed "as is" without any warranty of any kind, whether express * or implied. */ +#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 "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 DAVINCI_VPIF_BASE (0x01C12000) @@ -46,6 +52,7 @@ #define DM646X_EMAC_CNTRL_RAM_OFFSET 0x2000 #define DM646X_EMAC_CNTRL_RAM_SIZE 0x2000 +#ifndef CONFIG_COMMON_CLK static struct pll_data pll1_data = { .num = 1, .phys_base = DAVINCI_PLL1_BASE, @@ -356,6 +363,7 @@ static struct clk_lookup dm646x_clks[] = { CLK(NULL, "vpif1", &vpif1_clk), CLK(NULL, NULL, NULL), }; +#endif static struct emac_platform_data dm646x_emac_pdata = { .ctrl_reg_offset = DM646X_EMAC_CNTRL_OFFSET, @@ -953,9 +961,29 @@ void __init dm646x_init(void) void __init dm646x_init_time(unsigned long ref_clk_rate, unsigned long aux_clkin_rate) { +#ifdef CONFIG_COMMON_CLK + void __iomem *pll1, *pll2, *psc; + struct clk *clk; + + 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, ref_clk_rate); + clk_register_fixed_rate(NULL, "aux_clkin", NULL, 0, aux_clkin_rate); + + dm646x_pll_clk_init(pll1, pll2); + + dm646x_psc_clk_init(psc); + + /* no LPSC, always enabled; c.f. spruep9a */ + clk = clk_register_fixed_factor(NULL, "timer2", "pll1_sysclk3", 0, 1, 1); + clk_register_clkdev(clk, NULL, "davinci-wdt"); +#else ref_clk.rate = ref_clk_rate; aux_clkin.rate = aux_clkin_rate; davinci_clk_init(dm646x_clks); +#endif davinci_timer_init(); } -- 2.7.4