mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-08-22 00:42:01 +02:00

Each TPMI power domain includes a group of CPUs. Several power management settings in this case applicable to a group of CPUs. There can be several power domains in a CPU package. So, provide interfaces for: - Get power domain id for a Linux CPU - Get mask of Linux CPUs in a power domain Hardware Punit uses different CPU numbering, which is not based on APIC (Advanced Programmable Interrupt Controller) CPU numbering. The Linux CPU numbering is based on APIC CPU numbering. Some PM features like Intel Speed Select, the CPU core mask provided by the hardware is based on the Punit CPU numbering. To use the core mask, this mask needs to be converted to a Linux CPUs mask. So, provide interfaces for: - Convert to a Linux CPU number from a Punit CPU number - Convert to a Punit CPU number from a Linux CPU number On each CPU online, MSR 0x54 is used to read the mapping and stores in a per cpu array. Create a hash for faster searching of a Linux CPU number from a Punit CPU number. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> [tero.kristo: minor updates] Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com> Link: https://lore.kernel.org/r/20240528073457.497816-1-tero.kristo@linux.intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
19 lines
452 B
C
19 lines
452 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Mapping of TPMI power domain and CPUs
|
|
*
|
|
* Copyright (c) 2024, Intel Corporation.
|
|
*/
|
|
|
|
#ifndef _TPMI_POWER_DOMAINS_H_
|
|
#define _TPMI_POWER_DOMAINS_H_
|
|
|
|
#include <linux/cpumask.h>
|
|
|
|
int tpmi_get_linux_cpu_number(int package_id, int die_id, int punit_core_id);
|
|
int tpmi_get_punit_core_number(int cpu_no);
|
|
int tpmi_get_power_domain_id(int cpu_no);
|
|
cpumask_t *tpmi_get_power_domain_mask(int cpu_no);
|
|
|
|
#endif
|