rk29: pm: add JTAG config for debug
author黄涛 <huangtao@rock-chips.com>
Mon, 16 May 2011 11:55:17 +0000 (19:55 +0800)
committer黄涛 <huangtao@rock-chips.com>
Mon, 16 May 2011 12:03:32 +0000 (20:03 +0800)
arch/arm/mach-rk29/Kconfig
arch/arm/mach-rk29/pm.c

index c4cdddf53ccf1327ce1f5f568fa7f0928efd038d..b7409273d0036e0ab2dabc7cde1c55e7dab5fae3 100755 (executable)
@@ -161,4 +161,10 @@ config RK29_VPU_DEBUG
 
 endmenu
 
+config RK29_JTAG
+       bool "Enable JTAG support (debug only)"
+       help
+         This is an option for SDK board. Always enable JTAG clock,
+         but consumes more power.
+
 endif
index 3a02514ef884b7e8f34636395572ce0aa5c6f131..0fa338fb037e6ef08d977247a0d6a21335359742 100755 (executable)
@@ -285,6 +285,7 @@ static void __sramfunc rk29_sram_suspend(void)
        cru_writel(clksel0 | 0x1F, CRU_CLKSEL0_CON);
 
        printch('8');
+       dsb();
        asm("wfi");
        printch('8');
 
@@ -416,6 +417,13 @@ static int rk29_pm_enter(suspend_state_t state)
                   | (1 << CLK_GATE_GPIO0)
                   | (1 << CLK_GATE_RTC)
                   | (1 << CLK_GATE_GRF)
+#ifdef CONFIG_RK29_JTAG
+                  | (1 << CLK_GATE_PCLK_CORE)
+                  | (1 << CLK_GATE_ATCLK_CORE)
+                  | (1 << CLK_GATE_ATCLK_CPU)
+                  | (1 << CLK_GATE_DEBUG)
+                  | (1 << CLK_GATE_TPIU)
+#endif
                   ) | clkgate[0], CRU_CLKGATE0_CON);
        cru_writel(~0, CRU_CLKGATE1_CON);
        cru_writel(~((1 << CLK_GATE_GPIO1 % 32)
@@ -425,6 +433,9 @@ static int rk29_pm_enter(suspend_state_t state)
                   | (1 << CLK_GATE_GPIO5 % 32)
                   | (1 << CLK_GATE_GPIO6 % 32)
                   | (1 << CLK_GATE_PWM % 32)
+#ifdef CONFIG_RK29_JTAG
+                  | (1 << CLK_GATE_JTAG % 32)
+#endif
                   ) | clkgate[2], CRU_CLKGATE2_CON);
        cru_writel(~0, CRU_CLKGATE3_CON);
        printch('1');