Path: blob/master/Documentation/arm/Samsung-S3C24XX/Suspend.txt
10823 views
S3C24XX Suspend Support1=======================234Introduction5------------67The S3C24XX supports a low-power suspend mode, where the SDRAM is kept8in Self-Refresh mode, and all but the essential peripheral blocks are9powered down. For more information on how this works, please look10at the relevant CPU datasheet from Samsung.111213Requirements14------------15161) A bootloader that can support the necessary resume operation17182) Support for at least 1 source for resume19203) CONFIG_PM enabled in the kernel21224) Any peripherals that are going to be powered down at the same23time require suspend/resume support.242526Resuming27--------2829The S3C2410 user manual defines the process of sending the CPU to30sleep and how it resumes. The default behaviour of the Linux code31is to set the GSTATUS3 register to the physical address of the32code to resume Linux operation.3334GSTATUS4 is currently left alone by the sleep code, and is free to35use for any other purposes (for example, the EB2410ITX uses this to36save memory configuration in).373839Machine Support40---------------4142The machine specific functions must call the s3c_pm_init() function43to say that its bootloader is capable of resuming. This can be as44simple as adding the following to the machine's definition:4546INITMACHINE(s3c_pm_init)4748A board can do its own setup before calling s3c_pm_init, if it49needs to setup anything else for power management support.5051There is currently no support for over-riding the default method of52saving the resume address, if your board requires it, then contact53the maintainer and discuss what is required.5455Note, the original method of adding an late_initcall() is wrong,56and will end up initialising all compiled machines' pm init!5758The following is an example of code used for testing wakeup from59an falling edge on IRQ_EINT0:606162static irqreturn_t button_irq(int irq, void *pw)63{64return IRQ_HANDLED;65}6667statuc void __init machine_init(void)68{69...7071request_irq(IRQ_EINT0, button_irq, IRQF_TRIGGER_FALLING,72"button-irq-eint0", NULL);7374enable_irq_wake(IRQ_EINT0);7576s3c_pm_init();77}787980Debugging81---------8283There are several important things to remember when using PM suspend:84851) The uart drivers will disable the clocks to the UART blocks when86suspending, which means that use of printascii() or similar direct87access to the UARTs will cause the debug to stop.88892) Whilst the pm code itself will attempt to re-enable the UART clocks,90care should be taken that any external clock sources that the UARTs91rely on are still enabled at that point.92933) If any debugging is placed in the resume path, then it must have the94relevant clocks and peripherals setup before use (ie, bootloader).9596For example, if you transmit a character from the UART, the baud97rate and uart controls must be setup beforehand.9899100Configuration101-------------102103The S3C2410 specific configuration in `System Type` defines various104aspects of how the S3C2410 suspend and resume support is configured105106`S3C2410 PM Suspend debug`107108This option prints messages to the serial console before and after109the actual suspend, giving detailed information on what is110happening111112113`S3C2410 PM Suspend Memory CRC`114115Allows the entire memory to be checksummed before and after the116suspend to see if there has been any corruption of the contents.117118Note, the time to calculate the CRC is dependent on the CPU speed119and the size of memory. For an 64Mbyte RAM area on an 200MHz120S3C2410, this can take approximately 4 seconds to complete.121122This support requires the CRC32 function to be enabled.123124125`S3C2410 PM Suspend CRC Chunksize (KiB)`126127Defines the size of memory each CRC chunk covers. A smaller value128will mean that the CRC data block will take more memory, but will129identify any faults with better precision130131132Document Author133---------------134135Ben Dooks, Copyright 2004 Simtec Electronics136137138139