xref: /rk3399_ARM-atf/plat/xilinx/common/include/pm_common.h (revision d77583549f89af29b3582867fcf3eabdbc41bb84)
165c80d60SJolly Shah /*
265c80d60SJolly Shah  * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
365c80d60SJolly Shah  *
465c80d60SJolly Shah  * SPDX-License-Identifier: BSD-3-Clause
565c80d60SJolly Shah  */
665c80d60SJolly Shah 
765c80d60SJolly Shah /*
865c80d60SJolly Shah  * Contains definitions of commonly used macros and data types needed
965c80d60SJolly Shah  * for PU Power Management. This file should be common for all PU's.
1065c80d60SJolly Shah  */
1165c80d60SJolly Shah 
1265c80d60SJolly Shah #ifndef PM_COMMON_H
1365c80d60SJolly Shah #define PM_COMMON_H
1465c80d60SJolly Shah 
1565c80d60SJolly Shah #include <stdint.h>
1665c80d60SJolly Shah #include <plat_pm_common.h>
1765c80d60SJolly Shah 
18*d7758354SVenkatesh Yadav Abbarapu #if IPI_CRC_CHECK
19*d7758354SVenkatesh Yadav Abbarapu #define PAYLOAD_ARG_CNT         8U
20*d7758354SVenkatesh Yadav Abbarapu #define IPI_W0_TO_W6_SIZE       28U
21*d7758354SVenkatesh Yadav Abbarapu #define PAYLOAD_CRC_POS         7U
22*d7758354SVenkatesh Yadav Abbarapu #define CRC_INIT_VALUE          0x4F4EU
23*d7758354SVenkatesh Yadav Abbarapu #define CRC_ORDER               16U
24*d7758354SVenkatesh Yadav Abbarapu #define CRC_POLYNOM             0x8005U
25*d7758354SVenkatesh Yadav Abbarapu #else
26*d7758354SVenkatesh Yadav Abbarapu #define PAYLOAD_ARG_CNT         6U
27*d7758354SVenkatesh Yadav Abbarapu #endif
28*d7758354SVenkatesh Yadav Abbarapu #define PAYLOAD_ARG_SIZE	4U	/* size in bytes */
29*d7758354SVenkatesh Yadav Abbarapu 
3065c80d60SJolly Shah /**
3165c80d60SJolly Shah  * pm_ipi - struct for capturing IPI-channel specific info
3265c80d60SJolly Shah  * @local_ipi_id	Local IPI agent ID
3365c80d60SJolly Shah  * @remote_ipi_id	Remote IPI Agent ID
3465c80d60SJolly Shah  * @buffer_base	base address for payload buffer
3565c80d60SJolly Shah  */
3665c80d60SJolly Shah struct pm_ipi {
3765c80d60SJolly Shah 	const uint32_t local_ipi_id;
3865c80d60SJolly Shah 	const uint32_t remote_ipi_id;
3965c80d60SJolly Shah 	const uintptr_t buffer_base;
4065c80d60SJolly Shah };
4165c80d60SJolly Shah 
4265c80d60SJolly Shah /**
4365c80d60SJolly Shah  * pm_proc - struct for capturing processor related info
4465c80d60SJolly Shah  * @node_id	node-ID of the processor
4565c80d60SJolly Shah  * @pwrdn_mask	cpu-specific mask to be used for power control register
4665c80d60SJolly Shah  * @ipi		pointer to IPI channel structure
4765c80d60SJolly Shah  *		(in APU all processors share one IPI channel)
4865c80d60SJolly Shah  */
4965c80d60SJolly Shah struct pm_proc {
5065c80d60SJolly Shah 	const uint32_t node_id;
5165c80d60SJolly Shah 	const unsigned int pwrdn_mask;
5265c80d60SJolly Shah 	const struct pm_ipi *ipi;
5365c80d60SJolly Shah };
5465c80d60SJolly Shah 
5565c80d60SJolly Shah const struct pm_proc *pm_get_proc(unsigned int cpuid);
5665c80d60SJolly Shah 
5765c80d60SJolly Shah #endif /* PM_COMMON_H */
58