On Mon, 23 Mar 2015 09:21:01 -0700 (PDT)
Willi Gnilke <[email protected]> wrote:

>  
> 
> Using the linux-sunxi sunxi-3.4 branch I hoped to get suspend working 
> because there is a lot of code in the arch/arm/mach-sun7i/pm directory 
> which looks good.

The sun7i support in the sunxi-3.4 kernel is a result of a quick and
dirty forward porting from the old Allwinner's 3.3 kernel. AFAIK the
suspend support was never transplanted correctly.
 
> with echo mem > /sys/power/state
> 
> the device goes into sleep but does not wakeup after pressing the power 
> button. Instead it reboots.

The reboot is the bootloader thing.

For the suspend-to-ram implementation, the DRAM chips are put into the
self-refresh mode and the SoC is powered off. Waking up means that the
system is booting normally from the SD card or other default boot
locations. This means that the U-Boot bootloader is getting started
as part of the resume process. And right now it just discards the
data from DRAM and boots normally:

    
http://git.denx.de/?p=u-boot.git;a=commitdiff;h=f2577967738f923571b7156ad46ef91d9fa8d9f8

Which looks like a reboot.

Yes, for a proper suspend-to-ram support, we need to bring the DRAM back
from the self-refresh mode and resume the execution.
 
> I think that suspend is for battery powered devices essential and i'm very 
> interested in getting this work.
> 
> My questions:
> 
> - Is there a kernel (3.4) in which suspend/resume runs stable 
> 
> - Are there any special requirements to user space (i.e. graphics, X11 
> etc.) or even uboot?
> 
> - What about suspend for A20 in mainline kernel / sunxi-next?
> 
> - Where to start hacking?

You can have a look at super standby bits of the Allwinner's boot0
code here:

    
https://github.com/allwinner-zh/bootloader/tree/master/basic_loader/bsp/bsp_for_a20/init_dram

And then try to integrate the relevant parts from it into the mainline
U-Boot. Please note that the resume support is likely going to be quite
different for the mainline kernel compared to what is required for the
Allwinner's Android kernel (because of PSCI). But this all is better to
be discussed in the mainline U-Boot mailing list.

> My board is PcDuino3 but I think this is nothing special about it as 
> hardware  is very similar to other boards.

Yes, there should not be anything very much special. Can the PcDuino3
board in fact be powered from a battery?

-- 
Best regards,
Siarhei Siamashka

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to