BeagleBoard/GSoC/2023 Proposal/S2D Sukrut Bellary

=Enable Suspend to Disk on BeaglePlay = About Student: Sukrut Bellary Mentors: NishanthMenon, Dhruva Gole Code: TBD Wiki: GSoC: NA

=Status= Started with Pre-work.

=Proposal= This project proposes to enable the support for Suspend to Disk on AI64/AM62X

About you

 * IRC: sukrutb
 * Github:
 * Slack: Sukrut Bellary
 * Country: India, Currently in US
 * Primary language: English, Marathi, Hindi
 * Typical work hours: 8AM-5PM US PT

About your project
Project name: Enable Suspend to Disk on AI64/AM62

Description
This project aims to enable Suspend to Disk/Hibernation on AI64/AM62X - BeaglePlay.
 * Overview

Hibernation of the system is one of the techniques of power management where the System/System on Chip (SoC) is powered down while retaining its state. When hibernation is triggered, the Kernel freezes all the system activities. And creates and stores the snapshot of Random Access Memory (RAM) to non-volatile memory(NVM).
 * Hibernation:

Upon wake-up, Restore the snapshot image so that the system state will be the same as before hibernation.
 * Wake-up/Resume:

System hibernation can be triggered via the sysfs interface e.g., echo disk > /sys/power/state It starts the Linux kernel's hibernate, wherein
 * Implementation Details:
 * 1) User space processes are frozen.
 * 2) Devices on the SoC are put in suspension (by calling their respective freeze callbacks).
 * 3) Put CPU cores in a low-power state.
 * 4) Create the hibernation snapshot.
 * 5) Power on CPU and devices(by calling respective thaw callbacks).
 * 6) Store the hibernation snapshot in non-volatile memory. (Need to pass the NVM partition information to the Kernel).
 * 7) invoke power_down.

Resume: The power-on button triggers the Wake-up event. Here Kernel loads the hibernation snapshot from NVM, which restores the system state.

BeaglePlay: https://beagleboard.org/play
 * Hardware

Experience and approach

 * 1) I am an experienced Embedded System Software Developer.
 * 2) I have hands-on experience with C, RTOS, Linux kernel, and device driver development.
 * 3) I have worked on System power management on TI OMAP3 platform.
 * 4) I am familiar with the Linux kernel up-streaming process.

Contingency
If I get stuck on my project and my mentor isn’t around, I will use following resources
 * 1) TI reference manuals.
 * 2) BeaglePlay documentation: https://docs.beagleboard.org/latest/boards/beagleplay/
 * 3) The Linux Kernel Documentation: https://docs.kernel.org/
 * 4) Reach out to the other mentors on BeagleBoard Slack.
 * 5) Ask on BeagleBoard forum: https://forum.beagleboard.org/
 * 6) The Linux kernel mailing list

Benefit
Hibernation mode saves the system's current state to non-volatile memory, which means that the data is preserved even if the system loses power. This is particularly useful in embedded systems where data may need to be maintained across power cycles while achieving maximum power saving.