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.

AM62P: AM62P the deep sleep of mem cannot be awakened

Part Number: AM62P

Tool/software:

sdk version 10.0.0

1、Test using the evm board,I used the gpio1_10 of the main domain as the wake-up source. After going into sleep mode through mem, it failed to wake up when the edge was triggered。However, the freeze method can also wake it up。

2、Even if you wake it up using the official serial port method, mem cannot wake it up, but freeze can

#!/bin/bash -xe

# Detach kernel serial console
consoles=$(find /sys/bus/platform/devices/*.serial/ -name console)
for console in ${consoles}; do
        echo -n N > ${console}
done

# Configure PM runtime autosuspend
uarts=$(find /sys/bus/platform/devices/*.serial/power/ -type d)
for uart in $uarts; do
        echo -n 3000 > $uart/autosuspend_delay_ms
        echo -n enabled > $uart/wakeup
        echo -n auto > $uart/control
done

# Configure wake-up from suspend
uarts=$(find /sys/class/tty/tty[SO]*/power/ -type d 2>/dev/null)
for uart in $uarts; do
        echo -n enabled > $uart/wakeup
done

May I ask what the possible reasons might be。

thank!

  • Hello,

    First, freeze is not supported in the Linux SDK. Its possible it works but its not within TI's support scope.

    Can you explain how the GPIO was configured in the device tree to enable wakeup?

    Thanks,

    Anshu

  • gpio_wakeup {
    		compatible = "wakeup_gpios";
    		pinctrl-0 = <&main_gpio1_pins_default>;
    		gpios_wakeup  = <&main_gpio1 10 GPIO_ACTIVE_LOW>;  
    		wakeup-source;
    		status = "okay";
    	};   
    	
    	
    main_gpio1_pins_default: main-gpio1-pins-default {
    		pinctrl-single,pins = <
    			AM62PX_IOPAD(0x01a0, PIN_INPUT, 7) /* (F23) MCASP0_AXR0.GPIO1_10 */
    		>;
    	};;
    #include <linux/module.h>
    #include <linux/platform_device.h>
    #include <linux/of.h>
    #include <linux/of_gpio.h>
    #include <linux/interrupt.h>
    #include <linux/gpio.h>
    #include <linux/pm_wakeup.h>
     
    static int wakeup_irq;
    static struct device *dev;  
     
    static irqreturn_t wakeup_irq_handler(int irq, void *dev_id) {
        dev_info(dev, "wakeup pressed, interrupt triggered\n");
        return IRQ_HANDLED;
    }
     
    static int wakeup_probe(struct platform_device *pdev) {
        int ret;
        int gpio;
     
        dev = &pdev->dev;  
     
        // 从设备树中获取 GPIO 引脚号
        gpio = of_get_named_gpio(pdev->dev.of_node, "gpios_wakeup", 0);
        if (!gpio_is_valid(gpio)) {
            dev_err(dev, "Failed to get GPIO from device tree\n");
            return -EINVAL;
        }
     
        // 请求 GPIO 并配置为输入
        ret = devm_gpio_request_one(&pdev->dev, gpio, GPIOF_IN, "wakeup_gpio");
        if (ret) {
            dev_err(dev, "Failed to request GPIO\n");
            return ret;
        }
     
        // 将 GPIO 映射为中断号
        wakeup_irq = gpio_to_irq(gpio);
        if (wakeup_irq < 0) {
            dev_err(dev, "Failed to map GPIO to IRQ\n");
            return wakeup_irq;
        }
     
        // 请求中断
        ret = devm_request_irq(&pdev->dev, wakeup_irq, wakeup_irq_handler,
                               IRQF_TRIGGER_RISING, "wakeup_irq", NULL);
        if (ret) {
            dev_err(dev, "Failed to request IRQ\n");
            return ret;
        }
     
        // 启用唤醒功能
        enable_irq_wake(wakeup_irq);
        dev_info(dev, "wakeup driver initialized with GPIO %d\n", gpio);
     
        return 0;
    }
     
    static int wakeup_remove(struct platform_device *pdev) {
        // 禁用唤醒功能
        disable_irq_wake(wakeup_irq);
        dev_info(dev, "wakeup driver removed\n");
        return 0;
    }
     
    static const struct of_device_id wakeup_of_match[] = {
        { .compatible = "wakeup_gpios", },
        { /* Sentinel */ }
    };
    MODULE_DEVICE_TABLE(of, wakeup_of_match);
     
    static struct platform_driver wakeup_driver = {
        .probe = wakeup_probe,
        .remove = wakeup_remove,
        .driver = {
            .name = "wakeup_gpios",
            .of_match_table = wakeup_of_match,
        },
    };
     
    module_platform_driver(wakeup_driver);
     
    MODULE_AUTHOR("BYD chen.dao");
    MODULE_DESCRIPTION("wakeup driver with gpio");
    MODULE_LICENSE("GPL");
    root@am62pxx-evm:~# cat /proc/interrupts
               CPU0       CPU1       CPU2       CPU3
     11:    8948257      64370      87561      70310     GICv3  30 Level     arch_timer
     14:          0          0          0          0     GICv3 130 Level     pinctrl
     16:         15          0          0          0     GICv3 109 Level     mbox-mcu-r5-0
     17:          0          0          0          0     GICv3  23 Level     arm-pmu
     18:       1035          0          0          0     GICv3  66 Level     4d000000.mailbox thr_012
     27:          2          0          0          0     GICv3 139 Level     4900000.i2c
     28:          0          0          0          0     GICv3 197 Level     2b200000.i2c
    117:          0          0          0          0  MSI-INTA 1970707 Level     8000000.ethernet-tx0
    125:          0          0          0          0  MSI-INTA 1970715 Level     8000000.ethernet-tx1
    133:          0          0          0          0  MSI-INTA 1970723 Level     8000000.ethernet-tx2
    141:          0          0          0          0  MSI-INTA 1970731 Level     8000000.ethernet-tx3
    149:          0          0          0          0  MSI-INTA 1970739 Level     8000000.ethernet-tx4
    157:          0          7          0          0  MSI-INTA 1970747 Level     8000000.ethernet-tx5
    165:          0          0          0          0  MSI-INTA 1970755 Level     8000000.ethernet-tx6
    173:          0          0          0          0  MSI-INTA 1970763 Level     8000000.ethernet-tx7
    207:         32          0          0          0  MSI-INTA 1971731 Level     8000000.ethernet
    239:          0          0          0          0  MSI-INTA 13045248 Edge      4e230000.dma-controller chan0
    240:          0          0          0          0  MSI-INTA 13045249 Edge      4e230000.dma-controller chan1
    241:          0          0          0          0  MSI-INTA 13045250 Edge      4e230000.dma-controller chan2
    242:          0          0          0          0  MSI-INTA 13045251 Edge      4e230000.dma-controller chan3
    243:          0          0          0          0  MSI-INTA 13045252 Edge      4e230000.dma-controller chan4
    244:          0          0          0          0  MSI-INTA 13045253 Edge      4e230000.dma-controller chan5
    245:          0          0          0          0  MSI-INTA 13045760 Level     4e230000.dma-controller chan0
    246:          0          0          0          0  MSI-INTA 13045761 Level     4e230000.dma-controller chan1
    247:          0          0          0          0  MSI-INTA 13045762 Level     4e230000.dma-controller chan2
    248:          0          0          0          0  MSI-INTA 13045763 Level     4e230000.dma-controller chan3
    249:          0          0          0          0  MSI-INTA 13045764 Level     4e230000.dma-controller chan4
    250:          0          0          0          0  MSI-INTA 13045765 Level     4e230000.dma-controller chan5
    251:       1181          0          0          0     GICv3 210 Level     2800000.serial
    252:          0          0          0          0   pinctrl 456 Edge      2800000.serial:wakeup
    253:          0          0          0          0     GICv3 205 Level     20110000.spi
    254:          0          0          0          0     GICv3 134 Level     8000000.ethernet
    265:          0          0          0          0     GICv3 258 Level     xhci-hcd:usb1
    267:       7846          0          0          0     GICv3 165 Level     mmc0
    268:          0          0          0          0     GICv3 115 Level     mmc1
    380:       7398          0          0          0      GPIO  10 Edge    -davinci_gpio  wakeup_irq
    IPI0:       711       1165        826        903       Rescheduling interrupts
    IPI1:      1447      14824       3042       2733       Function call interrupts
    IPI2:         0          0          0          0       CPU stop interrupts
    IPI3:         0          0          0          0       CPU stop (for crash dump) interrupts
    IPI4:         0          0          0          0       Timer broadcast interrupts
    IPI5:       216          0          0          0       IRQ work interrupts
    IPI6:         0          0          0          0       CPU wake-up interrupts
    
    gpiochip1 - 52 lines:
            line   0:       unnamed                 input
            line   1:       unnamed                 input
            line   2:       unnamed                 input
            line   3:       unnamed                 input
            line   4:       unnamed                 input
            line   5:       unnamed                 input
            line   6:       unnamed                 input
            line   7:       unnamed                 input
            line   8:       unnamed                 input
            line   9:       unnamed                 input
            line  10:       unnamed                 input consumer=wakeup_gpio
            line  11:       unnamed                 input
            line  12:       unnamed                 input
            line  13:       unnamed                 input
            line  14:       unnamed                 input
            line  15:       unnamed                 input
            line  16:       unnamed                 input
            line  17:       unnamed                 input
            line  18:       unnamed                 input
            line  19:       unnamed                 input
            line  20:       unnamed                 input
            line  21:       unnamed                 input
            line  22:       unnamed                 input
            line  23:       unnamed                 input
            line  24:       unnamed                 input
            line  25:       unnamed                 input
            line  26:       unnamed                 input
            line  27:       unnamed                 input
            line  28:       unnamed                 input
            line  29:       unnamed                 input
            line  30:       unnamed                 input
            line  31:       unnamed                 input
            line  32:       unnamed                 input
            line  33:       unnamed                 input
            line  34:       unnamed                 input
            line  35:       unnamed                 input
            line  36:       unnamed                 input
            line  37:       unnamed                 input
            line  38:       unnamed                 input
            line  39:       unnamed                 input
            line  40:       unnamed                 input
            line  41:       unnamed                 input
            line  42:       unnamed                 input
            line  43:       unnamed                 input
            line  44:       unnamed                 input
            line  45:       unnamed                 input
            line  46:       unnamed                 input
            line  47:       unnamed                 input
            line  48:       unnamed                 input
            line  49:       unnamed                 output consumer=am62-sk:green:heartbeat
            line  50:       unnamed                 input
    
    The trigger interruption can already be seen

  • hello:
    We found that under mem, the mcu does not work. We plan to use the mcu only mode, which only sleeps the soc, but the mcu needs to work normally. 
    The document requires this interface to be enabled, but my version doesn't have this interface .sdk version 10.0.0

    echo enabled > /sys/bus/platform/devices/79000000.r5f/power/wakeup

  •  10.01.10.04 (2024-12-20)  I see.This version has fixed this problem.

    EXT_SITMPUSW-30

    Debian: Deepsleep doesn’t work on AM62P

  • Hello,

    Yes, you can try the latest SDK to see if that resolves the issue.

    If not, I can try to replicate the issue on my end.

    Thanks,

    Anshu

  • hello:

    sorry。We have been working on the project for a long time and have added a lot of things, so we can't change the sdk version. We need to help confirm whether this problem point exists and provide us with the patching method

  • Hi Anshu,

    Customer will try to test this feature on top of latest SDK, if it can work, please help to evaluate feasibility to backport the patch. thanks.

    Regards

    Joe

  • hello:

         ok,I tested the SDK version 10.01, but the test result was still unsatisfactory.
    The test steps are as follows:

    1、IO

    (一)Use the IO port wake-up source driver that I wrote above,

    (二)echo mem > /sys/power/state

      (三) Manually give this IO an edge signal

    2、uart

    (一)Execute the following script to enable the serial port to wake up the source

    (二)echo mem > /sys/power/state

    (三)Press the button on the serial port terminal

    #!/bin/bash -xe
    
    # Detach kernel serial console
    consoles=$(find /sys/bus/platform/devices/*.serial/ -name console)
    for console in ${consoles}; do
            echo -n N > ${console}
    done
    
    # Configure PM runtime autosuspend
    uarts=$(find /sys/bus/platform/devices/*.serial/power/ -type d)
    for uart in $uarts; do
            echo -n 3000 > $uart/autosuspend_delay_ms
            echo -n enabled > $uart/wakeup
            echo -n auto > $uart/control
    done
    
    # Configure wake-up from suspend
    uarts=$(find /sys/class/tty/tty[SO]*/power/ -type d 2>/dev/null)
    for uart in $uarts; do
            echo -n enabled > $uart/wakeup
    done

    It was found that it could not be awakened, but the command echo freeze > /sys/power/state could be awakened。

    And there is no mcu_only interface, making it impossible to implement the soc sleep mcu activation strategy。

  • Hello,

    I was able to successfully enter and exit MCU Only mode on SDK 10.1 on SK-AM62P-LP.

    The important note is to use this SYSFS entry to enable the MCU for MCU Only mode, not to enable the core command:

    echo 100 > /sys/devices/system/cpu/cpu0/power/pm_qos_resume_latency_us

    I've listed the steps below that I used to enter/exit MCU Only mode:

    For the GPIO1_10 wakeup source, I added the dtso overlay: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62x-sk-lpm-wkup-sources.dtso?h=ti-linux-6.6.y

    For details to add a device tree overlay, see here: https://software-dl.ti.com/processor-sdk-linux/esd/AM62PX/10_01_10_04/exports/docs/linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux.html

    This GPIO is name WKGPIO as shown in the device tree. Just confirm, it was checked in the interrupt list:

    root@am62pxx-evm:~# cat /proc/interrupts | grep WKGPIO
    407:          0          0          0          0      GPIO  10 Edge    -davinci_gpio  WKGPIO
    493:          0          0          0          0   pinctrl 416 Edge      WKGPIO:wakeup

    I made a quick script to enter MCU Only mode:

    #!/bin/bash
    
    echo -e "Kernel Version:"
    uname -a
    echo -e "\n"
    
    sleep .5
    
    echo -e "GPIO1_10 IRQ: "
    cat /proc/interrupts | grep 407:
    echo -e "\n"
    
    sleep .5
    
    echo -e "Set to MCU Only mode and suspend:"
    echo 100 > /sys/devices/system/cpu/cpu0/power/pm_qos_resume_latency_us
    echo mem > /sys/power/state
    

    To trigger a wakeup, I grounded GPIO1_10.

    Here are the logs of this script:

    Kernel Version:
    Linux am62pxx-evm 6.6.58-ti-01497-ga7758da17c28-dirty #1 SMP PREEMPT Wed Nov 27 13:23:15 UTC 2024 aarch64 GNU/Linux
    
    
    GPIO1_10 IRQ: 
    407:          0          0          0          0      GPIO  10 Edge    -davinci_gpio  WKGPIO
    
    
    Set to MCU Only mode and suspend:
    [  508.925063] PM: suspend entry (deep)
    [  508.952093] Filesystems sync: 0.020 seconds
    [  508.969176] Freezing user space processes
    [  508.974912] Freezing user space processes completed (elapsed 0.001 seconds)
    [  508.981922] OOM killer disabled.
    [  508.985155] Freezing remaining freezable tasks
    [  508.990896] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
    [  508.998300] printk: Suspending console(s) (use no_console_suspend to debug)
    [  509.020029] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 179: state: 1: ret 0
    [  509.020176] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 178: state: 1: ret 0
    [  509.029124] omap8250 2800000.serial: PM domain pd:146 will not be powered off
    [  509.029716] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 117: state: 1: ret 0
    [  509.029850] ti-sci 44043000.system-controller: ti_sci_cmd_set_latency_constraint: latency: 100: state: 1: ret 0
    [  509.050768] Disabling non-boot CPUs ...
    [  509.052994] psci: CPU1 killed (polled 4 ms)
    [  509.056342] psci: CPU2 killed (polled 0 ms)
    [  509.059523] psci: CPU3 killed (polled 0 ms)
    [  509.060670] Enabling non-boot CPUs ...
    [  509.061015] Detected VIPT I-cache on CPU1
    [  509.061057] GICv3: CPU1: found redistributor 1 region 0:0x00000000018a0000
    [  509.061111] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
    [  509.062197] CPU1 is up
    [  509.062442] Detected VIPT I-cache on CPU2
    [  509.062472] GICv3: CPU2: found redistributor 2 region 0:0x00000000018c0000
    [  509.062510] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
    [  509.063373] CPU2 is up
    [  509.063619] Detected VIPT I-cache on CPU3
    [  509.063648] GICv3: CPU3: found redistributor 3 region 0:0x00000000018e0000
    [  509.063690] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
    [  509.064635] CPU3 is up
    [  509.065080] ti-sci 44043000.system-controller: ti_sci_resume: wakeup source: 0x80
    [  509.078379] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 19
    [  509.094561] am65-cpsw-nuss 8000000.ethernet eth0: PHY [8000f00.mdio:00] driver [TI DP83867] (irq=POLL)
    [  509.094583] am65-cpsw-nuss 8000000.ethernet eth0: configuring for phy/rgmii-rxid link mode
    [  509.108019] am65-cpsw-nuss 8000000.ethernet eth1: PHY [8000f00.mdio:01] driver [TI DP83867] (irq=POLL)
    [  509.108030] am65-cpsw-nuss 8000000.ethernet eth1: configuring for phy/rgmii-rxid link mode
    [  509.291632] OOM killer enabled.
    [  509.294774] Restarting tasks ... done.
    [  509.300613] random: crng reseeded on system resumption
    [  509.308573] platform 79000000.r5f: Core is on in resume
    [  509.313987] platform 79000000.r5f: received echo reply from 79000000.r5f
    [  509.330272] PM: suspend exit
    

    From the logs, you can see the following:

    The other thing to note is the "pm_qos_resume_latency_us" entry is used instead of enabling the MCU core itself. This directory sets a constraint for the DM Firmware to understand which low power mode to enter. See here on the TISCI documentation: https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html#tisci-msg-lpm-set-latency-constraint

    In the case that the GPIO wakeup did not work, lets check the RTC signal to cause a wakeup. See an example script below:

    #!/bin/bash
    
    echo -e "Kernel Version:"
    uname -a
    echo -e "\n"
    
    sleep .5
    
    echo -e "GPIO1_10 IRQ: "
    cat /proc/interrupts | grep 407:
    echo -e "\n"
    
    sleep .5
    
    echo -e "Set to MCU Only mode and suspend:"
    echo 100 > /sys/devices/system/cpu/cpu0/power/pm_qos_resume_latency_us
    #echo mem > /sys/power/state
    rtcwake -m mem -s 10
    

    This will ensure that the suspend/resume sequence is working correctly before introducing the GPIO wakeup variable into the system.

    In the case you want to use Serial UART to enable wakeup, make sure the device tree is configured exactly as seen in this link: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts?h=ti-linux-6.12.y#n816

    After the device tree is configured, please use this script below to enable the UART wakeup source:

    #!/bin/bash
    
    echo -n N > /sys/bus/platform/devices/2800000.serial/tty/ttyS2/console
    echo -n 3000 > /sys/bus/platform/devices/2800000.serial/power/autosuspend_delay_ms
    echo -n enabled > /sys/bus/platform/devices/2800000.serial/power/wakeup
    echo -n auto > /sys/bus/platform/devices/2800000.serial/power/control
    echo -n enabled > /sys/class/tty/ttyS2/power/wakeup
    

    The original script that provided in the Linux SDK documentation resulted in an error on my test setup. The script I provided here is a workaround assuming ttyS2 is being used for serial communication.

    Please see the steps I provide to enter and exit MCU Only mode.

    Best Regards,

    Anshu

  • Hello,

    I just want to clarify what I tested was SDK 10.1, but to my understanding, the process should be the same for 10.0.

    If it doesn't work, lets make sure the RTC wakeup work which should work with a default device tree.

    Thanks,

    Anshu1

  • Hello,

    I checked again on SDK 10.0 default Linux image. I followed the process I mentioned above and was able to enter/exit MCU Only mode.

    Kernel Version:
    Linux am62pxx-evm 6.6.32-ti-g6de6e418c80e-dirty #1 SMP PREEMPT Fri Jul 26 14:32:20 UTC 2024 aarch64 GNU/Linux
    
    
    GPIO1_10 IRQ: 
    408:          0          0          0          0      GPIO  10 Edge    -davinci_gpio  WKGPIO
    
    
    Set to MCU Only mode and suspend:
    [  351.869538] PM: suspend entry (deep)
    [  352.075539] Filesystems sync: 0.199 seconds
    [  352.093468] Freezing user space processes
    [  352.099094] Freezing user space processes completed (elapsed 0.001 seconds)
    [  352.106098] OOM killer disabled.
    [  352.109363] Freezing remaining freezable tasks
    [  352.115075] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
    [  352.122498] printk: Suspending console(s) (use no_console_suspend to debug)
    [  352.142981] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 179: state: 1: ret 0
    [  352.143128] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 178: state: 1: ret 0
    [  352.152126] omap8250 2800000.serial: PM domain pd:146 will not be powered off
    [  352.152658] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 117: state: 1: ret 0
    [  352.152759] cpu cpu3: ti_sci_suspend: sending max CPU latency=100
    [  352.152798] ti-sci 44043000.system-controller: ti_sci_cmd_set_latency_constraint: latency: 100: state: 1: ret 0
    [  352.173375] Disabling non-boot CPUs ...
    [  352.175420] psci: CPU1 killed (polled 4 ms)
    [  352.178302] psci: CPU2 killed (polled 0 ms)
    [  352.181441] psci: CPU3 killed (polled 0 ms)
    [  352.182532] Enabling non-boot CPUs ...
    [  352.182868] Detected VIPT I-cache on CPU1
    [  352.182910] GICv3: CPU1: found redistributor 1 region 0:0x00000000018a0000
    [  352.182964] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
    [  352.183894] CPU1 is up
    [  352.184130] Detected VIPT I-cache on CPU2
    [  352.184156] GICv3: CPU2: found redistributor 2 region 0:0x00000000018c0000
    [  352.184194] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
    [  352.184908] CPU2 is up
    [  352.185143] Detected VIPT I-cache on CPU3
    [  352.185170] GICv3: CPU3: found redistributor 3 region 0:0x00000000018e0000
    [  352.185208] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
    [  352.185938] CPU3 is up
    [  352.186363] ti-sci 44043000.system-controller: ti_sci_resume: wakeup source: 0x80
    [  352.202040] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 19
    [  352.218098] am65-cpsw-nuss 8000000.ethernet eth0: PHY [8000f00.mdio:00] driver [TI DP83867] (irq=POLL)
    [  352.218126] am65-cpsw-nuss 8000000.ethernet eth0: configuring for phy/rgmii-rxid link mode
    [  352.231673] am65-cpsw-nuss 8000000.ethernet eth1: PHY [8000f00.mdio:01] driver [TI DP83867] (irq=POLL)
    [  352.231684] am65-cpsw-nuss 8000000.ethernet eth1: configuring for phy/rgmii-rxid link mode
    [  352.420589] OOM killer enabled.
    [  352.423738] Restarting tasks ... done.
    [  352.428764] random: crng reseeded on system resumption
    [  352.434138] platform 79000000.r5f: Core is on in resume
    [  352.439478] platform 79000000.r5f: received echo reply from 79000000.r5f
    [  352.448946] PM: suspend exit
    


    Best Regards,

    Anshu

  • Hi Anshu,

    Thanks for your help, I will check with Customer to see what is missing in their environments.

    Regards

    Joe

  • Hi Anshu,

    We tried to use prebuild-images following your steps, it can work. (ti-processor-sdk-linux-am62pxx-evm-10.01.10.04/board-support/prebuilt-images).

    but it is failed when we used build images in local environments. we only replace the "tispl.bin", it can not work.

    please check the steps

    -1-

    create SD card and install prebuild-images, following your steps it can work to exit MCU only mode.

    -2-

    cd ti-processor-sdk-linux-am62pxx-evm-10.01.10.04

    make u-boot

    cp -v ti-processor-sdk-linux-am62pxx-evm-10.01.10.04/board-support/u-boot-build/a53/tispl.bin /media/xxx/boot/tispl.bin

    following the steps you shared, it can not work, it can not exit MCU only mode.

    please help to check. thanks.

    Regards

    Joe

  • Hello Joe,

    If enabling this ATF doesn't solve the issue of entering/exit MCU only mode, then please provide more details about the issues. Please include suspend/resume Linux terminal logs and other U-Boot changes that may impact the tispl file as there are many components involved.

    Best Regards,

    Anshu

  • Hi Anshu,

    please help to check my experiments on top of SDK_10.1.

    -1-

    ti-processor-sdk-linux-am62pxx-evm-10.01.10.04/board-support/trusted-firmware-a-2.11+git
    git log
    58b25570c (HEAD -> joe_debug, master) Merge "feat(ti): implement DM_MANAGED suspend" into integration

    -2-

    make ARCH=aarch64 CROSS_COMPILE="$CROSS_COMPILE_64" PLAT=k3 K3_PM_SYSTEM_SUSPEND=1 TARGET_BOARD=lite SPD=opteed

    BTW:(there is no key words about K3_PM_SYSTEM_SUSPEND)

    cp -v ti-processor-sdk-linux-am62pxx-evm-10.01.10.04/board-support/trusted-firmware-a-2.11+git/build/k3/lite/release/bl31.bin 

             ti-processor-sdk-linux-am62pxx-evm-10.01.10.04/board-support/prebuilt-images/am62pxx-evm/bl31.bin

    make u-boot_clean

    make u-boot

    replace tispl.bin in SD card with "board-support/u-boot-build/a53/tispl.bin"

    no extra changes

    -3-

    It can not exit MCU only mode.

    root@am62pxx-evm:~# uname -a
    Linux am62pxx-evm 6.6.58-ti-01497-ga7758da17c28-dirty #1 SMP PREEMPT Wed Nov 27 13:23:15 UTC 2024 aarch64 GNU/Linux
    root@am62pxx-evm:~# cat /proc/interrupts | grep WKGPIO
    407: 0 0 0 0 GPIO 10 Edge -davinci_gpio WKGPIO
    493: 0 0 0 0 pinctrl 416 Edge WKGPIO:wakeup
    root@am62pxx-evm:~# echo 100 > /sys/devices/system/cpu/cpu0/power/pm_qos_resume_latency_us
    root@am62pxx-evm:~# echo mem > /sys/power/state
    [ 98.925779] PM: suspend entry (deep)
    [ 98.932549] Filesystems sync: 0.003 seconds
    [ 98.939234] Freezing user space processes
    [ 98.944981] Freezing user space processes completed (elapsed 0.001 seconds)
    [ 98.951985] OOM killer disabled.
    [ 98.955215] Freezing remaining freezable tasks
    [ 98.960970] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
    [ 98.968376] printk: Suspending console(s) (use no_console_suspend to debug)

    WKUP log:

    [IPC RPMSG ECHO] Version: REL.MCUSDK.K3.10.01.00.10+ (Nov 14 2024 14:00:57):
    [IPC RPMSG ECHO] Remote Core waiting for messages at end point 13 ... !!!
    [IPC RPMSG ECHO] Remote Core waiting for messages at end point 14 ... !!!
    [IPC RPMSG ECHO] Next MCU mode is 1
    [IPC RPMSG ECHO] Suspend request to MCU-only mode received
    [IPC RPMSG ECHO] Press a single key on this terminal to resume the kernel from MCU only mode

    Regards

    Joe

  • Hi Joe,

    I'm checking internally how the Makefiles in the SDK work to build these components. I'll get back to you on that.

    As a test, can you do the same process but update the OPTEE (bl32.bin) along with the ATF?

    You can follow the build instructions here: https://software-dl.ti.com/processor-sdk-linux/esd/AM62PX/10_01_10_04/exports/docs/linux/Foundational_Components_OPTEE.html

    Please use the make command without CFG_TEE_CORE_LOG_LEVEL=2. Make a backup copy of bl31 and bl32 just in case it doesn't work.

    Thanks,

    Anshu

  • Hi Anshu,

    I rebuilt the OPTEE(bl32.bin) and rebuild tispl.bin. it is the same issue, it can not exit MCU only mode.

    please double check below steps to rebuilt OPTEE in case there is something missing.

    cd /home/cnh20399/ti/arm-toolchain
    wget -c developer.arm.com/.../arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz -O - | tar -xv -J -C $COMPILER_PATH
    wget -c developer.arm.com/.../arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz -O - | tar -xv -J -C $COMPILER_PATH

    export COMPILER_PATH=/home/cnh20399/ti/arm-toolchain
    export CROSS_COMPILE_64=$COMPILER_PATH/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
    export CROSS_COMPILE_32=$COMPILER_PATH/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-
    export CC_64="${CROSS_COMPILE_64}gcc"
    export CC_32="${CROSS_COMPILE_32}gcc"


    make CROSS_COMPILE="$CROSS_COMPILE_32" CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=k3-am62px CFG_ARM64_core=y

    cp -v ./out/arm-plat-k3/core/tee-pager_v2.bin /home/cnh20399/worksource/am62p-10.1/ti-processor-sdk-linux-am62pxx-evm-10.01.10.04/board-support/prebuilt-images/am62pxx-evm/bl32.bin

    clean rebuild u-boot and copy tispl.bin to test, it is failed to exit MCU only mode.

    Regards

    Joe

  • Hi Joe,

    Can you share the output of these u-boot build log files:

    board-support/u-boot-build/a53/ti-spl.map
    board-support/u-boot-build/a53/tifsstub-fs.map

    From testing on my end, it seems like pieces of the TIFSSTUB is missing on the built image, not the pre-built image:

    Here is a working tispl.bin image:

    Image 4 (tifsstub-hs)
      Description:  TIFSSTUB
      Created:      Fri Nov 29 05:41:54 2024
      Type:         Firmware
      Compression:  uncompressed
      Data Size:    32133 Bytes = 31.38 KiB = 0.03 MiB
      Architecture: Unknown Architecture
      OS:           Unknown OS
      Load Address: 0x9ca00000
     Image 5 (tifsstub-fs)
      Description:  TIFSSTUB
      Created:      Fri Nov 29 05:41:54 2024
      Type:         Firmware
      Compression:  uncompressed
      Data Size:    30387 Bytes = 29.67 KiB = 0.03 MiB
      Architecture: Unknown Architecture
      OS:           Unknown OS
      Load Address: 0x9ca00000

    Here is one that was not working:

    Image 4 (tifsstub-hs)
      Description:  TIFSSTUB
      Created:      Tue Apr 29 17:28:56 2025
      Type:         Firmware
      Compression:  uncompressed
      Data Size:    1745 Bytes = 1.70 KiB = 0.00 MiB
      Architecture: Unknown Architecture
      OS:           Unknown OS
      Load Address: 0x9ca00000
     Image 5 (tifsstub-fs)
      Description:  TIFSSTUB
      Created:      Tue Apr 29 17:28:56 2025
      Type:         Firmware
      Compression:  uncompressed
      Data Size:    0 Bytes = 0.00 KiB = 0.00 MiB
      Architecture: Unknown Architecture
      OS:           Unknown OS
      Load Address: 0x9ca00000

    Notice how tifsstub-hs is much smaller in data size and tifsstub-fs doesn't have data size.

    I'm thinking based on this, during the suspend sequence, it will get stuck during the TIFS stage which will cause Linux to crash. So I don't think the device using the built image is even suspending rather its getting stuck prior to suspending.

    I'm still looking into why this is the case, but this might be an indicator of where in the suspend/resume sequence its at: software-dl.ti.com/.../pm_sw_arch.html

    If you can confirm the same output on your end, that would be helpful.

    Best Regards,

    Anshu

  • Hi Anshu,

    Thanks for your help.

    there is warning while make u-boot in my environment:

    Image 'tifsstub-hs' is missing optional external blobs but is still functional: tifsstub-hs-cert.bin tifsstub-hs-enc.bin

    /binman/tifsstub-hs/tifsstub-hs-cert.bin (ti-sysfw/ti-fs-stub-firmware-am62px-hs-cert.bin):
    Missing blob

    /binman/tifsstub-hs/tifsstub-hs-enc.bin (ti-sysfw/ti-fs-stub-firmware-am62px-hs-enc.bin):
    Missing blob

    Image 'tifsstub-fs' is missing optional external blobs but is still functional: tifsstub-fs-cert.bin tifsstub-fs-enc.bin

    /binman/tifsstub-fs/tifsstub-fs-cert.bin (ti-sysfw/ti-fs-stub-firmware-am62px-hs-cert.bin):
    Missing blob

    /binman/tifsstub-fs/tifsstub-fs-enc.bin (ti-sysfw/ti-fs-stub-firmware-am62px-hs-enc.bin):
    Missing blob

    I downloaded 2 files "ti-fs-stub-firmware-am62px-hs-cert.bin"/"ti-fs-stub-firmware-am62px-hs-enc.bin" through http://swubn04.india.englab.ti.com/smpusdk-internal-release/10_01_10_04/am62pxx-evm/7984_10122024_131104/am62pxx-evm/deploy/ti-sysfw/

    and put into

    board-support/prebuilt-images/am62pxx-evm/ti-sysfw/ti-fs-stub-firmware-am62px-hs-cert.bin
    board-support/prebuilt-images/am62pxx-evm/ti-sysfw/ti-fs-stub-firmware-am62px-hs-enc.bin

    then clean build u-boot and replace the tispl.bin.

    It can exit MCU only mode.

    root@am62pxx-evm:~# echo 100 > /sys/devices/system/cpu/cpu0/power/pm_qos_resume_latency_us
    root@am62pxx-evm:~# cat /proc/interrupts | grep WKGPIO
    407: 0 0 0 0 GPIO 10 Edge -davinci_gpio WKGPIO
    493: 0 0 0 0 pinctrl 416 Edge WKGPIO:wakeup
    root@am62pxx-evm:~# echo mem > /sys/power/state
    [ 36.691098] PM: suspend entry (deep)
    [ 40.487843] Filesystems sync: 3.793 seconds
    [ 40.494445] Freezing user space processes
    [ 40.500297] Freezing user space processes completed (elapsed 0.001 seconds)
    [ 40.507289] OOM killer disabled.
    [ 40.510505] Freezing remaining freezable tasks
    [ 40.516265] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
    [ 40.523664] printk: Suspending console(s) (use no_console_suspend to debug)
    [ 40.538976] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 179: state: 1: ret 0
    [ 40.539123] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 178: state: 1: ret 0
    [ 40.547959] omap8250 2800000.serial: PM domain pd:146 will not be powered off
    [ 40.548545] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 117: state: 1: ret 0
    [ 40.548677] ti-sci 44043000.system-controller: ti_sci_cmd_set_latency_constraint: latency: 100: state: 1: ret 0
    [ 40.569412] Disabling non-boot CPUs ...
    [ 40.571690] psci: CPU1 killed (polled 4 ms)
    [ 40.574796] psci: CPU2 killed (polled 4 ms)
    [ 40.578132] psci: CPU3 killed (polled 0 ms)
    [ 40.579735] Enabling non-boot CPUs ...
    [ 40.580075] Detected VIPT I-cache on CPU1
    [ 40.580117] GICv3: CPU1: found redistributor 1 region 0:0x00000000018a0000
    [ 40.580171] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
    [ 40.581259] CPU1 is up
    [ 40.581501] Detected VIPT I-cache on CPU2
    [ 40.581527] GICv3: CPU2: found redistributor 2 region 0:0x00000000018c0000
    [ 40.581565] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
    [ 40.582440] CPU2 is up
    [ 40.582689] Detected VIPT I-cache on CPU3
    [ 40.582723] GICv3: CPU3: found redistributor 3 region 0:0x00000000018e0000
    [ 40.582771] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
    [ 40.583744] CPU3 is up
    [ 40.584189] ti-sci 44043000.system-controller: ti_sci_resume: wakeup source: 0x80
    [ 40.597364] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 19
    [ 40.613419] am65-cpsw-nuss 8000000.ethernet eth0: PHY [8000f00.mdio:00] driver [TI DP83867] (irq=POLL)
    [ 40.613444] am65-cpsw-nuss 8000000.ethernet eth0: configuring for phy/rgmii-rxid link mode
    [ 40.626980] am65-cpsw-nuss 8000000.ethernet eth1: PHY [8000f00.mdio:01] driver [TI DP83867] (irq=POLL)
    [ 40.626993] am65-cpsw-nuss 8000000.ethernet eth1: configuring for phy/rgmii-rxid link mode
    [ 40.809867] OOM killer enabled.
    [ 40.813010] Restarting tasks ... done.
    [ 40.820166] random: crng reseeded on system resumption
    [ 40.825628] platform 79000000.r5f: Core is on in resume
    [ 40.830979] platform 79000000.r5f: received echo reply from 79000000.r5f
    root@am62pxx-evm:~# [ 40.838170] PM: suspend exit

    I attached 2 files here, customer will confirm if it is working or not

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/ti_2D00_fs_2D00_stub_2D00_firmware_2D00_am62px_2D00_hs_2D00_cert.bin

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/ti_2D00_fs_2D00_stub_2D00_firmware_2D00_am62px_2D00_hs_2D00_enc.bin

    Regards

    Joe

  • Hi Anshu,

    I tested on top of SDK_10.0, it can work to exit MCU only mode.

    I downloaded files from http://swubn04.india.englab.ti.com/Releases/smpusdk-releases/10.00.07.04/am62pxx-evm/am62pxx-evm/deploy/ti-sysfw/

    ti-fs-stub-firmware-am62px-hs-cert.bin

    ti-fs-stub-firmware-am62px-hs-enc.bin

    please double check if it is the right version with AM62P_SDK_10.0 release. thanks.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/6232.ti_2D00_fs_2D00_stub_2D00_firmware_2D00_am62px_2D00_hs_2D00_enc.bin

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/1856.ti_2D00_fs_2D00_stub_2D00_firmware_2D00_am62px_2D00_hs_2D00_cert.bin

    Customer will try this files with their environment on top of SDK_10.0.

    Regards

    Joe

  • Hi Joe,

    Thanks for confirming. I was also able to suspend/resume after adding these files to the pre-built images and use the top level makefile.

    Best Regards,

    Anshu