AnsweredAssumed Answered

About imx6dl resume after WFI

Question asked by Jerry zhou on Oct 30, 2016

Hello, everyone!

I am a newbie here, and have some questions now.

 

Currently, I am studying the imx6ql suspend/resume. I modified "arch/arm/mach-imx/suspend-imx6.S"

1. step1: Add a macro for output on the UART.

    .macro    putchar, char
    ldr    r8, =IMX_IO_P2V(0x021e8000)
    mov    r7, #\char
    str    r7, [r8, #0x40]

 

309:    ldr    r7, [r8, #0x98]        @ SR2
    tst    r7, #1 << 3        @ TXDC
    beq    309b            @ wait until transmit done
    .endm

2. step2: Some debug by output log

    putchar 'S'

    putchar 'l'
    putchar 'e'
    putchar 'e'
    putchar 'p'
    putchar '\r'
    putchar '\n'

    isb

 

    /* Zzz, enter stop mode */
    wfi
    nop
    nop
    nop
    nop

    putchar 'A'

    putchar 'w'
    putchar 'a'
    putchar 'k'
    putchar 'e'
    putchar '\r'
    putchar '\n'

    isb

    And the result is : "Sleep" could be dump out, But "Awake" couldn't. And more the system seemed blocking, couldn't resume successfully. But why? I very hope someone could answer my this question or give some some hints.

3. Use GPIO instead.

   @ Pull down GPIO2.17

    ldr    r6, =0x20000
    ldr    r8, =IMX_IO_P2V(0x020A0000)
    ldr    r7, [r8, #4]
    orr    r7, r7, r6
    str    r7, [r8, #4]

 

    @ldr    r8, =IMX_IO_P2V(0x020A0000)
    ldr    r7, [r8]
    bic    r7, r7, r6
    str    r7, [r8]

    isb

 

    /* Zzz, enter stop mode */
    wfi
    nop
    nop
    nop
    nop

 

    /*
     * We did not power down, disable bandgap
     * self-bias circuit.
     */
    ldr    r8, =IMX_IO_P2V(MX6Q_ANATOP_BASE_ADDR)
    ldr    r7, [r8, #MX6Q_ANATOP_MISC0]
    orr    r7, r7, #0x8
    str    r7, [r8, #MX6Q_ANATOP_MISC0]

 

    @ Pull Up the GPIO2.17

    isb
    ldr    r6, =0x20000
    ldr    r8, =IMX_IO_P2V(0x020A0000)
    ldr    r7, [r8]
    orr    r7, r7, r6
    str    r7, [r8]
    isb

 

And the result is same. Before WFI, the GPIO2.17 has been pull down. Then, the PMIC_STBY_REQ pin of imx6dl has been pull up. Next, I press the power key, the PMIC_STBY_REQ pin of imx6dl has been resumed to low level, but the GPIO2.17 is still Low level, it seems my code of pulling up GPIO2.17 does't work. At this case, the CPU is blocking some times, and other time CPU will reset automatically. And Why? Can some one help me, please?

Outcomes