From patchwork Tue Jun 25 06:43:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1951932 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W7b000rx1z20ZS for ; Tue, 25 Jun 2024 16:43:59 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sLzuB-00080N-6D; Tue, 25 Jun 2024 06:43:51 +0000 Received: from mail-pf1-f169.google.com ([209.85.210.169]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sLzu8-0007yl-VI for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 06:43:49 +0000 Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-706738c209bso1493468b3a.3 for ; Mon, 24 Jun 2024 23:43:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719297827; x=1719902627; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rU22gmG33nxYhYy6ZC4KTKUX81yqxzOb9KMdVv/BaqQ=; b=HQIS/0WO3TsH9hEORifV+mNwe8SZAPylbKv2GOoSecSthWXHX7o3dOID5OcICM4fpQ 62/K5L1sy7LBKPD4mgrOpxdg/NdZVcIId3nwHAiM940/4jirweMkdIE8q9st5hJwsLFd YT017T/W0pbfKNRvELdxKpPWWRFyWEBIcdCewfuT8W/6KhgOF+e0LgRrRPqBOd3qya3k K7eSATLYEPi7x0pMw7XgjCafzHMv/tM54+TZ4UMECRMevRsI39MApJGr43aZlgmP7ntZ hKhOvhtTYOIFwAJ7E44W+3N8wuxGKje8wSutP7W20sf5KLfCHNgksfhQ4t0DwEtrJF5l m1yw== X-Gm-Message-State: AOJu0YzPgGzE+jK4LZv0lB7ZasEafcRyT724JzqEkP6upL9xQaGvRRAh mVcWEC/8kjvHDCzelQCkTnkA4wym6CRZgRijNp5itjCe3B+VvFvoGNamdkQF X-Google-Smtp-Source: AGHT+IE88GmSengtkX+bXwbvRAUmWNlOOShoUZXs+CRkkMC8Lt3kaFxekEXsfBA/EUq8pWrPfbTDug== X-Received: by 2002:a05:6a20:8b17:b0:1b5:cf26:ed09 with SMTP id adf61e73a8af0-1bcf7e3cab2mr5302655637.7.1719297826899; Mon, 24 Jun 2024 23:43:46 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa1d3773d1sm46767525ad.270.2024.06.24.23.43.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 23:43:45 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/7][SRU][Noble] platform/x86/amd/pmf: Add support to get sbios requests in PMF driver Date: Tue, 25 Jun 2024 14:43:17 +0800 Message-ID: <20240625064321.3302827-4-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625064321.3302827-1-vicamo.yang@canonical.com> References: <20240625064321.3302827-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.169; envelope-from=vicamo@gmail.com; helo=mail-pf1-f169.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Shyam Sundar S K BugLink: https://bugs.launchpad.net/bugs/2058330 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 Signed-off-by: Patil Rajesh Reddy Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20240306114415.3267603-4-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen (cherry picked from commit 5fdc8b82aab4c8430bbd8d26a3c3898aaff90a40) Signed-off-by: You-Sheng Yang --- drivers/platform/x86/amd/pmf/acpi.c | 5 +++++ drivers/platform/x86/amd/pmf/pmf.h | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/platform/x86/amd/pmf/acpi.c b/drivers/platform/x86/amd/pmf/acpi.c index 1f287a147c57..13af83b187ac 100644 --- a/drivers/platform/x86/amd/pmf/acpi.c +++ b/drivers/platform/x86/amd/pmf/acpi.c @@ -166,6 +166,11 @@ int apmf_get_auto_mode_def(struct amd_pmf_dev *pdev, struct apmf_auto_mode *data return apmf_if_call_store_buffer(pdev, APMF_FUNC_AUTO_MODE, data, sizeof(*data)); } +int apmf_get_sbios_requests_v2(struct amd_pmf_dev *pdev, struct apmf_sbios_req_v2 *req) +{ + return apmf_if_call_store_buffer(pdev, APMF_FUNC_SBIOS_REQUESTS, req, sizeof(*req)); +} + int apmf_get_sbios_requests(struct amd_pmf_dev *pdev, struct apmf_sbios_req *req) { return apmf_if_call_store_buffer(pdev, APMF_FUNC_SBIOS_REQUESTS, diff --git a/drivers/platform/x86/amd/pmf/pmf.h b/drivers/platform/x86/amd/pmf/pmf.h index 4364af72a7a3..5d722e2772b8 100644 --- a/drivers/platform/x86/amd/pmf/pmf.h +++ b/drivers/platform/x86/amd/pmf/pmf.h @@ -116,6 +116,18 @@ struct apmf_sbios_req { u8 skin_temp_hs2; } __packed; +struct apmf_sbios_req_v2 { + u16 size; + u32 pending_req; + u8 rsd; + u32 ppt_pmf; + u32 ppt_pmf_apu_only; + u32 stt_min_limit; + u8 skin_temp_apu; + u8 skin_temp_hs2; + u32 custom_policy[10]; +} __packed; + struct apmf_fan_idx { u16 size; u8 fan_ctl_mode; @@ -612,6 +624,7 @@ void amd_pmf_init_auto_mode(struct amd_pmf_dev *dev); void amd_pmf_deinit_auto_mode(struct amd_pmf_dev *dev); void amd_pmf_trans_automode(struct amd_pmf_dev *dev, int socket_power, ktime_t time_elapsed_ms); int apmf_get_sbios_requests(struct amd_pmf_dev *pdev, struct apmf_sbios_req *req); +int apmf_get_sbios_requests_v2(struct amd_pmf_dev *pdev, struct apmf_sbios_req_v2 *req); void amd_pmf_update_2_cql(struct amd_pmf_dev *dev, bool is_cql_event); int amd_pmf_reset_amt(struct amd_pmf_dev *dev);