This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3352 processor periodically hang during the login to sleep mode

Used a custom board. Operating system Linux. Processor AM3352ZCZ60. Linux 3.2 kernel from TI.

Post is a continuation of: http://e2e.ti.com/support/arm/sitara_arm/f/791/p/341374/1226448.aspx

Periodically observed hovering board when you enter standby sleep. Managed to locate the place where it happens:

Below is a transition function which transfers control code translates processor in sleep mode. 

file: arch/arm/mach-omap2/pm33xx.c


static int am33xx_do_sram_idle(long unsigned int state)

 {

+    int i;

">>>>>>>>>>am33xx_do_sram_idle-100"
+pr_warn(">>>>>>>>>>%s-%d\n", __func__, __LINE__);

+    /* dump sram */

+//     for(i=0; i<16; i++) {

+//         pr_warn(">>>>>>>>>> 0x%lx\n", *(((unsigned long *)am33xx_do_wfi_sram) + i));

+//     };

+

+    /* calculate crc */

+    size_t size = am33xx_do_wfi_sz/sizeof(unsigned long);

+    unsigned long *p = (unsigned long *) am33xx_do_wfi_sram;

+    unsigned long summ = 0;

+    for(i = 0; i < size; i++) {

+        summ += *p++;

+    }

+

">>>>>>>>>> sram summ = 0xa789f63f"
+    pr_warn(">>>>>>>>>> sram summ = 0x%lx\n", summ);


     am33xx_do_wfi_sram(&suspend_cfg_param_list[0]);

-

     return 0;

 }




Also added logging sleep and wake:

@@ -117,11 +133,11 @@ static int am33xx_pm_suspend(void)

 {

     int state, ret = 0;

     unsigned int retval;

 

     struct omap_hwmod *gpmc_oh, *usb_oh, *gpio1_oh;

-

>>>>>>>>>>am33xx_pm_suspend-138
+pr_warn(">>>>>>>>>>%s-%d\n", __func__, __LINE__);

     usb_oh        = omap_hwmod_lookup("usb_otg_hs");

     gpmc_oh        = omap_hwmod_lookup("gpmc");

     gpio1_oh    = omap_hwmod_lookup("gpio1");    /* WKUP domain GPIO */

 

     omap_hwmod_enable(usb_oh);

@@ -169,11 +185,11 @@ static int am33xx_pm_suspend(void)

      * Keep Touchscreen module enabled during standby

      * to enable wakeup from standby.

      */

     if (suspend_state == PM_SUSPEND_STANDBY)

         writel(0x2, AM33XX_CM_WKUP_ADC_TSC_CLKCTRL);

-

>>>>>>>>>>am33xx_pm_suspend-190
+pr_warn(">>>>>>>>>>%s-%d\n", __func__, __LINE__);

     /* DMTimer wakeup from standby */

     if (suspend_state == PM_SUSPEND_STANDBY) {

         writel(0x2, AM33XX_CM_PER_TIMER7_CLKCTRL);

 

         standby_dmtmr.stndby_tmr = omap_dm_timer_request_specific(7);

@@ -215,13 +231,17 @@ err_out:

         pr_err("Could not program GFX to low power state\n");

 

     omap3_intc_suspend();

 

     writel(0x0, AM33XX_CM_MPU_MPU_CLKCTRL);

>>>>>>>>>>am33xx_pm_suspend-240
+    pr_warn(">>>>>>>>>>%s-%d\n", __func__, __LINE__);

     ret = cpu_suspend(0, am33xx_do_sram_idle);

>>>>>>>>>>am33xx_pm_suspend-242
+pr_warn(">>>>>>>>>>%s-%d\n", __func__, __LINE__);



Added logging gpio in functions "am33xx_do_vfi" (performed in the built SRAM)
:

     .align 3

 ENTRY(am33xx_do_wfi)

     stmfd    sp!, {r4 - r11, lr}    @ save registers on stack

 

     .macro    pll_bypass, name, clk_mode_addr, idlest_addr, pll_mode

@@ -119,21 +120,41 @@ wait_sc_\num:

     bne    wait_sc_\num

     .endm

 

     mov    r8, r0            @ same arg list passed to us

 

-    /* EMIF config for low power mode */

-    ldr    r0, emif_addr_func

-    blx    r0

-

-    str    r0, emif_addr_virt

Set pin in LO state
+#if 1
+/* debug 0 START */

+    /* Drive GPIO0_7 LOW */

+    ldr r0, gpio0_addr_func

+    blx r0

+    ldr r1, [r0, #OMAP4_GPIO_CLEARDATAOUT]

+    mov r2, #(1 << 7)

+    str r2, [r0, #OMAP4_GPIO_CLEARDATAOUT]

+/* debug 0 END */

+#endif

 

     ldr    r0, gpio0_addr_func

     blx    r0

-

     str    r0, gpio0_addr_virt

 

+#if 0

+/* debug 0 START */

+    /* Drive GPIO0_7 LOW */

+    ldr r0, gpio0_addr_virt

+    ldr r1, [r0, #OMAP4_GPIO_CLEARDATAOUT]

+    mov r2, #(1 << 7)

+    str r2, [r0, #OMAP4_GPIO_CLEARDATAOUT]

+/* debug 0 END */

+#endif

+

+    /* EMIF config for low power mode */

+    ldr r0, emif_addr_func

+    blx r0

+

+    str r0, emif_addr_virt


Options in the kernel use the following parameters: no_console_suspend
.

Log output in normal mode:
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.01 seconds) done.

Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.

wlcore: down

 Switching WLAN power to off

omap_hwmod: gpmc: _wait_target_disable failed

PM: suspend of devices complete after 146.606 msecs

PM: suspend devices took 0.150 seconds

PM: late suspend of devices complete after 1.525 msecs

>>>>>>>>>>am33xx_pm_suspend-138

omap_hwmod: gpmc: _wait_target_disable failed

>>>>>>>>>>am33xx_pm_suspend-190

>>>>>>>>>>am33xx_pm_suspend-240

>>>>>>>>>>am33xx_do_sram_idle-100

>>>>>>>>>> sram summ = 0xa789f63f

>>>>>>>>>>am33xx_pm_suspend-242

GFX domain entered low power state

Successfully transitioned all domains to low power state

PM: early resume of devices complete after 0.976 msecs
 
To the log when hanging:
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.01 seconds) done.

Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.

wlcore: down

 Switching WLAN power to off

omap_hwmod: gpmc: _wait_target_disable failed

PM: suspend of devices complete after 146.575 msecs

PM: suspend devices took 0.150 seconds

PM: late suspend of devices complete after 1.525 msecs

>>>>>>>>>>am33xx_pm_suspend-138

omap_hwmod: gpmc: _wait_target_disable failed

>>>>>>>>>>am33xx_pm_suspend-190

>>>>>>>>>>am33xx_pm_suspend-240

>>>>>>>>>>am33xx_do_sram_idle-100

>>>>>>>>>> sram summ = 0xa789f63f
When hanging pin still in a high state, from which it may be concluded problemme code execution in SRAM. Probable that fails SRAM. So were added capacity in supply chain VDDS_SRAM_CORE_BG (according to specification on the processor), it did not give a positive result. 

Can you have any ideas?