|
@@ -574,3 +574,59 @@ static struct clk_lookup lookups[] = {
|
|
CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */
|
|
CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */
|
|
CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */
|
|
CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */
|
|
CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]), /* SDHI2 */
|
|
CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]), /* SDHI2 */
|
|
|
|
+ CLKDEV_DEV_ID("leds-renesas-tpu.12", &mstp_clks[MSTP303]), /* TPU1 */
|
|
|
|
+ CLKDEV_DEV_ID("leds-renesas-tpu.21", &mstp_clks[MSTP302]), /* TPU2 */
|
|
|
|
+ CLKDEV_DEV_ID("leds-renesas-tpu.30", &mstp_clks[MSTP301]), /* TPU3 */
|
|
|
|
+ CLKDEV_DEV_ID("leds-renesas-tpu.41", &mstp_clks[MSTP300]), /* TPU4 */
|
|
|
|
+ CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */
|
|
|
|
+ CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */
|
|
|
|
+ CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+void __init sh73a0_clock_init(void)
|
|
|
|
+{
|
|
|
|
+ int k, ret = 0;
|
|
|
|
+
|
|
|
|
+ /* Set SDHI clocks to a known state */
|
|
|
|
+ __raw_writel(0x108, SD0CKCR);
|
|
|
|
+ __raw_writel(0x108, SD1CKCR);
|
|
|
|
+ __raw_writel(0x108, SD2CKCR);
|
|
|
|
+
|
|
|
|
+ /* detect main clock parent */
|
|
|
|
+ switch ((__raw_readl(CKSCR) >> 28) & 0x03) {
|
|
|
|
+ case 0:
|
|
|
|
+ main_clk.parent = &sh73a0_extal1_clk;
|
|
|
|
+ break;
|
|
|
|
+ case 1:
|
|
|
|
+ main_clk.parent = &extal1_div2_clk;
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ main_clk.parent = &sh73a0_extal2_clk;
|
|
|
|
+ break;
|
|
|
|
+ case 3:
|
|
|
|
+ main_clk.parent = &extal2_div2_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_reparent_register(div6_clks, DIV6_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]);
|
|
|
|
+
|
|
|
|
+ clkdev_add_table(lookups, ARRAY_SIZE(lookups));
|
|
|
|
+
|
|
|
|
+ if (!ret)
|
|
|
|
+ shmobile_clk_init();
|
|
|
|
+ else
|
|
|
|
+ panic("failed to setup sh73a0 clocks\n");
|
|
|
|
+}
|