| 641b41a7 | 23-Jul-2026 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Add 1AH_M80H metrics table and NPU metrics support
The 1AH_M80H platform introduces a new firmware managed DRAM based metrics table (amd_pmf_metrics_v3) covering the full platf
platform/x86/amd/pmf: Add 1AH_M80H metrics table and NPU metrics support
The 1AH_M80H platform introduces a new firmware managed DRAM based metrics table (amd_pmf_metrics_v3) covering the full platform telemetry including power, voltages, frequencies, throttlers and activity monitors.
As a first consumer of this table, add NPU metrics retrieval. Unlike earlier platforms that use a transfer table command, 1AH_M80H metrics are accumulator based and require delta calculation between consecutive samples.
Extend amd_pmf_npu_metrics with npu_temp, populated from the npu_temp_acc accumulator field available on 1AH_M80H.
Key changes include: - Add DRAM based metrics table support for the 1AH_M80H platform - Introduce amd_pmf_get_tbl_dram_addr() to obtain the DRAM address - Add amd_pmf_get_metrics_table_log_sample() to trigger metrics updates - Add struct amd_pmf_metrics_v3 for the 1AH_M80H metrics format - Implement accumulator based delta calculation for metrics - Introduce amd_pmf_calculate_acc_npu_metrics() to get NPU metrics - Introduce amd_pmf_supports_accumulator_metrics() to check the accumulator based metrics support.
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> 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://patch.msgid.link/20260723111534.1940925-8-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>
show more ...
|
| 17f3e140 | 23-Jul-2026 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Refactor NPU metrics for platform extensibility
Refactor the NPU metrics retrieval code to use a switch-case structure based on CPU ID, preparing the driver for supporting addi
platform/x86/amd/pmf: Refactor NPU metrics for platform extensibility
Refactor the NPU metrics retrieval code to use a switch-case structure based on CPU ID, preparing the driver for supporting additional platforms with different metrics table formats.
This change restructures amd_pmf_get_smu_metrics() to handle platform-specific metrics retrieval paths. The existing logic for 1AH_M20H and 1AH_M60H platforms is preserved within the switch-case block.
No functional changes.
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> 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://patch.msgid.link/20260723111534.1940925-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>
show more ...
|
| 9f29ec1f | 23-Jul-2026 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Use upper/lower_32_bits() in amd_pmf_set_dram_addr()
Replace the open coded manual bit shifting used to split a 64-bit physical address into its high and low 32-bit halves with
platform/x86/amd/pmf: Use upper/lower_32_bits() in amd_pmf_set_dram_addr()
Replace the open coded manual bit shifting used to split a 64-bit physical address into its high and low 32-bit halves with the standard kernel helpers upper_32_bits() and lower_32_bits().
No functional changes.
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> 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://patch.msgid.link/20260723111534.1940925-6-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>
show more ...
|
| d19eca50 | 23-Jul-2026 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Add missing newline in dev_err message
Add the missing trailing newline to the dev_err() message printed when an invalid CPU id is encountered.
Signed-off-by: Shyam Sundar S K
platform/x86/amd/pmf: Add missing newline in dev_err message
Add the missing trailing newline to the dev_err() message printed when an invalid CPU id is encountered.
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20260723111534.1940925-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>
show more ...
|
| 2e34aca4 | 23-Jul-2026 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Move metrics code to dedicated file
Refactor metrics related code from core.c into a new metrics.c file to improve code organization and maintainability. The metrics functional
platform/x86/amd/pmf: Move metrics code to dedicated file
Refactor metrics related code from core.c into a new metrics.c file to improve code organization and maintainability. The metrics functionality is evolving with new platform support, warranting a separate file.
No functional changes.
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> 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://patch.msgid.link/20260723111534.1940925-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>
show more ...
|
| 2f9db588 | 23-Jul-2026 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Add 1AH_M80H device IDs and extended SMU mailbox registers
Add PCI device ID (0x115b) and ACPI ID (AMDI0109) to enable PMF driver support for the AMD 1AH_M80H (Family 1AH Model
platform/x86/amd/pmf: Add 1AH_M80H device IDs and extended SMU mailbox registers
Add PCI device ID (0x115b) and ACPI ID (AMDI0109) to enable PMF driver support for the AMD 1AH_M80H (Family 1AH Model 80H).
The 1AH_M80H platform introduces an extended SMU mailbox interface that uses three argument registers instead of the single register used by earlier platforms. Define five new register offsets for the 1AH_M80H mailbox: message, response and three argument registers. The extended argument registers are required because 1AH_M80H exposes metrics through a firmware managed DRAM region. The GET_METRICS_TABLE_DRAM_ADDR command returns a 64-bit physical address split across arg_reg[0] (low 32-bit) and arg_reg[1] (high 32-bit), with the metrics table size in arg_reg[2].
Define amd_pmf_smu_regs_v2 to capture this extended register layout and register it in pmf_pci_ids[] via PCI_DEVICE_DATA(), keeping the existing amd_pmf_smu_regs_v1 shared instance for all prior platforms unchanged.
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> 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://patch.msgid.link/20260723111534.1940925-3-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>
show more ...
|
| e860e561 | 23-Jul-2026 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Use per-SoC smu_regs struct for SMU mailbox registers
Different AMD platforms use varying SMU register layouts for PMF-SMU mailbox communication. The register offsets are curre
platform/x86/amd/pmf: Use per-SoC smu_regs struct for SMU mailbox registers
Different AMD platforms use varying SMU register layouts for PMF-SMU mailbox communication. The register offsets are currently hardcoded as AMD_PMF_REGISTER_MESSAGE, AMD_PMF_REGISTER_RESPONSE and AMD_PMF_REGISTER_ARGUMENT directly in amd_pmf_send_cmd() and amd_pmf_dump_registers(), making it difficult to support platforms that use a different mailbox register layout without scattering per-platform conditionals across the send path.
Introduce struct amd_pmf_smu_regs to capture the SoC-specific SMU mailbox register offsets (msg_reg, resp_reg, arg_reg) and add a pointer to it in struct amd_pmf_dev. RMB, PS, 1AH_M20H and 1AH_M60H all share the same legacy register layout and point to a single shared amd_pmf_smu_regs_v1 instance, avoiding redundant struct definitions.
Convert the pmf_pci_ids[] table from PCI_DEVICE() to PCI_DEVICE_DATA(), embedding the smu_regs pointer directly as driver_data. Introduce amd_pmf_get_smu_mb_offset() which resolves the matching PCI entry via pci_match_id() at probe time and assigns driver_data to dev->smu_regs.
Update all SMU register accesses in amd_pmf_send_cmd() and amd_pmf_dump_registers() to go through dev->smu_regs. Remove the hardcoded register offset references from the send path. New platform support requires only a new smu_regs instance and a corresponding PCI_DEVICE_DATA() entry.
No functional changes for existing platforms.
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> 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://patch.msgid.link/20260723111534.1940925-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>
show more ...
|
| 5bda82c7 | 09-Jun-2026 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Implement util layer ioctl handler
Implement the ioctl handler for the util layer character device. This support adds the actual functionality to populate PMF metrics from the
platform/x86/amd/pmf: Implement util layer ioctl handler
Implement the ioctl handler for the util layer character device. This support adds the actual functionality to populate PMF metrics from the TA shared memory buffer and return them to userspace.
The implementation includes: - amd_pmf_populate_data() to extract metrics from TA shared memory - amd_pmf_set_ioctl() to handle userspace ioctl requests - Size negotiation for forward/backward compatibility - Feature-based population of struct fields - Export amd_pmf_get_ta_custom_bios_inputs()
Co-developed-by: Sanket Goswami <Sanket.Goswami@amd.com> Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20260609081044.2416731-6-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>
show more ...
|
| c7bdedfc | 09-Jun-2026 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Move debug helper functions to UAPI header
These debug helper functions convert enumerated values to appropriate message and can be useful for userspace tools and other kernel
platform/x86/amd/pmf: Move debug helper functions to UAPI header
These debug helper functions convert enumerated values to appropriate message and can be useful for userspace tools and other kernel components that need to interpret AMD PMF state values.
By making them inline functions in the UAPI header, they become available to both kernel and userspace without code duplication. Also, prefix the function names with amd_pmf_.
Also, include a case to cover unused enum entries.
Co-developed-by: Sanket Goswami <Sanket.Goswami@amd.com> Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20260609081044.2416731-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>
show more ...
|
| 08f3df92 | 09-Jun-2026 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Store commonly used enums in the header file
Relocate commonly used enums from multiple source files into a shared header file to simplify code structure, improve readability,
platform/x86/amd/pmf: Store commonly used enums in the header file
Relocate commonly used enums from multiple source files into a shared header file to simplify code structure, improve readability, and enhance maintainability. Also, remove the initialization of the first enum member, since it is not needed.
Add the AMD_PMF_ prefix to the laptop_placement and platform_type enums since these names are overly generic for inclusion in a UAPI header
Co-developed-by: Sanket Goswami <Sanket.Goswami@amd.com> Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20260609081044.2416731-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>
show more ...
|
| 1983d7de | 09-Jun-2026 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: store BIOS output values for user-space metrics via util IOCTL
Add a bios_output[] to amd_pmf_dev struct and store the latest values for BIOS output policies when applying PMF
platform/x86/amd/pmf: store BIOS output values for user-space metrics via util IOCTL
Add a bios_output[] to amd_pmf_dev struct and store the latest values for BIOS output policies when applying PMF policies. This enables the AMD PMF util layer to expose these BIOS outputs alongside selected thermal and power metrics to user space via /dev/amdpmf_interface and a new IOCTL, supporting real-time monitoring tools such as SystemDeck.
Co-developed-by: Sanket Goswami <Sanket.Goswami@amd.com> Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20260609081044.2416731-3-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>
show more ...
|
| 118222e2 | 15-Jan-2026 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Introduce new interface to export NPU metrics
The PMF driver retrieves NPU metrics data from the PMFW. Introduce a new interface to make NPU metrics accessible to other drivers
platform/x86/amd/pmf: Introduce new interface to export NPU metrics
The PMF driver retrieves NPU metrics data from the PMFW. Introduce a new interface to make NPU metrics accessible to other drivers like AMDXDNA driver, which can access and utilize this information as needed.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.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> [lizhi: save return value of is_npu_metrics_supported() and return it] Signed-off-by: Lizhi Hou <lizhi.hou@amd.com> Link: https://patch.msgid.link/20260115173448.403826-1-lizhi.hou@amd.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| 0b39ce8f | 19-Nov-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Use devm_mutex_init() for mutex initialization
Replace mutex_init() with the devm_mutex_init(), to ensure proper mutex cleanup during probe failure and driver removal.
Signed-
platform/x86/amd/pmf: Use devm_mutex_init() for mutex initialization
Replace mutex_init() with the devm_mutex_init(), to ensure proper mutex cleanup during probe failure and driver removal.
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20251119085813.546813-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>
show more ...
|
| 2bd038de | 19-Nov-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Add BIOS_INPUTS_MAX macro to replace hardcoded array size
Define a new macro BIOS_INPUTS_MAX, to represent the maximum number of BIOS input values. Replace hardcoded array size
platform/x86/amd/pmf: Add BIOS_INPUTS_MAX macro to replace hardcoded array size
Define a new macro BIOS_INPUTS_MAX, to represent the maximum number of BIOS input values. Replace hardcoded array sizes in relevant structures with this macro to improve readability and maintainability.
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Tested-by: Yijun Shen <Yijun.Shen@Dell.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> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://patch.msgid.link/20251119085813.546813-1-Shyam-sundar.S-k@amd.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| 278ff704 | 27-Nov-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Refactor repetitive BIOS output handling
Replace repetitive switch-case statements for PMF_POLICY_BIOS_OUTPUT_* with a helper function and consolidated case handling. This redu
platform/x86/amd/pmf: Refactor repetitive BIOS output handling
Replace repetitive switch-case statements for PMF_POLICY_BIOS_OUTPUT_* with a helper function and consolidated case handling. This reduces code duplication and improves maintainability.
The 10 BIOS output policies (PMF_POLICY_BIOS_OUTPUT_1 through PMF_POLICY_BIOS_OUTPUT_10) previously each had individual case statements with identical logic. This patch introduces amd_pmf_get_bios_output_idx() to map policy values to array indices, consolidating the handling into a single case block with fallthrough. Also, add a new function amd_pmf_update_bios_output() to simplify the code handling.
This approach handles non-sequential policy enum values gracefully and makes future additions easier to implement.
No functional changes.
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20251127091038.2088387-1-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>
show more ...
|
| 7ec374c6 | 20-Nov-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Replace magic table id with METRICS_TABLE_ID
Add METRICS_TABLE_ID (7) and use it when requesting the metrics transfer table instead of the hard-coded literal. This clarifies th
platform/x86/amd/pmf: Replace magic table id with METRICS_TABLE_ID
Add METRICS_TABLE_ID (7) and use it when requesting the metrics transfer table instead of the hard-coded literal. This clarifies the meaning of the argument to amd_pmf_send_cmd() and centralizes the table ID definition for easier maintenance.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.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> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://patch.msgid.link/20251120105210.3945710-4-Shyam-sundar.S-k@amd.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| 83f0442a | 20-Nov-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Use explicit SET_CMD/GET_CMD flags in amd_pmf_send_cmd()
Add SET_CMD and GET_CMD constants and replace boolean values passed as the get/set argument to amd_pmf_send_cmd() with
platform/x86/amd/pmf: Use explicit SET_CMD/GET_CMD flags in amd_pmf_send_cmd()
Add SET_CMD and GET_CMD constants and replace boolean values passed as the get/set argument to amd_pmf_send_cmd() with the new explicit flags. This improves readability, avoids ambiguity around true/false and 0/1 usage. There is no functional change.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.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://patch.msgid.link/20251120105210.3945710-3-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>
show more ...
|