From patchwork Tue Jun 25 06:43:15 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: 1951935 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 4W7b0029jYz23tw 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 1sLzu7-0007yU-Jc; Tue, 25 Jun 2024 06:43:47 +0000 Received: from mail-pl1-f177.google.com ([209.85.214.177]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sLzu5-0007y2-UT for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 06:43:46 +0000 Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1fa07e4f44eso24082035ad.2 for ; Mon, 24 Jun 2024 23:43:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719297824; x=1719902624; 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=ta5/LRbXQ3RliA35v2oimbopNJrpW5WCDrfXmEM/a5Q=; b=lnwSPBylRYFXdZZTVc92wU1tGcGwfMc9remZajyZYftcCd7EDt3jH1FjC4epj0fjcp 2xOmT5KzwRDL2N57Va68AtKBUnZeP2s1ouEDTNqRRUT0Sm3wpq2H6QOPDJtW19pAEuyx 5z2NXhc+FjmwDE8OmWNOOloYFbjpAQMpTqfsZZT4EcJtXvzEuEEtOW6XdRGZpBbnTmvm Okt8+b7JLQ/UBTa2RenYOu1K3PsfPOpWlpqBUzM9i4CM3aOHDV1cQUUUIJbtELeTaCPO ohZglQAOEcglHcf98N9/SpqTUD+wQdjlRi4EYi5zK1Lk+CF5UAnCNnjEuZnXUrHi/dGT AlXw== X-Gm-Message-State: AOJu0YxrsSFCiiqLz/6Jmpb3xGrdVr14Bq9Q7wQdtkUiYSyUlXxVYD9N 9r+S+bAlxikvkOjxzgLd8U4DwLF313Lw5Q4zpZg7vo8VdU/+vFhsg7Z2DxMj X-Google-Smtp-Source: AGHT+IFZ3NgDB3mDCSOs7BOxyyn33Kp6tefq9Bu94CbdrsznjPFtDEf2/Jj/hkJCPGOgIIXK/ubbUg== X-Received: by 2002:a17:902:d481:b0:1fa:d3d:a68d with SMTP id d9443c01a7336-1fa23bdded8mr72635765ad.22.1719297823769; Mon, 24 Jun 2024 23:43:43 -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.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 23:43:42 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/7][SRU][Noble] platform/x86/amd/pmf: Differentiate PMF ACPI versions Date: Tue, 25 Jun 2024 14:43:15 +0800 Message-ID: <20240625064321.3302827-2-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.214.177; envelope-from=vicamo@gmail.com; helo=mail-pl1-f177.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 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 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-2-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen (cherry picked from commit a33e9e106601b5271561e7d79a3d3c4e7e84f07f) Signed-off-by: You-Sheng Yang --- drivers/platform/x86/amd/pmf/acpi.c | 6 ++++-- drivers/platform/x86/amd/pmf/pmf.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/amd/pmf/acpi.c b/drivers/platform/x86/amd/pmf/acpi.c index f2eb07ef855a..1f287a147c57 100644 --- a/drivers/platform/x86/amd/pmf/acpi.c +++ b/drivers/platform/x86/amd/pmf/acpi.c @@ -218,8 +218,10 @@ static int apmf_if_verify_interface(struct amd_pmf_dev *pdev) return err; pdev->supported_func = output.supported_functions; - dev_dbg(pdev->dev, "supported functions:0x%x notifications:0x%x\n", - output.supported_functions, output.notification_mask); + dev_dbg(pdev->dev, "supported functions:0x%x notifications:0x%x version:%u\n", + output.supported_functions, output.notification_mask, output.version); + + pdev->pmf_if_version = output.version; return 0; } diff --git a/drivers/platform/x86/amd/pmf/pmf.h b/drivers/platform/x86/amd/pmf/pmf.h index 66cae1cca73c..e51ac981af73 100644 --- a/drivers/platform/x86/amd/pmf/pmf.h +++ b/drivers/platform/x86/amd/pmf/pmf.h @@ -231,6 +231,7 @@ struct amd_pmf_dev { u64 policy_addr; void *policy_base; bool smart_pc_enabled; + u16 pmf_if_version; }; struct apmf_sps_prop_granular {