bus: mvebu-mbus: provide a mechanism to save SDRAM window configuration
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 21 Nov 2014 16:00:04 +0000 (17:00 +0100)
committerJason Cooper <jason@lakedaemon.net>
Sun, 30 Nov 2014 16:40:11 +0000 (16:40 +0000)
commit4749c02b8da6d8dbc29218652985bda844017e95
tree992fd5ce8e264a02637ec8be69a828b16807c75f
parenta0e89c02da974838053a3604025e43600dc6ac45
bus: mvebu-mbus: provide a mechanism to save SDRAM window configuration

On Marvell EBU platforms, when doing suspend/resume, the SDRAM window
configuration must be saved on suspend, and restored on
resume. However, it needs to be restored on resume *before*
re-entering the kernel, because the SDRAM window configuration defines
the layout of the memory. For this reason, it cannot simply be done in
the ->suspend() and ->resume() hooks of the mvebu-mbus driver.

Instead, it needs to be restored by the bootloader "boot info"
mechanism used when resuming. This mechanism allows the kernel to
define a list of (address, value) pairs when suspending, that the
bootloader will restore on resume before jumping back into the kernel.

This commit therefore adds a new function to the mvebu-mbus driver,
called mvebu_mbus_save_cpu_target(), which will be called by the
platform code to make the mvebu-mbus driver save the SDRAM window
configuration in a way that can be understood by the bootloader "boot
info" mechanism.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Link: https://lkml.kernel.org/r/1416585613-2113-8-git-send-email-thomas.petazzoni@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
drivers/bus/mvebu-mbus.c
include/linux/mbus.h