ARM: firmware: Introduce suspend and resume operations
authorTomasz Figa <t.figa@samsung.com>
Tue, 23 Sep 2014 16:24:35 +0000 (01:24 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Mon, 20 Oct 2014 15:06:35 +0000 (00:06 +0900)
This patch extends the firmware_ops structure with two new callbacks:
.suspend() and .resume(). The former is intended to ask the firmware to
save all its volatile state and suspend the system, without returning
back to the kernel in between. The latter is to be called early by
very low level platform suspend code after waking up to restore low
level hardware state, which can't be restored in non-secure mode.

While at it, outdated version of the structure is removed from the
documentation and replaced with a reference to the header file.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Documentation/arm/firmware.txt
arch/arm/include/asm/firmware.h

index c2e468fe7b0be00979562b9c3f0d371a24d8cb67..da6713adac8acffc5924d447473351ab84c2d289 100644 (file)
@@ -7,32 +7,14 @@ world, which changes the way some things have to be initialized. This makes
 a need to provide an interface for such platforms to specify available firmware
 operations and call them when needed.
 
-Firmware operations can be specified using struct firmware_ops
-
-       struct firmware_ops {
-               /*
-               * Enters CPU idle mode
-               */
-               int (*do_idle)(void);
-               /*
-               * Sets boot address of specified physical CPU
-               */
-               int (*set_cpu_boot_addr)(int cpu, unsigned long boot_addr);
-               /*
-               * Boots specified physical CPU
-               */
-               int (*cpu_boot)(int cpu);
-               /*
-               * Initializes L2 cache
-               */
-               int (*l2x0_init)(void);
-       };
-
-and then registered with register_firmware_ops function
+Firmware operations can be specified by filling in a struct firmware_ops
+with appropriate callbacks and then registering it with register_firmware_ops()
+function.
 
        void register_firmware_ops(const struct firmware_ops *ops)
 
-the ops pointer must be non-NULL.
+The ops pointer must be non-NULL. More information about struct firmware_ops
+and its members can be found in arch/arm/include/asm/firmware.h header.
 
 There is a default, empty set of operations provided, so there is no need to
 set anything if platform does not require firmware operations.
index 2c9f10df7568d5c77010f0cf8e4e08b1bc820082..5904f59b04094a2f5933123d987f45e07f3127c8 100644 (file)
@@ -41,6 +41,14 @@ struct firmware_ops {
         * Initializes L2 cache
         */
        int (*l2x0_init)(void);
+       /*
+        * Enter system-wide suspend.
+        */
+       int (*suspend)(void);
+       /*
+        * Restore state of privileged hardware after system-wide suspend.
+        */
+       int (*resume)(void);
 };
 
 /* Global pointer for current firmware_ops structure, can't be NULL. */
This page took 0.029422 seconds and 5 git commands to generate.