Received: by 10.223.176.5 with SMTP id f5csp834723wra; Tue, 6 Feb 2018 08:08:39 -0800 (PST) X-Google-Smtp-Source: AH8x224SmeqdxRDuhBbadRQ0PBTqhNLbppoWtF1FMdzy2mtMnyid8NlhIwjYJvAUm0aLjLAUu6CP X-Received: by 10.101.78.201 with SMTP id w9mr2388851pgq.43.1517933319231; Tue, 06 Feb 2018 08:08:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517933319; cv=none; d=google.com; s=arc-20160816; b=dQISMf1U4iDfdjtxeuXRbWJWcH48wf394K0kliK6RkeNcbLCxwQyTIWW+Unbz6ai43 YYOu3RP6qJEhR29ckNN9bKduZCdaSdk+Hr2LCEHVEm9oPtAFXwPLry2J+NMwcfgcN50B xX7EfEGy2dKf9BFFEXukS+mBezOM3kKBBqqiwboKmE0ECz8jTTc3c7AEBRODXGCdBESy X/S+Pe5RKqcmpsgtbxjOMzzFqwrxWeznwdl6L2OoZNaADtZC3r8CWBvRW+kGqdiQODGQ 9Ki/0K/y1HuKDhjqR2ftf4tLfZSK2eDufsYPWcPcqxYKcl047V7pfCGD+sfYBMorKy4t 72VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=9oJ6kegxzJdsz4JlOlO04gkC3AzR5cEHJ7UQu4dMPTA=; b=ZWx8ZHImHhd4LLqqCNcR1aAjgOMciNBr8OI/X6sjsIsAmopWV1HYhVZf79FRPzVW96 x7JZEMg25AszZuGiPLyIJEp8e33o8QV8z8XEZEFAUPcPlSP45NMleM112g/vI0IoA5iT a9gIq1vB4qUV943RWX//XTi7lPQFDtOcZXwMurJF0aFAScDX/0+hRBYqVJ1Ka3FUx9HQ JBZhHoRnulMPazawvC6xneiFs7624QNCwfP9rd49NIkynRyjS9NzBKCX9D1+Mnas+ydj Cn35kn2lo2nj6rUxf3KZYZBqZTT0f8Yxu6eUIJdow8LOi5gCRGzWJduLQ6nR+joEXg9Z bJaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=pjJt5WNf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11si1192191pgf.367.2018.02.06.08.08.24; Tue, 06 Feb 2018 08:08:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=pjJt5WNf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752664AbeBFQHW (ORCPT + 99 others); Tue, 6 Feb 2018 11:07:22 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:7306 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752540AbeBFQGh (ORCPT ); Tue, 6 Feb 2018 11:06:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1517933197; x=1549469197; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=hLP06K5zQrdYj8aBi2IBptPWfjLUF15T6bY1HrdRXbw=; b=pjJt5WNfrNoUKF0xiL3JIp2zDLg+jeB6igOGsz4uIEFQCvJQ+ih7xdBA Z7kdt+zHFry9hWFsJJtDV7oKwnPDYWPyAEQH0YgJ3CxsxxtgGXvqxxx1t O+mHkMEs4P1Kfd5xZOxI+nQC8PEAl8ujGEvqFD1qP9ghrSHoxxAD7bc4d EhCKI/y1Z5XvTUViB1NIumYsQgYxMtvbgRDvF7K1fMnsYtjWLPqUR+ZWI 6BTAGX8CNrjbgHc/bgHUBZDCFOqr3uhTPjhjGhgRV5PAlmBHsYQHXh3oM TfkTNZkpV0UVOSEhndTcFyklmWN3ZZFfOsyNXAZk3PoETrV7vKjDnoMKU w==; X-IronPort-AV: E=Sophos;i="5.46,469,1511798400"; d="scan'208";a="71267299" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 07 Feb 2018 00:06:37 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 06 Feb 2018 08:01:27 -0800 Received: from ilb000042.sdcorp.global.sandisk.com ([10.0.231.79]) by uls-op-cesaip02.wdc.com with ESMTP; 06 Feb 2018 08:06:36 -0800 From: Stanislav Nijnikov To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, jaegeuk@kernel.org Cc: alex.lemberg@wdc.com, Stanislav Nijnikov Subject: [PATCH v5 03/11] scsi: ufs: sysfs: interconnect descriptor Date: Tue, 6 Feb 2018 18:06:15 +0200 Message-Id: <1517933183-30892-4-git-send-email-stanislav.nijnikov@wdc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517933183-30892-1-git-send-email-stanislav.nijnikov@wdc.com> References: <1517933183-30892-1-git-send-email-stanislav.nijnikov@wdc.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch introduces a sysfs group entry for the UFS interconnect descriptor parameters. The group adds "interconnect_descriptor" folder under the UFS driver sysfs entry (/sys/bus/platform/drivers/ufshcd/*). The parameters are shown as hexadecimal numbers. The full information about the parameters could be found at UFS specifications 2.1. Signed-off-by: Stanislav Nijnikov Reviewed-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-driver-ufs | 19 +++++++++++++++++++ drivers/scsi/ufs/ufs-sysfs.c | 18 ++++++++++++++++++ drivers/scsi/ufs/ufs.h | 8 ++++++++ 3 files changed, 45 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-driver-ufs b/Documentation/ABI/testing/sysfs-driver-ufs index 8da7b84..099e6fa 100644 --- a/Documentation/ABI/testing/sysfs-driver-ufs +++ b/Documentation/ABI/testing/sysfs-driver-ufs @@ -221,3 +221,22 @@ Description: This file shows the command maximum timeout for a change parameters. The full information about the descriptor could be found at UFS specifications 2.1. The file is read only. + + +What: /sys/bus/platform/drivers/ufshcd/*/interconnect_descriptor/unipro_version +Date: February 2018 +Contact: Stanislav Nijnikov +Description: This file shows the MIPI UniPro version number in BCD format. + This is one of the UFS interconnect descriptor parameters. + The full information about the descriptor could be found at + UFS specifications 2.1. + The file is read only. + +What: /sys/bus/platform/drivers/ufshcd/*/interconnect_descriptor/mphy_version +Date: February 2018 +Contact: Stanislav Nijnikov +Description: This file shows the MIPI M-PHY version number in BCD format. + This is one of the UFS interconnect descriptor parameters. + The full information about the descriptor could be found at + UFS specifications 2.1. + The file is read only. diff --git a/drivers/scsi/ufs/ufs-sysfs.c b/drivers/scsi/ufs/ufs-sysfs.c index aa2779a..e9e6ee4 100644 --- a/drivers/scsi/ufs/ufs-sysfs.c +++ b/drivers/scsi/ufs/ufs-sysfs.c @@ -249,9 +249,27 @@ static const struct attribute_group ufs_sysfs_device_descriptor_group = { .attrs = ufs_sysfs_device_descriptor, }; +#define UFS_INTERCONNECT_DESC_PARAM(_name, _uname, _size) \ + UFS_DESC_PARAM(_name, _uname, INTERCONNECT, _size) + +UFS_INTERCONNECT_DESC_PARAM(unipro_version, _UNIPRO_VER, 2); +UFS_INTERCONNECT_DESC_PARAM(mphy_version, _MPHY_VER, 2); + +static struct attribute *ufs_sysfs_interconnect_descriptor[] = { + &dev_attr_unipro_version.attr, + &dev_attr_mphy_version.attr, + NULL, +}; + +static const struct attribute_group ufs_sysfs_interconnect_descriptor_group = { + .name = "interconnect_descriptor", + .attrs = ufs_sysfs_interconnect_descriptor, +}; + static const struct attribute_group *ufs_sysfs_groups[] = { &ufs_sysfs_default_group, &ufs_sysfs_device_descriptor_group, + &ufs_sysfs_interconnect_descriptor_group, NULL, }; diff --git a/drivers/scsi/ufs/ufs.h b/drivers/scsi/ufs/ufs.h index 6ae1e08..773c049 100644 --- a/drivers/scsi/ufs/ufs.h +++ b/drivers/scsi/ufs/ufs.h @@ -230,6 +230,14 @@ enum device_desc_param { DEVICE_DESC_PARAM_PRDCT_REV = 0x2A, }; +/* Interconnect descriptor parameters offsets in bytes*/ +enum interconnect_desc_param { + INTERCONNECT_DESC_PARAM_LEN = 0x0, + INTERCONNECT_DESC_PARAM_TYPE = 0x1, + INTERCONNECT_DESC_PARAM_UNIPRO_VER = 0x2, + INTERCONNECT_DESC_PARAM_MPHY_VER = 0x4, +}; + /* * Logical Unit Write Protect * 00h: LU not write protected -- 2.7.4