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 not entering DeepSleep0

Other Parts Discussed in Thread: AM3352, SYSCONFIG

Hello,

I have an custom board with AM3352. In suspend the processor doesnt enter DeepSleep0.

# echo mem > sys/power/state
[   84.896454] PM: Syncing filesystems ... done.
[   84.934600] platform mpu.0: omap_target: unable to set voltage to 1100000 uV (for 275 MHz)
[   84.946515] Freezing user space processes ... (elapsed 0.01 seconds) done.
[   84.970252] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
[   84.992474] rtc-pcf8563 1-0051: low voltage detected, date/time is not reliable.
[   85.008873] PM: suspend of devices complete after 18.168 msecs
[   85.015911] PM: late suspend of devices complete after 0.859 msecs
[   85.027190] GFX domain entered low power state
[   85.027240] Could not enter low power state
[   85.027249] Please check for active clocks in PER domain
[   85.028339] PM: early resume of devices complete after 0.628 msecs
[   85.083636] mmc0: error -110 during resume (card was removed?)
[   85.092477] Ethernet slave.0: Found previously used MAC 00:ad:40:91:02:86
[   85.100390] net eth0: CPSW phy found : id is : 0x221556
[   85.106697] Ethernet slave.1: Found previously used MAC 00:ad:40:91:02:86
[   85.114488] net eth0: CPSW phy found : id is : 0x221556
[   85.125363] rtc-pcf8563 1-0051: low voltage detected, date/time is not reliable.
[   85.134340] PM: resume of devices complete after 84.398 msecs
[   85.140717] Restarting tasks ... done.
sh: write error: Operation not permitted
# [   86.641309] PHY: 0:00 - Link is Up - 100/Full

How coud I find out which clocks are active? Is there any chance to get more information from the M3 processor?

Is it only a software-problem or could the reason also be a wrong circut?

Thanks, Philipp

  • Hi Philipp,

    You could take a dump of Clock Module registers CM_PER_XXX_CLKCTRL(Refer AM335x TRM for register offsets) when the system is in suspend.

    This will give you an indication as to which module clock is enabled during suspend which is causing those prints to appear on your console ; after this you could check if your code is keeping this clock enabled during suspend.

    Regards

    Sandhya

  • Hi Sandhya,

    via the CM_PER_XXX_CLKCTRL registers I have found out, the clocks of GPIO1 and GPIO2 are not stopable. How can I read out their GPIO_Sysconfig registers?

    The Comand: reg = readl(0x4804C000 + 0x10);

    results in: Unable to handle kernel paging request at virtual address 4804c010

    Regards

    Philipp

  • Hi Philipp,

    As indicated by the error message, readl() needs virtual address.

    You will have to 'ioremap' the physical address to get the virtual address and then use readl. (Refer the code for correct readl usage - pm33xx.c)

    You can disable the clocks for GPIO1 and GPIO2 directly by writing a '0' to the corresponding clock register to see if those messages on your console go away.

    Regards

    Sandhya

  • Hi Sandhya,

    when I try to disable the Clocks of GPIO1 and GPIO2 by writing a '0' to the corresponding registers, they change IDLEST to: "0x1 = Trans : Module is performing transition: wakeup, or sleep, or sleep abortion" and they stay there through whole suspend/resume cycle.

    Only if I set their IDLEMODEs in GPIO_SYSCONFIG to: "0x0 = Force-idle. An idle request is acknowledged unconditionally", the clocks change to: "0x3 = Disable : Module is disabled and cannot be accessed". But then Kernel chrashes at resume and anyway DS0 isn't reached.

    I saw, that the Clock of EMIF is also active. Are there any dependencies between EMIF and GPIO? What is able to block Idlemode of the GPIOs?

    Thanks, Philipp

  • Hi Philipp,

    Can you try to disable GPIO modules using omap_hwmod_idle() instead of just writing a '0' to the clock register?

    EMIF clock is disabled before going into suspend and enabled on resume. You should not see this clock as active while in suspend.

    If you are seeing EMIF clock as active, you might have partially resumed and failed thereafter.

    Regards

    Sandhya

  • Hi Sandhya,

    ok I am not sure if I read the registres at the correct time. Which is the last function called before going into suspend in pm33xx.c? I have no JTAG and must print them on the console.

    Using omap_hwmod_idle() in am33xx_pm_suspend() results in the same as writing a '0' to the clock registers.

    Only these new errormessages appear on console.

    [   21.633329] omap_hwmod: gpio1: _wait_target_disable failed
    [   21.636628] omap_hwmod: gpio2: _wait_target_disable failed
    [   21.639925] omap_hwmod: gpio3: _wait_target_disable failed

    Is it right, that gpio3 in omap_hwmod.c corresponds to GPIO BANK 2 in AM3352? Putting gpio4 to idle works!

    Thanks, Philipp

    PS: Could be booting via Ethernet form tftp-server  the reason?

  • Hi,

    Yes, gpio3 in omap_hwmod.c corresponds to GPIO BANK 2 in AM335x.

    The core suspend/resume routine is in assembly (sleep33xx.S) where EMIF disable etc is done.

    However, you could check the clock status in pm33xx.c in am33xx_pm_suspend() just before cpu_suspend() is called.

    Regards

    Sandhya

  • Hello,

    these messages allready appears at boot-process very early:

    [    0.066470] omap_hwmod: gpio1: _wait_target_disable failed
    [    0.069794] omap_hwmod: gpio2: _wait_target_disable failed
    [    0.073106] omap_hwmod: gpio3: _wait_target_disable failed

    In boot-process of EVM-Board they dont appear, so I think there is something wrong at configuration of my Board or my Kernel.

    Any idea where can I search?

    Thanks, Philipp

  • Hello,

    I have printed out all Clock registers and tried to disable all active clocks. You can see the protocoll below. GPIO2 is only changes to IDLE when I set the IDLEMODE in GPIO2_SYSCONFIG to Force-idle. If I do the same for GPIO1, Kernel crashes without any crashdump. GPIO0 also does not become IDLE.

    # echo mem > sys/power/state
    [   36.741482] PM: Syncing filesystems ... done.
    [   36.759801] platform mpu.0: omap_target: unable to set voltage to 1100000 uV (for 275 MHz)
    [   36.782352] Freezing user space processes ... (elapsed 0.02 seconds) done.
    [   36.810589] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
    [   36.832936] rtc-pcf8563 1-0051: low voltage detected, date/time is not reliable.
    [   36.848517] PM: suspend of devices complete after 17.362 msecs
    [   36.855564] PM: late suspend of devices complete after 0.869 msecs
    [   36.862434] GPIO2_Sysconfig: 5
    [   36.865746] omap_hwmod: gpio1: _wait_target_disable failed
    [   36.865769] WAKEUP
    [   36.865778] GPIO0: 10000
    [   36.865787] TIMER0: 30000
    [   36.865796] TIMER1: 2
    [   36.865805] DEBUGSS: 52590000
    [   36.865815] UART0: 2
    [   36.865823] I2C0: 30000
    [   36.865832] ADC_TSC: 30000
    [   36.865842] SMARTREFLEX0: 30000
    [   36.865852] SMARTREFLEX1: 30000
    [   36.865861] WDT1: 30000
    [   36.865871] DIV_M4_DPLL_CORE: 22a
    [   36.865881] DIV_M5_DPLL_CORE: 28
    [   36.865891] DIV_M6_DPLL_CORE: 4
    [   36.865901] WKUP_CLKSTCTRL: 3206
    [   36.865910] WKUP_CONTROL_CLKCTRL: 2
    [   36.865921] WKUP_L4WKUP_CLKCTRL: 2
    [   36.865931] L3_AON_CLKSTCTRL: 1d
    [   36.865941] IDLEST_DPLL_PER: 1
    [   36.865951] L4_WKUP_AON_CLKSTCTRL: 6
    [   36.865962] WKUP_WKUP_M3_CLKCTRL: 40002
    [   36.865972] WKUP_L4WKUP_CLKCTRL: 2
    [   36.865981]
    [   36.865986] PERIPHERIE
    [   36.865994] GPIO1: 10002
    [   36.866004] GPIO2: 20002
    [   36.866012] GPIO3: 20002
    [   36.866022] CPGMAC0: 70000
    [   36.866031] LCDC: 70000
    [   36.866040] USB0: 70000
    [   36.866049] EMIF: 2
    [   36.866058] EMIF_FW: 30000
    [   36.866066] OCMCRAM: 2
    [   36.866075] GPMC: 30000
    [   36.866084] MCASP0: 30000
    [   36.866093] MCASP1: 30000
    [   36.866102] ELM: 30000
    [   36.866111] I2C1: 30000
    [   36.866120] I2C2: 30000
    [   36.866129] SPI0: 30000
    [   36.866138] SPI1: 30000
    [   36.866147] L3_INSTR: 30000
    [   36.866156] L3: 2
    [   36.866164] L3_CLKSTCTRL: 16
    [   36.866174] L3S_CLKSTCTRL: 1
    [   36.866184] L4LS: 30000
    [   36.866193] L4LS_CLKSTCTRL: 101
    [   36.866202] L4FW: 30000
    [   36.866211] L4FW_CLKSTCTRL: 1
    [   36.866221] L4HS: 30000
    [   36.866230] L4HS_CLKSTCTRL: 1
    [   36.866239] UART1: 30000
    [   36.866248] UART2: 30000
    [   36.866257] UART3: 30000
    [   36.866267] UART4: 30000
    [   36.866276] UART5: 30000
    [   36.866284] TIMER2: 30000
    [   36.866294] TIMER3: 30000
    [   36.866303] TIMER4: 30000
    [   36.866312] TIMER5: 30000
    [   36.866322] TIMER6: 30000
    [   36.866333] TIMER7: 30000
    [   36.866342] DCAN0: 30000
    [   36.866351] DCAN1: 30000
    [   36.866360] EPWMSS0: 30000
    [   36.866370] EPWMSS1: 30000
    [   36.866379] EPWMSS2: 30000
    [   36.866388] IEEE5000: 70000
    [   36.866398] MMC0: 30000
    [   36.866407] MMC1: 30000
    [   36.866416] MMC2: 30000
    [   36.866425] TPCC: 30000
    [   36.866434] TPTC0: 70000
    [   36.866443] TPTC1: 70000
    [   36.866452] TPTC2: 70000
    [   36.866461] SPINLOCK: 30000
    [   36.866470] MAILBOX0: 30000
    [   36.866480] OCPWP: 70000
    [   36.866489] OCPWP_L3_CLKSTCTRL: 1
    [   36.866499] CLKDIV32K: 30000
    [   36.866509] CPSW_CLKSTCTRL: 1
    [   36.866518] LCDC_CLKSTCTRL: 1
    [   36.866528] PRUSS_CLKCTRL: 70000
    [   36.866538] PRUSS_CLKSTCTRL: 1
    [   36.866548] CLK_24MHZ_CLKSTCTRL: 1
    [   36.866556]
    [   36.866561] GFX
    [   36.866569] GFX_L3_CLKSTCTRL: 1
    [   36.866579] GFX_GFX_CLKCTRL: 70000
    [   36.866589] GFX_BITBLT_CLKCTRL: 70000
    [   36.866600] GFX_L4LS_GFX_CLKSTCTRL__1: 1
    [   36.866611] GFX_MMUCFG_CLKCTRL: 30000
    [   36.866622] GFX_MMUDATA_CLKCTRL: 30000
    [   36.866630]
    [   36.866635] CEFUSE
    [   36.866643] CEFUSE_CLKSTCTRL: 1
    [   36.866654] CEFUSE_CLKCTRL: 30000
    [   36.871080] GFX domain entered low power state
    [   36.871129] Could not enter low power state
    [   36.871138] Please check for active clocks in PER domain
    [   36.872223] PM: early resume of devices complete after 0.622 msecs
    [   37.228349] mmc0: error -110 during resume (card was removed?)
    [   37.238015] net eth0: CPSW phy found : id is : 0x221556
    [   37.248858] rtc-pcf8563 1-0051: low voltage detected, date/time is not reliable.
    [   37.257865] PM: resume of devices complete after 63.065 msecs
    [   37.264237] Restarting tasks ... done.
    sh: write error: Operation not permitted
    # [   38.485196] PHY: 0:00 - Link is Up - 100/Full

     

    Depends the L4LS_GCLK in L4LS_CLKSTCTRL on GPIO1 or why is it still activ?

    Waking via GPIO0 does not work too. Is it because GPIO0 did not become Idle? 

    Thanks,

    Philipp