summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/intel/sdsi.c
AgeCommit message (Collapse)AuthorFilesLines
2023-04-17platform/x86/intel/sdsi: Change mailbox timeoutDavid E. Box1-1/+1
On some platforms, it may take up to 400ms for the ready bit to be set in a successful mailbox transaction. Set the timeout to 500ms to cover the worst case. Signed-off-by: David E. Box <david.e.box@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20230413013230.1521584-1-david.e.box@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-11-21platform/x86/intel/sdsi: Add meter certificate supportDavid E. Box1-11/+38
Add support for reading the meter certificate from Intel On Demand hardware. The meter certificate [1] is used to access the utilization metrics of enabled features in support of the Intel On Demand consumption model. Similar to the state certificate, the meter certificate is read by mailbox command. While making similar changes also use the BIN_ATTR_ADMIN_RO helper to create the 'registers' sysfs file. Link: https://github.com/intel-sandbox/debox1.intel_sdsi/blob/gnr-review/meter-certificate.rst [1] Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: https://lore.kernel.org/r/20221119002343.1281885-5-david.e.box@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-11-21platform/x86/intel/sdsi: Support different GUIDsDavid E. Box1-3/+47
Newer versions of Intel On Demand hardware may have an expanded list of registers to support new features. The register layout is identified by a unique GUID that's read during driver probe. Add support for handling different GUIDs and add support for current GUIDs [1]. Link: https://github.com/intel/intel-sdsi/blob/master/os-interface.rst [1] Signed-off-by: David E. Box <david.e.box@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20221119002343.1281885-4-david.e.box@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-11-21platform/x86/intel/sdsi: Hide attributes if hardware doesn't supportDavid E. Box1-11/+22
Provisioning capabilities are enabled by a bit set by BIOS. Read this bit and hide the provisioning attributes if the On Demand feature is not enabled. Also, remove the sdsi_enabled boolean from private and instead add a features register since this will be used for future features. Signed-off-by: David E. Box <david.e.box@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20221119002343.1281885-3-david.e.box@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-11-21platform/x86/intel/sdsi: Add Intel On Demand textDavid E. Box1-2/+2
Intel Software Defined Silicon (SDSi) is now officially known as Intel On Demand. Add On Demand to the description in the kconfig, documentation, and driver source. Signed-off-by: David E. Box <david.e.box@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20221119002343.1281885-2-david.e.box@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-04-27platform/x86/intel/sdsi: Fix bug in multi packet readsDavid E. Box1-5/+3
Fix bug that added an offset to the mailbox addr during multi-packet reads. Did not affect current ABI since it doesn't support multi-packet transactions. Fixes: 2546c6000430 ("platform/x86: Add Intel Software Defined Silicon driver") Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: https://lore.kernel.org/r/20220420155622.1763633-4-david.e.box@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-04-27platform/x86/intel/sdsi: Poll on ready bit for writesDavid E. Box1-2/+2
Due to change in firmware flow, update mailbox writes to poll on ready bit instead of run_busy bit. This change makes the polling method consistent for both writes and reads, which also uses the ready bit. Fixes: 2546c6000430 ("platform/x86: Add Intel Software Defined Silicon driver") Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: https://lore.kernel.org/r/20220420155622.1763633-3-david.e.box@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-04-27platform/x86/intel/sdsi: Handle leaky bucketDavid E. Box1-7/+25
To prevent an agent from indefinitely holding the mailbox firmware has implemented a leaky bucket algorithm. Repeated access to the mailbox may now incur a delay of up to 2.1 seconds. Add a retry loop that tries for up to 2.5 seconds to acquire the mailbox. Fixes: 2546c6000430 ("platform/x86: Add Intel Software Defined Silicon driver") Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: https://lore.kernel.org/r/20220420155622.1763633-2-david.e.box@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-02-14platform/x86: Add Intel Software Defined Silicon driverDavid E. Box1-0/+574
Intel Software Defined Silicon (SDSi) is a post manufacturing mechanism for activating additional silicon features. Features are enabled through a license activation process. The SDSi driver provides a per socket, sysfs attribute interface for applications to perform 3 main provisioning functions: 1. Provision an Authentication Key Certificate (AKC), a key written to internal NVRAM that is used to authenticate a capability specific activation payload. 2. Provision a Capability Activation Payload (CAP), a token authenticated using the AKC and applied to the CPU configuration to activate a new feature. 3. Read the SDSi State Certificate, containing the CPU configuration state. The operations perform function specific mailbox commands that forward the requests to SDSi hardware to perform authentication of the payloads and enable the silicon configuration (to be made available after power cycling). The SDSi device itself is enumerated as an auxiliary device from the intel_vsec driver and as such has a build dependency on CONFIG_INTEL_VSEC. Link: https://github.com/intel/intel-sdsi Signed-off-by: David E. Box <david.e.box@linux.intel.com> Reviewed-by: Mark Gross <markgross@kernel.org> Link: https://lore.kernel.org/r/20220212013252.1293396-2-david.e.box@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>