From patchwork Mon Jul 2 11:36:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajeshwari Shinde X-Patchwork-Id: 9738 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 911AD23E23 for ; Mon, 2 Jul 2012 11:33:35 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 59957A18723 for ; Mon, 2 Jul 2012 11:33:35 +0000 (UTC) Received: by mail-yx0-f180.google.com with SMTP id q6so4282555yen.11 for ; Mon, 02 Jul 2012 04:33:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-tm-as-mml:x-gm-message-state; bh=E6MgpEEP0vz4KxYxBGEQQgkcb6LjjLczeG2X+wbM/1g=; b=HmQ3daLQDNflJNyw6Q9JZQ7d6qfnvX7DTgY/68fTVIp3RDCbLrvO8qjsY5WBnoPAG4 2tF4JqUddTUfiHS50huwLmJoFyCFO5ak72Zn8rwDJw1Gj/phv9P5RRYmTGHJmwZMdKBA VNtOWOUPY3ayojDehf9CnMJPilJcKVm9TXkizltelCMhY+Rz4hpxwD9cfWa1nDTkhHiF yCAjDHLbOwnL9lILLmOB49CZjkRSGJbWJ03kXb2LuX8lvl5ErQPPE1dPf6Zte2L0LuQ1 DsuGzBEpDW1rsjgVMK+ZY5o0V+GjVPtEKQjFC65zh7WA4I72PGXF3lCxqcFJixR5sqgX Lf6w== Received: by 10.50.195.234 with SMTP id ih10mr5094375igc.0.1341228815057; Mon, 02 Jul 2012 04:33:35 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp21110ibb; Mon, 2 Jul 2012 04:33:34 -0700 (PDT) Received: by 10.68.130.9 with SMTP id oa9mr29183113pbb.95.1341228814371; Mon, 02 Jul 2012 04:33:34 -0700 (PDT) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id pj7si2269107pbc.270.2012.07.02.04.33.34; Mon, 02 Jul 2012 04:33:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.24 as permitted sender) client-ip=203.254.224.24; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.24 as permitted sender) smtp.mail=rajeshwari.s@samsung.com Received: from epcpsbgm2.samsung.com (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M6J00EW26PTHXO0@mailout1.samsung.com>; Mon, 02 Jul 2012 20:33:33 +0900 (KST) X-AuditID: cbfee61b-b7f776d000002f3f-e8-4ff1870d90b4 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 45.93.12095.D0781FF4; Mon, 02 Jul 2012 20:33:33 +0900 (KST) Received: from rajeshwari-linux.sisodomain.com ([107.108.215.115]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M6J00MOX6QL8K70@mmp2.samsung.com>; Mon, 02 Jul 2012 20:33:33 +0900 (KST) From: Rajeshwari Shinde To: u-boot@lists.denx.de Cc: patches@linaro.org, alim.akhtar@samsung.com, sjg@chromium.org, mk7.kang@samsung.com, chander.kashyap@linaro.org, jy0922.shim@samsung.com, jh80.chung@samsung.com Subject: [PATCH 07/10 V5] EXYNOS5: CLOCK: Modify MPLL clock out for Exynos5250 Rev 1.0 Date: Mon, 02 Jul 2012 17:06:42 +0530 Message-id: <1341229005-19008-8-git-send-email-rajeshwari.s@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1341229005-19008-1-git-send-email-rajeshwari.s@samsung.com> References: <1341229005-19008-1-git-send-email-rajeshwari.s@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBJMWRmVeSWpSXmKPExsVy+t9jQV3e9o/+BkcWc1g8XH+TxWLK4S8s Dkwed67tYQtgjOKySUnNySxLLdK3S+DK+HFpL1PBD/6KzwfyGxi/8nQxcnJICJhIPFqxlBXC FpO4cG89WxcjF4eQwHRGib+9k1ggnIlMEmvbu5hBqtgEjCS2npzGCGKLCEhI/Oq/yghSxCyw glFiTs82FpCEsECExMcN55lAbBYBVYmdL/+xg9i8Ah4SC+8sY4FYpyBxbOpXsNWcAp4SMy5P BrOFgGpudR1gnsDIu4CRYRWjaGpBckFxUnqukV5xYm5xaV66XnJ+7iZGsP+fSe9gXNVgcYhR gINRiYf3X/1HfyHWxLLiytxDjBIczEoivBsSgEK8KYmVValF+fFFpTmpxYcYpTlYlMR5m6wv +AsJpCeWpGanphakFsFkmTg4pRoYKxX3P86eXfva8NXMiZ5eXp1O8ps9dm2xeL9w8uUTHzUm XvpgLLQmLURr5j35I6ashYt1/FQ+OVYGNd7T2W0oJrFj1t1V+yKVHzPHcDS9fPg3e/b/mvum 59n2qAp/qw3ft1lEYFuFPN8N/SMTa5v4ZOoqj6v4fXCykrbcvXWzxnYF3aICxmWlSizFGYmG WsxFxYkA1J0sBfsBAAA= X-TM-AS-MML: No X-Gm-Message-State: ALoCoQklDeuMOFvEOlx3UFSAuhOX6diBtBqF8atVXZGb72S1ASiMakPUCFbGcut6MKiUImqWicCW MPLL clock-out of Exynos5250 Rev 1.0 is always at 1.6GHz. Adjust the divisor value to get 800MHz as needed by devices like UART etc Signed-off-by: Hatim Ali Signed-off-by: Rajeshwari Shinde Acked-by: Joonyoung Shim --- Changes in V2: - None Changes in V3: - Incorported review comments from Minkyu Kang. Changes in V4: - None. Changes in V5: - None arch/arm/cpu/armv7/exynos/clock.c | 12 +++++++++++- arch/arm/include/asm/arch-exynos/clock.h | 3 +++ 2 files changed, 14 insertions(+), 1 deletions(-) diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c index 330bd75..dbd5f11 100644 --- a/arch/arm/cpu/armv7/exynos/clock.c +++ b/arch/arm/cpu/armv7/exynos/clock.c @@ -98,7 +98,7 @@ static unsigned long exynos5_get_pll_clk(int pllreg) struct exynos5_clock *clk = (struct exynos5_clock *)samsung_get_base_clock(); unsigned long r, m, p, s, k = 0, mask, fout; - unsigned int freq; + unsigned int freq, pll_div2_sel, mpll_fout_sel; switch (pllreg) { case APLL: @@ -155,6 +155,16 @@ static unsigned long exynos5_get_pll_clk(int pllreg) fout = m * (freq / (p * (1 << (s - 1)))); } + /* According to the user manual, in EVT1 MPLL always gives + * 1.6GHz clock, so divide by 2 to get 800MHz MPLL clock.*/ + if (pllreg == MPLL) { + pll_div2_sel = readl(&clk->pll_div2_sel); + mpll_fout_sel = (pll_div2_sel >> MPLL_FOUT_SEL_SHIFT) + & MPLL_FOUT_SEL_MASK; + if (mpll_fout_sel == 0) + fout /= 2; + } + return fout; } diff --git a/arch/arm/include/asm/arch-exynos/clock.h b/arch/arm/include/asm/arch-exynos/clock.h index 90271f1..bf41c19 100644 --- a/arch/arm/include/asm/arch-exynos/clock.h +++ b/arch/arm/include/asm/arch-exynos/clock.h @@ -596,4 +596,7 @@ struct exynos5_clock { unsigned char res123[0xf5d8]; }; #endif + +#define MPLL_FOUT_SEL_SHIFT 4 +#define MPLL_FOUT_SEL_MASK 0x1 #endif