blob: 89626e5f2cfd423ffb5c5d1815a8867b3dfb1ab1 [file] [log] [blame]
Soren Brinkmann76fcae32016-03-06 20:16:27 -08001/*
Jolly Shah259afe52019-01-09 12:37:57 -08002 * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
Soren Brinkmann76fcae32016-03-06 20:16:27 -08003 *
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
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000012#ifndef PM_COMMON_H
13#define PM_COMMON_H
Soren Brinkmann76fcae32016-03-06 20:16:27 -080014
Soren Brinkmann76fcae32016-03-06 20:16:27 -080015#include <stdint.h>
Jolly Shah259afe52019-01-09 12:37:57 -080016#include <plat_pm_common.h>
Rajan Vajac7ee23d2018-02-14 23:10:54 -080017
Venkatesh Yadav Abbarapubfa2a2a2021-02-19 01:40:14 -070018#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
Jay Buddhabhattic3da9c02022-04-04 23:42:04 -070030#define TZ_VERSION_MAJOR 1
31#define TZ_VERSION_MINOR 0
32#define TZ_VERSION ((TZ_VERSION_MAJOR << 16) | \
33 TZ_VERSION_MINOR)
34
Soren Brinkmann76fcae32016-03-06 20:16:27 -080035/**
36 * pm_ipi - struct for capturing IPI-channel specific info
Jolly Shah36c930b2019-01-07 12:51:40 -080037 * @local_ipi_id Local IPI agent ID
38 * @remote_ipi_id Remote IPI Agent ID
Soren Brinkmann76fcae32016-03-06 20:16:27 -080039 * @buffer_base base address for payload buffer
40 */
41struct pm_ipi {
Jolly Shah36c930b2019-01-07 12:51:40 -080042 const uint32_t local_ipi_id;
43 const uint32_t remote_ipi_id;
Soren Brinkmann76fcae32016-03-06 20:16:27 -080044 const uintptr_t buffer_base;
45};
46
47/**
48 * pm_proc - struct for capturing processor related info
49 * @node_id node-ID of the processor
50 * @pwrdn_mask cpu-specific mask to be used for power control register
51 * @ipi pointer to IPI channel structure
52 * (in APU all processors share one IPI channel)
53 */
54struct pm_proc {
Jolly Shah259afe52019-01-09 12:37:57 -080055 const uint32_t node_id;
Venkatesh Yadav Abbarapue7c45382022-05-19 14:49:49 +053056 const uint32_t pwrdn_mask;
Soren Brinkmann76fcae32016-03-06 20:16:27 -080057 const struct pm_ipi *ipi;
58};
59
Venkatesh Yadav Abbarapue7c45382022-05-19 14:49:49 +053060const struct pm_proc *pm_get_proc(uint32_t cpuid);
Soren Brinkmann76fcae32016-03-06 20:16:27 -080061
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000062#endif /* PM_COMMON_H */