void do_ext_phy_settings(u32 base, const struct emif_regs *regs) { if (is_omap54xx()) do_ext_phy_settings_omap5(base, regs); else do_ext_phy_settings_dra7(base, regs); }
/* DDR3 specific IO settings */ static void io_settings_ddr3(void) { u32 io_settings = 0; const struct ctrl_ioregs *ioregs; get_ioregs(&ioregs); writel(ioregs->ctrl_ddr3ch, (*ctrl)->control_ddr3ch1_0); writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch1_0); writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch1_1); writel(ioregs->ctrl_ddr3ch, (*ctrl)->control_ddr3ch2_0); writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch2_0); writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch2_1); writel(ioregs->ctrl_ddrio_0, (*ctrl)->control_ddrio_0); writel(ioregs->ctrl_ddrio_1, (*ctrl)->control_ddrio_1); if (!is_dra7xx()) { writel(ioregs->ctrl_ddrio_2, (*ctrl)->control_ddrio_2); writel(ioregs->ctrl_lpddr2ch, (*ctrl)->control_lpddr2ch1_1); } /* omap5432 does not use lpddr2 */ writel(ioregs->ctrl_lpddr2ch, (*ctrl)->control_lpddr2ch1_0); writel(ioregs->ctrl_emif_sdram_config_ext, (*ctrl)->control_emif1_sdram_config_ext); if (!is_dra72x()) writel(ioregs->ctrl_emif_sdram_config_ext, (*ctrl)->control_emif2_sdram_config_ext); if (is_omap54xx()) { /* Disable DLL select */ io_settings = (readl((*ctrl)->control_port_emif1_sdram_config) & 0xFFEFFFFF); writel(io_settings, (*ctrl)->control_port_emif1_sdram_config); io_settings = (readl((*ctrl)->control_port_emif2_sdram_config) & 0xFFEFFFFF); writel(io_settings, (*ctrl)->control_port_emif2_sdram_config); } else { writel(ioregs->ctrl_ddr_ctrl_ext_0, (*ctrl)->control_ddr_control_ext_0); } }
void srcomp_enable(void) { u32 srcomp_value, mul_factor, div_factor, clk_val, i; u32 sysclk_ind = get_sys_clk_index(); u32 omap_rev = omap_revision(); if (!is_omap54xx()) return; mul_factor = srcomp_parameters[sysclk_ind].multiply_factor; div_factor = srcomp_parameters[sysclk_ind].divide_factor; for (i = 0; i < 4; i++) { srcomp_value = readl((*ctrl)->control_srcomp_north_side + i*4); srcomp_value &= ~(MULTIPLY_FACTOR_XS_MASK | DIVIDE_FACTOR_XS_MASK); srcomp_value |= (mul_factor << MULTIPLY_FACTOR_XS_SHIFT) | (div_factor << DIVIDE_FACTOR_XS_SHIFT); writel(srcomp_value, (*ctrl)->control_srcomp_north_side + i*4); } if ((omap_rev == OMAP5430_ES1_0) || (omap_rev == OMAP5432_ES1_0)) { clk_val = readl((*prcm)->cm_coreaon_io_srcomp_clkctrl); clk_val |= OPTFCLKEN_SRCOMP_FCLK_MASK; writel(clk_val, (*prcm)->cm_coreaon_io_srcomp_clkctrl); for (i = 0; i < 4; i++) { srcomp_value = readl((*ctrl)->control_srcomp_north_side + i*4); srcomp_value &= ~PWRDWN_XS_MASK; writel(srcomp_value, (*ctrl)->control_srcomp_north_side + i*4); while (((readl((*ctrl)->control_srcomp_north_side + i*4) & SRCODE_READ_XS_MASK) >> SRCODE_READ_XS_SHIFT) == 0) ; srcomp_value = readl((*ctrl)->control_srcomp_north_side + i*4); srcomp_value &= ~OVERRIDE_XS_MASK; writel(srcomp_value, (*ctrl)->control_srcomp_north_side + i*4); } } else {