aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2012-06-12 05:36:58 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-06-20 06:27:49 -0400
commit69efac9a8bc6d479bc4c339ae4ac4d353460def6 (patch)
tree1de694a1bd104ad3bd387b93848784442950faaa /arch/arm/mach-shmobile
parentad9f1721c15b84f1a2e45a8a03f1ff7c86c2829b (diff)
ARM: shmobile: r8a7740: add FSI parent clock support
r8a7740 FSI can select its parent clock, and its selection is dependent on platform board. In order to enable FSI parent selection from platform board, this patch adds its interface to clock framework. This patch is based on v1.0 manual Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Simon Horman <horms@verge.net.au> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7740.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
index ce0930a415e8..7b9e4ab34fa2 100644
--- a/arch/arm/mach-shmobile/clock-r8a7740.c
+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
@@ -46,6 +46,7 @@
46#define VCLKCR1 0xE6150008 46#define VCLKCR1 0xE6150008
47#define VCLKCR2 0xE615000c 47#define VCLKCR2 0xE615000c
48#define FRQCRC 0xe61500e0 48#define FRQCRC 0xe61500e0
49#define FSIACKCR 0xe6150018
49#define PLLC01CR 0xe6150028 50#define PLLC01CR 0xe6150028
50 51
51#define SUBCKCR 0xe6150080 52#define SUBCKCR 0xe6150080
@@ -56,6 +57,7 @@
56#define MSTPSR2 0xe6150040 57#define MSTPSR2 0xe6150040
57#define MSTPSR3 0xe6150048 58#define MSTPSR3 0xe6150048
58#define MSTPSR4 0xe615004c 59#define MSTPSR4 0xe615004c
60#define FSIBCKCR 0xe6150090
59#define HDMICKCR 0xe6150094 61#define HDMICKCR 0xe6150094
60#define SMSTPCR0 0xe6150130 62#define SMSTPCR0 0xe6150130
61#define SMSTPCR1 0xe6150134 63#define SMSTPCR1 0xe6150134
@@ -274,6 +276,13 @@ static struct clk usb24_clk = {
274 .parent = &usb24s_clk, 276 .parent = &usb24s_clk,
275}; 277};
276 278
279/* External FSIACK/FSIBCK clock */
280static struct clk fsiack_clk = {
281};
282
283static struct clk fsibck_clk = {
284};
285
277struct clk *main_clks[] = { 286struct clk *main_clks[] = {
278 &extalr_clk, 287 &extalr_clk,
279 &extal1_clk, 288 &extal1_clk,
@@ -291,6 +300,8 @@ struct clk *main_clks[] = {
291 &pllc1_div2_clk, 300 &pllc1_div2_clk,
292 &usb24s_clk, 301 &usb24s_clk,
293 &usb24_clk, 302 &usb24_clk,
303 &fsiack_clk,
304 &fsibck_clk,
294}; 305};
295 306
296static void div4_kick(struct clk *clk) 307static void div4_kick(struct clk *clk)
@@ -320,6 +331,7 @@ static struct clk_div4_table div4_table = {
320enum { 331enum {
321 DIV6_HDMI, 332 DIV6_HDMI,
322 DIV6_VCLK1, DIV6_VCLK2, 333 DIV6_VCLK1, DIV6_VCLK2,
334 DIV6_FSIA, DIV6_FSIB,
323 DIV6_REPARENT_NR, 335 DIV6_REPARENT_NR,
324}; 336};
325 337
@@ -337,6 +349,16 @@ static struct clk *vclk_parents[8] = {
337 [5] = &extalr_clk, 349 [5] = &extalr_clk,
338}; 350};
339 351
352static struct clk *fsia_parents[] = {
353 [0] = &pllc1_div2_clk,
354 [1] = &fsiack_clk, /* external clock */
355};
356
357static struct clk *fsib_parents[] = {
358 [0] = &pllc1_div2_clk,
359 [1] = &fsibck_clk, /* external clock */
360};
361
340static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = { 362static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = {
341 [DIV6_HDMI] = SH_CLK_DIV6_EXT(HDMICKCR, 0, 363 [DIV6_HDMI] = SH_CLK_DIV6_EXT(HDMICKCR, 0,
342 hdmi_parent, ARRAY_SIZE(hdmi_parent), 6, 2), 364 hdmi_parent, ARRAY_SIZE(hdmi_parent), 6, 2),
@@ -344,6 +366,10 @@ static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = {
344 vclk_parents, ARRAY_SIZE(vclk_parents), 12, 3), 366 vclk_parents, ARRAY_SIZE(vclk_parents), 12, 3),
345 [DIV6_VCLK2] = SH_CLK_DIV6_EXT(VCLKCR2, 0, 367 [DIV6_VCLK2] = SH_CLK_DIV6_EXT(VCLKCR2, 0,
346 vclk_parents, ARRAY_SIZE(vclk_parents), 12, 3), 368 vclk_parents, ARRAY_SIZE(vclk_parents), 12, 3),
369 [DIV6_FSIA] = SH_CLK_DIV6_EXT(FSIACKCR, 0,
370 fsia_parents, ARRAY_SIZE(fsia_parents), 6, 2),
371 [DIV6_FSIB] = SH_CLK_DIV6_EXT(FSIBCKCR, 0,
372 fsib_parents, ARRAY_SIZE(fsib_parents), 6, 2),
347}; 373};
348 374
349/* HDMI1/2 clock */ 375/* HDMI1/2 clock */
@@ -503,6 +529,8 @@ static struct clk_lookup lookups[] = {
503 CLKDEV_CON_ID("hdmi2", &hdmi2_clk), 529 CLKDEV_CON_ID("hdmi2", &hdmi2_clk),
504 CLKDEV_CON_ID("video1", &div6_reparent_clks[DIV6_VCLK1]), 530 CLKDEV_CON_ID("video1", &div6_reparent_clks[DIV6_VCLK1]),
505 CLKDEV_CON_ID("video2", &div6_reparent_clks[DIV6_VCLK2]), 531 CLKDEV_CON_ID("video2", &div6_reparent_clks[DIV6_VCLK2]),
532 CLKDEV_CON_ID("fsiack", &fsiack_clk),
533 CLKDEV_CON_ID("fsibck", &fsibck_clk),
506 534
507 /* DIV4 clocks */ 535 /* DIV4 clocks */
508 CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]), 536 CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]),
@@ -557,6 +585,9 @@ static struct clk_lookup lookups[] = {
557 CLKDEV_ICK_ID("pci", "renesas_usbhs", &div4_clks[DIV4_USBP]), 585 CLKDEV_ICK_ID("pci", "renesas_usbhs", &div4_clks[DIV4_USBP]),
558 CLKDEV_ICK_ID("usb24", "renesas_usbhs", &usb24_clk), 586 CLKDEV_ICK_ID("usb24", "renesas_usbhs", &usb24_clk),
559 CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]), 587 CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]),
588
589 CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
590 CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),
560}; 591};
561 592
562void __init r8a7740_clock_init(u8 md_ck) 593void __init r8a7740_clock_init(u8 md_ck)