Received: by 10.223.176.46 with SMTP id f43csp1031943wra; Sat, 20 Jan 2018 09:21:37 -0800 (PST) X-Google-Smtp-Source: AH8x225Ow5NT05BQrGepj/OpTJpCGS4AjwRW6tK7vZvExRCdsmJ4B7K5ME3N9OhRA+PeCbKC5CNk X-Received: by 2002:a17:902:2883:: with SMTP id f3-v6mr787797plb.435.1516468897138; Sat, 20 Jan 2018 09:21:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516468897; cv=none; d=google.com; s=arc-20160816; b=MSc28q1Rcxmx9S6QaE6nOBguN8OHx+1GNdErSn9IBxVwi6z6WMVbodmR8NfHv68JuL nrtWrspD2Wkq7rtwGbkdBR7s5NqdrH/Kg223CG0TJyX+4CKbIcr8l0zlStgkukVGJcHo q1oWZ1EFVmNkFafKwv4MTjXkhO7uGTuMphEGExSKj46gxkKEIp025WQ9UprmStOJwZWj LfszY2WOEpiX2e9tOqACiD/nd8lTQGlsupeh5579lrEzQCSB4a2VKA2W/j5hU1E91K0L Xj6kPx9P8QUuMFf/hoFVuf/Ks1wf5aBNofypocleHNKWpt5Y0jIqVElDlOjG9MEplac1 Qxxg== 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=fMVAEBImE43/5XkKhRpRxG7V9ArVqvu7MVszo26YhbM=; b=KLTZVJT/kUbXhfJP3fGXrN3hLYp4wvy+W/bwdsdgKwIGeK0Tasmowsyk6wQcIxc5YB 6d1gqDgl9v1ThGhHqOmiXVxcvdvEyI8wyFdhjy1R3BPhxyWxUTOgBdCo3p9z8XfaUa1n Rnuca0J7ba8lV0Kem5ZSa7Myp57GoYiLdrvKav6nhNxrZliRogGwbcaNPbo8j0dKW46q 1uNTlfIEYgYZs6hdMzImx8fwXYWzHev8VZ8kS9evabWVh2bN85U3y+mv4nO+05hLa3jF FzpAEX3UwxZ5Mnlr9r8swd2iPDT/VS9TDQJPn4/PQZm9Ysq/iSuylF909SeRWf40H0SW +YyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=YonXW9RF; 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 33-v6si1855394ply.34.2018.01.20.09.21.23; Sat, 20 Jan 2018 09:21: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=YonXW9RF; 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 S1756759AbeATRTY (ORCPT + 99 others); Sat, 20 Jan 2018 12:19:24 -0500 Received: from vern.gendns.com ([206.190.152.46]:42793 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755320AbeATRPn (ORCPT ); Sat, 20 Jan 2018 12:15:43 -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=fMVAEBImE43/5XkKhRpRxG7V9ArVqvu7MVszo26YhbM=; b=YonXW9RFT7/x7JcAzjsOaBOtV aBInE3tHOS0NKE1NT1R2M5XmZjezoy0MP7jmKBt3H83cvr1n99qXbTOqYiEH5O0r5AvrMVohY8k0w 3cSvvPXkJNQA1YdlSmOmu+DPDyOlhRHeBAaAYScJaMynfzdUpPvzfvXkaw4ItxyRMs9mC1AtUkDp5 1V4js36fiCurKIhcpax0xQDUt+GC9IwuL9RYffH6XBKFSeOxqkMQODhAYiJqiKNt1F70aO3QuGcU+ dy/v6VsaZhocsxaS86F1udiDUgLSIwgHgqUIkpKhMIlw6ajcVDVBG92EB+a0B8R98af4FwrgQqJe6 YVChQShUA==; 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 1ecwjX-00059q-PF; Sat, 20 Jan 2018 12:15:12 -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 24/41] ARM: dm644x: add new clock init using common clock framework Date: Sat, 20 Jan 2018 11:14:03 -0600 Message-Id: <1516468460-4908-25-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/dm644x.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/dm644x.c | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index b409801..5b5de85 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c @@ -8,28 +8,34 @@ * 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 "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 /* * Device specific clocks @@ -43,6 +49,7 @@ #define DM644X_EMAC_CNTRL_RAM_OFFSET 0x2000 #define DM644X_EMAC_CNTRL_RAM_SIZE 0x2000 +#ifndef CONFIG_COMMON_CLK static struct pll_data pll1_data = { .num = 1, .phys_base = DAVINCI_PLL1_BASE, @@ -326,6 +333,7 @@ static struct clk_lookup dm644x_clks[] = { CLK("davinci-wdt", NULL, &timer2_clk), CLK(NULL, NULL, NULL), }; +#endif static struct emac_platform_data dm644x_emac_pdata = { .ctrl_reg_offset = DM644X_EMAC_CNTRL_OFFSET, @@ -934,7 +942,21 @@ void __init dm644x_init(void) void __init dm644x_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, DM644X_REF_FREQ); + + dm644x_pll_clk_init(pll1, pll2); + + dm644x_psc_clk_init(psc); +#else davinci_clk_init(dm644x_clks); +#endif davinci_timer_init(); } -- 2.7.4