Hi Ulf,

See my comments inline.

Thanks,

Sandeep

On 12/7/2022 10:49 PM, Ulf Samuelsson via lists.yoctoproject.org wrote:
The core of the hellopm script (cleaned up) is:

=======================
reboot_menu () {
    while true; do
...
        read choice
        case $choice in
        1)
            echo subsystem > /sys/firmware/zynqmp/shutdown_scope
            reboot
            ;;
        2)
            echo ps_only > /sys/firmware/zynqmp/shutdown_scope
            reboot
        3)
            echo system > /sys/firmware/zynqmp/shutdown_scope
            reboot
            ;;
        esac
    done
}
=======================

[Sandeep]: May be this is old and not used anymore. I will obsolete this recipe after check with internal team if no one is using if for any specific purpose.
But we do not have the "shutdown_scope".

trax@trax-011:~$ cd /sys/firmware/zynqmp/
trax@trax-011:/sys/firmware/zynqmp$ ls -l
total 0
-rw-r--r--    1 root     root          4096 Dec  7 06:36 config_reg

[Sandeep]: I do see the same content.

zcu111-pl-ddr-20222:/home/petalinux# ls -la /sys/firmware/zynqmp/
total 0
drwxr-xr-x    2 root     root             0 Dec  8 17:51 .
drwxr-xr-x    4 root     root             0 Dec  8 17:50 ..
-rw-r--r--    1 root     root          4096 Dec  8 17:51 config_reg
zcu111-pl-ddr-20222:/home/petalinux#

Here is what happens at the reboot command without that:


=======================

trax@trax-011:~$ sudo reboot
[  OK  ] Removed slice Slice /system/modprobe.
[  OK  ] Stopped target Graphical Interface.
[  OK  ] Stopped target Host and Network Name Lookups.
[  OK  ] Stopped target RPC Port Mapper.
[  OK  ] Stopped target System Time Set.
[  OK  ] Stopped target Timer Units.
[  OK  ] Stopped Daily Cleanup of Temporary Directories.
[  OK  ] Closed Load/Save RF Kill Switch Status /dev/rfkill Watch.
         Stopping Shutdown initialization...
         Stopping Load/Save Random Seed...
[  OK  ] Stopped Load/Save Random Seed.
trax@trax-011:~$ [  OK  ] Stopped Shutdown initialization.
[  OK  ] Stopped target Multi-User System.
[  OK  ] Stopped target Login Prompts.
         Stoppin�[  OK  ] Stopped httpd.
[  OK  ] Stopped Kernel Logging Service.
[  OK  ] Stopped System Logging Service.
[  OK  ] Stopped D-Bus System Message Bus.
[  OK  ] Stopped Telephony service.
[  OK  ] Stopped User Login Management.
[  OK  ] Stopped Avahi mDNS/DNS-SD Stack.
[  OK  ] Stopped Getty on tty1.
[  OK  ] Stopped Serial Getty on ttyPS0.
[  OK  ] Stopped inetd.busybox.service.
[  OK  ] Removed slice Slice /system/getty.
[  OK  ] Removed slice Slice /system/serial-getty.
         Stopping Permit User Sessions...
[  OK  ] Stopped Permit User Sessions.
[  OK  ] Stopped target Network.
[  OK  ] Stopped target Remote File Systems.
         Stopping Network Name Resolution...
[  OK  ] Stopped Network Name Resolution.
         Stopping Network Configuration...
[  OK  ] Stopped Network Configuration.
[  OK  ] Stopped target Preparation for Network.
[  OK  ] Stopped IPv6 Packet Filtering Framework.
[  OK  ] Stopped IPv4 Packet Filtering Framework.
[  OK  ] Stopped target Basic System.
[  OK  ] Stopped target Path Units.
[  OK  ] Stopped Dispatch Password …ts to Console Directory Watch.
[  OK  ] Stopped Forward Password R…uests to Wall Directory Watch.
[  OK  ] Stopped target Slice Units.
[  OK  ] Removed slice User and Session Slice.
[  OK  ] Stopped target Socket Units.
[  OK  ] Closed Avahi mDNS/DNS-SD Stack Activation Socket.
[  OK  ] Closed D-Bus System Message Bus Socket.
[  OK  ] Closed dropbear.socket.
[  OK  ] Closed Syslog Socket.
[  OK  ] Closed Network Service Netlink Socket.
[  OK  ] Closed Weston socket.
[  OK  ] Stopped target System Initialization.
[  OK  ] Stopped Apply Kernel Variables.
[  OK  ] Stopped Load Kernel Modules.
         Stopping Network Time Synchronization...
         Stopping Record System Boot/Shutdown in UTMP...
[  OK  ] Stopped Network Time Synchronization.
         Unmounting /var/lib/systemd...
[  OK  ] Stopped Record System Boot/Shutdown in UTMP.
[  OK  ] Unmounted /var/lib/systemd.
[  OK  ] Stopped Create Volatile Files and Directories.
[  OK  ] Stopped target Local File Systems.
[  OK  ] Unset automount BOOT.automount.
[  OK  ] Unset automount media-card.automount.
[  OK  ] Unset automount media-usb.automount.
[  OK  ] Unset automount var-lib-systemd.automount.
[  OK  ] Unset automount var-lib-trax\x2dupdate.automount.
         Unmounting /home...
         Unmounting /media/boot-a...
         Unmounting /media/boot-b...
         Unmounting /media/data...
         Unmounting /media/rescue...
         Unmounting /media/root-a...
         Unmounting /media/root-b...
         Unmounting /run/media/sda2...
         Unmounting /tmp...
         Unmounting /var/volatile...
[  OK  ] Unmounted /home.
[  OK  ] Unmounted /media/boot-a.
[  OK  ] Unmounted /media/boot-b.
[  OK  ] Unmounted /media/data.
[  OK  ] Unmounted /media/rescue.
[  OK  ] Unmounted /media/root-a.
[  OK  ] Unmounted /media/root-b.
[  OK  ] Unmounted /run/media/sda2.
[  OK  ] Unmounted /tmp.
[  OK  ] Unmounted /var/volatile.
[  OK  ] Stopped target Swaps.
[  OK  ] Reached target Unmount All Filesystems.
[  OK  ] Stopped File System Check on /dev/mmcblk0p1.
[  OK  ] Stopped File System Check on /dev/mmcblk0p2.
[  OK  ] Stopped File System Check on /dev/mmcblk0p5.
[  OK  ] Stopped File System Check on /dev/mmcblk0p6.
[  OK  ] Stopped File System Check on /dev/mmcblk0p7.
[  OK  ] Stopped File System Check on /dev/mmcblk0p8.
[  OK  ] Stopped File System Check on /dev/sda2.
[  OK  ] Removed slice Slice /system/systemd-fsck.
[  OK  ] Stopped target Preparation for Local File Systems.
[  OK  ] Stopped Remount Root and Kernel File Systems.
[  OK  ] Stopped Create Static Device Nodes in /dev.
[  OK  ] Reached target System Shutdown.
[  OK  ] Reached target Late Shutdown Services.
[  OK  ] Finished System Reboot.
[  OK  ] Reached target System Reboot.
=======================

[Sandeep]: Today morning I tested the reboot feature and it works for me OOB in linux without adding any additional recipe or defconfigs. Can you post this question in AMD Xilinx forum they can help you out.


zcu111-pl-ddr-20222:/home/petalinux# reboot

Sessiÿ         Stopping Session c1 of User petalinux...
[  OK  ] Removed slice Slice /system/modprobe.
[  OK  ] Stopped target Multi-User System.
[  OK  ] Stopped target Login Prompts.
[  OK  ] Stopped target Host and Network Name Lookups.
[  OK  ] Stopped target Sound Card.
[  OK  ] Stopped target System Time Set.
[  OK  ] Stopped target Timer Units.
[  OK  ] Stopped Daily Cleanup of Temporary Directories.
[  OK  ] Closed Load/Save RF Kill Switch Status /dev/rfkill Watch.
         Stopping Kernel Logging Service...
         Stopping System Logging Service...
         Stopping Getty on tty1...
         Stopping inetd.busybox.service...
         Stopping Serial Getty on ttyPS0...
         Stopping Load/Save Random Seed...
         Stopping Target Communication Framework agent...
[  OK  ] Stopped Kernel Logging Service.
[  OK  ] Stopped System Logging Service.
[  OK  ] Stopped Target Communication Framework agent.
[  OK  ] Stopped Getty on tty1.
[  OK  ] Stopped Serial Getty on ttyPS0.
[  OK  ] Stopped inetd.busybox.service.
[  OK  ] Stopped Load/Save Random Seed.
[  OK  ] Stopped Session c1 of User petalinux.
[  OK  ] Removed slice Slice /system/getty.
[  OK  ] Removed slice Slice /system/serial-getty.
         Stopping LSB: NFS support for both client and server...
         Stopping User Login Management...
         Stopping User Manager for UID 1000...
[  OK  ] Stopped LSB: NFS support for both client and server.
[  OK  ] Stopped User Manager for UID 1000.
[  OK  ] Stopped target RPC Port Mapper.
         Stopping User Runtime Directory /run/user/1000...
[  OK  ] Unmounted /run/user/1000.
[  OK  ] Stopped User Runtime Directory /run/user/1000.
[  OK  ] Removed slice User Slice of UID 1000.
         Stopping D-Bus System Message Bus...
         Stopping Permit User Sessions...
[  OK  ] Stopped D-Bus System Message Bus.
[  OK  ] Stopped User Login Management.
[  OK  ] Stopped Permit User Sessions.
[  OK  ] Stopped target Basic System.
[  OK  ] Stopped target Network.
[  OK  ] Stopped target Path Units.
[  OK  ] Stopped Dispatch Password …ts to Console Directory Watch.
[  OK  ] Stopped Forward Password R…uests to Wall Directory Watch.
[  OK  ] Stopped target Remote File Systems.
[  OK  ] Stopped target Slice Units.
[  OK  ] Removed slice User and Session Slice.
[  OK  ] Stopped target Socket Units.
[  OK  ] Closed D-Bus System Message Bus Socket.
[  OK  ] Closed dropbear.socket.
[  OK  ] Stopped target System Initialization.
[  OK  ] Closed Syslog Socket.
         Stopping Network Name Resolution...
         Stopping Network Time Synchronization...
[  OK  ] Stopped Update is Completed.
[  OK  ] Stopped Rebuild Dynamic Linker Cache.
[  OK  ] Stopped Rebuild Journal Catalog.
[  OK  ] Stopped Network Time Synchronization.
[  OK  ] Stopped Network Name Resolution.
         Stopping Network Configuration...
[  OK  ] Stopped Create Volatile Files and Directories.
[  OK  ] Stopped target Local File Systems.
         Unmounting /run/credentials/systemd-sysusers.service...
         Unmounting /run/media/mmcblk0p1...
         Unmounting Temporary Directory /tmp...
         Unmounting /var/volatile...
[  OK  ] Stopped Network Configuration.
[  OK  ] Unmounted /run/credentials/systemd-sysusers.service.
[  OK  ] Unmounted /run/media/mmcblk0p1.
[  OK  ] Unmounted Temporary Directory /tmp.
[  OK  ] Unmounted /var/volatile.
[  OK  ] Stopped target Swaps.
[  OK  ] Reached target Unmount All Filesystems.
[  OK  ] Closed Network Service Netlink Socket.
[  OK  ] Stopped File System Check on /dev/mmcblk0p1.
[  OK  ] Removed slice Slice /system/systemd-fsck.
[  OK  ] Stopped target Preparation for Local File Systems.
[  OK  ] Stopped Apply Kernel Variables.
[  OK  ] Stopped Create Static Device Nodes in /dev.
[  OK  ] Stopped Create System Users.
[  OK  ] Stopped Remount Root and Kernel File Systems.
[  OK  ] Reached target System Shutdown.
[  OK  ] Reached target Late Shutdown Services.
[  OK  ] Finished System Reboot.
[  OK  ] Reached target System Reboot.
[   88.084488] systemd-shutdown[1]: Syncing filesystems and block devices.
[   88.091439] systemd-shutdown[1]: Sending SIGTERM to remaining processes... [   88.109585] systemd-journald[272]: Received SIGTERM from PID 1 (systemd-shutdow). [   88.117919] audit: type=1335 audit(1670521928.805:3): pid=272 uid=0 auid=4294967295 tty=(none) ses=4294967295 comm="systemd-journal" exe="/lib/systemd/systemd-journald" nl-mcgrp=1 op=disconnect res=1 [   88.136287] systemd-shutdown[1]: Sending SIGKILL to remaining processes... [   88.149837] systemd-shutdown[1]: Using hardware watchdog 'cdns_wdt watchdog', version 0, device /dev/watchdog
[   88.162325] systemd-shutdown[1]: Unmounting file systems.
[   88.169577] [626]: Remounting '/' read-only in with options '(null)'.
[   88.176495] systemd-shutdown[1]: All filesystems unmounted.
[   88.182640] systemd-shutdown[1]: Deactivating swaps.
[   88.187984] systemd-shutdown[1]: All swaps deactivated.
[   88.193232] systemd-shutdown[1]: Detaching loop devices.
[   88.203185] systemd-shutdown[1]: All loop devices detached.
[   88.208773] systemd-shutdown[1]: Stopping MD devices.
[   88.214143] systemd-shutdown[1]: All MD devices stopped.
[   88.219463] systemd-shutdown[1]: Detaching DM devices.
[   88.225456] systemd-shutdown[1]: All DM devices detached.
[   88.230864] systemd-shutdown[1]: All filesystems, swaps, loop devices, MD devices and DM devices detached.
[   88.242051] systemd-shutdown[1]: Syncing filesystems and block devices.
[   88.248726] systemd-shutdown[1]: Rebooting.
[   88.255099] unregister bridge display which is owned by other component
[   88.261721] unregister bridge display which is owned by other component
[   88.270298] reboot: Restarting system
Xilinx Zynq MP First Stage Boot Loader
Release 2022.2   Oct  7 2022  -  04:56:16
NOTICE:  BL31: v2.6(release):xlnx_rebase_v2.6_2022.1_update3-18-g0897efd45
NOTICE:  BL31: Built : 03:55:03, Sep  9 2022


U-Boot 2022.01 (Sep 20 2022 - 06:35:33 +0000)

CPU:   ZynqMP
Silicon: v3
Model: ZynqMP ZCU111 RevA
Board: Xilinx ZynqMP
DRAM:  4 GiB
PMUFW:  v1.1
PMUFW no permission to change config object
EL Level:       EL2
Chip ID:        zu28dr
NAND:  0 MiB
MMC:   mmc@ff170000: 0
Loading Environment from FAT... *** Error - No Valid Environment Area found
*** Warning - bad env area, using default environment

In:    serial
Out:   serial
Err:   serial
Bootmode: LVL_SHFT_SD_MODE1
Reset reason:   SOFT
Net:   FEC: can't find phy-handle

ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id

Warning: ethernet@ff0e0000 (eth0) using random MAC address - 36:fd:39:bb:57:df
eth0: ethernet@ff0e0000
scanning bus for devices...
SATA link 0 timeout.
SATA link 1 timeout.
AHCI 0001.0301 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
flags: 64bit ncq pm clo only pmp fbss pio slum part ccc apst
starting USB...
Bus usb@fe200000: Register 2000440 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus usb@fe200000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  2

Then it hangs.

I enclose our kernel config.
Is there something missing?

/Ulf

Den 2022-12-07 kl. 05:51, skrev Sandeep Gundlupet Raju via lists.yoctoproject.org:
Hi Ulf,

Reboot and other PM features is implemented in Firmware driver. For more details refer wiki page https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842232/Zynq+UltraScale+MPSoC+Power+Management+-+Linux+Kernel

May be you are missing hellopm https://github.com/Xilinx/meta-petalinux/tree/rel-v2022.2/recipes-examples/hellopm app in your image. Can you add hellopm and try with this?

IMAGE_INSTALL:append = "\
        hellopm \
        "

Thanks,

Sandeep

On 12/6/2022 8:56 PM, Ulf Samuelsson via lists.yoctoproject.org wrote:
We have a linux Zynqmp system based on Petalinux rev2022.1/systemd
We can halt the system, but if we try to reboot, systemd shuts down and it does not reboot. We would expect the chip to reset, and start from boot.bin.
If we try to reset the chip in U-Boot, there is no problem.
Does reboot depend on any connection on the PCB?

Best Regards
Ulf Samuelsson










-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#5108): 
https://lists.yoctoproject.org/g/meta-xilinx/message/5108
Mute This Topic: https://lists.yoctoproject.org/mt/95509662/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-xilinx/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to