Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 1 | /* |
| 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 | **********************************************************/ |
| 40 | enum 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 | |
| 45 | enum pm_ret_status pm_self_suspend(enum pm_node_id nid, |
| 46 | unsigned int latency, |
| 47 | unsigned int state, |
| 48 | uintptr_t address); |
| 49 | |
| 50 | enum pm_ret_status pm_force_powerdown(enum pm_node_id nid, |
| 51 | enum pm_request_ack ack); |
| 52 | |
| 53 | enum pm_ret_status pm_abort_suspend(enum pm_abort_reason reason); |
| 54 | |
| 55 | enum 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 | |
| 60 | enum pm_ret_status pm_set_wakeup_source(enum pm_node_id target, |
| 61 | enum pm_node_id wkup_node, |
| 62 | unsigned int enable); |
| 63 | |
| 64 | enum pm_ret_status pm_system_shutdown(unsigned int restart); |
| 65 | |
| 66 | enum 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 */ |
| 72 | enum 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); |
| 76 | enum pm_ret_status pm_release_node(enum pm_node_id nid); |
| 77 | |
| 78 | enum 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); |
| 82 | enum pm_ret_status pm_set_max_latency(enum pm_node_id nid, |
| 83 | unsigned int latency); |
| 84 | |
| 85 | /* Miscellaneous API functions */ |
| 86 | enum pm_ret_status pm_get_api_version(unsigned int *version); |
| 87 | enum pm_ret_status pm_set_configuration(unsigned int phys_addr); |
| 88 | enum pm_ret_status pm_get_node_status(enum pm_node_id node); |
| 89 | enum pm_ret_status pm_register_notifier(enum pm_node_id nid, |
| 90 | unsigned int event, |
| 91 | unsigned int wake, |
| 92 | unsigned int enable); |
| 93 | enum pm_ret_status pm_get_op_characteristic(enum pm_node_id nid, |
Anes Hadziahmetagic | 92aee01 | 2016-05-12 16:17:30 +0200 | [diff] [blame] | 94 | enum pm_opchar_type type, |
| 95 | uint32_t *result); |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 96 | enum pm_ret_status pm_acknowledge_cb(enum pm_node_id nid, |
| 97 | enum pm_ret_status status, |
| 98 | unsigned int oppoint); |
| 99 | enum pm_ret_status pm_notify_cb(enum pm_node_id nid, |
| 100 | unsigned int event, |
| 101 | unsigned int oppoint); |
| 102 | |
| 103 | /* Direct-Control API functions */ |
| 104 | enum pm_ret_status pm_reset_assert(unsigned int reset_id, |
| 105 | unsigned int assert); |
| 106 | enum pm_ret_status pm_reset_get_status(unsigned int reset_id, |
| 107 | unsigned int *reset_status); |
| 108 | enum pm_ret_status pm_mmio_write(uintptr_t address, |
| 109 | unsigned int mask, |
| 110 | unsigned int value); |
| 111 | enum pm_ret_status pm_mmio_read(uintptr_t address, unsigned int *value); |
Nava kishore Manne | 68d460c | 2016-08-20 23:18:09 +0530 | [diff] [blame] | 112 | enum pm_ret_status pm_fpga_load(uint32_t address_high, |
| 113 | uint32_t address_low, |
| 114 | uint32_t size, |
| 115 | uint32_t flags); |
| 116 | enum pm_ret_status pm_fpga_get_status(unsigned int *value); |
| 117 | |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 118 | #endif /* _PM_API_SYS_H_ */ |