mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
bus: mvebu-mbus: suspend/resume support
This commit extends the mvebu-mbus driver to provide suspend/resume support. Since mvebu-mbus is not a platform_driver, the syscore_ops mechanism is used to get ->suspend() and ->resume() hooks called into the driver. In those hooks, we save and restore the MBus windows state, to make sure after resume all Mbus windows are properly restored. Note that while the state of some windows could be gathered by looking again at the Device Tree (for statically described windows), it is not the case of dynamically described windows such as the PCIe memory and I/O windows. Therefore, we take the simple approach of saving and restoring the registers for all MBus windows. In addition, the commit extends the Device Tree binding of the MBus controller, to control the MBus bridge registers (which define which parts of the physical address space is routed to MBus windows vs. normal RAM memory). Those registers must be saved and restored during suspend/resume. The Device Tree binding extension is made is a backward compatible fashion, but of course, suspend/resume will not work without the Device Tree update. Signed-off-by: Thomas Petazzoni <[email protected]> Link: https://lkml.kernel.org/r/1416585613-2113-7-git-send-email-thomas.petazzoni@free-electrons.com Signed-off-by: Jason Cooper <[email protected]>
This commit is contained in:
parent
f9a49ab53a
commit
a0e89c02da
2 changed files with 130 additions and 11 deletions
|
|
@ -48,9 +48,12 @@ Required properties:
|
|||
- compatible: Should be set to "marvell,mbus-controller".
|
||||
|
||||
- reg: Device's register space.
|
||||
Two entries are expected (see the examples below):
|
||||
the first one controls the devices decoding window and
|
||||
the second one controls the SDRAM decoding window.
|
||||
Two or three entries are expected (see the examples below):
|
||||
the first one controls the devices decoding window,
|
||||
the second one controls the SDRAM decoding window and
|
||||
the third controls the MBus bridge (only with the
|
||||
marvell,armada370-mbus and marvell,armadaxp-mbus
|
||||
compatible strings)
|
||||
|
||||
Example:
|
||||
|
||||
|
|
@ -67,7 +70,7 @@ Example:
|
|||
|
||||
mbusc: mbus-controller@20000 {
|
||||
compatible = "marvell,mbus-controller";
|
||||
reg = <0x20000 0x100>, <0x20180 0x20>;
|
||||
reg = <0x20000 0x100>, <0x20180 0x20>, <0x20250 0x8>;
|
||||
};
|
||||
|
||||
/* more children ...*/
|
||||
|
|
@ -126,7 +129,7 @@ are skipped.
|
|||
|
||||
mbusc: mbus-controller@20000 {
|
||||
compatible = "marvell,mbus-controller";
|
||||
reg = <0x20000 0x100>, <0x20180 0x20>;
|
||||
reg = <0x20000 0x100>, <0x20180 0x20>, <0x20250 0x8>;
|
||||
};
|
||||
|
||||
/* more children ...*/
|
||||
|
|
@ -170,7 +173,7 @@ Using this macro, the above example would be:
|
|||
|
||||
mbusc: mbus-controller@20000 {
|
||||
compatible = "marvell,mbus-controller";
|
||||
reg = <0x20000 0x100>, <0x20180 0x20>;
|
||||
reg = <0x20000 0x100>, <0x20180 0x20>, <0x20250 0x8>;
|
||||
};
|
||||
|
||||
/* other children */
|
||||
|
|
@ -266,7 +269,7 @@ See the example below, where a more complete device tree is shown:
|
|||
ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
|
||||
|
||||
mbusc: mbus-controller@20000 {
|
||||
reg = <0x20000 0x100>, <0x20180 0x20>;
|
||||
reg = <0x20000 0x100>, <0x20180 0x20>, <0x20250 0x8>;
|
||||
};
|
||||
|
||||
interrupt-controller@20000 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue