Recommended way to implement a power off and reset in linux

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Recommended way to implement a power off and reset in linux

3,962 次查看
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.

标签 (2)
标记 (1)
3 回复数

1,738 次查看
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 项奖励
回复

1,738 次查看
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 项奖励
回复

1,738 次查看
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