Varun Wadekar | 91535cd | 2020-03-12 14:32:44 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2020, NVIDIA Corporation. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <arch.h> |
| 8 | #include <assert.h> |
| 9 | #include <stddef.h> |
| 10 | |
| 11 | #include <plat_topology.h> |
| 12 | #include <platform_def.h> |
| 13 | #include <tftf_lib.h> |
| 14 | |
| 15 | static const struct { |
| 16 | unsigned cluster_id; |
| 17 | unsigned cpu_id; |
| 18 | } tegra194_cores[] = { |
| 19 | { 0, 0 }, |
| 20 | { 0, 1 }, |
| 21 | { 1, 0 }, |
| 22 | { 1, 1 }, |
| 23 | { 2, 0 }, |
| 24 | { 2, 1 }, |
| 25 | { 3, 0 }, |
| 26 | { 3, 1 } |
| 27 | }; |
| 28 | |
| 29 | /* |
| 30 | * The Tegra194 power domain tree descriptor. Tegra194 implements a system |
| 31 | * power domain at the level 2. The first entry in the power domain descriptor |
| 32 | * specifies the number of power domains at the highest power level. |
| 33 | */ |
| 34 | static const unsigned char tegra194_power_domain_tree_desc[] = { |
| 35 | /* Number of root nodes */ |
| 36 | PLATFORM_SYSTEM_COUNT, |
| 37 | /* Number of children of root node */ |
| 38 | PLATFORM_CLUSTER_COUNT, |
| 39 | /* Number of children for the first cluster */ |
| 40 | PLATFORM_CORES_PER_CLUSTER, |
| 41 | /* Number of children for the second cluster */ |
| 42 | PLATFORM_CORES_PER_CLUSTER, |
| 43 | /* Number of children for the third cluster */ |
| 44 | PLATFORM_CORES_PER_CLUSTER, |
| 45 | /* Number of children for the fourth cluster */ |
| 46 | PLATFORM_CORES_PER_CLUSTER |
| 47 | }; |
| 48 | |
| 49 | const unsigned char *tftf_plat_get_pwr_domain_tree_desc(void) |
| 50 | { |
| 51 | return tegra194_power_domain_tree_desc; |
| 52 | } |
| 53 | |
| 54 | uint64_t tftf_plat_get_mpidr(unsigned int core_pos) |
| 55 | { |
| 56 | assert(core_pos < PLATFORM_CORE_COUNT); |
| 57 | |
| 58 | return make_mpid(tegra194_cores[core_pos].cluster_id, |
| 59 | tegra194_cores[core_pos].cpu_id); |
| 60 | } |