|
@@ -583,3 +583,102 @@ static struct clk_lookup lookups[] = {
|
|
|
CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]),
|
|
|
CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP111]),
|
|
|
CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]),
|
|
|
+ CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]),
|
|
|
+ CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]),
|
|
|
+ CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]),
|
|
|
+ CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP128]),
|
|
|
+
|
|
|
+ CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]),
|
|
|
+ CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]),
|
|
|
+ CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]),
|
|
|
+ CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]),
|
|
|
+ CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]),
|
|
|
+ CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]),
|
|
|
+ CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]),
|
|
|
+ CLKDEV_DEV_ID("sh-dma-engine.3", &mstp_clks[MSTP214]),
|
|
|
+ CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]),
|
|
|
+ CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]),
|
|
|
+ CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]),
|
|
|
+ CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP222]),
|
|
|
+ CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP230]),
|
|
|
+
|
|
|
+ CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]),
|
|
|
+ CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]),
|
|
|
+ CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]),
|
|
|
+ CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP320]),
|
|
|
+ CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]),
|
|
|
+ CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]),
|
|
|
+ CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP312]),
|
|
|
+ CLKDEV_DEV_ID("sh-eth", &mstp_clks[MSTP309]),
|
|
|
+
|
|
|
+ CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP415]),
|
|
|
+
|
|
|
+ /* ICK */
|
|
|
+ CLKDEV_ICK_ID("host", "renesas_usbhs", &mstp_clks[MSTP416]),
|
|
|
+ CLKDEV_ICK_ID("func", "renesas_usbhs", &mstp_clks[MSTP407]),
|
|
|
+ CLKDEV_ICK_ID("phy", "renesas_usbhs", &mstp_clks[MSTP406]),
|
|
|
+ CLKDEV_ICK_ID("pci", "renesas_usbhs", &div4_clks[DIV4_USBP]),
|
|
|
+ CLKDEV_ICK_ID("usb24", "renesas_usbhs", &usb24_clk),
|
|
|
+ CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]),
|
|
|
+
|
|
|
+ CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
|
|
|
+ CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),
|
|
|
+ CLKDEV_ICK_ID("diva", "sh_fsi2", &fsidivs[FSIDIV_A]),
|
|
|
+ CLKDEV_ICK_ID("divb", "sh_fsi2", &fsidivs[FSIDIV_B]),
|
|
|
+ CLKDEV_ICK_ID("xcka", "sh_fsi2", &fsiack_clk),
|
|
|
+ CLKDEV_ICK_ID("xckb", "sh_fsi2", &fsibck_clk),
|
|
|
+};
|
|
|
+
|
|
|
+void __init r8a7740_clock_init(u8 md_ck)
|
|
|
+{
|
|
|
+ int k, ret = 0;
|
|
|
+
|
|
|
+ /* detect system clock parent */
|
|
|
+ if (md_ck & MD_CK1)
|
|
|
+ system_clk.parent = &extal1_div2_clk;
|
|
|
+ else
|
|
|
+ system_clk.parent = &extal1_clk;
|
|
|
+
|
|
|
+ /* detect RCLK parent */
|
|
|
+ switch (md_ck & (MD_CK2 | MD_CK1)) {
|
|
|
+ case MD_CK2 | MD_CK1:
|
|
|
+ r_clk.parent = &extal1_div2048_clk;
|
|
|
+ break;
|
|
|
+ case MD_CK2:
|
|
|
+ r_clk.parent = &extal1_div1024_clk;
|
|
|
+ break;
|
|
|
+ case MD_CK1:
|
|
|
+ default:
|
|
|
+ r_clk.parent = &extalr_clk;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
|
|
|
+ ret = clk_register(main_clks[k]);
|
|
|
+
|
|
|
+ if (!ret)
|
|
|
+ ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
|
|
|
+
|
|
|
+ if (!ret)
|
|
|
+ ret = sh_clk_div6_register(div6_clks, DIV6_NR);
|
|
|
+
|
|
|
+ if (!ret)
|
|
|
+ ret = sh_clk_div6_reparent_register(div6_reparent_clks,
|
|
|
+ DIV6_REPARENT_NR);
|
|
|
+
|
|
|
+ if (!ret)
|
|
|
+ ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
|
|
|
+
|
|
|
+ for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
|
|
|
+ ret = clk_register(late_main_clks[k]);
|
|
|
+
|
|
|
+ if (!ret)
|
|
|
+ ret = sh_clk_fsidiv_register(fsidivs, FSIDIV_REPARENT_NR);
|
|
|
+
|
|
|
+ clkdev_add_table(lookups, ARRAY_SIZE(lookups));
|
|
|
+
|
|
|
+ if (!ret)
|
|
|
+ shmobile_clk_init();
|
|
|
+ else
|
|
|
+ panic("failed to setup r8a7740 clocks\n");
|
|
|
+}
|