Commit a9dd31b7 authored by Paul Walmsley's avatar Paul Walmsley

Merge branches 'clock_fixes_3.4rc', 'clockdomain_fixes_3.4rc',...

Merge branches 'clock_fixes_3.4rc', 'clockdomain_fixes_3.4rc', 'hsmmc_erratum_2_1_1_128_refine_3.4rc1', 'hwmod_data_fixes_a_3.4rc', 'hwmod_fixes_a2_3.4rc' and 'powerdomain_fixes_a_3.4rc' into omap-fixes-a2-for-3.4rc-branch
...@@ -390,7 +390,7 @@ static struct clockdomain emu_sys_44xx_clkdm = { ...@@ -390,7 +390,7 @@ static struct clockdomain emu_sys_44xx_clkdm = {
.prcm_partition = OMAP4430_PRM_PARTITION, .prcm_partition = OMAP4430_PRM_PARTITION,
.cm_inst = OMAP4430_PRM_EMU_CM_INST, .cm_inst = OMAP4430_PRM_EMU_CM_INST,
.clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS, .clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS,
.flags = CLKDM_CAN_HWSUP, .flags = CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_FORCE_WAKEUP,
}; };
static struct clockdomain l3_dma_44xx_clkdm = { static struct clockdomain l3_dma_44xx_clkdm = {
......
...@@ -506,6 +506,13 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo, ...@@ -506,6 +506,13 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo,
if (oh->dev_attr != NULL) { if (oh->dev_attr != NULL) {
mmc_dev_attr = oh->dev_attr; mmc_dev_attr = oh->dev_attr;
mmc_data->controller_flags = mmc_dev_attr->flags; mmc_data->controller_flags = mmc_dev_attr->flags;
/*
* erratum 2.1.1.128 doesn't apply if board has
* a transceiver is attached
*/
if (hsmmcinfo->transceiver)
mmc_data->controller_flags &=
~OMAP_HSMMC_BROKEN_MULTIBLOCK_READ;
} }
pdev = platform_device_alloc(name, ctrl_nr - 1); pdev = platform_device_alloc(name, ctrl_nr - 1);
......
...@@ -1477,6 +1477,11 @@ static int _reset(struct omap_hwmod *oh) ...@@ -1477,6 +1477,11 @@ static int _reset(struct omap_hwmod *oh)
ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh); ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh);
if (oh->class->sysc) {
_update_sysc_cache(oh);
_enable_sysc(oh);
}
return ret; return ret;
} }
...@@ -1786,20 +1791,9 @@ static int _setup(struct omap_hwmod *oh, void *data) ...@@ -1786,20 +1791,9 @@ static int _setup(struct omap_hwmod *oh, void *data)
return 0; return 0;
} }
if (!(oh->flags & HWMOD_INIT_NO_RESET)) { if (!(oh->flags & HWMOD_INIT_NO_RESET))
_reset(oh); _reset(oh);
/*
* OCP_SYSCONFIG bits need to be reprogrammed after a softreset.
* The _enable() function should be split to
* avoid the rewrite of the OCP_SYSCONFIG register.
*/
if (oh->class->sysc) {
_update_sysc_cache(oh);
_enable_sysc(oh);
}
}
postsetup_state = oh->_postsetup_state; postsetup_state = oh->_postsetup_state;
if (postsetup_state == _HWMOD_STATE_UNKNOWN) if (postsetup_state == _HWMOD_STATE_UNKNOWN)
postsetup_state = _HWMOD_STATE_ENABLED; postsetup_state = _HWMOD_STATE_ENABLED;
...@@ -1907,20 +1901,10 @@ void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs) ...@@ -1907,20 +1901,10 @@ void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs)
*/ */
int omap_hwmod_softreset(struct omap_hwmod *oh) int omap_hwmod_softreset(struct omap_hwmod *oh)
{ {
u32 v; if (!oh)
int ret;
if (!oh || !(oh->_sysc_cache))
return -EINVAL; return -EINVAL;
v = oh->_sysc_cache; return _ocp_softreset(oh);
ret = _set_softreset(oh, &v);
if (ret)
goto error;
_write_sysconfig(v, oh);
error:
return ret;
} }
/** /**
...@@ -2463,26 +2447,28 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh, ...@@ -2463,26 +2447,28 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod *
* *
* Sets the module OCP socket ENAWAKEUP bit to allow the module to * Sets the module OCP socket ENAWAKEUP bit to allow the module to
* send wakeups to the PRCM. Eventually this should sets PRCM wakeup * send wakeups to the PRCM, and enable I/O ring wakeup events for
* registers to cause the PRCM to receive wakeup events from the * this IP block if it has dynamic mux entries. Eventually this
* module. Does not set any wakeup routing registers beyond this * should set PRCM wakeup registers to cause the PRCM to receive
* point - if the module is to wake up any other module or subsystem, * wakeup events from the module. Does not set any wakeup routing
* that must be set separately. Called by omap_device code. Returns * registers beyond this point - if the module is to wake up any other
* -EINVAL on error or 0 upon success. * module or subsystem, that must be set separately. Called by
* omap_device code. Returns -EINVAL on error or 0 upon success.
*/ */
int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
{ {
unsigned long flags; unsigned long flags;
u32 v; u32 v;
if (!oh->class->sysc ||
!(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
return -EINVAL;
spin_lock_irqsave(&oh->_lock, flags); spin_lock_irqsave(&oh->_lock, flags);
v = oh->_sysc_cache;
_enable_wakeup(oh, &v); if (oh->class->sysc &&
_write_sysconfig(v, oh); (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) {
v = oh->_sysc_cache;
_enable_wakeup(oh, &v);
_write_sysconfig(v, oh);
}
_set_idle_ioring_wakeup(oh, true); _set_idle_ioring_wakeup(oh, true);
spin_unlock_irqrestore(&oh->_lock, flags); spin_unlock_irqrestore(&oh->_lock, flags);
...@@ -2494,26 +2480,28 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) ...@@ -2494,26 +2480,28 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod *
* *
* Clears the module OCP socket ENAWAKEUP bit to prevent the module * Clears the module OCP socket ENAWAKEUP bit to prevent the module
* from sending wakeups to the PRCM. Eventually this should clear * from sending wakeups to the PRCM, and disable I/O ring wakeup
* PRCM wakeup registers to cause the PRCM to ignore wakeup events * events for this IP block if it has dynamic mux entries. Eventually
* from the module. Does not set any wakeup routing registers beyond * this should clear PRCM wakeup registers to cause the PRCM to ignore
* this point - if the module is to wake up any other module or * wakeup events from the module. Does not set any wakeup routing
* subsystem, that must be set separately. Called by omap_device * registers beyond this point - if the module is to wake up any other
* code. Returns -EINVAL on error or 0 upon success. * module or subsystem, that must be set separately. Called by
* omap_device code. Returns -EINVAL on error or 0 upon success.
*/ */
int omap_hwmod_disable_wakeup(struct omap_hwmod *oh) int omap_hwmod_disable_wakeup(struct omap_hwmod *oh)
{ {
unsigned long flags; unsigned long flags;
u32 v; u32 v;
if (!oh->class->sysc ||
!(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
return -EINVAL;
spin_lock_irqsave(&oh->_lock, flags); spin_lock_irqsave(&oh->_lock, flags);
v = oh->_sysc_cache;
_disable_wakeup(oh, &v); if (oh->class->sysc &&
_write_sysconfig(v, oh); (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) {
v = oh->_sysc_cache;
_disable_wakeup(oh, &v);
_write_sysconfig(v, oh);
}
_set_idle_ioring_wakeup(oh, false); _set_idle_ioring_wakeup(oh, false);
spin_unlock_irqrestore(&oh->_lock, flags); spin_unlock_irqrestore(&oh->_lock, flags);
......
...@@ -2996,6 +2996,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp1_slaves[] = { ...@@ -2996,6 +2996,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp1_slaves[] = {
&omap44xx_l4_abe__mcbsp1_dma, &omap44xx_l4_abe__mcbsp1_dma,
}; };
static struct omap_hwmod_opt_clk mcbsp1_opt_clks[] = {
{ .role = "pad_fck", .clk = "pad_clks_ck" },
{ .role = "prcm_clk", .clk = "mcbsp1_sync_mux_ck" },
};
static struct omap_hwmod omap44xx_mcbsp1_hwmod = { static struct omap_hwmod omap44xx_mcbsp1_hwmod = {
.name = "mcbsp1", .name = "mcbsp1",
.class = &omap44xx_mcbsp_hwmod_class, .class = &omap44xx_mcbsp_hwmod_class,
...@@ -3012,6 +3017,8 @@ static struct omap_hwmod omap44xx_mcbsp1_hwmod = { ...@@ -3012,6 +3017,8 @@ static struct omap_hwmod omap44xx_mcbsp1_hwmod = {
}, },
.slaves = omap44xx_mcbsp1_slaves, .slaves = omap44xx_mcbsp1_slaves,
.slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp1_slaves), .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp1_slaves),
.opt_clks = mcbsp1_opt_clks,
.opt_clks_cnt = ARRAY_SIZE(mcbsp1_opt_clks),
}; };
/* mcbsp2 */ /* mcbsp2 */
...@@ -3071,6 +3078,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp2_slaves[] = { ...@@ -3071,6 +3078,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp2_slaves[] = {
&omap44xx_l4_abe__mcbsp2_dma, &omap44xx_l4_abe__mcbsp2_dma,
}; };
static struct omap_hwmod_opt_clk mcbsp2_opt_clks[] = {
{ .role = "pad_fck", .clk = "pad_clks_ck" },
{ .role = "prcm_clk", .clk = "mcbsp2_sync_mux_ck" },
};
static struct omap_hwmod omap44xx_mcbsp2_hwmod = { static struct omap_hwmod omap44xx_mcbsp2_hwmod = {
.name = "mcbsp2", .name = "mcbsp2",
.class = &omap44xx_mcbsp_hwmod_class, .class = &omap44xx_mcbsp_hwmod_class,
...@@ -3087,6 +3099,8 @@ static struct omap_hwmod omap44xx_mcbsp2_hwmod = { ...@@ -3087,6 +3099,8 @@ static struct omap_hwmod omap44xx_mcbsp2_hwmod = {
}, },
.slaves = omap44xx_mcbsp2_slaves, .slaves = omap44xx_mcbsp2_slaves,
.slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp2_slaves), .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp2_slaves),
.opt_clks = mcbsp2_opt_clks,
.opt_clks_cnt = ARRAY_SIZE(mcbsp2_opt_clks),
}; };
/* mcbsp3 */ /* mcbsp3 */
...@@ -3146,6 +3160,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp3_slaves[] = { ...@@ -3146,6 +3160,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp3_slaves[] = {
&omap44xx_l4_abe__mcbsp3_dma, &omap44xx_l4_abe__mcbsp3_dma,
}; };
static struct omap_hwmod_opt_clk mcbsp3_opt_clks[] = {
{ .role = "pad_fck", .clk = "pad_clks_ck" },
{ .role = "prcm_clk", .clk = "mcbsp3_sync_mux_ck" },
};
static struct omap_hwmod omap44xx_mcbsp3_hwmod = { static struct omap_hwmod omap44xx_mcbsp3_hwmod = {
.name = "mcbsp3", .name = "mcbsp3",
.class = &omap44xx_mcbsp_hwmod_class, .class = &omap44xx_mcbsp_hwmod_class,
...@@ -3162,6 +3181,8 @@ static struct omap_hwmod omap44xx_mcbsp3_hwmod = { ...@@ -3162,6 +3181,8 @@ static struct omap_hwmod omap44xx_mcbsp3_hwmod = {
}, },
.slaves = omap44xx_mcbsp3_slaves, .slaves = omap44xx_mcbsp3_slaves,
.slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp3_slaves), .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp3_slaves),
.opt_clks = mcbsp3_opt_clks,
.opt_clks_cnt = ARRAY_SIZE(mcbsp3_opt_clks),
}; };
/* mcbsp4 */ /* mcbsp4 */
...@@ -3200,6 +3221,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp4_slaves[] = { ...@@ -3200,6 +3221,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp4_slaves[] = {
&omap44xx_l4_per__mcbsp4, &omap44xx_l4_per__mcbsp4,
}; };
static struct omap_hwmod_opt_clk mcbsp4_opt_clks[] = {
{ .role = "pad_fck", .clk = "pad_clks_ck" },
{ .role = "prcm_clk", .clk = "mcbsp4_sync_mux_ck" },
};
static struct omap_hwmod omap44xx_mcbsp4_hwmod = { static struct omap_hwmod omap44xx_mcbsp4_hwmod = {
.name = "mcbsp4", .name = "mcbsp4",
.class = &omap44xx_mcbsp_hwmod_class, .class = &omap44xx_mcbsp_hwmod_class,
...@@ -3216,6 +3242,8 @@ static struct omap_hwmod omap44xx_mcbsp4_hwmod = { ...@@ -3216,6 +3242,8 @@ static struct omap_hwmod omap44xx_mcbsp4_hwmod = {
}, },
.slaves = omap44xx_mcbsp4_slaves, .slaves = omap44xx_mcbsp4_slaves,
.slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp4_slaves), .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp4_slaves),
.opt_clks = mcbsp4_opt_clks,
.opt_clks_cnt = ARRAY_SIZE(mcbsp4_opt_clks),
}; };
/* /*
......
...@@ -972,7 +972,13 @@ int pwrdm_wait_transition(struct powerdomain *pwrdm) ...@@ -972,7 +972,13 @@ int pwrdm_wait_transition(struct powerdomain *pwrdm)
int pwrdm_state_switch(struct powerdomain *pwrdm) int pwrdm_state_switch(struct powerdomain *pwrdm)
{ {
return _pwrdm_state_switch(pwrdm, PWRDM_STATE_NOW); int ret;
ret = pwrdm_wait_transition(pwrdm);
if (!ret)
ret = _pwrdm_state_switch(pwrdm, PWRDM_STATE_NOW);
return ret;
} }
int pwrdm_clkdm_state_switch(struct clockdomain *clkdm) int pwrdm_clkdm_state_switch(struct clockdomain *clkdm)
......
...@@ -47,17 +47,17 @@ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2; ...@@ -47,17 +47,17 @@ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2;
* with the original PRCM protocol defined for OMAP2420 * with the original PRCM protocol defined for OMAP2420
*/ */
#define SYSC_TYPE1_MIDLEMODE_SHIFT 12 #define SYSC_TYPE1_MIDLEMODE_SHIFT 12
#define SYSC_TYPE1_MIDLEMODE_MASK (0x3 << SYSC_MIDLEMODE_SHIFT) #define SYSC_TYPE1_MIDLEMODE_MASK (0x3 << SYSC_TYPE1_MIDLEMODE_SHIFT)
#define SYSC_TYPE1_CLOCKACTIVITY_SHIFT 8 #define SYSC_TYPE1_CLOCKACTIVITY_SHIFT 8
#define SYSC_TYPE1_CLOCKACTIVITY_MASK (0x3 << SYSC_CLOCKACTIVITY_SHIFT) #define SYSC_TYPE1_CLOCKACTIVITY_MASK (0x3 << SYSC_TYPE1_CLOCKACTIVITY_SHIFT)
#define SYSC_TYPE1_SIDLEMODE_SHIFT 3 #define SYSC_TYPE1_SIDLEMODE_SHIFT 3
#define SYSC_TYPE1_SIDLEMODE_MASK (0x3 << SYSC_SIDLEMODE_SHIFT) #define SYSC_TYPE1_SIDLEMODE_MASK (0x3 << SYSC_TYPE1_SIDLEMODE_SHIFT)
#define SYSC_TYPE1_ENAWAKEUP_SHIFT 2 #define SYSC_TYPE1_ENAWAKEUP_SHIFT 2
#define SYSC_TYPE1_ENAWAKEUP_MASK (1 << SYSC_ENAWAKEUP_SHIFT) #define SYSC_TYPE1_ENAWAKEUP_MASK (1 << SYSC_TYPE1_ENAWAKEUP_SHIFT)
#define SYSC_TYPE1_SOFTRESET_SHIFT 1 #define SYSC_TYPE1_SOFTRESET_SHIFT 1
#define SYSC_TYPE1_SOFTRESET_MASK (1 << SYSC_SOFTRESET_SHIFT) #define SYSC_TYPE1_SOFTRESET_MASK (1 << SYSC_TYPE1_SOFTRESET_SHIFT)
#define SYSC_TYPE1_AUTOIDLE_SHIFT 0 #define SYSC_TYPE1_AUTOIDLE_SHIFT 0
#define SYSC_TYPE1_AUTOIDLE_MASK (1 << SYSC_AUTOIDLE_SHIFT) #define SYSC_TYPE1_AUTOIDLE_MASK (1 << SYSC_TYPE1_AUTOIDLE_SHIFT)
/* /*
* OCP SYSCONFIG bit shifts/masks TYPE2. These are for IPs compliant * OCP SYSCONFIG bit shifts/masks TYPE2. These are for IPs compliant
......
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