platform/x86: ISST: Enumerate TPMI SST and create framework
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Wed, 8 Mar 2023 07:06:36 +0000 (23:06 -0800)
committerHans de Goede <hdegoede@redhat.com>
Thu, 16 Mar 2023 14:18:02 +0000 (15:18 +0100)
commitd805456c712f93ba8a012430f2a93bec133b6ff4
treea9ba6f65c68810805f977b0daa4ee87a862849ee
parente6d3418130cdf718eff72db9a05d7262ebb49cff
platform/x86: ISST: Enumerate TPMI SST and create framework

Enumerate TPMI SST driver and create basic framework to add more
features.

The basic user space interface is still same as the legacy using
/dev/isst_interface. Users of "intel-speed-select" utility should
be able to use same commands as prior gens without being aware
of new underlying hardware interface.

TPMI SST driver enumerates on device "intel_vsec.tpmi-sst". Since there
can be multiple instances and there is one common SST core, split
implementation into two parts: A common core part and an enumeration
part. The enumeration driver is loaded for each device instance and
register with the TPMI SST core driver.

On very first enumeration the TPMI SST core driver register with SST
core driver to get IOCTL callbacks. The api_version is incremented
for IOCTL ISST_IF_GET_PLATFORM_INFO, so that user space can issue
new IOCTLs.

Each TPMI package contains multiple power domains. Each power domain
has its own set of SST controls. For each domain map the MMIO memory
and update per domain struct tpmi_per_power_domain_info. This information
will be used to implement other SST interfaces.

Implement first IOCTL commands to get number of TPMI SST instances
and instance mask as some of the power domains may not have any
SST controls.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Pragya Tanwar <pragya.tanwar@intel.com>
Link: https://lore.kernel.org/r/20230308070642.1727167-3-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/intel/speed_select_if/Kconfig
drivers/platform/x86/intel/speed_select_if/Makefile
drivers/platform/x86/intel/speed_select_if/isst_tpmi.c [new file with mode: 0644]
drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c [new file with mode: 0644]
drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.h [new file with mode: 0644]
include/uapi/linux/isst_if.h