Commit Graph

18 Commits

Author SHA1 Message Date
David Arcari c748a537f7
platform/x86/amd/pmf: Add support to get sps default APTS index values
JIRA: https://issues.redhat.com/browse/RHEL-24997

commit 3eecb434d7f21be5fc79604b67954be30d7e39cb
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Wed Mar 6 17:14:14 2024 +0530

    platform/x86/amd/pmf: Add support to get sps default APTS index values

    During the driver probe, the default cache values for the static slider
    would be obtained by evaluating the APTS method. Add support to use
    these values as the thermal settings to be updated on the system based
    on the changing platform-profiles.

    Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
    Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20240306114415.3267603-7-Shyam-sundar.S-k@amd.com
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-10 10:31:56 -03:00
David Arcari 0f97c7d26a
platform/x86/amd/pmf: Add support to get APTS index numbers for static slider
JIRA: https://issues.redhat.com/browse/RHEL-24997

commit 48d38f569261bc6faa2b099be7a4029e538e095f
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Wed Mar 6 17:14:13 2024 +0530

    platform/x86/amd/pmf: Add support to get APTS index numbers for static slider

    APMF spec has a newer section called the APTS (AMD Performance and
    Thermal State) information, where each slider/power mode is associated
    with an index number.

    Add support to get these indices for the Static Slider.

    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
    Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20240306114415.3267603-6-Shyam-sundar.S-k@amd.com
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-10 10:31:56 -03:00
David Arcari aff56a28f7
platform/x86/amd/pmf: Add support to notify sbios heart beat event
JIRA: https://issues.redhat.com/browse/RHEL-24997
Conflicts: applied changes from merge 1c0a50de025d - in the end the
	   code compares favorably to upstream

commit 6262938eef28254f49c34af48e18cb543b0db5cd
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Wed Mar 6 17:14:12 2024 +0530

    platform/x86/amd/pmf: Add support to notify sbios heart beat event

    Add support for newer revision of the heart beat notify events.
    This event is used to notify to the OEM BIOS on driver
    load/unload/suspend/resume scenarios.

    If OEM BIOS does not receive the heart beat event from PMF driver, OEM
    BIOS shall conclude that PMF driver is no more active and BIOS will
    update to the legacy system power thermals.

    Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
    Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
    Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20240306114415.3267603-5-Shyam-sundar.S-k@amd.com
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-10 10:31:56 -03:00
David Arcari 9c272cef3d
platform/x86/amd/pmf: Add support to get sbios requests in PMF driver
JIRA: https://issues.redhat.com/browse/RHEL-24997

commit 5fdc8b82aab4c8430bbd8d26a3c3898aaff90a40
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Wed Mar 6 17:14:11 2024 +0530

    platform/x86/amd/pmf: Add support to get sbios requests in PMF driver

    Update the APMF function index 2 for family 1Ah, that gets the
    information of SBIOS requests (like the pending requests from BIOS,
    custom notifications, updation of power limits etc).

    Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
    Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20240306114415.3267603-4-Shyam-sundar.S-k@amd.com
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-10 10:31:56 -03:00
David Arcari 7ea69fdba1
platform/x86/amd/pmf: Differentiate PMF ACPI versions
JIRA: https://issues.redhat.com/browse/RHEL-24997

commit a33e9e106601b5271561e7d79a3d3c4e7e84f07f
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Wed Mar 6 17:14:09 2024 +0530

    platform/x86/amd/pmf: Differentiate PMF ACPI versions

    For family 1AH, certain PMF features have been enhanced - leading to a
    newer APMF (AMD PMF) spec (BIOS and PMF driver interface) called v2.

    This information would be fed into the if_version field of the
    verify_interface method of the APMF call from the BIOS.

    Use this information to store the version number to differentiate
    between v1 or v2 and also store the information into the PMF private
    data structure, as this information would be required for further code
    branching to support the latest silicon.

    Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
    Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
    Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20240306114415.3267603-2-Shyam-sundar.S-k@amd.com
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-10 10:31:55 -03:00
David Arcari 19983e6cd3
platform/x86/amd/pmf: Return a status code only as a constant in two functions
JIRA: https://issues.redhat.com/browse/RHEL-24997

commit 4527898e300ce65e9ac5d5a05e086a07e212753c
Author: Markus Elfring <elfring@users.sourceforge.net>
Date:   Thu Dec 28 10:48:16 2023 +0100

    platform/x86/amd/pmf: Return a status code only as a constant in two functions

    Return a status code without storing it in an intermediate variable.

    Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
    Link: https://lore.kernel.org/r/0d0c4876-37d7-4bee-912e-56324495454f@web.de
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-10 10:31:50 -03:00
David Arcari 8b9a31cbdf
platform/x86/amd/pmf: Return directly after a failed apmf_if_call() in apmf_sbios_heartbeat_notify()
JIRA: https://issues.redhat.com/browse/RHEL-24997

commit 9dd3f1ef40d01fdfe69c3ada28b1f201a7207f6e
Author: Markus Elfring <elfring@users.sourceforge.net>
Date:   Thu Dec 28 09:30:54 2023 +0100

    platform/x86/amd/pmf: Return directly after a failed apmf_if_call() in apmf_sbios_heartbeat_notify()

    The kfree() function was called in one case by
    the apmf_sbios_heartbeat_notify() function during error handling
    even if the passed variable contained a null pointer.
    This issue was detected by using the Coccinelle software.

    * Thus return directly after a call of the function “apmf_if_call” failed
      at the beginning.

    * Delete the label “out” which became unnecessary with this refactoring.

    Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
    Link: https://lore.kernel.org/r/362ee824-fc53-4e19-9529-8b621657635b@web.de
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-10 10:31:50 -03:00
David Arcari 2caaed406e
platform/x86/amd/pmf: Add support for PMF Policy Binary
JIRA: https://issues.redhat.com/browse/RHEL-24997

commit 7c45534afa4435c9fceeeb8ca33c0fdc269c2240
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Tue Dec 12 07:16:57 2023 +0530

    platform/x86/amd/pmf: Add support for PMF Policy Binary

    PMF Policy binary is a encrypted and signed binary that will be part
    of the BIOS. PMF driver via the ACPI interface checks the existence
    of Smart PC bit. If the advertised bit is found, PMF driver walks
    the acpi namespace to find out the policy binary size and the address
    which has to be passed to the TA during the TA init sequence.

    The policy binary is comprised of inputs (or the events) and outputs
    (or the actions). With the PMF ecosystem, OEMs generate the policy
    binary (or could be multiple binaries) that contains a supported set
    of inputs and outputs which could be specifically carved out for each
    usage segment (or for each user also) that could influence the system
    behavior either by enriching the user experience or/and boost/throttle
    power limits.

    Once the TA init command succeeds, the PMF driver sends the changing
    events in the current environment to the TA for a constant sampling
    frequency time (the event here could be a lid close or open) and
    if the policy binary has corresponding action built within it, the
    TA sends the action for it in the subsequent enact command.

    If the inputs sent to the TA has no output defined in the policy
    binary generated by OEMs, there will be no action to be performed
    by the PMF driver.

    Example policies:

    1) if slider is performance ; set the SPL to 40W
    Here PMF driver registers with the platform profile interface and
    when the slider position is changed, PMF driver lets the TA know
    about this. TA sends back an action to update the Sustained
    Power Limit (SPL). PMF driver updates this limit via the PMFW mailbox.

    2) if user_away ; then lock the system
    Here PMF driver hooks to the AMD SFH driver to know the user presence
    and send the inputs to TA and if the condition is met, the TA sends
    the action of locking the system. PMF driver generates a uevent and
    based on the udev rule in the userland the system gets locked with
    systemctl.

    The intent here is to provide the OEM's to make a policy to lock the
    system when the user is away ; but the userland can make a choice to
    ignore it.

    The OEMs will have an utility to create numerous such policies and
    the policies shall be reviewed by AMD before signing and encrypting
    them. Policies are shared between operating systems to have seemless user
    experience.

    Since all this action has to happen via the "amdtee" driver, currently
    there is no caller for it in the kernel which can load the amdtee driver.
    Without amdtee driver loading onto the system the "tee" calls shall fail
    from the PMF driver. Hence an explicit MODULE_SOFTDEP has been added
    to address this.

    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20231212014705.2017474-5-Shyam-sundar.S-k@amd.com
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-06-10 10:31:48 -03:00
David Arcari 4ec4881f8f platform/x86/amd/pmf: Notify OS power slider update
JIRA: https://issues.redhat.com/browse/RHEL-2037

commit 33c9ab5b493a0e922b06c12fed4fdcb862212cda
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Fri Jul 14 20:14:35 2023 +0530

    platform/x86/amd/pmf: Notify OS power slider update

    APMF fn8 can notify EC about the OS slider position change. Add this
    capability to the PMF driver so that it can call the APMF fn8 based on
    the changes in the Platform profile events.

    Co-developed-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20230714144435.1239776-2-Shyam-sundar.S-k@amd.com
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-10-18 13:05:41 -04:00
David Arcari 1813590a50 platform/x86/amd/pmf: reduce verbosity of apmf_get_system_params
JIRA: https://issues.redhat.com/browse/RHEL-2037

commit 839e90e75e695b3d9ee17f5a2811e7ee5aea8d4a
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Fri Jul 14 20:14:34 2023 +0530

    platform/x86/amd/pmf: reduce verbosity of apmf_get_system_params

    apmf_get_system_params() failure is not a critical event, reduce its
    verbosity from dev_err to dev_dbg.

    Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20230714144435.1239776-1-Shyam-sundar.S-k@amd.com
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-10-18 13:05:41 -04:00
David Arcari 51437140c7 platform/x86/amd/pmf: install notify handler after acpi init
JIRA: https://issues.redhat.com/browse/RHEL-2037

commit 22ee98cb696e95b05a188756d479d382d93559ef
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Fri Sep 23 18:47:24 2022 +0530

    platform/x86/amd/pmf: install notify handler after acpi init

    It is observed that when thinkpad_acpi driver loads before amd-pmf
    driver, thinkpad_acpi driver sends the AMT "on" event and the request
    immediately will be part of the PMF BIOS "pending requests".

    With the current amd-pmf code, as soon as the amd-pmf driver gets
    probed, it calls apmf_acpi_init() where the notify handler will be
    installed. Handler callback would call amd_pmf_handle_amt() where the
    amd_pmf_set_automode() shall update the auto-mode thermals.
    In this case, the auto-mode config_store shall have "zeros", as the
    auto mode init gets called during the later stage.

    To fix this, change the order of the acpi notifer install and call it
    after the auto mode initialization is done.

    Fixes: 7d77dcc83ada ("platform/x86/amd/pmf: Handle AMT and CQL events for Auto mode")
    Cc: Mario Limonciello <mario.limonciello@amd.com>
    Cc: Mark Pearson <markpearson@lenovo.com>
    Cc: Patil Rajesh Reddy <Patil.Reddy@amd.com>
    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
    Link: https://lore.kernel.org/r/20220923131724.1812685-1-Shyam-sundar.S-k@amd.com
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-10-18 13:05:39 -04:00
David Arcari 8dd8eaa661 platform/x86/amd/pmf: Add support for CnQF
JIRA: https://issues.redhat.com/browse/RHEL-2037

commit 1738061c9ec854db2db76be8bb968f550d9bdddc
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Thu Sep 22 18:42:00 2022 +0530

    platform/x86/amd/pmf: Add support for CnQF

    CnQF (a.k.a Cool and Quiet Framework) extends the static slider concept.
    PMF dynamically manages system power limits and fan policy based on system
    power trends which is representative of workload trend.

    Static slider and CnQF controls are mutually exclusive for system power
    budget adjustments. CnQF supports configurable number of modes which can
    be unique for AC and DC. Every mode is representative of a system state
    characterized by unique steady state and boost behavior.

    OEMs can configure the different modes/system states and how the
    transition to a mode happens. Whether to have CnQF manage system power
    budget dynamically in AC or DC or both is also configurable. Mode changes
    due to CnQF don't result in slider position change.

    The default OEM values are obtained after evaluating the PMF ACPI function
    idx 11 & 12 for AC and DC respectively. Whether to turn ON/OFF by default
    is guided by a "flag" passed by the OEM BIOS.

    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20220922131202.56529-2-Shyam-sundar.S-k@amd.com
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-10-18 13:05:39 -04:00
David Arcari 1aaf556c9b platform/x86/amd/pmf: Handle AMT and CQL events for Auto mode
JIRA: https://issues.redhat.com/browse/RHEL-2037

commit 7d77dcc83adaffacbb9000924a212566170c1257
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Tue Aug 2 20:41:47 2022 +0530

    platform/x86/amd/pmf: Handle AMT and CQL events for Auto mode

    The transition to auto-mode happens when the PMF driver receives
    AMT (Auto Mode transition) event. transition logic will reside in the
    PMF driver but the events would come from other supported drivers[1].

    The thermal parameters would vary between when a performance "on-lap" mode
    is detected and versus when not. The CQL event would get triggered from
    other drivers, so that PMF driver would adjust the system thermal config
    based on the ACPI inputs.

    OEMs can control whether or not to enable AMT or CQL via other supported
    drivers[1] but the actual transition logic resides in the AMD PMF driver.
    When an AMT event is received the automatic mode transition RAPL algorithm
    will run. When a CQL event is received an performance "on-lap" mode will
    be enabled and thermal parameters will be adjusted accordingly.

    [1]
    Link: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?h=review-hans&id=755b249250df1b612d982f3b702c831b26ecdf73

    Cc: Mario Limonciello <mario.limonciello@amd.com>
    Cc: Mark Pearson <markpearson@lenovo.com>
    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20220802151149.2123699-10-Shyam-sundar.S-k@amd.com
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-10-18 13:05:39 -04:00
David Arcari 92d0a9585d platform/x86/amd/pmf: Add support for Auto mode feature
JIRA: https://issues.redhat.com/browse/RHEL-2037

commit 3f5571d9952473c183762b801c61c42b9dbe1903
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Tue Aug 2 20:41:46 2022 +0530

    platform/x86/amd/pmf: Add support for Auto mode feature

    This feature has 3 modes quiet, balanced, performance

    The objective of this feature is to track the moving average of system
    power over the time period specified and switch to the subsequent mode.

    In order to do this, PMF driver will get the moving average of APU power
    from PMFW and power threshold, time constants, system config parameters
    from OEM inputs.

    System power as read by PMF driver from PMFW is the filtered value over
    the sampling window. Every sampling window, moving average of system power
    is computed. At the end of the monitoring window, the moving average is
    compared against the threshold for mode switch for decision making.

    With AMD managing the system config limits, any mode switch within
    auto-mode will result in limits of fPPT/sPPT/STAPM or STT being scaled
    down.

    When "auto mode" is enabled, the static slider control remains out of
    the PMF driver, so the platform_profile registration would not
    happen in PMF driver.

    The transition to auto-mode only happens when the APMF fn5 is enabled
    in BIOS, platform_profile set to "balanced" and a AMT
    (Auto Mode transition) is received.

    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20220802151149.2123699-9-Shyam-sundar.S-k@amd.com
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-10-18 13:05:39 -04:00
David Arcari 62b3d8a56c platform/x86/amd/pmf: Add fan control support
JIRA: https://issues.redhat.com/browse/RHEL-2037

commit a3281ec556071bda86964b6cf3ed42ec9f924cd8
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Tue Aug 2 20:41:44 2022 +0530

    platform/x86/amd/pmf: Add fan control support

    PMF has a generic interface defined via PMF ACPI fn9 for influencing fan
    policy during mode switch.

    PMF ACPI fn9 will normally be invoked when AMDPMF needs to change the fan
    table index for the EC. When AMDPMF is loaded this function will be invoked
    to change fan speed. OEM can also choose to report the actual fan table
    index and fan RPM to PMF through OEM structure.

    This information will be communicated by PMF driver to customer BIOS.

    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20220802151149.2123699-7-Shyam-sundar.S-k@amd.com
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-10-18 13:05:39 -04:00
David Arcari 81ae3883c0 platform/x86/amd/pmf: Add heartbeat signal support
JIRA: https://issues.redhat.com/browse/RHEL-2037

commit b9ab888b4eccfd9b90835d6d95459aec7382564d
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Tue Aug 2 20:41:43 2022 +0530

    platform/x86/amd/pmf: Add heartbeat signal support

    PMF driver can send periodic heartbeat signals to OEM BIOS. When BIOS does
    not receive the signal after a period of time, it can infer that AMDPMF
    has hung or failed to load.

    In this situation, BIOS can fallback to legacy operations. OEM can modify
    the time interval of the signal or completely disable signals through
    ACPI Method.

    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20220802151149.2123699-6-Shyam-sundar.S-k@amd.com
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-10-18 13:05:39 -04:00
David Arcari 8357bb1ae7 platform/x86/amd/pmf: Add support SPS PMF feature
JIRA: https://issues.redhat.com/browse/RHEL-2037

commit 4c71ae4144746eb467f6aaab0ff83e306f11d6af
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Tue Aug 2 20:41:41 2022 +0530

    platform/x86/amd/pmf: Add support SPS PMF feature

    SPS (a.k.a. Static Power Slider) gives a feel of Windows performance
    power slider for the Linux users, where the user selects a certain
    mode (like "balanced", "low-power" or "performance") and the thermals
    associated with each selected mode gets applied from the silicon
    side via the mailboxes defined through PMFW.

    PMF driver hooks to platform_profile by reading the PMF ACPI fn9 to
    see if the support is being advertised by ACPI interface.

    If supported, the PMF driver reacts to platform_profile selection choices
    made by the user and adjust the system thermal behavior.

    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20220802151149.2123699-4-Shyam-sundar.S-k@amd.com
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-10-18 13:05:38 -04:00
David Arcari 8c7fa22bd0 platform/x86/amd/pmf: Add support for PMF APCI layer
JIRA: https://issues.redhat.com/browse/RHEL-2037

commit 5eb315ebf47b605cb9364da40a9363ad4065014b
Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Date:   Tue Aug 2 20:41:40 2022 +0530

    platform/x86/amd/pmf: Add support for PMF APCI layer

    PMF driver implements the ACPI methods as defined by AMD for PMF Support.
    The ACPI layer acts as a glue that helps in providing the infrastructure
    for OEMs customization.

    OEMs can refer to PMF support documentation to decide on the list of
    functions to be supported on their specific platform model.

    AMD mandates that PMF ACPI fn0 and fn1 to be implemented which
    provides the set of functions, params and the notifications that
    would be sent to PMF driver so that PMF driver can adapt and
    react.

    Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Link: https://lore.kernel.org/r/20220802151149.2123699-3-Shyam-sundar.S-k@amd.com
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-10-18 13:05:38 -04:00