1 /*
2  * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
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 <stdint.h>
16 #include <plat_pm_common.h>
17 
18 #if IPI_CRC_CHECK
19 #define PAYLOAD_ARG_CNT         8U
20 #define IPI_W0_TO_W6_SIZE       28U
21 #define PAYLOAD_CRC_POS         7U
22 #define CRC_INIT_VALUE          0x4F4EU
23 #define CRC_ORDER               16U
24 #define CRC_POLYNOM             0x8005U
25 #else
26 #define PAYLOAD_ARG_CNT         6U
27 #endif
28 #define PAYLOAD_ARG_SIZE	4U	/* size in bytes */
29 
30 /**
31  * pm_ipi - struct for capturing IPI-channel specific info
32  * @local_ipi_id	Local IPI agent ID
33  * @remote_ipi_id	Remote IPI Agent ID
34  * @buffer_base	base address for payload buffer
35  */
36 struct pm_ipi {
37 	const uint32_t local_ipi_id;
38 	const uint32_t remote_ipi_id;
39 	const uintptr_t buffer_base;
40 };
41 
42 /**
43  * pm_proc - struct for capturing processor related info
44  * @node_id	node-ID of the processor
45  * @pwrdn_mask	cpu-specific mask to be used for power control register
46  * @ipi		pointer to IPI channel structure
47  *		(in APU all processors share one IPI channel)
48  */
49 struct pm_proc {
50 	const uint32_t node_id;
51 	const unsigned int pwrdn_mask;
52 	const struct pm_ipi *ipi;
53 };
54 
55 const struct pm_proc *pm_get_proc(unsigned int cpuid);
56 
57 #endif /* PM_COMMON_H */
58