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.

AM335x DDR3 Suspend

Other Parts Discussed in Thread: AM3352

Hello,

I have a custom board with AM3352 and DDR3-memory. I want to use the Suspend mode, but when I let the processor longer in Suspend than about 10 seconds, Kernel crashes at wakeup. If I wake it up faster than 10 seconds, it works.

I suppose a problem with DDR-Self-Refresh.

Can you give me some Ideas, where I can search?

Thanks, Philipp

  • Hi Philipp,

    This could be happening if DDR is not held in self-refresh properly during suspend-resume.

    Can you share your crash log?

    Regards

    Sandhya

  • Hi Sandhya,

    can you show me the point in Code where the DDR or the EMIF is configured for self-refresh?

    Here is my crash log:

    # echo mem > sys/power/state
    [   38.380947] PM: Syncing filesystems ... done.
    [   38.386174] platform mpu.0: omap_target: unable to set voltage to 1100000 uV (for 275 MHz)
    [   38.395186] Freezing user space processes ... (elapsed 0.01 seconds) done.
    [   38.419231] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
    [   38.441553] rtc-pcf8563 1-0051: low voltage detected, date/time is not reliable.
    [   38.458014] PM: suspend of devices complete after 18.225 msecs
    [   38.465006] PM: late suspend of devices complete after 0.815 msecs
    [   38.476340] GFX domain entered low power state
    [   38.476391] Could not enter low power state
    [   38.476400] Please check for active clocks in PER domain
    [   38.477078] Unable to handle kernel paging request at virtual address 5555aaa8
    [   38.481338] Internal error: Oops - undefined instruction: 0 [#1] PREEMPT
    [   38.481356] Modules linked in:
    [   38.481377] CPU: 0    Not tainted  (3.2.31-rt46 #2)
    [   38.481421] PC is at free_one_page+0x18c/0x274
    [   38.481437] LR is at 0x0
    [   38.481454] pc : [<c007d974>]    lr : [<00000000>]    psr: 60000113
    [   38.481465] sp : c7835ea0  ip : 00000080  fp : c7835ecc
    [   38.481480] r10: c0443f40  r9 : 00000000  r8 : 00000001
    [   38.481496] r7 : 00000001  r6 : 00000004  r5 : c0443f24  r4 : c0562f40
    [   38.481514] r3 : c0562f80  r2 : ffffff80  r1 : c0562f00  r0 : 00000002
    [   38.481533] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
    [   38.481554] Control: 10c5387d  Table: 87018019  DAC: 00000015
    [   38.481571] Process rcu_kthread (pid: 7, stack limit = 0xc78342f0)
    [   38.481588] Stack: (0xc7835ea0 to 0xc7836000)
    [   38.481613] 5ea0: 00000000 c0562f40 00000001 c0443f24 c042fae8 c7834000 00000000 00000000
    [   38.481642] 5ec0: c7835ef4 c7835ed0 c007dbe0 c007d7f4 c0562f50 00000000 00000000 c78913f4
    [   38.481671] 5ee0: 00000013 00000000 c7835f0c c7835ef8 c007ea3c c007da68 c7891080 00000fff
    [   38.481700] 5f00: c7835f1c c7835f10 c007ea78 c007ea04 c7835f34 c7835f20 c00339d0 c007ea4c
    [   38.481729] 5f20: c0430474 c7891080 c7835f4c c7835f38 c003418c c00339b4 c0034198 00000000
    [   38.481758] 5f40: c7835f5c c7835f50 c00341ac c00340f8 c7835f7c c7835f60 c0076328 c00341a4
    [   38.481787] 5f60: 60000113 c7834000 c7835f90 c0076340 c7835fac c7835f80 c007641c c00762a0
    [   38.481816] 5f80: 00000013 00000000 c7826400 c004f744 c7835f90 c7835f90 c7823f2c 00000000
    [   38.481844] 5fa0: c7835ff4 c7835fb0 c004f0cc c007634c 00000000 00000000 00000000 c7835fbc
    [   38.481872] 5fc0: c7835fbc 00000000 c00396b4 00000013 c7835fd0 c7835fd0 00000000 c7823f2c
    [   38.481901] 5fe0: c004f03c c00396b4 00000000 c7835ff8 c00396b4 c004f048 5555aaaa 5555aaaa
    [   38.481916] Backtrace:
    [   38.481948] [<c007d7e8>] (free_one_page+0x0/0x274) from [<c007dbe0>] (__free_pages_ok+0x184/0x1bc)
    [   38.481984] [<c007da5c>] (__free_pages_ok+0x0/0x1bc) from [<c007ea3c>] (__free_pages+0x44/0x48)
    [   38.482002]  r8:00000000 r7:00000013 r6:c78913f4 r5:00000000 r4:00000000
    [   38.482027] r3:c0562f50
    [   38.482051] [<c007e9f8>] (__free_pages+0x0/0x48) from [<c007ea78>] (free_pages+0x38/0x44)
    [   38.482068]  r5:00000fff r4:c7891080
    [   38.482101] [<c007ea40>] (free_pages+0x0/0x44) from [<c00339d0>] (free_task+0x28/0x40)
    [   38.482131] [<c00339a8>] (free_task+0x0/0x40) from [<c003418c>] (__put_task_struct+0xa0/0xac)
    [   38.482148]  r4:c7891080 r3:c0430474
    [   38.482176] [<c00340ec>] (__put_task_struct+0x0/0xac) from [<c00341ac>] (__put_task_struct_cb+0x14/0x18)
    [   38.482193]  r4:00000000 r3:c0034198
    [   38.482224] [<c0034198>] (__put_task_struct_cb+0x0/0x18) from [<c0076328>] (__rcu_process_callbacks+0x94/0xac)
    [   38.482255] [<c0076294>] (__rcu_process_callbacks+0x0/0xac) from [<c007641c>] (rcu_kthread+0xdc/0x100)
    [   38.482273]  r6:c0076340 r5:c7835f90 r4:c7834000 r3:60000113
    [   38.482311] [<c0076340>] (rcu_kthread+0x0/0x100) from [<c004f0cc>] (kthread+0x90/0x98)
    [   38.482326]  r5:00000000 r4:c7823f2c
    [   38.482360] [<c004f03c>] (kthread+0x0/0x98) from [<c00396b4>] (do_exit+0x0/0x2a4)
    [   38.482376]  r6:c00396b4 r5:c004f03c r4:c7823f2c
    [   38.482405] Code: 1a000015 e593200c e3720080 1a000012 (ed93201c)
    [   38.482425] ---[ end trace 0000000000000002 ]---
    [   38.813638] pgd = c7018000
    [   38.816486] [5555aaa8] *pgd=00000000
    [   38.820260] Internal error: Oops: 80000005 [#2] PREEMPT
    [   38.820272] Modules linked in:
    [   38.820289] CPU: 0    Tainted: G      D       (3.2.31-rt46 #2)
    [   38.820304] PC is at 0x5555aaa8
    [   38.820323] LR is at _omap_device_activate+0x88/0x1b4
    [   38.820343] pc : [<5555aaa8>]    lr : [<c002a3b8>]    psr: 20000113
    [   38.820354] sp : c7bf7d60  ip : 00000000  fp : c7bf7dac
    [   38.820368] r10: 00000010  r9 : 00000000  r8 : 00000001
    [   38.820385] r7 : c04646cc  r6 : c041f8ac  r5 : c78a3340  r4 : c78a3380
    [   38.820402] r3 : 5555aaaa  r2 : 00000000  r1 : 00000000  r0 : c78a3380
    [   38.820420] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
    [   38.820440] Control: 10c5387d  Table: 87018019  DAC: 00000015
    [   38.820456] Process sh (pid: 446, stack limit = 0xc7bf62f0)
    [   38.820471] Stack: (0xc7bf7d60 to 0xc7bf8000)
    [   38.820495] 7d60: c0028a1c c002ce18 c7bf7d9c c7bf7d78 00000000 00000000 00000000 c7bf6000
    [   38.820524] 7d80: c7bf7da4 c7bf7d90 c0061218 c78a3380 c78c1e08 c041f8ac c04646cc 00000000
    [   38.820554] 7da0: c7bf7dc4 c7bf7db0 c002ad04 c002a33c c78a3380 c78c1e08 c7bf7ddc c7bf7dc8
    [   38.820582] 7dc0: c002ada0 c002acbc 00000000 c002ad4c c7bf7e14 c7bf7de0 c01bab94 c002ad58
    [   38.820611] 7de0: c0057a14 c0019a00 c789e010 c789e074 c043a454 c78c1e08 00000010 c043a43c
    [   38.820640] 7e00: c78c1e08 00000000 c7bf7e2c c7bf7e18 c01bada8 c01baac8 c04646cc c78c1e74
    [   38.820669] 7e20: c7bf7e6c c7bf7e30 c01bae78 c01bad14 f422e33f 00000008 f422e33f 00000008
    [   38.820696] 7e40: c038830d 00000003 ffffffff 00000000 00000004 c02e5064 c02f6594 c038830d
    [   38.820725] 7e60: c7bf7e8c c7bf7e70 c0068498 c01bae08 c001eb58 c045e1d8 00000003 00000000
    [   38.820754] 7e80: c7bf7eb4 c7bf7e90 c0068550 c006835c c7bf7eb4 00bf7eac c7bf7ed4 00000003
    [   38.820782] 7ea0: c038830d 00000000 c7bf7ed4 c7bf7eb8 c0068668 c00684d4 00000003 c7bcb000
    [   38.820811] 7ec0: 00000003 00000003 c7bf7efc c7bf7ed8 c0067314 c00685e4 00000004 c7850e00
    [   38.820840] 7ee0: c7b9d2c0 c7bf7f70 c7801240 c7b9d2d8 c7bf7f0c c7bf7f00 c016d878 c0067278
    [   38.820869] 7f00: c7bf7f3c c7bf7f10 c00f0868 c016d868 c7bf7f70 00000004 c78cfd80 000a4470
    [   38.820897] 7f20: c7bf7f70 00000000 00000000 00000000 c7bf7f6c c7bf7f40 c00a090c c00f07f0
    [   38.820925] 7f40: c7bf7fa4 c7bf7f50 c0039da0 c78cfd80 000a4470 00000004 00000004 00000000
    [   38.820953] 7f60: c7bf7fa4 c7bf7f70 c00a0b70 c00a085c 00000000 00000000 00200200 00000000
    [   38.820981] 7f80: c009eb8c 00099978 00000004 000a4470 c000e704 c7bf6000 00000000 c7bf7fa8
    [   38.821009] 7fa0: c000e580 c00a0b38 00099978 00000004 00000001 000a4470 00000004 00000000
    [   38.821036] 7fc0: 00099978 00000004 000a4470 00000004 00000001 00000002 00000020 0009a29c
    [   38.821063] 7fe0: 00000000 bee62674 00011c28 40219b7c 60000010 00000001 00000000 00000000
    [   38.821077] Backtrace:
    [   38.821102] [<c002a330>] (_omap_device_activate+0x0/0x1b4) from [<c002ad04>] (omap_device_enable+0x54/0x78)
    [   38.821120]  r8:00000000 r7:c04646cc r6:c041f8ac r5:c78c1e08 r4:c78a3380
    [   38.821161] [<c002acb0>] (omap_device_enable+0x0/0x78) from [<c002ada0>] (_od_resume_noirq+0x54/0x68)
    [   38.821179]  r4:c78c1e08 r3:c78a3380
    [   38.821212] [<c002ad4c>] (_od_resume_noirq+0x0/0x68) from [<c01bab94>] (pm_noirq_op+0xd8/0x158)
    [   38.821230]  r4:c002ad4c r3:00000000
    [   38.821257] [<c01baabc>] (pm_noirq_op+0x0/0x158) from [<c01bada8>] (device_resume_noirq+0xa0/0xf4)
    [   38.821274]  r9:00000000 r8:c78c1e08 r6:c043a43c r5:00000010 r4:c78c1e08
    [   38.821315] [<c01bad08>] (device_resume_noirq+0x0/0xf4) from [<c01bae78>] (dpm_resume_noirq+0x7c/0x174)
    [   38.821333]  r5:c78c1e74 r4:c04646cc
    [   38.821373] [<c01badfc>] (dpm_resume_noirq+0x0/0x174) from [<c0068498>] (suspend_enter+0x148/0x178)
    [   38.821407] [<c0068350>] (suspend_enter+0x0/0x178) from [<c0068550>] (suspend_devices_and_enter+0x88/0x110)
    [   38.821425]  r6:00000000 r5:00000003 r4:c045e1d8 r3:c001eb58
    [   38.821464] [<c00684c8>] (suspend_devices_and_enter+0x0/0x110) from [<c0068668>] (enter_state+0x90/0xe0)
    [   38.821481]  r6:00000000 r5:c038830d r4:00000003
    [   38.821516] [<c00685d8>] (enter_state+0x0/0xe0) from [<c0067314>] (state_store+0xa8/0x114)
    [   38.821532]  r6:00000003 r5:00000003 r4:c7bcb000 r3:00000003
    [   38.821574] [<c006726c>] (state_store+0x0/0x114) from [<c016d878>] (kobj_attr_store+0x1c/0x28)
    [   38.821611] [<c016d85c>] (kobj_attr_store+0x0/0x28) from [<c00f0868>] (sysfs_write_file+0x84/0xb8)
    [   38.821656] [<c00f07e4>] (sysfs_write_file+0x0/0xb8) from [<c00a090c>] (file_ioctl+0xbc/0x138)
    [   38.821687] [<c00a0850>] (file_ioctl+0x0/0x138) from [<c00a0b70>] (filldir+0x44/0x70)
    [   38.821703]  r8:00000000 r7:00000004 r6:00000004 r5:000a4470 r4:c78cfd80
    [   38.821752] [<c00a0b2c>] (filldir+0x0/0x70) from [<c000e580>] (ret_fast_syscall+0x0/0x30)
    [   38.821768]  r9:c7bf6000 r8:c000e704 r6:000a4470 r5:00000004 r4:00099978
    [   38.821798] Code: bad PC value
    [   39.273563] ---[ end trace 0000000000000003 ]---

  • DDR is put into self-refresh while going into suspend and taken out of self-refresh during resume.

    You can find this code in the assembly file arch/arm/mach-omap2/sleep33xx.S

    This code may not be the issue, the problem could be that once DDR is put into self-refresh, it is not retained there due to some voltage levels not being maintained etc.

    Also, some clock in the PER domain is still active and the system has not entered DeepSleep0,  as seen from the log.

    Regards

    Sandhya

  • Hi Philipp,
     
    Do you have 10kOhm pulldown resistor on the CKE line?
  • No, I have not. Thank you for the Tip, I will tri it.

  • It is solved! The missing pulldown was the problem. Now I only need to find why the Prozessor does not enter DeepSleep0.

    Thanks, Philipp

  • Hi,

    i have an issue about wakeup form suspend to ram with DDR3 400MHz in my custon board based on AM335x Starter Kit.

    After VTT_EN goes high, NO CKE goes high but the differential clock is present and stable.

    See image

    LOG:

    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|
                  |___|                    |___|
    
    Arago Project http://arago-project.org am335x-evm ttyO0
    
    Arago 2012.10 am335x-evm ttyO0
    
    am335x-evm login: root
    root@am335x-evm:~# echo mem > /sys/power/state
    [   87.983306] PM: Syncing filesystems ... done.
    [   88.003692] Freezing user space processes ... (elapsed 0.01 seconds) done.
    [   88.026733] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
    [   88.062469] PM: suspend of devices complete after 15.014 msecs
    [   88.073699] PM: late suspend of devices complete after 4.974 msecs
    ....
    No other output

    The same board is working with 303MHz DDR3 configuration.

    A big differece: the time between VTT_EN and CLOCK

    400MHz is every time 1.6us

    303MHZ is variable 10us-200us


    Any ideas ?

    I made a suspend-to-ram on AM335x Starter Kit with

    Linux http://arago-project.org/git/projects/linux-am33x.git?p=projects/linux-am33x.git;a=shortlog;h=refs/heads/v3.2-staging

    Uboot http://arago-project.org/git/projects/u-boot-am33x.git?p=projects/u-boot-am33x.git;a=shortlog;h=refs/heads/master


    but suspend-to-ram with DDR3 400MHz dosen't works: CKE is LOW

     _____                    _____           _         _
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|
                  |___|                    |___|
    
    Arago Project http://arago-project.org am335x-evm ttyO0
    
    Arago 2011.09 am335x-evm ttyO0
    
    am335x-evm login: root
    root@am335x-evm:~# echo mem > /sys/power/state
    [   41.045837] PM: Syncing filesystems ... done.
    [   42.664459] Freezing user space processes ... (elapsed 0.01 seconds) done.
    [   42.688903] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
    [   42.708923] Suspending console(s) (use no_console_suspend to debug)
    
    

    Standby works... The DDR3 wakeup corretly

    root@am335x-evm:~# echo standby > /sys/power/state
    [   50.286987] PM: Syncing filesystems ... done.
    [   51.809783] Freezing user space processes ... (elapsed 0.01 seconds) done.
    [   51.834014] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
    [   51.854003] Suspending console(s) (use no_console_suspend to debug)
    [   51.882202] PM: suspend of devices complete after 20.843 msecs
    [   51.887390] PM: late suspend of devices complete after 5.096 msecs
    [   53.408233] GFX domain entered low power state
    [   53.408355] Successfully transitioned all domains to low power state
    [   53.411285] PM: early resume of devices complete after 2.532 msecs
    [   53.628479] net eth0: CPSW phy found : id is : 0x4dd074
    [   53.630676] PM: resume of devices complete after 218.644 msecs
    [   53.673553] Restarting tasks ... done.
    
    standby
    root@am335x-evm:~#

    The differemce is the time between VTT_EN and CLOCK.

    Uboot patch for 400MHz

    ---------------------- arch/arm/cpu/armv7/am33xx/emif4.c ----------------------
    index 2d2014e..689171b 100644
    @@ -166,7 +166,8 @@ void config_ddr(short ddr_type)
     		ioctrl_val = DDR2_IOCTRL_VALUE;
     		emif_regs = &ddr2_emif_reg_data;
     	} else if (ddr_type == EMIF_REG_SDRAM_TYPE_DDR3) {
    -		ddr_pll = 303;
    +		//ddr_pll = 303;
    +		ddr_pll = 400;
     		ioctrl_val = DDR3_IOCTRL_VALUE;
     		cmd_ctrl_data = &ddr3_cmd_ctrl_data;
     		if (board_is_evm_15_or_later()) {
    
    ----------------- arch/arm/include/asm/arch-am33xx/ddr_defs.h -----------------
    index 7aac2c9..4e80337 100644
    @@ -48,12 +48,17 @@
     #define DDR2_IOCTRL_VALUE	0x18B
     
     /* Micron MT41J128M16JT-125 */
    -#define DDR3_EMIF_READ_LATENCY	0x100006	/* Enable Dynamic Power Down */
    -#define DDR3_EMIF_TIM1		0x0888A39B
    -#define DDR3_EMIF_TIM2		0x26337FDA
    -#define DDR3_EMIF_TIM3		0x501F830F
    +//#define DDR3_EMIF_READ_LATENCY	0x100006	/* Enable Dynamic Power Down */
    +#define DDR3_EMIF_READ_LATENCY	0x07
    +//#define DDR3_EMIF_TIM1		0x0888A39B
    +#define DDR3_EMIF_TIM1		0x0AAAE4DB
    +//#define DDR3_EMIF_TIM2		0x26337FDA
    +#define DDR3_EMIF_TIM2		0x26437FDA
    +//#define DDR3_EMIF_TIM3		0x501F830F
    +#define	DDR3_EMIF_TIM3		0x501F83FF
     #define DDR3_EMIF_SDCFG		0x61C04AB2
    -#define DDR3_EMIF_SDREF		0x0000093B
    +//#define DDR3_EMIF_SDREF		0x0000093B
    +#define DDR3_EMIF_SDREF		0x00000C30
     #define DDR3_ZQ_CFG		0x50074BE4
     #define DDR3_DLL_LOCK_DIFF	0x1
     #define DDR3_RATIO		0x40
    @@ -65,8 +70,10 @@
     #define DDR3_IOCTRL_VALUE	0x18B
     
     /* Micron ???? on 1.5 and later EVMs */
    -#define DDR3_EMIF_TIM2_EVM	0x26517FDA
    -#define DDR3_EMIF_TIM3_EVM	0x501F851F
    +//#define DDR3_EMIF_TIM2_EVM	0x26517FDA
    +#define DDR3_EMIF_TIM2_EVM		0x26437FDA
    +//#define DDR3_EMIF_TIM3_EVM	0x501F851F
    +#define	DDR3_EMIF_TIM3_EVM		0x501F83FF
     #define DDR3_RD_DQS_EVM		0x3A
     #define DDR3_WR_DQS_EVM		0x0CD
     #define DDR3_PHY_FIFO_WE_EVM	0x10B

    Thanks

    Paolo