Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 1 | /* |
Michal Simek | 2a47faa | 2023-04-14 08:43:51 +0200 | [diff] [blame] | 2 | * Copyright (c) 2013-2018, Arm Limited and Contributors. All rights reserved. |
Prasad Kummari | 7d0623a | 2023-06-09 14:32:00 +0530 | [diff] [blame] | 3 | * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 4 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 5 | * SPDX-License-Identifier: BSD-3-Clause |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * Contains definitions of commonly used macros and data types needed |
| 10 | * for PU Power Management. This file should be common for all PU's. |
| 11 | */ |
| 12 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 13 | #ifndef PM_COMMON_H |
| 14 | #define PM_COMMON_H |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 15 | |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 16 | #include <stdint.h> |
Jolly Shah | 259afe5 | 2019-01-09 12:37:57 -0800 | [diff] [blame] | 17 | #include <plat_pm_common.h> |
Rajan Vaja | c7ee23d | 2018-02-14 23:10:54 -0800 | [diff] [blame] | 18 | |
Venkatesh Yadav Abbarapu | bfa2a2a | 2021-02-19 01:40:14 -0700 | [diff] [blame] | 19 | #if IPI_CRC_CHECK |
| 20 | #define PAYLOAD_ARG_CNT 8U |
| 21 | #define IPI_W0_TO_W6_SIZE 28U |
| 22 | #define PAYLOAD_CRC_POS 7U |
| 23 | #define CRC_INIT_VALUE 0x4F4EU |
| 24 | #define CRC_ORDER 16U |
| 25 | #define CRC_POLYNOM 0x8005U |
| 26 | #else |
| 27 | #define PAYLOAD_ARG_CNT 6U |
| 28 | #endif |
| 29 | #define PAYLOAD_ARG_SIZE 4U /* size in bytes */ |
| 30 | |
Jay Buddhabhatti | c3da9c0 | 2022-04-04 23:42:04 -0700 | [diff] [blame] | 31 | #define TZ_VERSION_MAJOR 1 |
| 32 | #define TZ_VERSION_MINOR 0 |
| 33 | #define TZ_VERSION ((TZ_VERSION_MAJOR << 16) | \ |
| 34 | TZ_VERSION_MINOR) |
| 35 | |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 36 | /** |
Prasad Kummari | 7d0623a | 2023-06-09 14:32:00 +0530 | [diff] [blame] | 37 | * struct pm_ipi - struct for capturing IPI-channel specific info. |
| 38 | * @local_ipi_id: Local IPI agent ID. |
| 39 | * @remote_ipi_id: Remote IPI Agent ID. |
| 40 | * @buffer_base: base address for payload buffer. |
| 41 | * |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 42 | */ |
| 43 | struct pm_ipi { |
Jolly Shah | 36c930b | 2019-01-07 12:51:40 -0800 | [diff] [blame] | 44 | const uint32_t local_ipi_id; |
| 45 | const uint32_t remote_ipi_id; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 46 | const uintptr_t buffer_base; |
| 47 | }; |
| 48 | |
| 49 | /** |
Prasad Kummari | 7d0623a | 2023-06-09 14:32:00 +0530 | [diff] [blame] | 50 | * struct pm_proc - struct for capturing processor related info. |
| 51 | * @node_id: node-ID of the processor. |
| 52 | * @pwrdn_mask: cpu-specific mask to be used for power control register. |
| 53 | * @ipi: pointer to IPI channel structure. |
| 54 | * (in APU all processors share one IPI channel) |
| 55 | * |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 56 | */ |
| 57 | struct pm_proc { |
Jolly Shah | 259afe5 | 2019-01-09 12:37:57 -0800 | [diff] [blame] | 58 | const uint32_t node_id; |
Venkatesh Yadav Abbarapu | e7c4538 | 2022-05-19 14:49:49 +0530 | [diff] [blame] | 59 | const uint32_t pwrdn_mask; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 60 | const struct pm_ipi *ipi; |
| 61 | }; |
| 62 | |
Venkatesh Yadav Abbarapu | e7c4538 | 2022-05-19 14:49:49 +0530 | [diff] [blame] | 63 | const struct pm_proc *pm_get_proc(uint32_t cpuid); |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 64 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 65 | #endif /* PM_COMMON_H */ |