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.

RTOS/AM5746: Power and clock gating

Part Number: AM5746

Tool/software: TI-RTOS

My customers are thinking about power saving in AM5746.
They want to turn off the following modules:
・SD
・Ethernet
・USB
・I2C/UART
・PCIe

Question:
Would you tell me the power gating and clock gating method for each.
(About API usage and register rewriting )

Regards,
Rei

  • Hi Rei,

    The core clocks and module clocks used on the custom board library may vary based on the power requirements and external components used on the boards.

    <Board>_clock.c: Defines functions and structures for configuring the clock and power modules. Update this file based on the data from clock tree tool and GEL file validation.

    Refer to the below user guide for more info:

    software-dl.ti.com/.../index_board.html
    software-dl.ti.com/.../index_board.html
    software-dl.ti.com/.../index_device_drv.html
    software-dl.ti.com/.../FAQ.html

    Regards,
    Pavel
  • Rei,

    The best resource to refer and understand different features offered in PRCM module and power management options on this device is the Power management App note:

    www.ti.com/.../sprac22.pdf (this also applies to AM57x devices)

    As Pavel suggested, you can control the clocks and modules statically using the board library and shut the clocks and power domain for the unused modules. ABB and AVS feature for the chip is configured using SBL(bootloader) that sets up the core voltages on the PMIC for optimal operation.

    If you need more advanced features outside of just clock gating and power gating, we provide a power management driver that allows for frequency and power scaling or thermal management. The PM driver is documented here:
    software-dl.ti.com/.../index_device_drv.html

    Regards,
    Rahul
  • Hi,Pavel-san,Rahul-san

    Thank you for your reply.
    An additional question came from my customers.

    They would like to back up data when AM5746 is turned off.
    They want to reduce the power consumption of the module to secure backup's time.

    Question:
    Would you tell me how to turn off the following modules, other than the timing of initialization (GEL, board_init)
    ・SD
    ・Ethernet
    ・USB
    ・I2C/UART
    ・PCIe

    Regards,
    Rei
  • Rei,

    Can you please describe your customers use case. My original understanding was that the customer was trying to reduce application power consumption by shutting off clock and power to these modules. However, with your latest E2E post, it appears that the customer uses these interface in the application and wants to put them in low power state and recover from it, is that right?

    Implementing this is slightly more complex that just board library update to shut off the modules. You can do the module power state configuration using PM LLD driver. Refer to PM System configuration Test that is documented here:
    software-dl.ti.com/.../index_device_drv.html

    However, in an application scenario, software needs to ensure that there is no pending interrupts and activity on the interface before the module is put into low power state. Also , if the application needs to preserve the module state and recover back from lower power state then it adds another layer of challenges. We currently don`t support this low power state recovery mechanism in RTOS . For Linux, you can refer to the discussion here:
    e2e.ti.com/.../483378

    Regards,
    Rahul
  • Hi Rahul.
    Sorry for the late reply.

    My customer's use case:
    Suddenly, when the power could not be supplied,
    It attempts to back up to non-volatile memory with the remaining power.

    They turned off the module according to "PM System Configuration Test".
    However, it seems that power of USB PHY and PCIe can not be turned off. (USB OTG is successful)
    Specifically, it is as follows.

    USB OTG (Success case)
    pmlibSysConfigPowerStateParams_t modId : PMHAL_PRCM_MOD_USB_OTG_SS1~4
    pmlibSysConfigPowerStateParams_t pwrState:PMLIB_SYS_CONFIG_DISABLED
    pmlibSysConfigErrReturn_t failCause:PM_SUCCESS

    USB PHY (Failure case)
    pmlibSysConfigPowerStateParams_t modId:PMHAL_PRCM_MOD_USB_PHY1~3_ALWAYS_ON
    pmlibSysConfigPowerStateParams_t pwrState:PMLIB_SYS_CONFIG_DISABLED
    pmlibSysConfigErrReturn_t failCause:PM_SYS_CONFIG_MODULE_CANNOT_BE_DISABLED

    PCIe(Failure case)
    pmlibSysConfigPowerStateParams_t modId:PMHAL_PRCM_MOD_MMU_PCIESS
    pmlibSysConfigPowerStateParams_t pwrState:PMLIB_SYS_CONFIG_DISABLED
    pmlibSysConfigErrReturn_t failCause:PM_SYS_CONFIG_MODULE_HAS_DEPENDENCIES

    Question:
    Would you tell me the cause of failure?

    ■Environment
    HW TMDSIDK574
    SW pdk_am57xx_1_0_11
      bios_6_52_00_12
    Sample code PM System Configuration Test
    (Sample code is different depending on the pdk version)

    Regards,
    Rei
  • They have one more question.
    I think that they had a question because they could not turn off the module.
    Are there any documents or information about the following macros in the header file?
    (C: \ ti \ pdk_am57xx_1_0_11 \ packages \ ti \ drv \ pm \ include \ prcm \ V0 \ pmhal_prcm_modinc.h)
    -PMHAL_PRCM_MOD_USB_PHY1_ALWAYS_ON
    -PMHAL_PRCM_MOD_USB_PHY2_ALWAYS_ON
    -PMHAL_PRCM_MOD_USB_PHY3_ALWAYS_ON
    -PMHAL_PRCM_MOD_USB_OTG_SS1
    -PMHAL_PRCM_MOD_USB_OTG_SS2
    -PMHAL_PRCM_MOD_USB_OTG_SS3
    -PMHAL_PRCM_MOD_USB_OTG_SS4

    Thank you as always.

    Regards,
    Rei
  • Hi TI experts,

    Please respond.
  • rei said:
    Are there any documents or information about the following macros in the header file?
    (C: \ ti \ pdk_am57xx_1_0_11 \ packages \ ti \ drv \ pm \ include \ prcm \ V0 \ pmhal_prcm_modinc.h)
    -PMHAL_PRCM_MOD_USB_PHY1_ALWAYS_ON
    -PMHAL_PRCM_MOD_USB_PHY2_ALWAYS_ON
    -PMHAL_PRCM_MOD_USB_PHY3_ALWAYS_ON
    -PMHAL_PRCM_MOD_USB_OTG_SS1
    -PMHAL_PRCM_MOD_USB_OTG_SS2
    -PMHAL_PRCM_MOD_USB_OTG_SS3
    -PMHAL_PRCM_MOD_USB_OTG_SS4

    The doxygen documentation of APIs, files and macros for the PM LLD is provided in the PM LLD package in the path :

    pdk_am57xx_1_0_13/packages/ti/drv/pm/docs/doxygen/html/files.html

    pdk_am57xx_1_0_13/packages/ti/drv/pm/docs/doxygen/html/index.html (Top level index for the LLD API documentation)

    Regards,

    Rahul

  • The question is not purely PM LLD related. It relates to the way the PRCM modules is designed where there are certain modules which are in the always on domain and can`t be power down or have some 

    Certain modules are always in ON state and cannot be disabled for such modules PMLIBSysConfigSetPowerState would return PM_SYS_CONFIG_MODULE_CANNOT_BE_DISABLED. The case when PMLIBSysConfigSetPowerState would return PM_SYS_CONFIG_MODULE_HAS_DEPENDENCIES. Certain modules would be dependent on other hence needed to be disabled in order.Higher level software needs to take care of the dependencies while disabling.

    In case there is a built in dependency for modules, you can use the functions Power_getDependencyCount, Power_releaseDependency. For example , if you look at the pmrtos example code, you will see how the DSS module dependencies are set and released during the CPU Idle sequence. Check the code at:

    pdk_am57xx_1_0_xx\packages\ti\drv\pm\examples\pmrtos\src\pm_main_prcm.c

    Additional guidance for PM LLD driver is also provided here:

    http://processors.wiki.ti.com/index.php/PDK/PDK_TDA_PM_User_Guide

    The expected output for the PM LLD example system config is provided here:

    http://processors.wiki.ti.com/index.php/PDK/PDK_TDA_PM_User_Guide#PM_System_Configuration_Test

    Regards,

    Rahul

  • Rei,

    As a general comment, the suspend to flash and recovery mechanism that your customer is trying to implement is not supported in RTOS SDK. The PM LLD is designed more for power scaling and management, slave core idle recovery/wakeup and thermal management.

    I will loop in more system level and power experts to comment from a device perspective if this can be supported with the device in question.

    Regards,
    Rahul
  • Hi Rahul,
    Thank you very much as always.
    Your reply is very easy to understand.
    I told to my customers.

    Regards,
    Rei