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