blob: f0365cd9979492e758758a8d0f45f76b9ac939da [file] [log] [blame]
Soren Brinkmann76fcae32016-03-06 20:16:27 -08001/*
2 * Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * Redistributions of source code must retain the above copyright notice, this
8 * list of conditions and the following disclaimer.
9 *
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 *
14 * Neither the name of ARM nor the names of its contributors may be used
15 * to endorse or promote products derived from this software without specific
16 * prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#ifndef _PM_API_SYS_H_
32#define _PM_API_SYS_H_
33
34#include <stdint.h>
35#include "pm_defs.h"
36
37/**********************************************************
38 * System-level API function declarations
39 **********************************************************/
40enum pm_ret_status pm_req_suspend(enum pm_node_id nid,
41 enum pm_request_ack ack,
42 unsigned int latency,
43 unsigned int state);
44
45enum pm_ret_status pm_self_suspend(enum pm_node_id nid,
46 unsigned int latency,
47 unsigned int state,
48 uintptr_t address);
49
50enum pm_ret_status pm_force_powerdown(enum pm_node_id nid,
51 enum pm_request_ack ack);
52
53enum pm_ret_status pm_abort_suspend(enum pm_abort_reason reason);
54
55enum pm_ret_status pm_req_wakeup(enum pm_node_id nid,
56 unsigned int set_address,
57 uintptr_t address,
58 enum pm_request_ack ack);
59
60enum pm_ret_status pm_set_wakeup_source(enum pm_node_id target,
61 enum pm_node_id wkup_node,
62 unsigned int enable);
63
64enum pm_ret_status pm_system_shutdown(unsigned int restart);
65
66enum pm_ret_status pm_init_suspend_cb(enum pm_suspend_reason reason,
67 unsigned int latency,
68 unsigned int state,
69 unsigned int timeout);
70
71/* API functions for managing PM Slaves */
72enum pm_ret_status pm_req_node(enum pm_node_id nid,
73 unsigned int capabilities,
74 unsigned int qos,
75 enum pm_request_ack ack);
76enum pm_ret_status pm_release_node(enum pm_node_id nid);
77
78enum pm_ret_status pm_set_requirement(enum pm_node_id nid,
79 unsigned int capabilities,
80 unsigned int qos,
81 enum pm_request_ack ack);
82enum pm_ret_status pm_set_max_latency(enum pm_node_id nid,
83 unsigned int latency);
84
85/* Miscellaneous API functions */
86enum pm_ret_status pm_get_api_version(unsigned int *version);
87enum pm_ret_status pm_set_configuration(unsigned int phys_addr);
88enum pm_ret_status pm_get_node_status(enum pm_node_id node);
89enum pm_ret_status pm_register_notifier(enum pm_node_id nid,
90 unsigned int event,
91 unsigned int wake,
92 unsigned int enable);
93enum pm_ret_status pm_get_op_characteristic(enum pm_node_id nid,
94 enum pm_opchar_type type);
95enum pm_ret_status pm_acknowledge_cb(enum pm_node_id nid,
96 enum pm_ret_status status,
97 unsigned int oppoint);
98enum pm_ret_status pm_notify_cb(enum pm_node_id nid,
99 unsigned int event,
100 unsigned int oppoint);
101
102/* Direct-Control API functions */
103enum pm_ret_status pm_reset_assert(unsigned int reset_id,
104 unsigned int assert);
105enum pm_ret_status pm_reset_get_status(unsigned int reset_id,
106 unsigned int *reset_status);
107enum pm_ret_status pm_mmio_write(uintptr_t address,
108 unsigned int mask,
109 unsigned int value);
110enum pm_ret_status pm_mmio_read(uintptr_t address, unsigned int *value);
111#endif /* _PM_API_SYS_H_ */