3.2.2.11.7. S/W Architecture of System Suspend

3.2.2.11.7.1. Overview

In AM62, Deep Sleep is the state of the SoC in which it consumes very low power overall yet it is not completely shut off. During Deep Sleep, Certain IPs (depending on the power domain to which then belong) will lose context on suspend. S/W should save and restore the context as required across state transitions. DDR is in self- refresh to allow context saving.

This document explains the overall high level Software Flow of deep sleep in AM62x.

3.2.2.11.7.2. System diagram and components

../../../../../_images/AM62x_Deep_Sleep_Flow.png

Above diagram has software sequence for how deep sleep (ie. Suspend to RAM) works on SK-AM62 ( Read more on the Starter Kit here ).

3.2.2.11.7.2.1. Deep Sleep Entry:

  1. The user first instructs the System to Suspend. This triggers a suspend sequence from linux side (which runs on the A53 cluster of the SoC).

  2. As part of the TI_SCI driver’s suspend hook, I/O isolation is invoked which isolates all the pads from their respective pinmuxed controllers. Refer to Wakeup sources Documentation to understand more on this.

  3. Linux then suspends all the drivers in the order that they are probed. After ensuring that there were no faults in suspending the drivers, linux then issues core system suspend which ultimately is a PSCI system suspend call. Read more about PSCI here

  4. At this point only ATF is running on A53 cores and it does the job of sending a TISCI Message to the TIFS Core telling it to enter deep sleep and then it puts A53 into standby.

  5. The TIFS Core then encrypts and writes the contents of it’s own SRAM to DDR.

  6. Further it stops tick timer, disables interrupts that are not needed, and suspends local drivers. After the above steps it sends TISCI To DM for Suspend Finish and enters WFI.

  7. The DM (Device Manager) is the final entity in this entire deep sleep sequence. It does the following:

    1. Saves own context to DDR

    2. Disables Security IP LPSCs, such as LPSC_SAUL.

    3. Disables non-critical “IP-less” LPSCs, such as LPSC_main_test.

    4. Saves MAIN PADCONF MMRs

    5. Saves GTC counter and Disable it.

    6. Finally, Suspends OS.

    The OS in this case is the Free RTOS based Device Manager firmware itself. After this step it starts performing final Steps toward completion of Suspend to RAM.

  8. These steps include the following:

    1. Place DDR into Self Refresh

    2. Place USB into reset isolation

    3. Disable all LPSCs in MAIN except Debug, Always ON

    4. Disable all HSDIVs in MAIN_PLL.

    5. Bypass all MAIN PLLs.

    6. Configure selected wake sources, Enable MAIN IO Isolation.

    7. Disable MCU Core LPSCs, PDs

    8. Bypass MCU PLL

  9. Finally, DM R5 Enters WFI with all the other power domains turned OFF except WKUP Always ON. DM in WFI will basically wait for the configured wakeup source to trigger an interrupt that will act as the wakeup signal.

3.2.2.11.7.2.2. Deep Sleep Exit:

  1. External async wakeup from wake source triggers the DM to resume.

  2. The DM brings MAIN Domain out of reset.

  3. Secure (TIFS) ROM begins to boot.

  4. A small piece of code called the FS Stub is required to restore the remaining context and resume the TIFS firmware.

    The TIFS Stub is loaded into the ATCM (Tightly Coupled Memory A of the DM R5) during device boot. The R5 SPL loads the TIFS Stub (which is a part of tispl.bin) onto DDR at address 0x9dc00000. The DM Firmware pulls in this TIFS Stub from DDR RAM to it’s ATCM where it then resides as long as the device is not shutdown.

  5. Then, the rest of the resume sequence is a mirror image of the deep sleep entry sequence.

  6. As the A53 core resumes, and subsequently the linux TI_SCI driver’s resume hook is called, I/O isolation is disabled. This allows the pads to be re-connected to their respective controllers and allow the device to function normally post resume.

3.2.2.11.7.3. Learning Resources

  1. AM62x Technical Reference Manual

  2. Technical White Paper on Enabling Low Power on AM62x

  3. Low Power Modes Documentation