Amit Nagal | 7c9f2fc | 2024-02-08 16:35:08 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2022-2024, Advanced Micro Devices, Inc. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <arch.h> |
| 8 | #include <assert.h> |
| 9 | #include <mmio.h> |
| 10 | #include <plat_topology.h> |
| 11 | #include <platform_def.h> |
| 12 | #include <stddef.h> |
| 13 | #include <tftf_lib.h> |
| 14 | |
| 15 | static const struct { |
| 16 | unsigned int cluster_id; |
| 17 | unsigned int cpu_id; |
| 18 | } zynqmp_cores[PLATFORM_CORE_COUNT] = { |
| 19 | { 0, 0 }, |
| 20 | { 0, 1 }, |
| 21 | { 0, 2 }, |
| 22 | { 0, 3 } |
| 23 | }; |
| 24 | |
| 25 | static const unsigned char zynqmp_power_domain_tree_desc[] = { |
| 26 | /* Number of root nodes */ |
| 27 | PLATFORM_SYSTEM_COUNT, |
| 28 | /* Number of children of root node */ |
| 29 | PLATFORM_CLUSTER_COUNT, |
| 30 | /* Number of children for the cluster */ |
| 31 | PLATFORM_CORES_PER_CLUSTER |
| 32 | }; |
| 33 | |
| 34 | const unsigned char *tftf_plat_get_pwr_domain_tree_desc(void) |
| 35 | { |
| 36 | return zynqmp_power_domain_tree_desc; |
| 37 | } |
| 38 | |
| 39 | uint64_t tftf_plat_get_mpidr(unsigned int core_pos) |
| 40 | { |
| 41 | assert(core_pos < PLATFORM_CORE_COUNT); |
| 42 | |
| 43 | return make_mpid(zynqmp_cores[core_pos].cluster_id, |
| 44 | zynqmp_cores[core_pos].cpu_id); |
| 45 | } |