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.

Linux/AM3352: AM335x: Custom Board: How the board restarts itself when all the power is cut down.

Part Number: AM3352
Other Parts Discussed in Thread: TPS65217

Tool/software: Linux

Hi,

I was wondering about the functionality of reboot, how exactly it works.

Because as per my understanding it does the shutdown only with some macro set to RESTART or something similar, which somehow triggers to start the power up sequence.

So, what exactly here gets triggered to start the power up sequence, as I see now, you can control the nRESET pin of the PMIC TPS65217 to turn ON the board after 1 second. If that's true, are there any other alternatives to this approach ? Maybe without using nRESET pin of the PMIC.

For the better understanding of the use case,

  • I am using a custom AM335x based board and I am not using nRESET of TPS65217 at all.
  • I am not able to reboot the board, it just powers it off and then it won't start the power up sequence.
  • I am not trying to control the power OFF via Button, but from the terminal I am issuing a reboot command. (not using gpio-poweroff)

  • Hi Moses,

    Do you use AM335x TI PSDK Linux v5.02?

    Can you provide console log of the reboot command execution?

    Regards,
    Pavel
  • 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

    Regards,
    Pavel
  • Hi Pavel,

    I am not using TI SDK.

    Console log has been attached.


    $ sudo reboot
    [sudo] password for user:
    [ OK ] Stopped target Timers.
    [ OK ] Stopped Mark updrade is complete.
    Stopping User Manager for UID 1000...
    Stopping Session 2 of user user.
    Stopping Session 3 of user user.
    Stopping Session 10 of user user.
    [ OK ] Stopped Daily Cleanup of Temporary Directories.
    [ OK ] Stopped Daily apt upgrade and clean activities.
    Stopping Session 4 of user user.
    [ OK ] Stopped Daily apt download activities.
    [ OK ] Stopped target System Time Synchronized.
    [ OK ] Stopped target Graphical Interface.
    Stopping Disk Manager...
    Stopping Qt GUI Service for Mt Linux Platform...
    [ OK ] Stopped target Multi-User System.
    Stopping Apertis update manager...
    Stopping Network Name Resolution...
    Stopping MTD Health Daemon...
    Stopping UBI Health Daemon...
    Stopping OpenBSD Secure Shell server...
    [ OK ] Stopped target Login Prompts.
    Stopping Serial Getty on ttyO0...
    Stopping Getty on tty1...
    Stopping IPv4 firewall with iptables...
    Stopping LSB: Set the CPU Frequency Scaling governor to "ondemand"...
    [ OK ] Stopped OpenBSD Secure Shell server.
    [ OK ] Stopped UBI Health Daemon.
    [ OK ] Stopped Network Name Resolution.
    [ OK ] Stopped Apertis update manager.
    [ OK ] Stopped Board Control Unit Daemon.
    [ OK ] Stopped MTD Health Daemon.
    [ OK ] Stopped Disk Manager.
    [ OK ] Stopped Serial Getty on ttyO0.
    [ OK ] Stopped Getty on tty1.
    [ OK ] Stopped Weston, a Wayland compositor, as a system service.
    [ OK ] Stopped Qt GUI Service for Mt Linux Platform.
    [ OK ] Stopped User Manager for UID 1000.
    [ OK ] Stopped Session 2 of user user.
    [ OK ] Stopped Session 10 of user user.
    [ OK ] Stopped Session 3 of user user.
    [ OK ] Stopped Session 4 of user user.
    [ OK ] Stopped IPv4 firewall with iptables.
    [ OK ] Removed slice User Slice of user.
    Stopping Login Service...
    [ OK ] Removed slice system-getty.slice.
    [ OK ] Removed slice system-serial\x2dgetty.slice.
    Stopping Permit User Sessions...
    Stopping Statistics Manager Daemon...
    [ OK ] Stopped Login Service.
    [ OK ] Stopped Statistics Manager Daemon.
    [ OK ] Stopped LSB: Set the CPU Frequency Scaling governor to "ondemand".
    [ OK ] Stopped Permit User Sessions.
    [ OK ] Stopped target Network.
    Stopping Network Service...
    [ OK ] Stopped target Remote File Systems.
    Stopping D-Bus System Message Bus...
    [ OK ] Stopped Network Service.
    [ OK ] Stopped D-Bus System Message Bus.
    [ OK ] Stopped target Basic System.
    [ OK ] Stopped target Slices.
    [ OK ] Removed slice User and Session Slice.
    [ OK ] Stopped target Paths.
    [ OK ] Stopped target Sockets.
    [ OK ] Closed D-Bus System Message Bus Socket.
    [ OK ] Stopped target System Initialization.
    Stopping Network Time Synchronization...
    Stopping Load/Save Random Seed...
    Stopping Update UTMP about System Boot/Shutdown...
    Stopping Load/Save Screen Backlight…htness of backlight:tps65217-bl...
    [ OK ] Stopped target Encrypted Volumes.
    [ OK ] Stopped Forward Password Requests to Wall Directory Watch.
    [ OK ] Stopped Dispatch Password Requests to Console Directory Watch.
    [ OK ] Stopped Apply Kernel Variables.
    [ OK ] Stopped Load Kernel Modules.
    [ OK ] Stopped Network Time Synchronization.
    [ OK ] Stopped Load/Save Random Seed.
    [ OK ] Stopped Load/Save Screen Backlight …ightness of backlight:tps65217-bl.
    [ OK ] Stopped Update UTMP about System Boot/Shutdown.
    [ OK ] Removed slice system-systemd\x2dbacklight.slice.
    [ OK ] Stopped Create Volatile Files and Directories.
    [ OK ] Stopped target Local File Systems.
    Unmounting home mount point...
    Unmounting boot mount point...
    Unmounting /run/user/1000...
    Unmounting Temporary Directory (/tmp)...
    [ OK ] Unmounted home mount point.
    [ OK ] Unmounted Temporary Directory (/tmp).
    [ OK ] Stopped target Swap.
    [ OK ] Unmounted boot mount point.
    [ OK ] Unmounted /run/user/1000.
    Unmounting root mount point...
    Unmounting /sysroot...
    [ OK ] Unmounted root mount point.
    Unmounting /var...
    [ OK ] Unmounted /sysroot.
    [FAILED] Failed unmounting /var.
    [ OK ] Reached target Unmount All Filesystems.
    [ OK ] Stopped target Local File Systems (Pre).
    [ OK ] Stopped Create Static Device Nodes in /dev.
    [ OK ] Stopped Remount Root and Kernel File Systems.
    [ OK ] Reached target Shutdown.
    [ 32.223999] watchdog: watchdog0: watchdog did not stop!
  • Moses,

    Moses Christopher said:
    I am not using TI SDK.

    Then what SW you are using? Can you also try with AM335x TI PSDK Linux? Can you try without sudo, only reboot?

    Please check what I have on my side (AM335x StartyerKit board with TI PSDK Linux).

    root@am335x-evm:~# reboot
             Stopping Session c1 of user root.
    [  OK  ] Stopped Session c1 of user root.
    [  OK  ] Unmounted /run/media/mmcblk0p1.
    [  OK  ] Reached target Unmount All Filesystems.
    [  OK  ] Stopped weston.service.
             Stopping rc.pvr.service...
    [  OK  ] Stopped rc.pvr.service.
             Stopping uim-sysfs.service...
    [  OK  ] Stopped User Manager for UID 0.
    [  OK  ] Removed slice User Slice of root.
             Stopping Permit User Sessions...
             Stopping Login Service...
    [  OK  ] Stopped Login Service.
    [  OK  ] Stopped Permit User Sessions.
    [  OK  ] Stopped target Remote File Systems.
    [  OK  ] Stopped target Network.
             Stopping Network Service...
    [  OK  ] Stopped Network Service.
    [  OK  ] Stopped Apply Kernel Variables.
    [  OK  ] Stopped Load Kernel Modules.
             Stopping D-Bus System Message Bus...
    [  OK  ] Stopped D-Bus System Message Bus.
    [  OK  ] Stopped uim-sysfs.service.
    [  OK  ] Stopped target Basic System.
    [  OK  ] Stopped target Slices.
    [  OK  ] Removed slice User and Session Slice.
    [  OK  ] Stopped target Paths.
    [  OK  ] Stopped Forward Password Requests to Wall Directory Watch.
    [  OK  ] Stopped Dispatch Password Requests to Console Directory Watch.
    [  OK  ] Stopped target Sockets.
    [  OK  ] Closed dropbear.socket.
    [  OK  ] Closed Avahi mDNS/DNS-SD Stack Activation Socket.
    [  OK  ] Closed D-Bus System Message Bus Socket.
    [  OK  ] Closed RPCbind Server Activation Socket.
    [  OK  ] Closed Syslog Socket.
    [  OK  ] Reached target Shutdown.
    [  OK  ] Reached target Final Step.
             Starting Reboot...
    [   71.165768] watchdog: watchdog0: watchdog did not stop!
    [   71.212272] systemd-shutdow: 30 output lines suppressed due to ratelimiting
    [   71.244953] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
    [   71.288340] systemd-journald[103]: Received SIGTERM from PID 1 (systemd-shutdow).
    [   81.307374] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
    [   81.347905] systemd-shutdown[1]: Sending SIGKILL to PID 813 (rngd).
    [   81.361112] systemd-shutdown[1]: Hardware watchdog 'OMAP Watchdog', version 0
    [   81.374761] systemd-shutdown[1]: Unmounting file systems.
    [   81.382740] systemd-shutdown[1]: Remounting '/run/user/0' read-only with options 'size=24852k,mode=700'.
    [   81.396102] systemd-shutdown[1]: Unmounting /run/user/0.
    [   81.424011] systemd-shutdown[1]: Remounting '/var/volatile' read-only with options 'size=51200k'.
    [   81.435701] systemd-shutdown[1]: Unmounting /var/volatile.
    [   81.464254] systemd-shutdown[1]: Remounting '/tmp' read-only with options ''.
    [   81.474172] systemd-shutdown[1]: Unmounting /tmp.
    [   90.215629] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
    [   90.245570] systemd-shutdown[1]: Remounting '/' read-only with options 'data=ordered'.
    [   90.256886] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
    [   90.263025] systemd-shutdown[1]: Remounting '/' read-only with options 'data=ordered'.
    [   90.273968] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
    [   90.280009] systemd-shutdown[1]: All filesystems unmounted.
    [   90.285706] systemd-shutdown[1]: Deactivating swaps.
    [   90.291401] systemd-shutdown[1]: All swaps deactivated.
    [   90.296831] systemd-shutdown[1]: Detaching loop devices.
    [   90.320565] systemd-shutdown[1]: All loop devices detached.
    [   90.326444] systemd-shutdown[1]: Detaching DM devices.
    [   90.333344] systemd-shutdown[1]: All DM devices detached.
    [   90.359305] systemd-shutdown[1]: Failed to read reboot parameter file: No such file or directory
    [   90.395530] reboot: Restarting system
    
    U-Boot SPL 2017.01-gc68ed086bd (Mar 26 2018 - 15:08:11)
    Trying to boot from MMC1
    reading uboot.env
    
    

    Regards,
    Pavel

  • Pavel,

    I am using custom linux build based on Apertis which was derived from Debian.
  • Moses,

    In e2e forum we support only Arago Linux, that comes with AM335x TI PSDK Linux:

    software-dl.ti.com/.../index_FDS.html

    For Debian Linux, you might check with beagleboard community.

    Regards,
    Pavel