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