From: Tero Kristo <t-kristo@ti.com>
To: linux-omap@vger.kernel.org, tony@atomide.com, khilman@linaro.org,
paul@pwsan.com
Cc: linux-arm-kernel@lists.infradead.org,
Mike Turquette <mturquette@linaro.org>
Subject: [RFC 6/8] CLK: OMAP4: add support for the new clock init code
Date: Thu, 21 Mar 2013 19:35:45 +0200 [thread overview]
Message-ID: <1363887347-4686-7-git-send-email-t-kristo@ti.com> (raw)
In-Reply-To: <1363887347-4686-1-git-send-email-t-kristo@ti.com>
Modifies the omap4 clock init code to support the new clock
registration method.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Cc: Mike Turquette <mturquette@linaro.org>
---
drivers/clk/omap/cclock44xx_data.c | 52 ++++++++++++++---------------------
1 files changed, 21 insertions(+), 31 deletions(-)
diff --git a/drivers/clk/omap/cclock44xx_data.c b/drivers/clk/omap/cclock44xx_data.c
index 25285a3..aba9bcb 100644
--- a/drivers/clk/omap/cclock44xx_data.c
+++ b/drivers/clk/omap/cclock44xx_data.c
@@ -20,20 +20,15 @@
#include <linux/kernel.h>
#include <linux/list.h>
-#include <linux/clk-private.h>
+#include <linux/clk-provider.h>
#include <linux/clkdev.h>
#include <linux/io.h>
-#include "soc.h"
-#include "iomap.h"
#include "clock.h"
-#include "clock44xx.h"
#include "cm1_44xx.h"
#include "cm2_44xx.h"
#include "cm-regbits-44xx.h"
#include "prm44xx.h"
-#include "prm-regbits-44xx.h"
-#include "control.h"
#include "scrm44xx.h"
/* OMAP4 modulemode control */
@@ -48,6 +43,13 @@
*/
#define OMAP4_DPLL_ABE_DEFFREQ 98304000
+enum {
+ OMAP4_CM1_INDEX = 1,
+ OMAP4_CM2_INDEX,
+ OMAP4_PRM_INDEX,
+ OMAP4_SCRM_INDEX
+};
+
/* Root clocks */
OMAP_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0);
@@ -1925,37 +1927,24 @@ static const char *enable_init_clks[] = {
int __init omap4xxx_clk_init(void)
{
- u32 cpu_clkflg;
- struct omap_clk *c;
- int rc;
-
- if (cpu_is_omap443x()) {
- cpu_mask = RATE_IN_4430;
- cpu_clkflg = CK_443X;
- } else if (cpu_is_omap446x() || cpu_is_omap447x()) {
- cpu_mask = RATE_IN_4460 | RATE_IN_4430;
- cpu_clkflg = CK_446X | CK_443X;
-
- if (cpu_is_omap447x())
- pr_warn("WARNING: OMAP4470 clock data incomplete!\n");
- } else {
- return 0;
- }
-
- for (c = omap44xx_clks; c < omap44xx_clks + ARRAY_SIZE(omap44xx_clks);
- c++) {
- if (c->cpu & cpu_clkflg) {
- clkdev_add(&c->lk);
- if (!__clk_init(NULL, c->lk.clk))
- omap2_init_clk_hw_omap_clocks(c->lk.clk);
- }
- }
+ void __iomem *base[5];
+
+ base[OMAP4_CM1_INDEX] = ioremap(OMAP4430_CM1_BASE, SZ_64K);
+ base[OMAP4_CM2_INDEX] = ioremap(OMAP4430_CM2_BASE, SZ_64K);
+ base[OMAP4_PRM_INDEX] = ioremap(OMAP4430_PRM_BASE, SZ_64K);
+ base[OMAP4_SCRM_INDEX] = ioremap(OMAP4_SCRM_BASE, SZ_64K);
+
+ cpu_mask = RATE_IN_4430;
+
+ omap_clk_register_clks(omap44xx_clks, ARRAY_SIZE(omap44xx_clks),
+ CK_443X, base);
omap2_clk_disable_autoidle_all();
omap2_clk_enable_init_clocks(enable_init_clks,
ARRAY_SIZE(enable_init_clks));
+#if 0
/*
* On OMAP4460 the ABE DPLL fails to turn on if in idle low-power
* state when turning the ABE clock domain. Workaround this by
@@ -1967,6 +1956,7 @@ int __init omap4xxx_clk_init(void)
rc = clk_set_rate(&dpll_abe_ck, OMAP4_DPLL_ABE_DEFFREQ);
if (rc)
pr_err("%s: failed to configure ABE DPLL!\n", __func__);
+#endif
return 0;
}
--
1.7.4.1
next prev parent reply other threads:[~2013-03-21 17:37 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-21 17:35 [RFC 0/8]: omap4: clk: move clock data under drivers/clk Tero Kristo
2013-03-21 17:35 ` Tero Kristo
2013-03-21 17:35 ` [RFC 1/8] RFC: CLK: OMAP: Add basic infrastructure for OMAP clocks Tero Kristo
2013-03-21 18:50 ` Mike Turquette
2013-03-21 18:50 ` Mike Turquette
2013-03-22 8:39 ` Tero Kristo
2013-03-22 8:39 ` Tero Kristo
2013-03-22 16:47 ` Mike Turquette
2013-03-22 16:47 ` Mike Turquette
2013-03-22 18:39 ` Tero Kristo
2013-03-22 18:39 ` Tero Kristo
2013-03-22 20:01 ` Mike Turquette
2013-03-22 20:01 ` Mike Turquette
2013-03-21 17:35 ` [RFC 3/8] CLK: OMAP4: Clock header register declarations to struct Tero Kristo
2013-03-21 17:35 ` [RFC 4/8] CLK: OMAP4: copy over cclock44xx_data.c file from mach-omap2 Tero Kristo
2013-03-21 17:35 ` [RFC 5/8] CLK: OMAP4: modify clock data layout for the new driver format Tero Kristo
2013-03-21 17:35 ` Tero Kristo [this message]
2013-03-21 17:35 ` [RFC 7/8] clk: use strncmp for matching con_id in clk_find Tero Kristo
2013-03-21 17:35 ` [RFC 8/8] ARM: OMAP4: use new driver for omap4 clock data Tero Kristo
2013-03-22 5:28 ` [RFC 0/8]: omap4: clk: move clock data under drivers/clk Rajendra Nayak
2013-03-22 5:28 ` Rajendra Nayak
2013-03-22 9:32 ` Tero Kristo
2013-03-22 9:32 ` Tero Kristo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1363887347-4686-7-git-send-email-t-kristo@ti.com \
--to=t-kristo@ti.com \
--cc=khilman@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=paul@pwsan.com \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.