Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp34023pxh; Thu, 7 Apr 2022 13:08:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRDHOHJ4Wfm82D9Kp8e7s4LDr0zvhYG70tX/D1keZ4oUD+aElP9dzBZFl/lpJnn5Tk+vyj X-Received: by 2002:a17:902:8d8b:b0:155:f201:16ad with SMTP id v11-20020a1709028d8b00b00155f20116admr15814838plo.150.1649362121231; Thu, 07 Apr 2022 13:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649362121; cv=none; d=google.com; s=arc-20160816; b=pZ43077kShiGzU3WN2434FX0/367Xl7fj9OJFPgxX+iTa5MivzuEnldx5EcwWbiZi6 9YqkqNUX5CgvOcuI69UWC4LxdtbZu/RZ5On/5DpFWjqeV2wZUbnCCZYWASKOxaylk1Tl 7FkkD9vCzz42U+kCRjLN6Es2xSLsJX8RhLjTTFPUPGTi3w1kB0gKEEaZ6+519zW3zkMX qZyhTWpCOqYWi32VlObsKPoMMEIEph9PXG7tLN10kqIqJVOSGqvSIhgqs+8q182womjN C18x7Mx/S7mleG5UQ0/D43ynsCgCiW08xJSvLrlgIBHKgEyNngE4LY55lenAtn1afl3q fdag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/qW12bmgL168IeWCIpH9xFVj43ldtIrg9Unlyo70g4A=; b=xRv4Tnm3+tmvgc4Mg8Va/73wV+JALf7+0oexMEsTkAxLYVRNKt15ZXmnIA9AtFoef4 M4sD0XRmKN+sA3jOYYL3g4VtS0tP9EhlyDud/no5sZouiaixsAlNwGoRWZMDIrBoVOrg f+D5ljnFj1p1XrxdSQJqysNpN1q5Uvi2rdQXWznrk4T0V+f9MxlKsBYe75v7gHxvEuhr vCecZOAlQa+hfYuBMAj/iXNTI7SEXDavV2/1PrPwLQC0uemF7Mt2Y95yseviXIgpAmkA 3gmVHYYTNLigzqGJgBfjjWdkKbwDOa3LvZ4fLFAo2iUIzUZ72iP7Jh/gHc9+UawFTXo1 IU0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dtIKRUJ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q10-20020a170902788a00b00156c32d5670si575045pll.22.2022.04.07.13.08.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:08:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dtIKRUJ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A32102B44A8; Thu, 7 Apr 2022 12:31:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245636AbiDGNBm (ORCPT + 99 others); Thu, 7 Apr 2022 09:01:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245633AbiDGNBi (ORCPT ); Thu, 7 Apr 2022 09:01:38 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7763F1945EE for ; Thu, 7 Apr 2022 05:59:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649336379; x=1680872379; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2tDSaTXga5Q4o87KQEHKUYopCWX0617A/UkXwV6T7RA=; b=dtIKRUJ5KiSpAFFG4fn/9G3WL+REAh1I4gtS+vMI2Zexd/4jJutERIT/ 1Dco1R+jILnW4kOBp4iR1yo+UZC1nEBPz95qi4SWG10p6+ehlGOv9UZ6i rx1D1FhhXQqjzKQsSUNzXw6juzoYgWSCtrn68+4J1GlvsuUg2CI/3uBtI dYDRjT7WxmEj82vLhroP4vnkOJcUi4BcmIBh4XY4FHwlimI9hURl6MXPA IhOUnM2JvQqZkcElQVeIk6UsEN75l1h08F5wZ2QE3cO4C3xmQM2tL7JPU a1AHd+6G0xGhmVi6RaOq95SxNysT4Egxq/uw+n4+W9CJZOozrUcFYyiXm A==; X-IronPort-AV: E=McAfee;i="6400,9594,10309"; a="241907472" X-IronPort-AV: E=Sophos;i="5.90,242,1643702400"; d="scan'208";a="241907472" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 05:59:39 -0700 X-IronPort-AV: E=Sophos;i="5.90,242,1643702400"; d="scan'208";a="571040822" Received: from sannilnx.jer.intel.com ([10.12.231.73]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 05:59:35 -0700 From: Alexander Usyskin To: Greg Kroah-Hartman , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Tvrtko Ursulin Cc: Tomas Winkler , Alexander Usyskin , Vitaly Lubart , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ashutosh Dixit , Daniele Ceraolo Spurio Subject: [PATCH 05/20] mei: gsc: retrieve the firmware version Date: Thu, 7 Apr 2022 15:58:24 +0300 Message-Id: <20220407125839.1479249-6-alexander.usyskin@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220407125839.1479249-1-alexander.usyskin@intel.com> References: <20220407125839.1479249-1-alexander.usyskin@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a hook to retrieve the firmware version of the GSC devices to bus-fixup. GSC has a different MKHI clients GUIDs but the same message structure to retrieve the firmware version as MEI so mei_fwver() can be reused. CC: Ashutosh Dixit Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Reviewed-by: Daniele Ceraolo Spurio --- drivers/misc/mei/bus-fixup.c | 25 +++++++++++++++++++++++++ drivers/misc/mei/hw-me.c | 2 ++ 2 files changed, 27 insertions(+) diff --git a/drivers/misc/mei/bus-fixup.c b/drivers/misc/mei/bus-fixup.c index 67844089db21..59506ba6fc48 100644 --- a/drivers/misc/mei/bus-fixup.c +++ b/drivers/misc/mei/bus-fixup.c @@ -30,6 +30,12 @@ static const uuid_le mei_nfc_info_guid = MEI_UUID_NFC_INFO; #define MEI_UUID_MKHIF_FIX UUID_LE(0x55213584, 0x9a29, 0x4916, \ 0xba, 0xdf, 0xf, 0xb7, 0xed, 0x68, 0x2a, 0xeb) +#define MEI_UUID_IGSC_MKHI UUID_LE(0xE2C2AFA2, 0x3817, 0x4D19, \ + 0x9D, 0x95, 0x06, 0xB1, 0x6B, 0x58, 0x8A, 0x5D) + +#define MEI_UUID_IGSC_MKHI_FIX UUID_LE(0x46E0C1FB, 0xA546, 0x414F, \ + 0x91, 0x70, 0xB7, 0xF4, 0x6D, 0x57, 0xB4, 0xAD) + #define MEI_UUID_HDCP UUID_LE(0xB638AB7E, 0x94E2, 0x4EA2, \ 0xA5, 0x52, 0xD1, 0xC5, 0x4B, 0x62, 0x7F, 0x04) @@ -241,6 +247,23 @@ static void mei_mkhi_fix(struct mei_cl_device *cldev) mei_cldev_disable(cldev); } +static void mei_gsc_mkhi_ver(struct mei_cl_device *cldev) +{ + int ret; + + /* No need to enable the client if nothing is needed from it */ + if (!cldev->bus->fw_f_fw_ver_supported) + return; + + ret = mei_cldev_enable(cldev); + if (ret) + return; + + ret = mei_fwver(cldev); + if (ret < 0) + dev_err(&cldev->dev, "FW version command failed %d\n", ret); + mei_cldev_disable(cldev); +} /** * mei_wd - wd client on the bus, change protocol version * as the API has changed. @@ -492,6 +515,8 @@ static struct mei_fixup { MEI_FIXUP(MEI_UUID_NFC_HCI, mei_nfc), MEI_FIXUP(MEI_UUID_WD, mei_wd), MEI_FIXUP(MEI_UUID_MKHIF_FIX, mei_mkhi_fix), + MEI_FIXUP(MEI_UUID_IGSC_MKHI, mei_gsc_mkhi_ver), + MEI_FIXUP(MEI_UUID_IGSC_MKHI_FIX, mei_gsc_mkhi_ver), MEI_FIXUP(MEI_UUID_HDCP, whitelist), MEI_FIXUP(MEI_UUID_ANY, vt_support), MEI_FIXUP(MEI_UUID_PAVP, whitelist), diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index 03945d3b34da..9870bf717979 100644 --- a/drivers/misc/mei/hw-me.c +++ b/drivers/misc/mei/hw-me.c @@ -1584,12 +1584,14 @@ static const struct mei_cfg mei_me_pch15_sps_cfg = { static const struct mei_cfg mei_me_gsc_cfg = { MEI_CFG_TYPE_GSC, MEI_CFG_PCH8_HFS, + MEI_CFG_FW_VER_SUPP, }; /* Graphics System Controller Firmware Interface */ static const struct mei_cfg mei_me_gscfi_cfg = { MEI_CFG_TYPE_GSCFI, MEI_CFG_PCH8_HFS, + MEI_CFG_FW_VER_SUPP, }; /* -- 2.32.0