This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3352: Difference between poweroff and reboot

Part Number: AM3352

Hi,

I would like to know, if we can call two separate functions for reboot and poweroff from a platform driver, like leds-gpio.c

Because, as far as I understand, reboot is triggering poweroff internally. Hence, I felt that there is no differentiation between reboot and poweroff at the platform driver level.

Is that true ?

Or can we differentiate between poweroff and reboot ?

Use case,

I would like to keep a GPIO as is (do not make it LOW explicitly), when reboot command is issued,

but, make it LOW when poweroff command is issued.

  • Hi Moses,

    From what I was able to find, reboot command does NOT impact the AM335x PORz and nRESETIN_OUT pins. reboot command initiate internal reset, through the PRM_RSTCTRL[0] RST_GLOBAL_WARM_SW and after reboot, this event is logged in PRM_RSTST[1] GLOBAL_WARM_SW_RST.

    You can refer to below kernel files for details:

    linux-kernel/kernel/reboot.c -> kernel_restart(), SYSCALL_DEFINE4()

    linux-kernel/arch/arm/mach-omap2/board-generic.c -> am33xx_restart
    linux-kernel/arch/arm/mach-omap2/am33xx-restart.c
    linux-kernel/arch/arm/mach-omap2/prm_common.c -> omap_prm_reset_system()
    linux-kernel/arch/arm/mach-omap2/prm33xx.c -> am33xx_prm_global_warm_sw_reset()
    linux-kernel/arch/arm/mach-omap2/prm33xx.h

    While poweroff command initiates PMIC shutdown event by controlling PMIC DEV_ON registers through I2C interface. Check below pointers for details:

    linux-kernel/kernel/reboot.c -> kernel_power_off()

    Regards,
    Pavel

  • Hi Pavel,

    Thanks for the information, I'll check that and get back to you.

  • Hello  Pavel,

    Using gpio-poweroff driver and removing system-power-controller from rtc block, in DTS, I was able to solve the issue.

    I was able to differentiate the behavior of a GPIO based on poweroff command and reboot command.

    Thanks for the hints :-)