Received: by 10.223.176.46 with SMTP id f43csp1030439wra; Sat, 20 Jan 2018 09:19:55 -0800 (PST) X-Google-Smtp-Source: AH8x226dKAzuCpzb05AJoM1pifpkAvt1KSn5K9s6BHsrOXWLht8dwC+m4gFrWJ5PYQoyxxSWV+UA X-Received: by 10.98.47.193 with SMTP id v184mr2988407pfv.90.1516468795044; Sat, 20 Jan 2018 09:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516468795; cv=none; d=google.com; s=arc-20160816; b=id1WLSBqVyqEcPYk1ldNCSOtDPj1YaYGLug/P8QisSowNGTlSkIstO6QiWFegqe4PY 7adgOm7qKtGAVqYgaD31U2f76JgUwJnJ9R73QykOL5nrwwBWepysVGdLseW/JWK+qxL+ Yo7r8vkXHaWpbDlrNjDiC1jMqBSyLWAGNw9ANPHuLxrfbRTmRSjAu/iVMilxZ5YqfWtj 1iD92nK0gpS0horUtlCIYg4TzBX/o2uGIH9WhCyKQYbZye+osghLQiBBfTw7oj1bc827 jITCdo90vu/XctMZZElnUjek3aOV2sTHorz4rM4ehnVUtn05ByRGYmUvFQnJdWG99cgK 3tRA== 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=EK2OPzBWDUOOlapWfZy5Vfa2w+Wx7N2ujBYtCJEjTzw=; b=Le4vEAd0KgAjFrFA4Wyp6UdTSSCDpAHpYF/odWeujUP+eEDqcPa2EbPxMHNdxczBRk EutJbGgB2xLNms767+zYoiyTcPTQd38paMATMm1eB09ZzSN0ceyLI+s0ny9LIlVgTsbA UsuFQAXRctxT4XeDPn6JMBxHYTYFfLbaq33sCTjJgs/hQ099eOf6jUywA0SAyPF5OMkw dUkIPqPkWXAZLqqYCvjIdTLPhpBhrR+Q3d5ulS+YlirhABmrKK8u11sFjAVO6ZjC3fEj sYqFZJJHLUPUqtQJjtBnsqF6p1RqULRWddizSLXiC9Pji/XRHfkge8itLsH7STV5Z1Ee m/tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=mNg1Tns4; 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 j192si10548709pge.14.2018.01.20.09.19.41; Sat, 20 Jan 2018 09:19:54 -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=mNg1Tns4; 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 S1756639AbeATRPk (ORCPT + 99 others); Sat, 20 Jan 2018 12:15:40 -0500 Received: from vern.gendns.com ([206.190.152.46]:42551 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756279AbeATRPD (ORCPT ); Sat, 20 Jan 2018 12:15:03 -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=EK2OPzBWDUOOlapWfZy5Vfa2w+Wx7N2ujBYtCJEjTzw=; b=mNg1Tns4ZCzfva8HJlNbEnd9s mbnRdsKMInfD2i6NXXP1fJdOUTGryBN7E5XrbxlUc6xVO9EozT1Ask4c4N/cNritncFjsBsCprb3b UW5ZCxIz0ZA3tmMI0Y0G9hcdQYjox+lVIDSlxkM5PDC9WoZmfiAEDuDtIZq3DPOogamJwK+P6RBsq Ox3DYDSrcdk21Zxahh+xWJYS+KFII7FcKlbMPPDIk2DmYJ1Cxh2xb/EJbhgfs2TJ6ssrkCrM4ebd9 8lx+ReKzd27imZ/vq3qOjiUlS/CntGVya6mOi6tkKJhqYeXAIdoF5H1UKN4EZ8CyMo5Efsut5a7cB kOgIY3aHA==; 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 1ecwiu-00059q-Ag; Sat, 20 Jan 2018 12:14:32 -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 03/41] clk: davinci: Add platform information for TI DA830 PLL Date: Sat, 20 Jan 2018 11:13:42 -0600 Message-Id: <1516468460-4908-4-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 platform-specific declarations for the PLL clocks on TI DA830/ OMAP-L137/AM17XX SoCs. Signed-off-by: David Lechner --- v6 changes: - Added da830_pll_info with controller-specific information - Add empty lines between function calls drivers/clk/davinci/Makefile | 1 + drivers/clk/davinci/pll-da830.c | 51 +++++++++++++++++++++++++++++++++++++++++ include/linux/clk/davinci.h | 14 +++++++++++ 3 files changed, 66 insertions(+) create mode 100644 drivers/clk/davinci/pll-da830.c create mode 100644 include/linux/clk/davinci.h diff --git a/drivers/clk/davinci/Makefile b/drivers/clk/davinci/Makefile index d9673bd..9061e19 100644 --- a/drivers/clk/davinci/Makefile +++ b/drivers/clk/davinci/Makefile @@ -2,4 +2,5 @@ ifeq ($(CONFIG_COMMON_CLK), y) obj-y += pll.o +obj-$(CONFIG_ARCH_DAVINCI_DA830) += pll-da830.o endif diff --git a/drivers/clk/davinci/pll-da830.c b/drivers/clk/davinci/pll-da830.c new file mode 100644 index 0000000..548eb73 --- /dev/null +++ b/drivers/clk/davinci/pll-da830.c @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * PLL clock descriptions for TI DA830/OMAP-L137/AM17XX + * + * Copyright (C) 2018 David Lechner + */ + +#include +#include +#include + +#include "pll.h" + +static const struct davinci_pll_clk_info da830_pll_info __initconst = { + .name = "pll0", + .pllm_mask = GENMASK(4, 0), + .pllm_min = 4, + .pllm_max = 32, + .pllout_min_rate = 300000000, + .pllout_max_rate = 600000000, + .flags = PLL_HAS_OSCIN | PLL_HAS_PREDIV | PLL_HAS_POSTDIV, +}; + +/* + * NB: Technically, the clocks flagged as SYSCLK_FIXED_DIV are "fixed ratio", + * meaning that we could change the divider as long as we keep the correct + * ratio between all of the clocks, but we don't support that because there is + * currently not a need for it. + */ + +static const struct davinci_pll_sysclk_info da830_pll_sysclk_info[] __initconst = { + SYSCLK(2, pll0_sysclk2, pll0_pllen, 5, SYSCLK_FIXED_DIV), + SYSCLK(3, pll0_sysclk3, pll0_pllen, 5, 0), + SYSCLK(4, pll0_sysclk4, pll0_pllen, 5, SYSCLK_FIXED_DIV), + SYSCLK(5, pll0_sysclk5, pll0_pllen, 5, 0), + SYSCLK(6, pll0_sysclk6, pll0_pllen, 5, SYSCLK_FIXED_DIV), + SYSCLK(7, pll0_sysclk7, pll0_pllen, 5, 0), + { } +}; + +void __init da830_pll_clk_init(void __iomem *pll) +{ + const struct davinci_pll_sysclk_info *info; + + davinci_pll_clk_register(&da830_pll_info, "ref_clk", pll); + + davinci_pll_auxclk_register("pll0_auxclk", pll); + + for (info = da830_pll_sysclk_info; info->name; info++) + davinci_pll_sysclk_register(info, pll); +} diff --git a/include/linux/clk/davinci.h b/include/linux/clk/davinci.h new file mode 100644 index 0000000..4f4d60d --- /dev/null +++ b/include/linux/clk/davinci.h @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * TI Davinci clocks + * + * Copyright (C) 2017 David Lechner + */ +#ifndef __LINUX_CLK_DAVINCI_H__ +#define __LINUX_CLK_DAVINCI_H__ + +#include + +void da830_pll_clk_init(void __iomem *pll); + +#endif /* __LINUX_CLK_DAVINCI_H__ */ -- 2.7.4