linux/tools/platform/x86/amd/Makefile
Shyam Sundar S K a5edf10e3a
platform/x86/amd/pmf: Introduce AMD PMF testing tool for driver metrics and features
This tool leverages amd-pmf ioctls exposed via the util layer, allowing
validation of its newly integrated util layer and /dev/amdpmf_interface.
It includes a user-space test application, test_amd_pmf, designed to
interact with the PMF driver and retrieve relevant metrics for the
testing and analysis.

It provides definitions for test metrics, feature IDs, and device states,
and includes tests for various AMD PMF metrics such as power source, skin
temperature, battery state, and custom BIOS inputs/outputs. It also
enables the testing of PMF metrics data and feature support reporting.

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-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>
2026-07-10 15:15:51 +03:00

61 lines
1.7 KiB
Makefile

# SPDX-License-Identifier: GPL-2.0
ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
endif
# Include common tools build infrastructure
include $(srctree)/tools/scripts/Makefile.include
CC = $(CROSS_COMPILE)gcc
BUILD_OUTPUT := $(CURDIR)
PREFIX ?= /usr
DESTDIR ?=
ifeq ("$(origin O)", "command line")
BUILD_OUTPUT := $(O)
endif
# Include paths: tools/include has linux/kernel.h with ARRAY_SIZE
INCLUDES = -I$(srctree)/tools/include
INCLUDES += -I$(srctree)/tools/include/uapi
INCLUDES += -I$(srctree)/include/uapi
INCLUDES += -I$(srctree)/include
override CFLAGS += -O2 -Wall -Wextra -D_GNU_SOURCE $(INCLUDES)
override CFLAGS += -D_FILE_OFFSET_BITS=64
override CFLAGS += -D__EXPORTED_HEADERS__
TARGETS = test_amd_pmf
all: $(TARGETS)
test_amd_pmf: test-pmf.c
$(QUIET_CC)$(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@ $(LDFLAGS)
.PHONY: clean
clean:
$(call QUIET_CLEAN, test_amd_pmf)$(RM) $(BUILD_OUTPUT)/test_amd_pmf
.PHONY: install
install: $(TARGETS)
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
$(INSTALL) $(BUILD_OUTPUT)/test_amd_pmf $(DESTDIR)$(PREFIX)/bin/test_amd_pmf
.PHONY: help
help:
@echo "AMD Platform Tools Makefile"
@echo ""
@echo "Targets:"
@echo " all - Build all tools (default)"
@echo " test_amd_pmf - Build the PMF test tool"
@echo " clean - Remove built files"
@echo " install - Install tools to $(PREFIX)/bin"
@echo ""
@echo "Variables:"
@echo " O=<dir> - Build output directory"
@echo " PREFIX - Installation prefix (default: /usr)"
@echo " DESTDIR - Destination directory for install"