blob: f8262a8c3994f2f0c10da51257d86c3b7e84cf07 [file] [log] [blame]
Amit Nagal7c9f2fc2024-02-08 16:35:08 +05301/*
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
15static 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
25static 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
34const unsigned char *tftf_plat_get_pwr_domain_tree_desc(void)
35{
36 return zynqmp_power_domain_tree_desc;
37}
38
39uint64_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}