Recommended way to implement a power off and reset in linux

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Recommended way to implement a power off and reset in linux

3,960件の閲覧回数
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,736件の閲覧回数
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,736件の閲覧回数
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,736件の閲覧回数
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