*/
/* Works on Always On power domain only (no PD argument) */
-void lpsc_on(unsigned int id)
+static void lpsc_transition(unsigned int id, unsigned int state)
{
dv_reg_p mdstat, mdctl, ptstat, ptcmd;
#ifdef CONFIG_SOC_DA8XX
while (readl(ptstat) & 0x01)
continue;
- if ((readl(mdstat) & PSC_MDSTAT_STATE) == 0x03)
- return; /* Already on and enabled */
+ if ((readl(mdstat) & PSC_MDSTAT_STATE) == state)
+ return; /* Already in that state */
- writel(readl(mdctl) | 0x03, mdctl);
+ writel((readl(mdctl) & ~PSC_MDCTL_NEXT) | state, mdctl);
switch (id) {
#ifdef CONFIG_SOC_DM644X
while (readl(ptstat) & 0x01)
continue;
- while ((readl(mdstat) & PSC_MDSTAT_STATE) != 0x03)
+ while ((readl(mdstat) & PSC_MDSTAT_STATE) != state)
continue;
}
+void lpsc_on(unsigned int id)
+{
+ lpsc_transition(id, 0x03);
+}
+
+void lpsc_syncreset(unsigned int id)
+{
+ lpsc_transition(id, 0x01);
+}
+
/* Not all DaVinci chips have a DSP power domain. */
#ifdef CONFIG_SOC_DM644X
#endif /* CONFIG_SOC_DA8XX */
void lpsc_on(unsigned int id);
+void lpsc_syncreset(unsigned int id);
void dsp_on(void);
void davinci_enable_uart0(void);
#endif /* CONFIG_SOC_DA8XX */
#define PSC_MDSTAT_STATE 0x3f
+#define PSC_MDCTL_NEXT 0x07
#ifndef CONFIG_SOC_DA8XX