static void clk_tree_init(void)
{
+ unsigned int reg;
+ reg = __raw_readl(MMDC_MDMISC_OFFSET);
+ if ((reg & MMDC_MDMISC_DDR_TYPE_MASK) ==
+ (0x1 << MMDC_MDMISC_DDR_TYPE_OFFSET)) {
+ clk_set_parent(&periph_clk, &pll2_pfd_400M);
+ printk(KERN_INFO "Set periph_clk's parent to pll2_pfd_400M!\n");
+ }
}
unsigned long ckih1, unsigned long ckih2)
{
__iomem void *base;
- unsigned int reg;
-
int i;
external_low_reference = ckil;
apll_base = ioremap(ANATOP_BASE_ADDR, SZ_4K);
- clk_tree_init();
-
for (i = 0; i < ARRAY_SIZE(lookups); i++) {
clkdev_add(&lookups[i]);
clk_debug_register(lookups[i].clk);
}
+ clk_tree_init();
+
/* enable mmdc_ch0_axi_clk to make sure the usecount is > 0
* or ipu's parent is mmdc_ch0_axi_clk, if ipu disable clk,
* mmdc_ch0_axi_clk will also be disabled, system will hang */
#define IOMUXC_GPR12 (MXC_IOMUXC_BASE + 0x30)
#define IOMUXC_GPR13 (MXC_IOMUXC_BASE + 0x34)
+/* MMDC */
+#define MXC_MMDC_P0_BASE MX6_IO_ADDRESS(MMDC_P0_BASE_ADDR)
+#define MMDC_MDMISC_OFFSET (MXC_MMDC_P0_BASE + 0x18)
+#define MMDC_MDMISC_DDR_TYPE_MASK (0x3 << 3)
+#define MMDC_MDMISC_DDR_TYPE_OFFSET (3)
+
/* PLLs */
#define MXC_PLL_BASE MX6_IO_ADDRESS(ANATOP_BASE_ADDR)
#define PLL1_SYS_BASE_ADDR (MXC_PLL_BASE + 0x0)