blob: 5dcbb0d864a7c84902afc971b4c5b3290d4e6ee5 [file] [log] [blame]
Soren Brinkmann76fcae32016-03-06 20:16:27 -08001/*
2 * Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved.
3 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Soren Brinkmann76fcae32016-03-06 20:16:27 -08005 */
6
7/*
8 * Contains definitions of commonly used macros and data types needed
9 * for PU Power Management. This file should be common for all PU's.
10 */
11
12#ifndef _PM_COMMON_H_
13#define _PM_COMMON_H_
14
15#include <debug.h>
16#include <stdint.h>
17#include "pm_defs.h"
18
19#define PAYLOAD_ARG_CNT 6U
20#define PAYLOAD_ARG_SIZE 4U /* size in bytes */
21
22/**
23 * pm_ipi - struct for capturing IPI-channel specific info
Wendy Liang328105c2017-10-03 23:21:11 -070024 * @apu_ipi_id APU IPI agent ID
25 * @pmu_ipi_id PMU Agent ID
Soren Brinkmann76fcae32016-03-06 20:16:27 -080026 * @buffer_base base address for payload buffer
27 */
28struct pm_ipi {
Wendy Liang328105c2017-10-03 23:21:11 -070029 const uint32_t apu_ipi_id;
30 const uint32_t pmu_ipi_id;
Soren Brinkmann76fcae32016-03-06 20:16:27 -080031 const uintptr_t buffer_base;
32};
33
34/**
35 * pm_proc - struct for capturing processor related info
36 * @node_id node-ID of the processor
37 * @pwrdn_mask cpu-specific mask to be used for power control register
38 * @ipi pointer to IPI channel structure
39 * (in APU all processors share one IPI channel)
40 */
41struct pm_proc {
42 const enum pm_node_id node_id;
43 const unsigned int pwrdn_mask;
44 const struct pm_ipi *ipi;
45};
46
47const struct pm_proc *pm_get_proc(unsigned int cpuid);
48const struct pm_proc *pm_get_proc_by_node(enum pm_node_id nid);
49
50#endif /* _PM_COMMON_H_ */