xref: /rk3399_ARM-atf/plat/arm/css/common/css_topology.c (revision 82cb2c1ad9897473743f08437d0a3995bed561b9)
138dce70fSSoby Mathew /*
2d8d6cf24SSummer Qin  * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
338dce70fSSoby Mathew  *
4*82cb2c1aSdp-arm  * SPDX-License-Identifier: BSD-3-Clause
538dce70fSSoby Mathew  */
638dce70fSSoby Mathew 
738dce70fSSoby Mathew #include <plat_arm.h>
838dce70fSSoby Mathew 
9d8d6cf24SSummer Qin #if ARM_PLAT_MT
10d8d6cf24SSummer Qin #pragma weak plat_arm_get_cpu_pe_count
11d8d6cf24SSummer Qin #endif
12d8d6cf24SSummer Qin 
1338dce70fSSoby Mathew /******************************************************************************
1438dce70fSSoby Mathew  * This function implements a part of the critical interface between the psci
1538dce70fSSoby Mathew  * generic layer and the platform that allows the former to query the platform
1638dce70fSSoby Mathew  * to convert an MPIDR to a unique linear index. An error code (-1) is
1738dce70fSSoby Mathew  * returned in case the MPIDR is invalid.
1838dce70fSSoby Mathew  *****************************************************************************/
1938dce70fSSoby Mathew int plat_core_pos_by_mpidr(u_register_t mpidr)
2038dce70fSSoby Mathew {
2138dce70fSSoby Mathew 	if (arm_check_mpidr(mpidr) == 0)
2238dce70fSSoby Mathew 		return plat_arm_calc_core_pos(mpidr);
2338dce70fSSoby Mathew 
2438dce70fSSoby Mathew 	return -1;
2538dce70fSSoby Mathew }
26d8d6cf24SSummer Qin 
27d8d6cf24SSummer Qin #if ARM_PLAT_MT
28d8d6cf24SSummer Qin /******************************************************************************
29d8d6cf24SSummer Qin  * This function returns the PE count within the physical cpu corresponding to
30d8d6cf24SSummer Qin  * `mpidr`. Now one cpu only have one thread, so just return 1.
31d8d6cf24SSummer Qin  *****************************************************************************/
32d8d6cf24SSummer Qin unsigned int plat_arm_get_cpu_pe_count(u_register_t mpidr)
33d8d6cf24SSummer Qin {
34d8d6cf24SSummer Qin 	return 1;
35d8d6cf24SSummer Qin }
36d8d6cf24SSummer Qin #endif /* ARM_PLAT_MT */
37