public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ceraolo Spurio, Daniele" <daniele.ceraolospurio@intel.com>
To: Alexander Usyskin <alexander.usyskin@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: <intel-gfx@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	"Tomas Winkler" <tomas.winkler@intel.com>,
	Vitaly Lubart <vitaly.lubart@intel.com>
Subject: Re: [Intel-gfx] [PATCH v10 5/5] mei: gsc: retrieve the firmware version
Date: Wed, 9 Mar 2022 17:14:01 -0800	[thread overview]
Message-ID: <c9998ec7-bf40-e4dc-2842-c211412ad702@intel.com> (raw)
In-Reply-To: <20220308163654.942820-6-alexander.usyskin@intel.com>



On 3/8/2022 8:36 AM, Alexander Usyskin wrote:
> 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 <ashutosh.dixit@intel.com>
> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> ---
>   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)
> +

These matches what the HW is reporting as sub-devices got gscfi and gsc 
respectively. I think we could use a comment to make which matches what 
clearer, but anyway:

Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

>   #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 9748d14849a1..7e77328142ff 100644
> --- a/drivers/misc/mei/hw-me.c
> +++ b/drivers/misc/mei/hw-me.c
> @@ -1577,12 +1577,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,
>   };
>   
>   /*


      reply	other threads:[~2022-03-10  1:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 16:36 [PATCH v10 0/5] Add driver for GSC controller Alexander Usyskin
2022-03-08 16:36 ` [PATCH v10 1/5] drm/i915/gsc: add gsc as a mei auxiliary device Alexander Usyskin
2022-03-09 22:50   ` [Intel-gfx] " Ceraolo Spurio, Daniele
2022-03-13 10:02     ` Usyskin, Alexander
2022-03-08 16:36 ` [PATCH v10 2/5] mei: add support for graphics system controller (gsc) devices Alexander Usyskin
2022-03-10  0:24   ` [Intel-gfx] " Ceraolo Spurio, Daniele
2022-03-13 11:23     ` Usyskin, Alexander
2022-03-08 16:36 ` [PATCH v10 3/5] mei: gsc: setup char driver alive in spite of firmware handshake failure Alexander Usyskin
2022-03-10  0:28   ` [Intel-gfx] " Ceraolo Spurio, Daniele
2022-03-13 12:12     ` Usyskin, Alexander
2022-03-08 16:36 ` [PATCH v10 4/5] mei: gsc: add runtime pm handlers Alexander Usyskin
2022-03-10 19:03   ` [Intel-gfx] " Rodrigo Vivi
2022-03-13 15:47     ` Usyskin, Alexander
2022-03-08 16:36 ` [PATCH v10 5/5] mei: gsc: retrieve the firmware version Alexander Usyskin
2022-03-10  1:14   ` Ceraolo Spurio, Daniele [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c9998ec7-bf40-e4dc-2842-c211412ad702@intel.com \
    --to=daniele.ceraolospurio@intel.com \
    --cc=airlied@linux.ie \
    --cc=alexander.usyskin@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=gregkh@linuxfoundation.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=tomas.winkler@intel.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    --cc=vitaly.lubart@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox