How to Put IMX6 solo in WFI mode in uboot.

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Put IMX6 solo in WFI mode in uboot.

510 Views
mohamedthalibha
Contributor III

How to Put IMX6 solo in WFI mode in uboot.

I am trying to put the IMX6 solo processor in WFI interrupt mode, when there is not operation.

But when a button is pressed it should exit for WFI mode.

I have created a command wfi which executes wfi asm instruction.

int do_wfi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])

{

    printf("Entering WFI mode\n");

  

    __asm__ volatile("wfi");

  

    printf("Exiting WFI mode\n");

    return 0;

}

From command mode I am setting the registers to configure the interrupt.

For configuring GPIO as interrupt

mw.l 0x20AC010 0x100000 1

mw.l 0x20AC014 0x100000 1

mw.l 0x20AC018 0xFFFFFFFF 1

Set the mask on GIC

mw.l 0x20DC010 0x800 1

Then run the command wfi on uboot command line, the processor appears to enter wfi mode , but not waking up from wif mode when the button is pressed.

Am I missing any steps or is there any mistake. Please help

Labels (2)
5 Replies

182 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Mohamed,

      See following explanations, please !

(1) WFI mode is not supported in u-boot by default.

(2) ARM interrupt is not opened in u-boot by default.

So Interrupt from GPIO button to ARM core couldn't be responsed.

     If you want to test WFI mode, you will have to do the following steps by yourself:

(1) Open ARM interrupt(set ARM core I bit)

(2) Configuring interrupt vector table.

(3) Configure GIC register by refering to GIC driver in Linux BSP.

(4) Open CONFIG_CMD_IRQ Macro in u-boot

     Maybe there is no GICv2 initial code, you will have to add them by yourself.

     Above items are just probable steps for your request, we didn't debug corresponding source code, so you can try!

Good luck!

Regards,

Weidong

182 Views
mohamedthalibha
Contributor III

Thanks Weidong Sun,

Will try your suggestion.

0 Kudos

182 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Mohamed,

Could you please specify where are you setting the registers to configure the GPIO as interrupt? Are you properly configuring the button to generate a trigger? According with the snipped code, it seems that the interrupt service may be missing, so, the flag is not properly cleared.

Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

182 Views
mohamedthalibha
Contributor III

Is there any WFI implementation for UBoot from freescale,

0 Kudos

182 Views
mohamedthalibha
Contributor III

Hi Carlos,

I am configuring the register from command line of uboot.

Yes there is no ISR.

I am entering below command to set the registers generate interrupt.

mw.l 0x20AC010 0x100000 1

mw.l 0x20AC014 0x100000 1

mw.l 0x20AC018 0xFFFFFFFF 1

Set the mask on GIC

mw.l 0x20DC010 0x800 1

Even though there is no ISR the processor should wake up from WFI mode when a exception/interrupt happens. but it is not waking up.

0 Kudos