Commit 4fb85d35 authored by Paul Walmsley's avatar Paul Walmsley

Merge branch 'clock_devel_3.7' into hwmod_prcm_clock_a_3.7

Conflicts:
	arch/arm/mach-omap2/clkt34xx_dpll3m2.c
	arch/arm/mach-omap2/clkt_clksel.c
	arch/arm/mach-omap2/clock.c
parents 1e2ee2a6 a86c0b98
...@@ -202,7 +202,7 @@ static inline void __init apollon_init_smc91x(void) ...@@ -202,7 +202,7 @@ static inline void __init apollon_init_smc91x(void)
return; return;
} }
clk_enable(gpmc_fck); clk_prepare_enable(gpmc_fck);
rate = clk_get_rate(gpmc_fck); rate = clk_get_rate(gpmc_fck);
eth_cs = APOLLON_ETH_CS; eth_cs = APOLLON_ETH_CS;
...@@ -246,7 +246,7 @@ static inline void __init apollon_init_smc91x(void) ...@@ -246,7 +246,7 @@ static inline void __init apollon_init_smc91x(void)
gpmc_cs_free(APOLLON_ETH_CS); gpmc_cs_free(APOLLON_ETH_CS);
} }
out: out:
clk_disable(gpmc_fck); clk_disable_unprepare(gpmc_fck);
clk_put(gpmc_fck); clk_put(gpmc_fck);
} }
......
...@@ -265,9 +265,9 @@ static inline void __init h4_init_debug(void) ...@@ -265,9 +265,9 @@ static inline void __init h4_init_debug(void)
return; return;
} }
clk_enable(gpmc_fck); clk_prepare_enable(gpmc_fck);
rate = clk_get_rate(gpmc_fck); rate = clk_get_rate(gpmc_fck);
clk_disable(gpmc_fck); clk_disable_unprepare(gpmc_fck);
clk_put(gpmc_fck); clk_put(gpmc_fck);
if (is_gpmc_muxed()) if (is_gpmc_muxed())
...@@ -311,7 +311,7 @@ static inline void __init h4_init_debug(void) ...@@ -311,7 +311,7 @@ static inline void __init h4_init_debug(void)
gpmc_cs_free(eth_cs); gpmc_cs_free(eth_cs);
out: out:
clk_disable(gpmc_fck); clk_disable_unprepare(gpmc_fck);
clk_put(gpmc_fck); clk_put(gpmc_fck);
} }
......
...@@ -171,7 +171,7 @@ static void __init omap4_ehci_init(void) ...@@ -171,7 +171,7 @@ static void __init omap4_ehci_init(void)
return; return;
} }
clk_set_rate(phy_ref_clk, 19200000); clk_set_rate(phy_ref_clk, 19200000);
clk_enable(phy_ref_clk); clk_prepare_enable(phy_ref_clk);
/* disable the power to the usb hub prior to init and reset phy+hub */ /* disable the power to the usb hub prior to init and reset phy+hub */
ret = gpio_request_array(panda_ehci_gpios, ret = gpio_request_array(panda_ehci_gpios,
......
...@@ -59,7 +59,7 @@ static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask) ...@@ -59,7 +59,7 @@ static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask)
omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
omap2_cm_wait_idlest(cm_idlest_pll, status_mask, omap2_cm_wait_idlest(cm_idlest_pll, status_mask,
OMAP24XX_CM_IDLEST_VAL, clk->name); OMAP24XX_CM_IDLEST_VAL, __clk_get_name(clk));
/* /*
* REVISIT: Should we return an error code if omap2_wait_clock_ready() * REVISIT: Should we return an error code if omap2_wait_clock_ready()
......
...@@ -68,14 +68,15 @@ unsigned long omap2_table_mpu_recalc(struct clk *clk) ...@@ -68,14 +68,15 @@ unsigned long omap2_table_mpu_recalc(struct clk *clk)
long omap2_round_to_table_rate(struct clk *clk, unsigned long rate) long omap2_round_to_table_rate(struct clk *clk, unsigned long rate)
{ {
const struct prcm_config *ptr; const struct prcm_config *ptr;
long highest_rate; long highest_rate, sys_clk_rate;
highest_rate = -EINVAL; highest_rate = -EINVAL;
sys_clk_rate = __clk_get_rate(sclk);
for (ptr = rate_table; ptr->mpu_speed; ptr++) { for (ptr = rate_table; ptr->mpu_speed; ptr++) {
if (!(ptr->flags & cpu_mask)) if (!(ptr->flags & cpu_mask))
continue; continue;
if (ptr->xtal_speed != sclk->rate) if (ptr->xtal_speed != sys_clk_rate)
continue; continue;
highest_rate = ptr->mpu_speed; highest_rate = ptr->mpu_speed;
...@@ -94,12 +95,15 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate) ...@@ -94,12 +95,15 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate)
const struct prcm_config *prcm; const struct prcm_config *prcm;
unsigned long found_speed = 0; unsigned long found_speed = 0;
unsigned long flags; unsigned long flags;
long sys_clk_rate;
sys_clk_rate = __clk_get_rate(sclk);
for (prcm = rate_table; prcm->mpu_speed; prcm++) { for (prcm = rate_table; prcm->mpu_speed; prcm++) {
if (!(prcm->flags & cpu_mask)) if (!(prcm->flags & cpu_mask))
continue; continue;
if (prcm->xtal_speed != sclk->rate) if (prcm->xtal_speed != sys_clk_rate)
continue; continue;
if (prcm->mpu_speed <= rate) { if (prcm->mpu_speed <= rate) {
......
...@@ -56,6 +56,7 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) ...@@ -56,6 +56,7 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
struct omap_sdrc_params *sdrc_cs0; struct omap_sdrc_params *sdrc_cs0;
struct omap_sdrc_params *sdrc_cs1; struct omap_sdrc_params *sdrc_cs1;
int ret; int ret;
unsigned long clkrate;
if (!clk || !rate) if (!clk || !rate)
return -EINVAL; return -EINVAL;
...@@ -64,11 +65,12 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) ...@@ -64,11 +65,12 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
if (validrate != rate) if (validrate != rate)
return -EINVAL; return -EINVAL;
sdrcrate = sdrc_ick_p->rate; sdrcrate = __clk_get_rate(sdrc_ick_p);
if (rate > clk->rate) clkrate = __clk_get_rate(clk);
sdrcrate <<= ((rate / clk->rate) >> 1); if (rate > clkrate)
sdrcrate <<= ((rate / clkrate) >> 1);
else else
sdrcrate >>= ((clk->rate / rate) >> 1); sdrcrate >>= ((clkrate / rate) >> 1);
ret = omap2_sdrc_get_params(sdrcrate, &sdrc_cs0, &sdrc_cs1); ret = omap2_sdrc_get_params(sdrcrate, &sdrc_cs0, &sdrc_cs1);
if (ret) if (ret)
...@@ -82,7 +84,7 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) ...@@ -82,7 +84,7 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
/* /*
* XXX This only needs to be done when the CPU frequency changes * XXX This only needs to be done when the CPU frequency changes
*/ */
_mpurate = arm_fck_p->rate / CYCLES_PER_MHZ; _mpurate = __clk_get_rate(arm_fck_p) / CYCLES_PER_MHZ;
c = (_mpurate << SDRC_MPURATE_SCALE) >> SDRC_MPURATE_BASE_SHIFT; c = (_mpurate << SDRC_MPURATE_SCALE) >> SDRC_MPURATE_BASE_SHIFT;
c += 1; /* for safety */ c += 1; /* for safety */
c *= SDRC_MPURATE_LOOPS; c *= SDRC_MPURATE_LOOPS;
...@@ -90,8 +92,8 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) ...@@ -90,8 +92,8 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
if (c == 0) if (c == 0)
c = 1; c = 1;
pr_debug("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate, pr_debug("clock: changing CORE DPLL rate from %lu to %lu\n",
validrate); clkrate, validrate);
pr_debug("clock: SDRC CS0 timing params used: RFR %08x CTRLA %08x CTRLB %08x MR %08x\n", pr_debug("clock: SDRC CS0 timing params used: RFR %08x CTRLA %08x CTRLB %08x MR %08x\n",
sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla,
sdrc_cs0->actim_ctrlb, sdrc_cs0->mr); sdrc_cs0->actim_ctrlb, sdrc_cs0->mr);
...@@ -102,14 +104,14 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) ...@@ -102,14 +104,14 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
if (sdrc_cs1) if (sdrc_cs1)
omap3_configure_core_dpll( omap3_configure_core_dpll(
new_div, unlock_dll, c, rate > clk->rate, new_div, unlock_dll, c, rate > clkrate,
sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla,
sdrc_cs0->actim_ctrlb, sdrc_cs0->mr, sdrc_cs0->actim_ctrlb, sdrc_cs0->mr,
sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla, sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla,
sdrc_cs1->actim_ctrlb, sdrc_cs1->mr); sdrc_cs1->actim_ctrlb, sdrc_cs1->mr);
else else
omap3_configure_core_dpll( omap3_configure_core_dpll(
new_div, unlock_dll, c, rate > clk->rate, new_div, unlock_dll, c, rate > clkrate,
sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla,
sdrc_cs0->actim_ctrlb, sdrc_cs0->mr, sdrc_cs0->actim_ctrlb, sdrc_cs0->mr,
0, 0, 0, 0); 0, 0, 0, 0);
......
...@@ -72,7 +72,7 @@ static const struct clksel *_get_clksel_by_parent(struct clk *clk, ...@@ -72,7 +72,7 @@ static const struct clksel *_get_clksel_by_parent(struct clk *clk,
if (!clks->parent) { if (!clks->parent) {
/* This indicates a data problem */ /* This indicates a data problem */
WARN(1, "clock: %s: could not find parent clock %s in clksel array\n", WARN(1, "clock: %s: could not find parent clock %s in clksel array\n",
clk->name, src_clk->name); __clk_get_name(clk), __clk_get_name(src_clk));
return NULL; return NULL;
} }
...@@ -127,7 +127,8 @@ static u8 _get_div_and_fieldval(struct clk *src_clk, struct clk *clk, ...@@ -127,7 +127,8 @@ static u8 _get_div_and_fieldval(struct clk *src_clk, struct clk *clk,
if (max_div == 0) { if (max_div == 0) {
/* This indicates an error in the clksel data */ /* This indicates an error in the clksel data */
WARN(1, "clock: %s: could not find divisor for parent %s\n", WARN(1, "clock: %s: could not find divisor for parent %s\n",
clk->name, src_clk->parent->name); __clk_get_name(clk),
__clk_get_name(__clk_get_parent(src_clk)));
return 0; return 0;
} }
...@@ -176,8 +177,10 @@ static u32 _clksel_to_divisor(struct clk *clk, u32 field_val) ...@@ -176,8 +177,10 @@ static u32 _clksel_to_divisor(struct clk *clk, u32 field_val)
{ {
const struct clksel *clks; const struct clksel *clks;
const struct clksel_rate *clkr; const struct clksel_rate *clkr;
struct clk *parent;
clks = _get_clksel_by_parent(clk, clk->parent); parent = __clk_get_parent(clk);
clks = _get_clksel_by_parent(clk, parent);
if (!clks) if (!clks)
return 0; return 0;
...@@ -191,8 +194,8 @@ static u32 _clksel_to_divisor(struct clk *clk, u32 field_val) ...@@ -191,8 +194,8 @@ static u32 _clksel_to_divisor(struct clk *clk, u32 field_val)
if (!clkr->div) { if (!clkr->div) {
/* This indicates a data error */ /* This indicates a data error */
WARN(1, "clock: %s: could not find fieldval %d parent %s\n", WARN(1, "clock: %s: could not find fieldval %d for parent %s\n",
clk->name, field_val, clk->parent->name); __clk_get_name(clk), field_val, __clk_get_name(parent));
return 0; return 0;
} }
...@@ -213,11 +216,13 @@ static u32 _divisor_to_clksel(struct clk *clk, u32 div) ...@@ -213,11 +216,13 @@ static u32 _divisor_to_clksel(struct clk *clk, u32 div)
{ {
const struct clksel *clks; const struct clksel *clks;
const struct clksel_rate *clkr; const struct clksel_rate *clkr;
struct clk *parent;
/* should never happen */ /* should never happen */
WARN_ON(div == 0); WARN_ON(div == 0);
clks = _get_clksel_by_parent(clk, clk->parent); parent = __clk_get_parent(clk);
clks = _get_clksel_by_parent(clk, parent);
if (!clks) if (!clks)
return ~0; return ~0;
...@@ -230,8 +235,8 @@ static u32 _divisor_to_clksel(struct clk *clk, u32 div) ...@@ -230,8 +235,8 @@ static u32 _divisor_to_clksel(struct clk *clk, u32 div)
} }
if (!clkr->div) { if (!clkr->div) {
pr_err("clock: %s: could not find divisor %d parent %s\n", pr_err("clock: %s: could not find divisor %d for parent %s\n",
clk->name, div, clk->parent->name); __clk_get_name(clk), div, __clk_get_name(parent));
return ~0; return ~0;
} }
...@@ -281,16 +286,23 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate, ...@@ -281,16 +286,23 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate,
const struct clksel *clks; const struct clksel *clks;
const struct clksel_rate *clkr; const struct clksel_rate *clkr;
u32 last_div = 0; u32 last_div = 0;
struct clk *parent;
unsigned long parent_rate;
const char *clk_name;
parent = __clk_get_parent(clk);
parent_rate = __clk_get_rate(parent);
clk_name = __clk_get_name(clk);
if (!clk->clksel || !clk->clksel_mask) if (!clk->clksel || !clk->clksel_mask)
return ~0; return ~0;
pr_debug("clock: clksel_round_rate_div: %s target_rate %ld\n", pr_debug("clock: clksel_round_rate_div: %s target_rate %ld\n",
clk->name, target_rate); clk_name, target_rate);
*new_div = 1; *new_div = 1;
clks = _get_clksel_by_parent(clk, clk->parent); clks = _get_clksel_by_parent(clk, parent);
if (!clks) if (!clks)
return ~0; return ~0;
...@@ -300,29 +312,29 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate, ...@@ -300,29 +312,29 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate,
/* Sanity check */ /* Sanity check */
if (clkr->div <= last_div) if (clkr->div <= last_div)
pr_err("clock: %s: clksel_rate table not sorted", pr_err("clock: %s: clksel_rate table not sorted\n",
clk->name); clk_name);
last_div = clkr->div; last_div = clkr->div;
test_rate = clk->parent->rate / clkr->div; test_rate = parent_rate / clkr->div;
if (test_rate <= target_rate) if (test_rate <= target_rate)
break; /* found it */ break; /* found it */
} }
if (!clkr->div) { if (!clkr->div) {
pr_err("clock: %s: could not find divisor for target rate %ld parent %s\n", pr_err("clock: %s: could not find divisor for target rate %ld for parent %s\n",
clk->name, target_rate, clk->parent->name); clk_name, target_rate, __clk_get_name(parent));
return ~0; return ~0;
} }
*new_div = clkr->div; *new_div = clkr->div;
pr_debug("clock: new_div = %d, new_rate = %ld\n", *new_div, pr_debug("clock: new_div = %d, new_rate = %ld\n", *new_div,
(clk->parent->rate / clkr->div)); (parent_rate / clkr->div));
return clk->parent->rate / clkr->div; return parent_rate / clkr->div;
} }
/* /*
...@@ -344,10 +356,15 @@ void omap2_init_clksel_parent(struct clk *clk) ...@@ -344,10 +356,15 @@ void omap2_init_clksel_parent(struct clk *clk)
const struct clksel *clks; const struct clksel *clks;
const struct clksel_rate *clkr; const struct clksel_rate *clkr;
u32 r, found = 0; u32 r, found = 0;
struct clk *parent;
const char *clk_name;
if (!clk->clksel || !clk->clksel_mask) if (!clk->clksel || !clk->clksel_mask)
return; return;
parent = __clk_get_parent(clk);
clk_name = __clk_get_name(clk);
r = __raw_readl(clk->clksel_reg) & clk->clksel_mask; r = __raw_readl(clk->clksel_reg) & clk->clksel_mask;
r >>= __ffs(clk->clksel_mask); r >>= __ffs(clk->clksel_mask);
...@@ -357,11 +374,13 @@ void omap2_init_clksel_parent(struct clk *clk) ...@@ -357,11 +374,13 @@ void omap2_init_clksel_parent(struct clk *clk)
continue; continue;
if (clkr->val == r) { if (clkr->val == r) {
if (clk->parent != clks->parent) { if (parent != clks->parent) {
pr_debug("clock: %s: inited parent to %s (was %s)\n", pr_debug("clock: %s: inited parent to %s (was %s)\n",
clk->name, clks->parent->name, clk_name,
((clk->parent) ? __clk_get_name(clks->parent),
clk->parent->name : "NULL")); ((parent) ?
__clk_get_name(parent) :
"NULL"));
clk_reparent(clk, clks->parent); clk_reparent(clk, clks->parent);
}; };
found = 1; found = 1;
...@@ -371,7 +390,7 @@ void omap2_init_clksel_parent(struct clk *clk) ...@@ -371,7 +390,7 @@ void omap2_init_clksel_parent(struct clk *clk)
/* This indicates a data error */ /* This indicates a data error */
WARN(!found, "clock: %s: init parent: could not find regval %0x\n", WARN(!found, "clock: %s: init parent: could not find regval %0x\n",
clk->name, r); clk_name, r);
return; return;
} }
...@@ -389,15 +408,17 @@ unsigned long omap2_clksel_recalc(struct clk *clk) ...@@ -389,15 +408,17 @@ unsigned long omap2_clksel_recalc(struct clk *clk)
{ {
unsigned long rate; unsigned long rate;
u32 div = 0; u32 div = 0;
struct clk *parent;
div = _read_divisor(clk); div = _read_divisor(clk);
if (div == 0) if (div == 0)
return clk->rate; return __clk_get_rate(clk);
rate = clk->parent->rate / div; parent = __clk_get_parent(clk);
rate = __clk_get_rate(parent) / div;
pr_debug("clock: %s: recalc'd rate is %ld (div %d)\n", clk->name, pr_debug("clock: %s: recalc'd rate is %ld (div %d)\n",
rate, div); __clk_get_name(clk), rate, div);
return rate; return rate;
} }
...@@ -452,9 +473,10 @@ int omap2_clksel_set_rate(struct clk *clk, unsigned long rate) ...@@ -452,9 +473,10 @@ int omap2_clksel_set_rate(struct clk *clk, unsigned long rate)
_write_clksel_reg(clk, field_val); _write_clksel_reg(clk, field_val);
clk->rate = clk->parent->rate / new_div; clk->rate = __clk_get_rate(__clk_get_parent(clk)) / new_div;
pr_debug("clock: %s: set rate to %ld\n", clk->name, clk->rate); pr_debug("clock: %s: set rate to %ld\n", __clk_get_name(clk),
__clk_get_rate(clk));
return 0; return 0;
} }
...@@ -496,13 +518,15 @@ int omap2_clksel_set_parent(struct clk *clk, struct clk *new_parent) ...@@ -496,13 +518,15 @@ int omap2_clksel_set_parent(struct clk *clk, struct clk *new_parent)
clk_reparent(clk, new_parent); clk_reparent(clk, new_parent);
/* CLKSEL clocks follow their parents' rates, divided by a divisor */ /* CLKSEL clocks follow their parents' rates, divided by a divisor */
clk->rate = new_parent->rate; clk->rate = __clk_get_rate(new_parent);
if (parent_div > 0) if (parent_div > 0)
clk->rate /= parent_div; __clk_get_rate(clk) /= parent_div;
pr_debug("clock: %s: set parent to %s (new rate %ld)\n", pr_debug("clock: %s: set parent to %s (new rate %ld)\n",
clk->name, clk->parent->name, clk->rate); __clk_get_name(clk),
__clk_get_name(__clk_get_parent(clk)),
__clk_get_rate(clk));
return 0; return 0;
} }
...@@ -87,7 +87,7 @@ static int _dpll_test_fint(struct clk *clk, u8 n) ...@@ -87,7 +87,7 @@ static int _dpll_test_fint(struct clk *clk, u8 n)
dd = clk->dpll_data; dd = clk->dpll_data;
/* DPLL divider must result in a valid jitter correction val */ /* DPLL divider must result in a valid jitter correction val */
fint = clk->parent->rate / n; fint = __clk_get_rate(__clk_get_parent(clk)) / n;
if (cpu_is_omap24xx()) { if (cpu_is_omap24xx()) {
/* Should not be called for OMAP2, so warn if it is called */ /* Should not be called for OMAP2, so warn if it is called */
...@@ -252,16 +252,16 @@ u32 omap2_get_dpll_rate(struct clk *clk) ...@@ -252,16 +252,16 @@ u32 omap2_get_dpll_rate(struct clk *clk)
if (cpu_is_omap24xx()) { if (cpu_is_omap24xx()) {
if (v == OMAP2XXX_EN_DPLL_LPBYPASS || if (v == OMAP2XXX_EN_DPLL_LPBYPASS ||
v == OMAP2XXX_EN_DPLL_FRBYPASS) v == OMAP2XXX_EN_DPLL_FRBYPASS)
return dd->clk_bypass->rate; return __clk_get_rate(dd->clk_bypass);
} else if (cpu_is_omap34xx()) { } else if (cpu_is_omap34xx()) {
if (v == OMAP3XXX_EN_DPLL_LPBYPASS || if (v == OMAP3XXX_EN_DPLL_LPBYPASS ||
v == OMAP3XXX_EN_DPLL_FRBYPASS) v == OMAP3XXX_EN_DPLL_FRBYPASS)
return dd->clk_bypass->rate; return __clk_get_rate(dd->clk_bypass);
} else if (soc_is_am33xx() || cpu_is_omap44xx()) { } else if (soc_is_am33xx() || cpu_is_omap44xx()) {
if (v == OMAP4XXX_EN_DPLL_LPBYPASS || if (v == OMAP4XXX_EN_DPLL_LPBYPASS ||
v == OMAP4XXX_EN_DPLL_FRBYPASS || v == OMAP4XXX_EN_DPLL_FRBYPASS ||
v == OMAP4XXX_EN_DPLL_MNBYPASS) v == OMAP4XXX_EN_DPLL_MNBYPASS)
return dd->clk_bypass->rate; return __clk_get_rate(dd->clk_bypass);
} }
v = __raw_readl(dd->mult_div1_reg); v = __raw_readl(dd->mult_div1_reg);
...@@ -270,7 +270,7 @@ u32 omap2_get_dpll_rate(struct clk *clk) ...@@ -270,7 +270,7 @@ u32 omap2_get_dpll_rate(struct clk *clk)
dpll_div = v & dd->div1_mask; dpll_div = v & dd->div1_mask;
dpll_div >>= __ffs(dd->div1_mask); dpll_div >>= __ffs(dd->div1_mask);
dpll_clk = (long long)dd->clk_ref->rate * dpll_mult; dpll_clk = (long long) __clk_get_rate(dd->clk_ref) * dpll_mult;
do_div(dpll_clk, dpll_div + 1); do_div(dpll_clk, dpll_div + 1);
return dpll_clk; return dpll_clk;
...@@ -296,16 +296,20 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) ...@@ -296,16 +296,20 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
unsigned long scaled_rt_rp; unsigned long scaled_rt_rp;
unsigned long new_rate = 0; unsigned long new_rate = 0;
struct dpll_data *dd; struct dpll_data *dd;
unsigned long ref_rate;
const char *clk_name;
if (!clk || !clk->dpll_data) if (!clk || !clk->dpll_data)
return ~0; return ~0;
dd = clk->dpll_data; dd = clk->dpll_data;
ref_rate = __clk_get_rate(dd->clk_ref);
clk_name = __clk_get_name(clk);
pr_debug("clock: %s: starting DPLL round_rate, target rate %ld\n", pr_debug("clock: %s: starting DPLL round_rate, target rate %ld\n",
clk->name, target_rate); clk_name, target_rate);
scaled_rt_rp = target_rate / (dd->clk_ref->rate / DPLL_SCALE_FACTOR); scaled_rt_rp = target_rate / (ref_rate / DPLL_SCALE_FACTOR);
scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR; scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR;
dd->last_rounded_rate = 0; dd->last_rounded_rate = 0;
...@@ -332,14 +336,14 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) ...@@ -332,14 +336,14 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
break; break;
r = _dpll_test_mult(&m, n, &new_rate, target_rate, r = _dpll_test_mult(&m, n, &new_rate, target_rate,
dd->clk_ref->rate); ref_rate);
/* m can't be set low enough for this n - try with a larger n */ /* m can't be set low enough for this n - try with a larger n */
if (r == DPLL_MULT_UNDERFLOW) if (r == DPLL_MULT_UNDERFLOW)
continue; continue;
pr_debug("clock: %s: m = %d: n = %d: new_rate = %ld\n", pr_debug("clock: %s: m = %d: n = %d: new_rate = %ld\n",
clk->name, m, n, new_rate); clk_name, m, n, new_rate);
if (target_rate == new_rate) { if (target_rate == new_rate) {
dd->last_rounded_m = m; dd->last_rounded_m = m;
...@@ -350,8 +354,8 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) ...@@ -350,8 +354,8 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
} }
if (target_rate != new_rate) { if (target_rate != new_rate) {
pr_debug("clock: %s: cannot round to rate %ld\n", clk->name, pr_debug("clock: %s: cannot round to rate %ld\n",
target_rate); clk_name, target_rate);
return ~0; return ~0;
} }
......
...@@ -78,7 +78,7 @@ static void _omap2_module_wait_ready(struct clk *clk) ...@@ -78,7 +78,7 @@ static void _omap2_module_wait_ready(struct clk *clk)
clk->ops->find_idlest(clk, &idlest_reg, &idlest_bit, &idlest_val); clk->ops->find_idlest(clk, &idlest_reg, &idlest_bit, &idlest_val);
omap2_cm_wait_idlest(idlest_reg, (1 << idlest_bit), idlest_val, omap2_cm_wait_idlest(idlest_reg, (1 << idlest_bit), idlest_val,
clk->name); __clk_get_name(clk));
} }
/* Public functions */ /* Public functions */
...@@ -94,18 +94,21 @@ static void _omap2_module_wait_ready(struct clk *clk) ...@@ -94,18 +94,21 @@ static void _omap2_module_wait_ready(struct clk *clk)
void omap2_init_clk_clkdm(struct clk *clk) void omap2_init_clk_clkdm(struct clk *clk)
{ {
struct clockdomain *clkdm; struct clockdomain *clkdm;
const char *clk_name;
if (!clk->clkdm_name) if (!clk->clkdm_name)
return; return;
clk_name = __clk_get_name(clk);
clkdm = clkdm_lookup(clk->clkdm_name); clkdm = clkdm_lookup(clk->clkdm_name);
if (clkdm) { if (clkdm) {
pr_debug("clock: associated clk %s to clkdm %s\n", pr_debug("clock: associated clk %s to clkdm %s\n",
clk->name, clk->clkdm_name); clk_name, clk->clkdm_name);
clk->clkdm = clkdm; clk->clkdm = clkdm;
} else { } else {
pr_debug("clock: could not associate clk %s to clkdm %s\n", pr_debug("clock: could not associate clk %s to clkdm %s\n",
clk->name, clk->clkdm_name); clk_name, clk->clkdm_name);
} }
} }
......
...@@ -1804,6 +1804,7 @@ static struct omap_clk omap2420_clks[] = { ...@@ -1804,6 +1804,7 @@ static struct omap_clk omap2420_clks[] = {
CLK(NULL, "gfx_ick", &gfx_ick, CK_242X), CLK(NULL, "gfx_ick", &gfx_ick, CK_242X),
/* DSS domain clocks */ /* DSS domain clocks */
CLK("omapdss_dss", "ick", &dss_ick, CK_242X), CLK("omapdss_dss", "ick", &dss_ick, CK_242X),
CLK(NULL, "dss_ick", &dss_ick, CK_242X),
CLK(NULL, "dss1_fck", &dss1_fck, CK_242X), CLK(NULL, "dss1_fck", &dss1_fck, CK_242X),
CLK(NULL, "dss2_fck", &dss2_fck, CK_242X), CLK(NULL, "dss2_fck", &dss2_fck, CK_242X),
CLK(NULL, "dss_54m_fck", &dss_54m_fck, CK_242X), CLK(NULL, "dss_54m_fck", &dss_54m_fck, CK_242X),
...@@ -1843,12 +1844,16 @@ static struct omap_clk omap2420_clks[] = { ...@@ -1843,12 +1844,16 @@ static struct omap_clk omap2420_clks[] = {
CLK(NULL, "gpt12_ick", &gpt12_ick, CK_242X), CLK(NULL, "gpt12_ick", &gpt12_ick, CK_242X),
CLK(NULL, "gpt12_fck", &gpt12_fck, CK_242X), CLK(NULL, "gpt12_fck", &gpt12_fck, CK_242X),
CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_242X), CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_242X),
CLK(NULL, "mcbsp1_ick", &mcbsp1_ick, CK_242X),
CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_242X), CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_242X),
CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_242X), CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_242X),
CLK(NULL, "mcbsp2_ick", &mcbsp2_ick, CK_242X),
CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_242X), CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_242X),
CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_242X), CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_242X),
CLK(NULL, "mcspi1_ick", &mcspi1_ick, CK_242X),
CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_242X), CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_242X),
CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_242X), CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_242X),
CLK(NULL, "mcspi2_ick", &mcspi2_ick, CK_242X),
CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_242X), CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_242X),
CLK(NULL, "uart1_ick", &uart1_ick, CK_242X), CLK(NULL, "uart1_ick", &uart1_ick, CK_242X),
CLK(NULL, "uart1_fck", &uart1_fck, CK_242X), CLK(NULL, "uart1_fck", &uart1_fck, CK_242X),
...@@ -1859,12 +1864,15 @@ static struct omap_clk omap2420_clks[] = { ...@@ -1859,12 +1864,15 @@ static struct omap_clk omap2420_clks[] = {
CLK(NULL, "gpios_ick", &gpios_ick, CK_242X), CLK(NULL, "gpios_ick", &gpios_ick, CK_242X),
CLK(NULL, "gpios_fck", &gpios_fck, CK_242X), CLK(NULL, "gpios_fck", &gpios_fck, CK_242X),
CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_242X), CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_242X),
CLK(NULL, "mpu_wdt_ick", &mpu_wdt_ick, CK_242X),
CLK(NULL, "mpu_wdt_fck", &mpu_wdt_fck, CK_242X), CLK(NULL, "mpu_wdt_fck", &mpu_wdt_fck, CK_242X),
CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_242X), CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_242X),
CLK(NULL, "wdt1_ick", &wdt1_ick, CK_242X), CLK(NULL, "wdt1_ick", &wdt1_ick, CK_242X),
CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_242X), CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_242X),
CLK("omap24xxcam", "fck", &cam_fck, CK_242X), CLK("omap24xxcam", "fck", &cam_fck, CK_242X),
CLK(NULL, "cam_fck", &cam_fck, CK_242X),
CLK("omap24xxcam", "ick", &cam_ick, CK_242X), CLK("omap24xxcam", "ick", &cam_ick, CK_242X),
CLK(NULL, "cam_ick", &cam_ick, CK_242X),
CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_242X), CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_242X),
CLK(NULL, "wdt4_ick", &wdt4_ick, CK_242X), CLK(NULL, "wdt4_ick", &wdt4_ick, CK_242X),
CLK(NULL, "wdt4_fck", &wdt4_fck, CK_242X), CLK(NULL, "wdt4_fck", &wdt4_fck, CK_242X),
...@@ -1873,16 +1881,22 @@ static struct omap_clk omap2420_clks[] = { ...@@ -1873,16 +1881,22 @@ static struct omap_clk omap2420_clks[] = {
CLK(NULL, "mspro_ick", &mspro_ick, CK_242X), CLK(NULL, "mspro_ick", &mspro_ick, CK_242X),
CLK(NULL, "mspro_fck", &mspro_fck, CK_242X), CLK(NULL, "mspro_fck", &mspro_fck, CK_242X),
CLK("mmci-omap.0", "ick", &mmc_ick, CK_242X), CLK("mmci-omap.0", "ick", &mmc_ick, CK_242X),
CLK(NULL, "mmc_ick", &mmc_ick, CK_242X),
CLK("mmci-omap.0", "fck", &mmc_fck, CK_242X), CLK("mmci-omap.0", "fck", &mmc_fck, CK_242X),
CLK(NULL, "mmc_fck", &mmc_fck, CK_242X),
CLK(NULL, "fac_ick", &fac_ick, CK_242X), CLK(NULL, "fac_ick", &fac_ick, CK_242X),
CLK(NULL, "fac_fck", &fac_fck, CK_242X), CLK(NULL, "fac_fck", &fac_fck, CK_242X),
CLK(NULL, "eac_ick", &eac_ick, CK_242X), CLK(NULL, "eac_ick", &eac_ick, CK_242X),
CLK(NULL, "eac_fck", &eac_fck, CK_242X), CLK(NULL, "eac_fck", &eac_fck, CK_242X),
CLK("omap_hdq.0", "ick", &hdq_ick, CK_242X), CLK("omap_hdq.0", "ick", &hdq_ick, CK_242X),
CLK(NULL, "hdq_ick", &hdq_ick, CK_242X),
CLK("omap_hdq.0", "fck", &hdq_fck, CK_242X), CLK("omap_hdq.0", "fck", &hdq_fck, CK_242X),
CLK(NULL, "hdq_fck", &hdq_fck, CK_242X),
CLK("omap_i2c.1", "ick", &i2c1_ick, CK_242X), CLK("omap_i2c.1", "ick", &i2c1_ick, CK_242X),
CLK(NULL, "i2c1_ick", &i2c1_ick, CK_242X),
CLK(NULL, "i2c1_fck", &i2c1_fck, CK_242X), CLK(NULL, "i2c1_fck", &i2c1_fck, CK_242X),
CLK("omap_i2c.2", "ick", &i2c2_ick, CK_242X), CLK("omap_i2c.2", "ick", &i2c2_ick, CK_242X),
CLK(NULL, "i2c2_ick", &i2c2_ick, CK_242X),
CLK(NULL, "i2c2_fck", &i2c2_fck, CK_242X), CLK(NULL, "i2c2_fck", &i2c2_fck, CK_242X),
CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X), CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X),
CLK(NULL, "sdma_fck", &sdma_fck, CK_242X), CLK(NULL, "sdma_fck", &sdma_fck, CK_242X),
...@@ -1892,14 +1906,18 @@ static struct omap_clk omap2420_clks[] = { ...@@ -1892,14 +1906,18 @@ static struct omap_clk omap2420_clks[] = {
CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X), CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X),
CLK(NULL, "des_ick", &des_ick, CK_242X), CLK(NULL, "des_ick", &des_ick, CK_242X),
CLK("omap-sham", "ick", &sha_ick, CK_242X), CLK("omap-sham", "ick", &sha_ick, CK_242X),
CLK(NULL, "sha_ick", &sha_ick, CK_242X),
CLK("omap_rng", "ick", &rng_ick, CK_242X), CLK("omap_rng", "ick", &rng_ick, CK_242X),
CLK(NULL, "rng_ick", &rng_ick, CK_242X),
CLK("omap-aes", "ick", &aes_ick, CK_242X), CLK("omap-aes", "ick", &aes_ick, CK_242X),
CLK(NULL, "aes_ick", &aes_ick, CK_242X),
CLK(NULL, "pka_ick", &pka_ick, CK_242X), CLK(NULL, "pka_ick", &pka_ick, CK_242X),
CLK(NULL, "usb_fck", &usb_fck, CK_242X), CLK(NULL, "usb_fck", &usb_fck, CK_242X),
CLK("musb-hdrc", "fck", &osc_ck, CK_242X), CLK("musb-hdrc", "fck", &osc_ck, CK_242X),
CLK(NULL, "timer_32k_ck", &func_32k_ck, CK_243X), CLK(NULL, "timer_32k_ck", &func_32k_ck, CK_242X),
CLK(NULL, "timer_sys_ck", &sys_ck, CK_243X), CLK(NULL, "timer_sys_ck", &sys_ck, CK_242X),
CLK(NULL, "timer_ext_ck", &alt_ck, CK_243X), CLK(NULL, "timer_ext_ck", &alt_ck, CK_242X),
CLK(NULL, "cpufreq_ck", &virt_prcm_set, CK_242X),
}; };
/* /*
......
...@@ -1888,6 +1888,7 @@ static struct omap_clk omap2430_clks[] = { ...@@ -1888,6 +1888,7 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X), CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X),
/* DSS domain clocks */ /* DSS domain clocks */
CLK("omapdss_dss", "ick", &dss_ick, CK_243X), CLK("omapdss_dss", "ick", &dss_ick, CK_243X),
CLK(NULL, "dss_ick", &dss_ick, CK_243X),
CLK(NULL, "dss1_fck", &dss1_fck, CK_243X), CLK(NULL, "dss1_fck", &dss1_fck, CK_243X),
CLK(NULL, "dss2_fck", &dss2_fck, CK_243X), CLK(NULL, "dss2_fck", &dss2_fck, CK_243X),
CLK(NULL, "dss_54m_fck", &dss_54m_fck, CK_243X), CLK(NULL, "dss_54m_fck", &dss_54m_fck, CK_243X),
...@@ -1927,20 +1928,28 @@ static struct omap_clk omap2430_clks[] = { ...@@ -1927,20 +1928,28 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X), CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X),
CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X), CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X),
CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X), CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X),
CLK(NULL, "mcbsp1_ick", &mcbsp1_ick, CK_243X),
CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_243X), CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_243X),
CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X), CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X),
CLK(NULL, "mcbsp2_ick", &mcbsp2_ick, CK_243X),
CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_243X), CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_243X),
CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X), CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X),
CLK(NULL, "mcbsp3_ick", &mcbsp3_ick, CK_243X),
CLK(NULL, "mcbsp3_fck", &mcbsp3_fck, CK_243X), CLK(NULL, "mcbsp3_fck", &mcbsp3_fck, CK_243X),
CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X), CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X),
CLK(NULL, "mcbsp4_ick", &mcbsp4_ick, CK_243X),
CLK(NULL, "mcbsp4_fck", &mcbsp4_fck, CK_243X), CLK(NULL, "mcbsp4_fck", &mcbsp4_fck, CK_243X),
CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X), CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X),
CLK(NULL, "mcbsp5_ick", &mcbsp5_ick, CK_243X),
CLK(NULL, "mcbsp5_fck", &mcbsp5_fck, CK_243X), CLK(NULL, "mcbsp5_fck", &mcbsp5_fck, CK_243X),
CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X), CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X),
CLK(NULL, "mcspi1_ick", &mcspi1_ick, CK_243X),
CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_243X), CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_243X),
CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X), CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X),
CLK(NULL, "mcspi2_ick", &mcspi2_ick, CK_243X),
CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_243X), CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_243X),
CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X), CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X),
CLK(NULL, "mcspi3_ick", &mcspi3_ick, CK_243X),
CLK(NULL, "mcspi3_fck", &mcspi3_fck, CK_243X), CLK(NULL, "mcspi3_fck", &mcspi3_fck, CK_243X),
CLK(NULL, "uart1_ick", &uart1_ick, CK_243X), CLK(NULL, "uart1_ick", &uart1_ick, CK_243X),
CLK(NULL, "uart1_fck", &uart1_fck, CK_243X), CLK(NULL, "uart1_fck", &uart1_fck, CK_243X),
...@@ -1951,13 +1960,16 @@ static struct omap_clk omap2430_clks[] = { ...@@ -1951,13 +1960,16 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL, "gpios_ick", &gpios_ick, CK_243X), CLK(NULL, "gpios_ick", &gpios_ick, CK_243X),
CLK(NULL, "gpios_fck", &gpios_fck, CK_243X), CLK(NULL, "gpios_fck", &gpios_fck, CK_243X),
CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X), CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X),
CLK(NULL, "mpu_wdt_ick", &mpu_wdt_ick, CK_243X),
CLK(NULL, "mpu_wdt_fck", &mpu_wdt_fck, CK_243X), CLK(NULL, "mpu_wdt_fck", &mpu_wdt_fck, CK_243X),
CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X), CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X),
CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X), CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X),
CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X), CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X),
CLK(NULL, "icr_ick", &icr_ick, CK_243X), CLK(NULL, "icr_ick", &icr_ick, CK_243X),
CLK("omap24xxcam", "fck", &cam_fck, CK_243X), CLK("omap24xxcam", "fck", &cam_fck, CK_243X),
CLK(NULL, "cam_fck", &cam_fck, CK_243X),
CLK("omap24xxcam", "ick", &cam_ick, CK_243X), CLK("omap24xxcam", "ick", &cam_ick, CK_243X),
CLK(NULL, "cam_ick", &cam_ick, CK_243X),
CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X), CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X),
CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X), CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X),
CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X), CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X),
...@@ -1966,10 +1978,14 @@ static struct omap_clk omap2430_clks[] = { ...@@ -1966,10 +1978,14 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL, "fac_ick", &fac_ick, CK_243X), CLK(NULL, "fac_ick", &fac_ick, CK_243X),
CLK(NULL, "fac_fck", &fac_fck, CK_243X), CLK(NULL, "fac_fck", &fac_fck, CK_243X),
CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X), CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X),
CLK(NULL, "hdq_ick", &hdq_ick, CK_243X),
CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X), CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X),
CLK(NULL, "hdq_fck", &hdq_fck, CK_243X),
CLK("omap_i2c.1", "ick", &i2c1_ick, CK_243X), CLK("omap_i2c.1", "ick", &i2c1_ick, CK_243X),
CLK(NULL, "i2c1_ick", &i2c1_ick, CK_243X),
CLK(NULL, "i2chs1_fck", &i2chs1_fck, CK_243X), CLK(NULL, "i2chs1_fck", &i2chs1_fck, CK_243X),
CLK("omap_i2c.2", "ick", &i2c2_ick, CK_243X), CLK("omap_i2c.2", "ick", &i2c2_ick, CK_243X),
CLK(NULL, "i2c2_ick", &i2c2_ick, CK_243X),
CLK(NULL, "i2chs2_fck", &i2chs2_fck, CK_243X), CLK(NULL, "i2chs2_fck", &i2chs2_fck, CK_243X),
CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X), CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X),
CLK(NULL, "sdma_fck", &sdma_fck, CK_243X), CLK(NULL, "sdma_fck", &sdma_fck, CK_243X),
...@@ -1978,22 +1994,29 @@ static struct omap_clk omap2430_clks[] = { ...@@ -1978,22 +1994,29 @@ static struct omap_clk omap2430_clks[] = {
CLK(NULL, "des_ick", &des_ick, CK_243X), CLK(NULL, "des_ick", &des_ick, CK_243X),
CLK("omap-sham", "ick", &sha_ick, CK_243X), CLK("omap-sham", "ick", &sha_ick, CK_243X),
CLK("omap_rng", "ick", &rng_ick, CK_243X), CLK("omap_rng", "ick", &rng_ick, CK_243X),
CLK(NULL, "rng_ick", &rng_ick, CK_243X),
CLK("omap-aes", "ick", &aes_ick, CK_243X), CLK("omap-aes", "ick", &aes_ick, CK_243X),
CLK(NULL, "pka_ick", &pka_ick, CK_243X), CLK(NULL, "pka_ick", &pka_ick, CK_243X),
CLK(NULL, "usb_fck", &usb_fck, CK_243X), CLK(NULL, "usb_fck", &usb_fck, CK_243X),
CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X), CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X),
CLK(NULL, "usbhs_ick", &usbhs_ick, CK_243X),
CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_243X), CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_243X),
CLK(NULL, "mmchs1_ick", &mmchs1_ick, CK_243X),
CLK(NULL, "mmchs1_fck", &mmchs1_fck, CK_243X), CLK(NULL, "mmchs1_fck", &mmchs1_fck, CK_243X),
CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_243X), CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_243X),
CLK(NULL, "mmchs2_ick", &mmchs2_ick, CK_243X),
CLK(NULL, "mmchs2_fck", &mmchs2_fck, CK_243X), CLK(NULL, "mmchs2_fck", &mmchs2_fck, CK_243X),
CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X), CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X),
CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X), CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X),
CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X), CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X),
CLK("omap_hsmmc.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X), CLK("omap_hsmmc.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X),
CLK(NULL, "mmchsdb1_fck", &mmchsdb1_fck, CK_243X),
CLK("omap_hsmmc.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X), CLK("omap_hsmmc.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X),
CLK(NULL, "mmchsdb2_fck", &mmchsdb2_fck, CK_243X),
CLK(NULL, "timer_32k_ck", &func_32k_ck, CK_243X), CLK(NULL, "timer_32k_ck", &func_32k_ck, CK_243X),
CLK(NULL, "timer_sys_ck", &sys_ck, CK_243X), CLK(NULL, "timer_sys_ck", &sys_ck, CK_243X),
CLK(NULL, "timer_ext_ck", &alt_ck, CK_243X), CLK(NULL, "timer_ext_ck", &alt_ck, CK_243X),
CLK(NULL, "cpufreq_ck", &virt_prcm_set, CK_243X),
}; };
/* /*
......
...@@ -1013,6 +1013,7 @@ static struct omap_clk am33xx_clks[] = { ...@@ -1013,6 +1013,7 @@ static struct omap_clk am33xx_clks[] = {
CLK(NULL, "dpll_core_m5_ck", &dpll_core_m5_ck, CK_AM33XX), CLK(NULL, "dpll_core_m5_ck", &dpll_core_m5_ck, CK_AM33XX),
CLK(NULL, "dpll_core_m6_ck", &dpll_core_m6_ck, CK_AM33XX), CLK(NULL, "dpll_core_m6_ck", &dpll_core_m6_ck, CK_AM33XX),
CLK(NULL, "dpll_mpu_ck", &dpll_mpu_ck, CK_AM33XX), CLK(NULL, "dpll_mpu_ck", &dpll_mpu_ck, CK_AM33XX),
CLK("cpu0", NULL, &dpll_mpu_ck, CK_AM33XX),
CLK(NULL, "dpll_mpu_m2_ck", &dpll_mpu_m2_ck, CK_AM33XX), CLK(NULL, "dpll_mpu_m2_ck", &dpll_mpu_m2_ck, CK_AM33XX),
CLK(NULL, "dpll_ddr_ck", &dpll_ddr_ck, CK_AM33XX), CLK(NULL, "dpll_ddr_ck", &dpll_ddr_ck, CK_AM33XX),
CLK(NULL, "dpll_ddr_m2_ck", &dpll_ddr_m2_ck, CK_AM33XX), CLK(NULL, "dpll_ddr_m2_ck", &dpll_ddr_m2_ck, CK_AM33XX),
......
...@@ -63,15 +63,15 @@ void __init omap3_clk_lock_dpll5(void) ...@@ -63,15 +63,15 @@ void __init omap3_clk_lock_dpll5(void)
dpll5_clk = clk_get(NULL, "dpll5_ck"); dpll5_clk = clk_get(NULL, "dpll5_ck");
clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST); clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST);
clk_enable(dpll5_clk); clk_prepare_enable(dpll5_clk);
/* Program dpll5_m2_clk divider for no division */ /* Program dpll5_m2_clk divider for no division */
dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck"); dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck");
clk_enable(dpll5_m2_clk); clk_prepare_enable(dpll5_m2_clk);
clk_set_rate(dpll5_m2_clk, DPLL5_FREQ_FOR_USBHOST); clk_set_rate(dpll5_m2_clk, DPLL5_FREQ_FOR_USBHOST);
clk_disable(dpll5_m2_clk); clk_disable_unprepare(dpll5_m2_clk);
clk_disable(dpll5_clk); clk_disable_unprepare(dpll5_clk);
return; return;
} }
......
...@@ -3215,7 +3215,6 @@ static struct clk dummy_apb_pclk = { ...@@ -3215,7 +3215,6 @@ static struct clk dummy_apb_pclk = {
* clkdev * clkdev
*/ */
/* XXX At some point we should rename this file to clock3xxx_data.c */
static struct omap_clk omap3xxx_clks[] = { static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "apb_pclk", &dummy_apb_pclk, CK_3XXX), CLK(NULL, "apb_pclk", &dummy_apb_pclk, CK_3XXX),
CLK(NULL, "omap_32k_fck", &omap_32k_fck, CK_3XXX), CLK(NULL, "omap_32k_fck", &omap_32k_fck, CK_3XXX),
...@@ -3243,11 +3242,13 @@ static struct omap_clk omap3xxx_clks[] = { ...@@ -3243,11 +3242,13 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "dpll3_m2x2_ck", &dpll3_m2x2_ck, CK_3XXX), CLK(NULL, "dpll3_m2x2_ck", &dpll3_m2x2_ck, CK_3XXX),
CLK(NULL, "dpll3_m3_ck", &dpll3_m3_ck, CK_3XXX), CLK(NULL, "dpll3_m3_ck", &dpll3_m3_ck, CK_3XXX),
CLK(NULL, "dpll3_m3x2_ck", &dpll3_m3x2_ck, CK_3XXX), CLK(NULL, "dpll3_m3x2_ck", &dpll3_m3x2_ck, CK_3XXX),
CLK(NULL, "emu_core_alwon_ck", &emu_core_alwon_ck, CK_3XXX),
CLK("etb", "emu_core_alwon_ck", &emu_core_alwon_ck, CK_3XXX), CLK("etb", "emu_core_alwon_ck", &emu_core_alwon_ck, CK_3XXX),
CLK(NULL, "dpll4_ck", &dpll4_ck, CK_3XXX), CLK(NULL, "dpll4_ck", &dpll4_ck, CK_3XXX),
CLK(NULL, "dpll4_x2_ck", &dpll4_x2_ck, CK_3XXX), CLK(NULL, "dpll4_x2_ck", &dpll4_x2_ck, CK_3XXX),
CLK(NULL, "omap_192m_alwon_fck", &omap_192m_alwon_fck, CK_36XX), CLK(NULL, "omap_192m_alwon_fck", &omap_192m_alwon_fck, CK_36XX),
CLK(NULL, "omap_96m_alwon_fck", &omap_96m_alwon_fck, CK_3XXX), CLK(NULL, "omap_96m_alwon_fck", &omap_96m_alwon_fck, CK_3XXX),
CLK(NULL, "omap_96m_alwon_fck_3630", &omap_96m_alwon_fck_3630, CK_36XX),
CLK(NULL, "omap_96m_fck", &omap_96m_fck, CK_3XXX), CLK(NULL, "omap_96m_fck", &omap_96m_fck, CK_3XXX),
CLK(NULL, "cm_96m_fck", &cm_96m_fck, CK_3XXX), CLK(NULL, "cm_96m_fck", &cm_96m_fck, CK_3XXX),
CLK(NULL, "omap_54m_fck", &omap_54m_fck, CK_3XXX), CLK(NULL, "omap_54m_fck", &omap_54m_fck, CK_3XXX),
...@@ -3263,6 +3264,7 @@ static struct omap_clk omap3xxx_clks[] = { ...@@ -3263,6 +3264,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "dpll4_m5x2_ck", &dpll4_m5x2_ck, CK_3XXX), CLK(NULL, "dpll4_m5x2_ck", &dpll4_m5x2_ck, CK_3XXX),
CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck, CK_3XXX), CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck, CK_3XXX),
CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck, CK_3XXX), CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck, CK_3XXX),
CLK(NULL, "emu_per_alwon_ck", &emu_per_alwon_ck, CK_3XXX),
CLK("etb", "emu_per_alwon_ck", &emu_per_alwon_ck, CK_3XXX), CLK("etb", "emu_per_alwon_ck", &emu_per_alwon_ck, CK_3XXX),
CLK(NULL, "dpll5_ck", &dpll5_ck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK(NULL, "dpll5_ck", &dpll5_ck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
...@@ -3272,6 +3274,7 @@ static struct omap_clk omap3xxx_clks[] = { ...@@ -3272,6 +3274,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "dpll1_fck", &dpll1_fck, CK_3XXX), CLK(NULL, "dpll1_fck", &dpll1_fck, CK_3XXX),
CLK(NULL, "mpu_ck", &mpu_ck, CK_3XXX), CLK(NULL, "mpu_ck", &mpu_ck, CK_3XXX),
CLK(NULL, "arm_fck", &arm_fck, CK_3XXX), CLK(NULL, "arm_fck", &arm_fck, CK_3XXX),
CLK(NULL, "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_3XXX),
CLK("etb", "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_3XXX), CLK("etb", "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_3XXX),
CLK(NULL, "dpll2_fck", &dpll2_fck, CK_34XX | CK_36XX), CLK(NULL, "dpll2_fck", &dpll2_fck, CK_34XX | CK_36XX),
CLK(NULL, "iva2_ck", &iva2_ck, CK_34XX | CK_36XX), CLK(NULL, "iva2_ck", &iva2_ck, CK_34XX | CK_36XX),
...@@ -3295,6 +3298,7 @@ static struct omap_clk omap3xxx_clks[] = { ...@@ -3295,6 +3298,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK("usbhs_omap", "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK("usbhs_omap", "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK("usbhs_tll", "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX),
CLK(NULL, "mmchs3_fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK(NULL, "mmchs3_fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK(NULL, "mmchs2_fck", &mmchs2_fck, CK_3XXX), CLK(NULL, "mmchs2_fck", &mmchs2_fck, CK_3XXX),
...@@ -3315,6 +3319,7 @@ static struct omap_clk omap3xxx_clks[] = { ...@@ -3315,6 +3319,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "fshostusb_fck", &fshostusb_fck, CK_3430ES1), CLK(NULL, "fshostusb_fck", &fshostusb_fck, CK_3430ES1),
CLK(NULL, "core_12m_fck", &core_12m_fck, CK_3XXX), CLK(NULL, "core_12m_fck", &core_12m_fck, CK_3XXX),
CLK("omap_hdq.0", "fck", &hdq_fck, CK_3XXX), CLK("omap_hdq.0", "fck", &hdq_fck, CK_3XXX),
CLK(NULL, "hdq_fck", &hdq_fck, CK_3XXX),
CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es1, CK_3430ES1), CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es1, CK_3430ES1),
CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es2, CK_3430ES2PLUS | CK_36XX), CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es2, CK_3430ES2PLUS | CK_36XX),
CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1), CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1),
...@@ -3322,6 +3327,8 @@ static struct omap_clk omap3xxx_clks[] = { ...@@ -3322,6 +3327,8 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "core_l3_ick", &core_l3_ick, CK_3XXX), CLK(NULL, "core_l3_ick", &core_l3_ick, CK_3XXX),
CLK("musb-omap2430", "ick", &hsotgusb_ick_3430es1, CK_3430ES1), CLK("musb-omap2430", "ick", &hsotgusb_ick_3430es1, CK_3430ES1),
CLK("musb-omap2430", "ick", &hsotgusb_ick_3430es2, CK_3430ES2PLUS | CK_36XX), CLK("musb-omap2430", "ick", &hsotgusb_ick_3430es2, CK_3430ES2PLUS | CK_36XX),
CLK(NULL, "hsotgusb_ick", &hsotgusb_ick_3430es1, CK_3430ES1),
CLK(NULL, "hsotgusb_ick", &hsotgusb_ick_3430es2, CK_3430ES2PLUS | CK_36XX),
CLK(NULL, "sdrc_ick", &sdrc_ick, CK_3XXX), CLK(NULL, "sdrc_ick", &sdrc_ick, CK_3XXX),
CLK(NULL, "gpmc_fck", &gpmc_fck, CK_3XXX), CLK(NULL, "gpmc_fck", &gpmc_fck, CK_3XXX),
CLK(NULL, "security_l3_ick", &security_l3_ick, CK_34XX | CK_36XX), CLK(NULL, "security_l3_ick", &security_l3_ick, CK_34XX | CK_36XX),
...@@ -3329,28 +3336,42 @@ static struct omap_clk omap3xxx_clks[] = { ...@@ -3329,28 +3336,42 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX), CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX),
CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK("usbhs_omap", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK("usbhs_omap", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK("usbhs_tll", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK("omap_hsmmc.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK("omap_hsmmc.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK(NULL, "mmchs3_ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX), CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX),
CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX), CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX),
CLK("omap-sham", "ick", &sha12_ick, CK_34XX | CK_36XX), CLK("omap-sham", "ick", &sha12_ick, CK_34XX | CK_36XX),
CLK(NULL, "des2_ick", &des2_ick, CK_34XX | CK_36XX), CLK(NULL, "des2_ick", &des2_ick, CK_34XX | CK_36XX),
CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_3XXX), CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_3XXX),
CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_3XXX), CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_3XXX),
CLK(NULL, "mmchs2_ick", &mmchs2_ick, CK_3XXX),
CLK(NULL, "mmchs1_ick", &mmchs1_ick, CK_3XXX),
CLK(NULL, "mspro_ick", &mspro_ick, CK_34XX | CK_36XX), CLK(NULL, "mspro_ick", &mspro_ick, CK_34XX | CK_36XX),
CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX), CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX),
CLK(NULL, "hdq_ick", &hdq_ick, CK_3XXX),
CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX), CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX),
CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_3XXX), CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_3XXX),
CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_3XXX), CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_3XXX),
CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_3XXX), CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_3XXX),
CLK(NULL, "mcspi4_ick", &mcspi4_ick, CK_3XXX),
CLK(NULL, "mcspi3_ick", &mcspi3_ick, CK_3XXX),
CLK(NULL, "mcspi2_ick", &mcspi2_ick, CK_3XXX),
CLK(NULL, "mcspi1_ick", &mcspi1_ick, CK_3XXX),
CLK("omap_i2c.3", "ick", &i2c3_ick, CK_3XXX), CLK("omap_i2c.3", "ick", &i2c3_ick, CK_3XXX),
CLK("omap_i2c.2", "ick", &i2c2_ick, CK_3XXX), CLK("omap_i2c.2", "ick", &i2c2_ick, CK_3XXX),
CLK("omap_i2c.1", "ick", &i2c1_ick, CK_3XXX), CLK("omap_i2c.1", "ick", &i2c1_ick, CK_3XXX),
CLK(NULL, "i2c3_ick", &i2c3_ick, CK_3XXX),
CLK(NULL, "i2c2_ick", &i2c2_ick, CK_3XXX),
CLK(NULL, "i2c1_ick", &i2c1_ick, CK_3XXX),
CLK(NULL, "uart2_ick", &uart2_ick, CK_3XXX), CLK(NULL, "uart2_ick", &uart2_ick, CK_3XXX),
CLK(NULL, "uart1_ick", &uart1_ick, CK_3XXX), CLK(NULL, "uart1_ick", &uart1_ick, CK_3XXX),
CLK(NULL, "gpt11_ick", &gpt11_ick, CK_3XXX), CLK(NULL, "gpt11_ick", &gpt11_ick, CK_3XXX),
CLK(NULL, "gpt10_ick", &gpt10_ick, CK_3XXX), CLK(NULL, "gpt10_ick", &gpt10_ick, CK_3XXX),
CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_3XXX), CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_3XXX),
CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_3XXX), CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_3XXX),
CLK(NULL, "mcbsp5_ick", &mcbsp5_ick, CK_3XXX),
CLK(NULL, "mcbsp1_ick", &mcbsp1_ick, CK_3XXX),
CLK(NULL, "fac_ick", &fac_ick, CK_3430ES1), CLK(NULL, "fac_ick", &fac_ick, CK_3430ES1),
CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_34XX | CK_36XX), CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_34XX | CK_36XX),
CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_3XXX), CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_3XXX),
...@@ -3369,7 +3390,9 @@ static struct omap_clk omap3xxx_clks[] = { ...@@ -3369,7 +3390,9 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "dss_96m_fck", &dss_96m_fck, CK_3XXX), CLK(NULL, "dss_96m_fck", &dss_96m_fck, CK_3XXX),
CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck, CK_3XXX), CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck, CK_3XXX),
CLK("omapdss_dss", "ick", &dss_ick_3430es1, CK_3430ES1), CLK("omapdss_dss", "ick", &dss_ick_3430es1, CK_3430ES1),
CLK(NULL, "dss_ick", &dss_ick_3430es1, CK_3430ES1),
CLK("omapdss_dss", "ick", &dss_ick_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK("omapdss_dss", "ick", &dss_ick_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK(NULL, "dss_ick", &dss_ick_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK(NULL, "cam_mclk", &cam_mclk, CK_34XX | CK_36XX), CLK(NULL, "cam_mclk", &cam_mclk, CK_34XX | CK_36XX),
CLK(NULL, "cam_ick", &cam_ick, CK_34XX | CK_36XX), CLK(NULL, "cam_ick", &cam_ick, CK_34XX | CK_36XX),
CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_34XX | CK_36XX), CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_34XX | CK_36XX),
...@@ -3385,6 +3408,8 @@ static struct omap_clk omap3xxx_clks[] = { ...@@ -3385,6 +3408,8 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "usb_host_hs_utmi_p2_clk", &dummy_ck, CK_3XXX), CLK(NULL, "usb_host_hs_utmi_p2_clk", &dummy_ck, CK_3XXX),
CLK("usbhs_omap", "usb_tll_hs_usb_ch0_clk", &dummy_ck, CK_3XXX), CLK("usbhs_omap", "usb_tll_hs_usb_ch0_clk", &dummy_ck, CK_3XXX),
CLK("usbhs_omap", "usb_tll_hs_usb_ch1_clk", &dummy_ck, CK_3XXX), CLK("usbhs_omap", "usb_tll_hs_usb_ch1_clk", &dummy_ck, CK_3XXX),
CLK("usbhs_tll", "usb_tll_hs_usb_ch0_clk", &dummy_ck, CK_3XXX),
CLK("usbhs_tll", "usb_tll_hs_usb_ch1_clk", &dummy_ck, CK_3XXX),
CLK(NULL, "init_60m_fclk", &dummy_ck, CK_3XXX), CLK(NULL, "init_60m_fclk", &dummy_ck, CK_3XXX),
CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX), CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX),
CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX), CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX),
...@@ -3394,6 +3419,7 @@ static struct omap_clk omap3xxx_clks[] = { ...@@ -3394,6 +3419,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "wkup_l4_ick", &wkup_l4_ick, CK_34XX | CK_36XX), CLK(NULL, "wkup_l4_ick", &wkup_l4_ick, CK_34XX | CK_36XX),
CLK(NULL, "usim_ick", &usim_ick, CK_3430ES2PLUS | CK_36XX), CLK(NULL, "usim_ick", &usim_ick, CK_3430ES2PLUS | CK_36XX),
CLK("omap_wdt", "ick", &wdt2_ick, CK_3XXX), CLK("omap_wdt", "ick", &wdt2_ick, CK_3XXX),
CLK(NULL, "wdt2_ick", &wdt2_ick, CK_3XXX),
CLK(NULL, "wdt1_ick", &wdt1_ick, CK_3XXX), CLK(NULL, "wdt1_ick", &wdt1_ick, CK_3XXX),
CLK(NULL, "gpio1_ick", &gpio1_ick, CK_3XXX), CLK(NULL, "gpio1_ick", &gpio1_ick, CK_3XXX),
CLK(NULL, "omap_32ksync_ick", &omap_32ksync_ick, CK_3XXX), CLK(NULL, "omap_32ksync_ick", &omap_32ksync_ick, CK_3XXX),
...@@ -3439,9 +3465,13 @@ static struct omap_clk omap3xxx_clks[] = { ...@@ -3439,9 +3465,13 @@ static struct omap_clk omap3xxx_clks[] = {
CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_3XXX), CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_3XXX),
CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_3XXX), CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_3XXX),
CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_3XXX), CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_3XXX),
CLK(NULL, "mcbsp4_ick", &mcbsp2_ick, CK_3XXX),
CLK(NULL, "mcbsp3_ick", &mcbsp3_ick, CK_3XXX),
CLK(NULL, "mcbsp2_ick", &mcbsp4_ick, CK_3XXX),
CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_3XXX), CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_3XXX),
CLK(NULL, "mcbsp3_fck", &mcbsp3_fck, CK_3XXX), CLK(NULL, "mcbsp3_fck", &mcbsp3_fck, CK_3XXX),
CLK(NULL, "mcbsp4_fck", &mcbsp4_fck, CK_3XXX), CLK(NULL, "mcbsp4_fck", &mcbsp4_fck, CK_3XXX),
CLK(NULL, "emu_src_ck", &emu_src_ck, CK_3XXX),
CLK("etb", "emu_src_ck", &emu_src_ck, CK_3XXX), CLK("etb", "emu_src_ck", &emu_src_ck, CK_3XXX),
CLK(NULL, "pclk_fck", &pclk_fck, CK_3XXX), CLK(NULL, "pclk_fck", &pclk_fck, CK_3XXX),
CLK(NULL, "pclkx2_fck", &pclkx2_fck, CK_3XXX), CLK(NULL, "pclkx2_fck", &pclkx2_fck, CK_3XXX),
...@@ -3457,8 +3487,12 @@ static struct omap_clk omap3xxx_clks[] = { ...@@ -3457,8 +3487,12 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "ipss_ick", &ipss_ick, CK_AM35XX), CLK(NULL, "ipss_ick", &ipss_ick, CK_AM35XX),
CLK(NULL, "rmii_ck", &rmii_ck, CK_AM35XX), CLK(NULL, "rmii_ck", &rmii_ck, CK_AM35XX),
CLK(NULL, "pclk_ck", &pclk_ck, CK_AM35XX), CLK(NULL, "pclk_ck", &pclk_ck, CK_AM35XX),
CLK(NULL, "emac_ick", &emac_ick, CK_AM35XX),
CLK(NULL, "emac_fck", &emac_fck, CK_AM35XX),
CLK("davinci_emac.0", NULL, &emac_ick, CK_AM35XX), CLK("davinci_emac.0", NULL, &emac_ick, CK_AM35XX),
CLK("davinci_mdio.0", NULL, &emac_fck, CK_AM35XX), CLK("davinci_mdio.0", NULL, &emac_fck, CK_AM35XX),
CLK(NULL, "vpfe_ick", &emac_ick, CK_AM35XX),
CLK(NULL, "vpfe_fck", &emac_fck, CK_AM35XX),
CLK("vpfe-capture", "master", &vpfe_ick, CK_AM35XX), CLK("vpfe-capture", "master", &vpfe_ick, CK_AM35XX),
CLK("vpfe-capture", "slave", &vpfe_fck, CK_AM35XX), CLK("vpfe-capture", "slave", &vpfe_fck, CK_AM35XX),
CLK(NULL, "hsotgusb_ick", &hsotgusb_ick_am35xx, CK_AM35XX), CLK(NULL, "hsotgusb_ick", &hsotgusb_ick_am35xx, CK_AM35XX),
...@@ -3467,6 +3501,7 @@ static struct omap_clk omap3xxx_clks[] = { ...@@ -3467,6 +3501,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "uart4_ick", &uart4_ick_am35xx, CK_AM35XX), CLK(NULL, "uart4_ick", &uart4_ick_am35xx, CK_AM35XX),
CLK(NULL, "timer_32k_ck", &omap_32k_fck, CK_3XXX), CLK(NULL, "timer_32k_ck", &omap_32k_fck, CK_3XXX),
CLK(NULL, "timer_sys_ck", &sys_ck, CK_3XXX), CLK(NULL, "timer_sys_ck", &sys_ck, CK_3XXX),
CLK(NULL, "cpufreq_ck", &dpll1_ck, CK_3XXX),
}; };
......
...@@ -3156,6 +3156,7 @@ static struct omap_clk omap44xx_clks[] = { ...@@ -3156,6 +3156,7 @@ static struct omap_clk omap44xx_clks[] = {
CLK(NULL, "dss_tv_clk", &dss_tv_clk, CK_443X), CLK(NULL, "dss_tv_clk", &dss_tv_clk, CK_443X),
CLK(NULL, "dss_48mhz_clk", &dss_48mhz_clk, CK_443X), CLK(NULL, "dss_48mhz_clk", &dss_48mhz_clk, CK_443X),
CLK(NULL, "dss_dss_clk", &dss_dss_clk, CK_443X), CLK(NULL, "dss_dss_clk", &dss_dss_clk, CK_443X),
CLK(NULL, "dss_fck", &dss_fck, CK_443X),
CLK("omapdss_dss", "ick", &dss_fck, CK_443X), CLK("omapdss_dss", "ick", &dss_fck, CK_443X),
CLK(NULL, "efuse_ctrl_cust_fck", &efuse_ctrl_cust_fck, CK_443X), CLK(NULL, "efuse_ctrl_cust_fck", &efuse_ctrl_cust_fck, CK_443X),
CLK(NULL, "emif1_fck", &emif1_fck, CK_443X), CLK(NULL, "emif1_fck", &emif1_fck, CK_443X),
...@@ -3212,6 +3213,7 @@ static struct omap_clk omap44xx_clks[] = { ...@@ -3212,6 +3213,7 @@ static struct omap_clk omap44xx_clks[] = {
CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X), CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X),
CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X), CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X),
CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X), CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X),
CLK(NULL, "rng_ick", &rng_ick, CK_443X),
CLK("omap_rng", "ick", &rng_ick, CK_443X), CLK("omap_rng", "ick", &rng_ick, CK_443X),
CLK(NULL, "sha2md5_fck", &sha2md5_fck, CK_443X), CLK(NULL, "sha2md5_fck", &sha2md5_fck, CK_443X),
CLK(NULL, "sl2if_ick", &sl2if_ick, CK_443X), CLK(NULL, "sl2if_ick", &sl2if_ick, CK_443X),
...@@ -3243,6 +3245,7 @@ static struct omap_clk omap44xx_clks[] = { ...@@ -3243,6 +3245,7 @@ static struct omap_clk omap44xx_clks[] = {
CLK(NULL, "uart3_fck", &uart3_fck, CK_443X), CLK(NULL, "uart3_fck", &uart3_fck, CK_443X),
CLK(NULL, "uart4_fck", &uart4_fck, CK_443X), CLK(NULL, "uart4_fck", &uart4_fck, CK_443X),
CLK("usbhs_omap", "fs_fck", &usb_host_fs_fck, CK_443X), CLK("usbhs_omap", "fs_fck", &usb_host_fs_fck, CK_443X),
CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X),
CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X), CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X),
CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X), CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X),
CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X), CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X),
...@@ -3253,15 +3256,19 @@ static struct omap_clk omap44xx_clks[] = { ...@@ -3253,15 +3256,19 @@ static struct omap_clk omap44xx_clks[] = {
CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X), CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X),
CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X), CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X),
CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X), CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X),
CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck, CK_443X),
CLK("usbhs_omap", "hs_fck", &usb_host_hs_fck, CK_443X), CLK("usbhs_omap", "hs_fck", &usb_host_hs_fck, CK_443X),
CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X), CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X),
CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X), CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X),
CLK(NULL, "usb_otg_hs_ick", &usb_otg_hs_ick, CK_443X),
CLK("musb-omap2430", "ick", &usb_otg_hs_ick, CK_443X), CLK("musb-omap2430", "ick", &usb_otg_hs_ick, CK_443X),
CLK(NULL, "usb_phy_cm_clk32k", &usb_phy_cm_clk32k, CK_443X), CLK(NULL, "usb_phy_cm_clk32k", &usb_phy_cm_clk32k, CK_443X),
CLK(NULL, "usb_tll_hs_usb_ch2_clk", &usb_tll_hs_usb_ch2_clk, CK_443X), CLK(NULL, "usb_tll_hs_usb_ch2_clk", &usb_tll_hs_usb_ch2_clk, CK_443X),
CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X), CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X),
CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X), CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X),
CLK(NULL, "usb_tll_hs_ick", &usb_tll_hs_ick, CK_443X),
CLK("usbhs_omap", "usbtll_ick", &usb_tll_hs_ick, CK_443X), CLK("usbhs_omap", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
CLK("usbhs_tll", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
CLK(NULL, "usim_ck", &usim_ck, CK_443X), CLK(NULL, "usim_ck", &usim_ck, CK_443X),
CLK(NULL, "usim_fclk", &usim_fclk, CK_443X), CLK(NULL, "usim_fclk", &usim_fclk, CK_443X),
CLK(NULL, "usim_fck", &usim_fck, CK_443X), CLK(NULL, "usim_fck", &usim_fck, CK_443X),
...@@ -3312,8 +3319,10 @@ static struct omap_clk omap44xx_clks[] = { ...@@ -3312,8 +3319,10 @@ static struct omap_clk omap44xx_clks[] = {
CLK(NULL, "uart4_ick", &dummy_ck, CK_443X), CLK(NULL, "uart4_ick", &dummy_ck, CK_443X),
CLK("usbhs_omap", "usbhost_ick", &dummy_ck, CK_443X), CLK("usbhs_omap", "usbhost_ick", &dummy_ck, CK_443X),
CLK("usbhs_omap", "usbtll_fck", &dummy_ck, CK_443X), CLK("usbhs_omap", "usbtll_fck", &dummy_ck, CK_443X),
CLK("usbhs_tll", "usbtll_fck", &dummy_ck, CK_443X),
CLK("omap_wdt", "ick", &dummy_ck, CK_443X), CLK("omap_wdt", "ick", &dummy_ck, CK_443X),
CLK(NULL, "timer_32k_ck", &sys_32k_ck, CK_443X), CLK(NULL, "timer_32k_ck", &sys_32k_ck, CK_443X),
/* TODO: Remove "omap_timer.X" aliases once DT migration is complete */
CLK("omap_timer.1", "timer_sys_ck", &sys_clkin_ck, CK_443X), CLK("omap_timer.1", "timer_sys_ck", &sys_clkin_ck, CK_443X),
CLK("omap_timer.2", "timer_sys_ck", &sys_clkin_ck, CK_443X), CLK("omap_timer.2", "timer_sys_ck", &sys_clkin_ck, CK_443X),
CLK("omap_timer.3", "timer_sys_ck", &sys_clkin_ck, CK_443X), CLK("omap_timer.3", "timer_sys_ck", &sys_clkin_ck, CK_443X),
...@@ -3325,6 +3334,18 @@ static struct omap_clk omap44xx_clks[] = { ...@@ -3325,6 +3334,18 @@ static struct omap_clk omap44xx_clks[] = {
CLK("omap_timer.6", "timer_sys_ck", &syc_clk_div_ck, CK_443X), CLK("omap_timer.6", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
CLK("omap_timer.7", "timer_sys_ck", &syc_clk_div_ck, CK_443X), CLK("omap_timer.7", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
CLK("omap_timer.8", "timer_sys_ck", &syc_clk_div_ck, CK_443X), CLK("omap_timer.8", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
CLK("4a318000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
CLK("48032000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
CLK("48034000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
CLK("48036000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
CLK("4803e000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
CLK("48086000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
CLK("48088000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
CLK("49038000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
CLK("4903a000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
CLK("4903c000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
CLK("4903e000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
CLK(NULL, "cpufreq_ck", &dpll_mpu_ck, CK_443X),
}; };
int __init omap4xxx_clk_init(void) int __init omap4xxx_clk_init(void)
......
This diff is collapsed.
This diff is collapsed.
...@@ -354,6 +354,7 @@ ...@@ -354,6 +354,7 @@
/* AM33XX CONTROL_STATUS bitfields (partial) */ /* AM33XX CONTROL_STATUS bitfields (partial) */
#define AM33XX_CONTROL_STATUS_SYSBOOT1_SHIFT 22 #define AM33XX_CONTROL_STATUS_SYSBOOT1_SHIFT 22
#define AM33XX_CONTROL_STATUS_SYSBOOT1_WIDTH 0x2
#define AM33XX_CONTROL_STATUS_SYSBOOT1_MASK (0x3 << 22) #define AM33XX_CONTROL_STATUS_SYSBOOT1_MASK (0x3 << 22)
/* CONTROL OMAP STATUS register to identify OMAP3 features */ /* CONTROL OMAP STATUS register to identify OMAP3 features */
......
...@@ -488,7 +488,7 @@ int omap_dss_reset(struct omap_hwmod *oh) ...@@ -488,7 +488,7 @@ int omap_dss_reset(struct omap_hwmod *oh)
for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
if (oc->_clk) if (oc->_clk)
clk_enable(oc->_clk); clk_prepare_enable(oc->_clk);
dispc_disable_outputs(); dispc_disable_outputs();
...@@ -515,7 +515,7 @@ int omap_dss_reset(struct omap_hwmod *oh) ...@@ -515,7 +515,7 @@ int omap_dss_reset(struct omap_hwmod *oh)
for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
if (oc->_clk) if (oc->_clk)
clk_disable(oc->_clk); clk_disable_unprepare(oc->_clk);
r = (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT : 0; r = (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT : 0;
......
...@@ -63,8 +63,10 @@ static int _omap3_wait_dpll_status(struct clk *clk, u8 state) ...@@ -63,8 +63,10 @@ static int _omap3_wait_dpll_status(struct clk *clk, u8 state)
const struct dpll_data *dd; const struct dpll_data *dd;
int i = 0; int i = 0;
int ret = -EINVAL; int ret = -EINVAL;
const char *clk_name;
dd = clk->dpll_data; dd = clk->dpll_data;
clk_name = __clk_get_name(clk);
state <<= __ffs(dd->idlest_mask); state <<= __ffs(dd->idlest_mask);
...@@ -76,10 +78,10 @@ static int _omap3_wait_dpll_status(struct clk *clk, u8 state) ...@@ -76,10 +78,10 @@ static int _omap3_wait_dpll_status(struct clk *clk, u8 state)
if (i == MAX_DPLL_WAIT_TRIES) { if (i == MAX_DPLL_WAIT_TRIES) {
printk(KERN_ERR "clock: %s failed transition to '%s'\n", printk(KERN_ERR "clock: %s failed transition to '%s'\n",
clk->name, (state) ? "locked" : "bypassed"); clk_name, (state) ? "locked" : "bypassed");
} else { } else {
pr_debug("clock: %s transition to '%s' in %d loops\n", pr_debug("clock: %s transition to '%s' in %d loops\n",
clk->name, (state) ? "locked" : "bypassed", i); clk_name, (state) ? "locked" : "bypassed", i);
ret = 0; ret = 0;
} }
...@@ -93,7 +95,7 @@ static u16 _omap3_dpll_compute_freqsel(struct clk *clk, u8 n) ...@@ -93,7 +95,7 @@ static u16 _omap3_dpll_compute_freqsel(struct clk *clk, u8 n)
unsigned long fint; unsigned long fint;
u16 f = 0; u16 f = 0;
fint = clk->dpll_data->clk_ref->rate / n; fint = __clk_get_rate(clk->dpll_data->clk_ref) / n;
pr_debug("clock: fint is %lu\n", fint); pr_debug("clock: fint is %lu\n", fint);
...@@ -140,7 +142,7 @@ static int _omap3_noncore_dpll_lock(struct clk *clk) ...@@ -140,7 +142,7 @@ static int _omap3_noncore_dpll_lock(struct clk *clk)
u8 state = 1; u8 state = 1;
int r = 0; int r = 0;
pr_debug("clock: locking DPLL %s\n", clk->name); pr_debug("clock: locking DPLL %s\n", __clk_get_name(clk));
dd = clk->dpll_data; dd = clk->dpll_data;
state <<= __ffs(dd->idlest_mask); state <<= __ffs(dd->idlest_mask);
...@@ -187,7 +189,7 @@ static int _omap3_noncore_dpll_bypass(struct clk *clk) ...@@ -187,7 +189,7 @@ static int _omap3_noncore_dpll_bypass(struct clk *clk)
return -EINVAL; return -EINVAL;
pr_debug("clock: configuring DPLL %s for low-power bypass\n", pr_debug("clock: configuring DPLL %s for low-power bypass\n",
clk->name); __clk_get_name(clk));
ai = omap3_dpll_autoidle_read(clk); ai = omap3_dpll_autoidle_read(clk);
...@@ -217,7 +219,7 @@ static int _omap3_noncore_dpll_stop(struct clk *clk) ...@@ -217,7 +219,7 @@ static int _omap3_noncore_dpll_stop(struct clk *clk)
if (!(clk->dpll_data->modes & (1 << DPLL_LOW_POWER_STOP))) if (!(clk->dpll_data->modes & (1 << DPLL_LOW_POWER_STOP)))
return -EINVAL; return -EINVAL;
pr_debug("clock: stopping DPLL %s\n", clk->name); pr_debug("clock: stopping DPLL %s\n", __clk_get_name(clk));
ai = omap3_dpll_autoidle_read(clk); ai = omap3_dpll_autoidle_read(clk);
...@@ -245,7 +247,7 @@ static void _lookup_dco(struct clk *clk, u8 *dco, u16 m, u8 n) ...@@ -245,7 +247,7 @@ static void _lookup_dco(struct clk *clk, u8 *dco, u16 m, u8 n)
{ {
unsigned long fint, clkinp; /* watch out for overflow */ unsigned long fint, clkinp; /* watch out for overflow */
clkinp = clk->parent->rate; clkinp = __clk_get_rate(__clk_get_parent(clk));
fint = (clkinp / n) * m; fint = (clkinp / n) * m;
if (fint < 1000000000) if (fint < 1000000000)
...@@ -271,7 +273,7 @@ static void _lookup_sddiv(struct clk *clk, u8 *sd_div, u16 m, u8 n) ...@@ -271,7 +273,7 @@ static void _lookup_sddiv(struct clk *clk, u8 *sd_div, u16 m, u8 n)
unsigned long clkinp, sd; /* watch out for overflow */ unsigned long clkinp, sd; /* watch out for overflow */
int mod1, mod2; int mod1, mod2;
clkinp = clk->parent->rate; clkinp = __clk_get_rate(__clk_get_parent(clk));
/* /*
* target sigma-delta to near 250MHz * target sigma-delta to near 250MHz
...@@ -380,16 +382,19 @@ int omap3_noncore_dpll_enable(struct clk *clk) ...@@ -380,16 +382,19 @@ int omap3_noncore_dpll_enable(struct clk *clk)
{ {
int r; int r;
struct dpll_data *dd; struct dpll_data *dd;
struct clk *parent;
dd = clk->dpll_data; dd = clk->dpll_data;
if (!dd) if (!dd)
return -EINVAL; return -EINVAL;
if (clk->rate == dd->clk_bypass->rate) { parent = __clk_get_parent(clk);
WARN_ON(clk->parent != dd->clk_bypass);
if (__clk_get_rate(clk) == __clk_get_rate(dd->clk_bypass)) {
WARN_ON(parent != dd->clk_bypass);
r = _omap3_noncore_dpll_bypass(clk); r = _omap3_noncore_dpll_bypass(clk);
} else { } else {
WARN_ON(clk->parent != dd->clk_ref); WARN_ON(parent != dd->clk_ref);
r = _omap3_noncore_dpll_lock(clk); r = _omap3_noncore_dpll_lock(clk);
} }
/* /*
...@@ -432,7 +437,7 @@ void omap3_noncore_dpll_disable(struct clk *clk) ...@@ -432,7 +437,7 @@ void omap3_noncore_dpll_disable(struct clk *clk)
int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate) int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
{ {
struct clk *new_parent = NULL; struct clk *new_parent = NULL;
unsigned long hw_rate; unsigned long hw_rate, bypass_rate;
u16 freqsel = 0; u16 freqsel = 0;
struct dpll_data *dd; struct dpll_data *dd;
int ret; int ret;
...@@ -456,7 +461,8 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate) ...@@ -456,7 +461,8 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
omap2_clk_enable(dd->clk_bypass); omap2_clk_enable(dd->clk_bypass);
omap2_clk_enable(dd->clk_ref); omap2_clk_enable(dd->clk_ref);
if (dd->clk_bypass->rate == rate && bypass_rate = __clk_get_rate(dd->clk_bypass);
if (bypass_rate == rate &&
(clk->dpll_data->modes & (1 << DPLL_LOW_POWER_BYPASS))) { (clk->dpll_data->modes & (1 << DPLL_LOW_POWER_BYPASS))) {
pr_debug("clock: %s: set rate: entering bypass.\n", clk->name); pr_debug("clock: %s: set rate: entering bypass.\n", clk->name);
...@@ -479,7 +485,7 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate) ...@@ -479,7 +485,7 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
} }
pr_debug("clock: %s: set rate: locking rate to %lu.\n", pr_debug("clock: %s: set rate: locking rate to %lu.\n",
clk->name, rate); __clk_get_name(clk), rate);
ret = omap3_noncore_dpll_program(clk, dd->last_rounded_m, ret = omap3_noncore_dpll_program(clk, dd->last_rounded_m,
dd->last_rounded_n, freqsel); dd->last_rounded_n, freqsel);
...@@ -557,7 +563,7 @@ void omap3_dpll_allow_idle(struct clk *clk) ...@@ -557,7 +563,7 @@ void omap3_dpll_allow_idle(struct clk *clk)
if (!dd->autoidle_reg) { if (!dd->autoidle_reg) {
pr_debug("clock: DPLL %s: autoidle not supported\n", pr_debug("clock: DPLL %s: autoidle not supported\n",
clk->name); __clk_get_name(clk));
return; return;
} }
...@@ -591,7 +597,7 @@ void omap3_dpll_deny_idle(struct clk *clk) ...@@ -591,7 +597,7 @@ void omap3_dpll_deny_idle(struct clk *clk)
if (!dd->autoidle_reg) { if (!dd->autoidle_reg) {
pr_debug("clock: DPLL %s: autoidle not supported\n", pr_debug("clock: DPLL %s: autoidle not supported\n",
clk->name); __clk_get_name(clk));
return; return;
} }
...@@ -617,11 +623,12 @@ unsigned long omap3_clkoutx2_recalc(struct clk *clk) ...@@ -617,11 +623,12 @@ unsigned long omap3_clkoutx2_recalc(struct clk *clk)
unsigned long rate; unsigned long rate;
u32 v; u32 v;
struct clk *pclk; struct clk *pclk;
unsigned long parent_rate;
/* Walk up the parents of clk, looking for a DPLL */ /* Walk up the parents of clk, looking for a DPLL */
pclk = clk->parent; pclk = __clk_get_parent(clk);
while (pclk && !pclk->dpll_data) while (pclk && !pclk->dpll_data)
pclk = pclk->parent; pclk = __clk_get_parent(pclk);
/* clk does not have a DPLL as a parent? error in the clock data */ /* clk does not have a DPLL as a parent? error in the clock data */
if (!pclk) { if (!pclk) {
...@@ -633,12 +640,13 @@ unsigned long omap3_clkoutx2_recalc(struct clk *clk) ...@@ -633,12 +640,13 @@ unsigned long omap3_clkoutx2_recalc(struct clk *clk)
WARN_ON(!dd->enable_mask); WARN_ON(!dd->enable_mask);
parent_rate = __clk_get_rate(__clk_get_parent(clk));
v = __raw_readl(dd->control_reg) & dd->enable_mask; v = __raw_readl(dd->control_reg) & dd->enable_mask;
v >>= __ffs(dd->enable_mask); v >>= __ffs(dd->enable_mask);
if ((v != OMAP3XXX_EN_DPLL_LOCKED) || (dd->flags & DPLL_J_TYPE)) if ((v != OMAP3XXX_EN_DPLL_LOCKED) || (dd->flags & DPLL_J_TYPE))
rate = clk->parent->rate; rate = parent_rate;
else else
rate = clk->parent->rate * 2; rate = parent_rate * 2;
return rate; return rate;
} }
......
...@@ -879,7 +879,7 @@ static int __init gpmc_init(void) ...@@ -879,7 +879,7 @@ static int __init gpmc_init(void)
BUG(); BUG();
} }
clk_enable(gpmc_l3_clk); clk_prepare_enable(gpmc_l3_clk);
l = gpmc_read_reg(GPMC_REVISION); l = gpmc_read_reg(GPMC_REVISION);
printk(KERN_INFO "GPMC revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f); printk(KERN_INFO "GPMC revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f);
......
...@@ -679,16 +679,25 @@ static int _init_main_clk(struct omap_hwmod *oh) ...@@ -679,16 +679,25 @@ static int _init_main_clk(struct omap_hwmod *oh)
if (!oh->main_clk) if (!oh->main_clk)
return 0; return 0;
oh->_clk = omap_clk_get_by_name(oh->main_clk); oh->_clk = clk_get(NULL, oh->main_clk);
if (!oh->_clk) { if (IS_ERR(oh->_clk)) {
pr_warning("omap_hwmod: %s: cannot clk_get main_clk %s\n", pr_warning("omap_hwmod: %s: cannot clk_get main_clk %s\n",
oh->name, oh->main_clk); oh->name, oh->main_clk);
return -EINVAL; return -EINVAL;
} }
/*
* HACK: This needs a re-visit once clk_prepare() is implemented
* to do something meaningful. Today its just a no-op.
* If clk_prepare() is used at some point to do things like
* voltage scaling etc, then this would have to be moved to
* some point where subsystems like i2c and pmic become
* available.
*/
clk_prepare(oh->_clk);
if (!oh->_clk->clkdm) if (!oh->_clk->clkdm)
pr_warning("omap_hwmod: %s: missing clockdomain for %s.\n", pr_warning("omap_hwmod: %s: missing clockdomain for %s.\n",
oh->main_clk, oh->_clk->name); oh->name, oh->main_clk);
return ret; return ret;
} }
...@@ -715,13 +724,22 @@ static int _init_interface_clks(struct omap_hwmod *oh) ...@@ -715,13 +724,22 @@ static int _init_interface_clks(struct omap_hwmod *oh)
if (!os->clk) if (!os->clk)
continue; continue;
c = omap_clk_get_by_name(os->clk); c = clk_get(NULL, os->clk);
if (!c) { if (IS_ERR(c)) {
pr_warning("omap_hwmod: %s: cannot clk_get interface_clk %s\n", pr_warning("omap_hwmod: %s: cannot clk_get interface_clk %s\n",
oh->name, os->clk); oh->name, os->clk);
ret = -EINVAL; ret = -EINVAL;
} }
os->_clk = c; os->_clk = c;
/*
* HACK: This needs a re-visit once clk_prepare() is implemented
* to do something meaningful. Today its just a no-op.
* If clk_prepare() is used at some point to do things like
* voltage scaling etc, then this would have to be moved to
* some point where subsystems like i2c and pmic become
* available.
*/
clk_prepare(os->_clk);
} }
return ret; return ret;
...@@ -742,13 +760,22 @@ static int _init_opt_clks(struct omap_hwmod *oh) ...@@ -742,13 +760,22 @@ static int _init_opt_clks(struct omap_hwmod *oh)
int ret = 0; int ret = 0;
for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) { for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) {
c = omap_clk_get_by_name(oc->clk); c = clk_get(NULL, oc->clk);
if (!c) { if (IS_ERR(c)) {
pr_warning("omap_hwmod: %s: cannot clk_get opt_clk %s\n", pr_warning("omap_hwmod: %s: cannot clk_get opt_clk %s\n",
oh->name, oc->clk); oh->name, oc->clk);
ret = -EINVAL; ret = -EINVAL;
} }
oc->_clk = c; oc->_clk = c;
/*
* HACK: This needs a re-visit once clk_prepare() is implemented
* to do something meaningful. Today its just a no-op.
* If clk_prepare() is used at some point to do things like
* voltage scaling etc, then this would have to be moved to
* some point where subsystems like i2c and pmic become
* available.
*/
clk_prepare(oc->_clk);
} }
return ret; return ret;
...@@ -827,7 +854,7 @@ static void _enable_optional_clocks(struct omap_hwmod *oh) ...@@ -827,7 +854,7 @@ static void _enable_optional_clocks(struct omap_hwmod *oh)
for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
if (oc->_clk) { if (oc->_clk) {
pr_debug("omap_hwmod: enable %s:%s\n", oc->role, pr_debug("omap_hwmod: enable %s:%s\n", oc->role,
oc->_clk->name); __clk_get_name(oc->_clk));
clk_enable(oc->_clk); clk_enable(oc->_clk);
} }
} }
...@@ -842,7 +869,7 @@ static void _disable_optional_clocks(struct omap_hwmod *oh) ...@@ -842,7 +869,7 @@ static void _disable_optional_clocks(struct omap_hwmod *oh)
for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
if (oc->_clk) { if (oc->_clk) {
pr_debug("omap_hwmod: disable %s:%s\n", oc->role, pr_debug("omap_hwmod: disable %s:%s\n", oc->role,
oc->_clk->name); __clk_get_name(oc->_clk));
clk_disable(oc->_clk); clk_disable(oc->_clk);
} }
} }
......
...@@ -188,7 +188,7 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name, ...@@ -188,7 +188,7 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
goto exit; goto exit;
} }
freq = clk->rate; freq = clk_get_rate(clk);
clk_put(clk); clk_put(clk);
rcu_read_lock(); rcu_read_lock();
......
...@@ -312,33 +312,6 @@ void clk_enable_init_clocks(void) ...@@ -312,33 +312,6 @@ void clk_enable_init_clocks(void)
} }
} }
/**
* omap_clk_get_by_name - locate OMAP struct clk by its name
* @name: name of the struct clk to locate
*
* Locate an OMAP struct clk by its name. Assumes that struct clk
* names are unique. Returns NULL if not found or a pointer to the
* struct clk if found.
*/
struct clk *omap_clk_get_by_name(const char *name)
{
struct clk *c;
struct clk *ret = NULL;
mutex_lock(&clocks_mutex);
list_for_each_entry(c, &clocks, node) {
if (!strcmp(c->name, name)) {
ret = c;
break;
}
}
mutex_unlock(&clocks_mutex);
return ret;
}
int omap_clk_enable_autoidle_all(void) int omap_clk_enable_autoidle_all(void)
{ {
struct clk *c; struct clk *c;
......
...@@ -19,6 +19,11 @@ struct module; ...@@ -19,6 +19,11 @@ struct module;
struct clk; struct clk;
struct clockdomain; struct clockdomain;
/* Temporary, needed during the common clock framework conversion */
#define __clk_get_name(clk) (clk->name)
#define __clk_get_parent(clk) (clk->parent)
#define __clk_get_rate(clk) (clk->rate)
/** /**
* struct clkops - some clock function pointers * struct clkops - some clock function pointers
* @enable: fn ptr that enables the current clock in hardware * @enable: fn ptr that enables the current clock in hardware
......
...@@ -261,10 +261,10 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias, ...@@ -261,10 +261,10 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias,
return; return;
} }
r = omap_clk_get_by_name(clk_name); r = clk_get(NULL, clk_name);
if (IS_ERR(r)) { if (IS_ERR(r)) {
dev_err(&od->pdev->dev, dev_err(&od->pdev->dev,
"omap_clk_get_by_name for %s failed\n", clk_name); "clk_get for %s failed\n", clk_name);
return; return;
} }
......
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <plat/clock.h>
#define OMAP1_SPI100K_MAX_FREQ 48000000 #define OMAP1_SPI100K_MAX_FREQ 48000000
#define ICR_SPITAS (OMAP7XX_ICR_BASE + 0x12) #define ICR_SPITAS (OMAP7XX_ICR_BASE + 0x12)
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <plat/clock.h>
#include <plat/mcspi.h> #include <plat/mcspi.h>
#define OMAP2_MCSPI_MAX_FREQ 48000000 #define OMAP2_MCSPI_MAX_FREQ 48000000
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment