From: Barry.Song@csr.com (Barry Song)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/2] clk: prima2: move from arch/arm/mach to drivers/clk
Date: Mon, 16 Jul 2012 10:06:43 +0800 [thread overview]
Message-ID: <1342404403-12703-3-git-send-email-Barry.Song@csr.com> (raw)
In-Reply-To: <1342404403-12703-1-git-send-email-Barry.Song@csr.com>
-#define SIRFSOC_CLOCK_VA_BASE SIRFSOC_VA(0x005000)
+static void *sirfsoc_clk_vbase;
#define KHZ 1000
#define MHZ (KHZ * KHZ)
@@ -91,12 +91,12 @@ static void std_clk_disable(struct clk_hw *hw);
static inline unsigned long clkc_readl(unsigned reg)
{
- return readl(SIRFSOC_CLOCK_VA_BASE + reg);
+ return readl(sirfsoc_clk_vbase + reg);
}
static inline void clkc_writel(u32 val, unsigned reg)
{
- writel(val, SIRFSOC_CLOCK_VA_BASE + reg);
+ writel(val, sirfsoc_clk_vbase + reg);
}
/*
@@ -944,9 +944,25 @@ static struct clk_std clk_security = {
},
};
+static struct of_device_id clkc_ids[] = {
+ { .compatible = "sirf,prima2-clkc" },
+ {},
+};
+
void __init sirfsoc_clk_init(void)
{
struct clk *clk;
+ struct device_node *np;
+
+ np = of_find_matching_node(NULL, clkc_ids);
+ if (!np)
+ panic("unable to find compatible clkc node in dtb\n");
+
+ sirfsoc_clk_vbase = of_iomap(np, 0);
+ if (!sirfsoc_clk_vbase)
+ panic("unable to map clkc registers\n");
+
+ of_node_put(np);
/* These are always available (RTC and 26MHz OSC)*/
clk = clk_register_fixed_rate(NULL, "rtc", NULL,
@@ -1063,32 +1079,8 @@ void __init sirfsoc_clk_init(void)
clkc_writel(0xFFFFFFFF, SIRFSOC_CLKC_CLK_EN1);
}
-static struct of_device_id clkc_ids[] = {
- { .compatible = "sirf,prima2-clkc" },
- {},
-};
-
void __init sirfsoc_clk_map(void)
{
- struct device_node *np;
- struct resource res;
- struct map_desc sirfsoc_clkc_iodesc = {
- .virtual = SIRFSOC_CLOCK_VA_BASE,
- .type = MT_DEVICE,
- };
-
- np = of_find_matching_node(NULL, clkc_ids);
- if (!np)
- panic("unable to find compatible clkc node in dtb\n");
-
- if (of_address_to_resource(np, 0, &res))
- panic("unable to find clkc range in dtb");
- of_node_put(np);
-
- sirfsoc_clkc_iodesc.pfn = __phys_to_pfn(res.start);
- sirfsoc_clkc_iodesc.length = 1 + res.end - res.start;
-
- iotable_init(&sirfsoc_clkc_iodesc, 1);
}
/*
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog
next prev parent reply other threads:[~2012-07-16 2:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-16 2:06 [PATCH v2 1/2] ARM: PRIMA2: convert to common clk and finish full clk tree Barry Song
2012-07-16 2:06 ` [PATCH v2 2/2] clk: prima2: move from arch/arm/mach to drivers/clk Barry Song
2012-07-16 2:06 ` Barry Song [this message]
2012-07-16 2:15 ` Barry Song
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=1342404403-12703-3-git-send-email-Barry.Song@csr.com \
--to=barry.song@csr.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox