Recommended way to implement a power off and reset in linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Recommended way to implement a power off and reset in linux

3,606 Views
kevin_chaves
Contributor III

I don't know how how linux handles power state implementations. We currently just need to write to a GPIO to shutdown or reset using an IMX6 in linux. I'd know where to put it in wince but I'm kind of confused how linux does it.

imx6q_add_pm_imx I find this but it seems to only handle suspend/wake. I haven't found a very clear answer though via google.

Labels (2)
Tags (1)
3 Replies

1,382 Views
YixingKong
Senior Contributor IV

Kevin

This discussion is closed since no activity. If you still need help, please feel free to reply with an update to this discussion, or create another discussion.

Thanks,

Yixing

0 Kudos

1,382 Views
YixingKong
Senior Contributor IV

Kevin

Had your issue got resolved? If yes, we are going to close the discussion in 3 days. If you still need help, please feel free to reply with an update to this discussion.

Thanks,
Yixing

0 Kudos

1,382 Views
AnsonHuang
NXP Employee
NXP Employee

Hi, Kevin

     Linux kernel has its framework to handle power off and reset, and eventually it will call platform code to finish the flow, so you can put the hardware operation in the platform code, take i.MX6Q sabresd board with kernel v3.0.35 for example as below:

reset:

     arch/arm/plat-mxc/system.c, routine named arch_reset, it will call wdog to finish the reset, and kernel will call arch_reset, refer to arch/arm/kernel/process.c. So when you execute "reboot" command from shell, kernel will finish that flow.

power off:

     refer to arch/arm/mach-mx6/board-mx6q_sabresd.c, we need to register the pm_power_off routine, kernel will call it eventually when you power off the board from kernel shell. refer to arch/arm/kernel/process.c