summaryrefslogtreecommitdiffstats
path: root/board/davinci/da8xxevm
diff options
context:
space:
mode:
authorNagabhushana Netagunte <nagabhushana.netagunte@ti.com>2011-09-03 22:19:28 -0400
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2011-09-04 11:36:19 +0200
commitcf2c24e3996e49a26b449ab7daf843856b35b5c8 (patch)
tree22d39b0c5e95b4249529c7f5675c842e9a71b8c7 /board/davinci/da8xxevm
parentac935e567bee77b39fc37c1ad360bb0d1ac07c4e (diff)
downloadblackbird-obmc-uboot-cf2c24e3996e49a26b449ab7daf843856b35b5c8.tar.gz
blackbird-obmc-uboot-cf2c24e3996e49a26b449ab7daf843856b35b5c8.zip
da850: add support to wake up DSP during board init
add support for DSP wake-up by default on DA850/OMAP-L138 during board initialization. Enable hwconfig environment and added extra env setting through CONFIG_EXTRA_ENV_SETTINGS. To prevent DSP from being woken up,set the environment variable as, set hwconfig "dsp:wake=no" Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
Diffstat (limited to 'board/davinci/da8xxevm')
-rw-r--r--board/davinci/da8xxevm/da850evm.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index d3d965cdab..8c3d64e787 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -30,6 +30,7 @@
#include <asm/arch/emac_defs.h>
#include <asm/io.h>
#include <asm/arch/davinci_misc.h>
+#include <hwconfig.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -163,6 +164,64 @@ const struct pinmux_config nor_pins[] = {
#endif
#endif /* CONFIG_DRIVER_TI_EMAC */
+void dsp_lpsc_on(unsigned domain, unsigned int id)
+{
+ dv_reg_p mdstat, mdctl, ptstat, ptcmd;
+ struct davinci_psc_regs *psc_regs;
+
+ psc_regs = davinci_psc0_regs;
+ mdstat = &psc_regs->psc0.mdstat[id];
+ mdctl = &psc_regs->psc0.mdctl[id];
+ ptstat = &psc_regs->ptstat;
+ ptcmd = &psc_regs->ptcmd;
+
+ while (*ptstat & (0x1 << domain))
+ ;
+
+ if ((*mdstat & 0x1f) == 0x03)
+ return; /* Already on and enabled */
+
+ *mdctl |= 0x03;
+
+ *ptcmd = 0x1 << domain;
+
+ while (*ptstat & (0x1 << domain))
+ ;
+ while ((*mdstat & 0x1f) != 0x03)
+ ; /* Probably an overkill... */
+}
+
+static void dspwake(void)
+{
+ unsigned *resetvect = (unsigned *)DAVINCI_L3CBARAM_BASE;
+ u32 val;
+
+ /* if the device is ARM only, return */
+ if ((readl(CHIP_REV_ID_REG) & 0x3f) == 0x10)
+ return;
+
+ if (hwconfig_subarg_cmp_f("dsp", "wake", "no", NULL))
+ return;
+
+ *resetvect++ = 0x1E000; /* DSP Idle */
+ /* clear out the next 10 words as NOP */
+ memset(resetvect, 0, sizeof(unsigned) *10);
+
+ /* setup the DSP reset vector */
+ writel(DAVINCI_L3CBARAM_BASE, HOST1CFG);
+
+ dsp_lpsc_on(1, DAVINCI_LPSC_GEM);
+ val = readl(PSC0_MDCTL + (15 * 4));
+ val |= 0x100;
+ writel(val, (PSC0_MDCTL + (15 * 4)));
+}
+
+int misc_init_r(void)
+{
+ dspwake();
+ return 0;
+}
+
static const struct pinmux_resource pinmuxes[] = {
#ifdef CONFIG_SPI_FLASH
PINMUX_ITEM(spi1_pins),
OpenPOWER on IntegriCloud