Received: by 10.223.176.5 with SMTP id f5csp2940266wra; Thu, 1 Feb 2018 08:20:38 -0800 (PST) X-Google-Smtp-Source: AH8x227UHVfwmrZIhc8eLqznB1wZa1YgueMuE67+4YbVpRtQK9/richvx+V2mQw7DFaPY3VRMfFA X-Received: by 10.99.173.5 with SMTP id g5mr29578197pgf.391.1517502038627; Thu, 01 Feb 2018 08:20:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517502038; cv=none; d=google.com; s=arc-20160816; b=MnssP1HPC8bkVwT6wDuOYfHbMGDjS9LsY8VVI+yOc6CldBow84MlbJWLtZ2wb2OHrw /0D9Lg0diYGA5UeuaqVyL2VWgKkV0mItBUGKEYobYWn/vUod4Q6B0ABb6ZU1Ju6zbC4Z 4w6S84ACif75RkFJNDYNcivGOCz20K1B3x+dxQ0/acSqepkUB9MU/v+adDsmnYceLcJ5 mazwTMsrKxGd3+kcEX+/hQcCsT7EH9TOoEMvLMSbSYAAk7ioSh3I/yT6q3JIHZFJQuFN tdo+iwWLcVf8VcCFcLn2WvaFM6Lz+7wdlyJMnIWoRLNMBuk4mfrQpYd7/rYcH2Hj8+Xk aNwQ== 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=qSeU0a0+rteJdgqTnbwhZUm6rr/XNtFm7kFJ+e1g3yo=; b=mYqAVUODXdbJuWLyBTXTMu6vB3+FCK5Pg+JTivwa3tnbLSbrQVJ96HaA4BprYB8i8T A2fkntC5ZHd9a1B4QRe4gZ9SRsLj4ZnVrzgzoJWJVlxYjwEKSHJ3/QkAfdgEBk6vwa/H ypN8+5BEmDHAVG5OdlB+I6NhxYT+iwwHjUYBHrem7iMXcmDUkcdYWxz/RQeK3pIB+56r MfBsUemTI3wFDsbErhGHVFOii1aYYKq/2afEQBEkQPNcSNdI/OP3fIZ69VplhJ9rntB7 g5eurt6MhmNuvU7IKIKGyXI+IW+XCIROgJ1BRM4kIQY76cirDxATFTLHw1/fN+vyM4ba PlCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=DAGOVhdJ; 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 70-v6si16414707pla.635.2018.02.01.08.20.23; Thu, 01 Feb 2018 08:20:38 -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=DAGOVhdJ; 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 S1752805AbeBAQSo (ORCPT + 99 others); Thu, 1 Feb 2018 11:18:44 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:7694 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751827AbeBAQP4 (ORCPT ); Thu, 1 Feb 2018 11:15:56 -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=1517501757; x=1549037757; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=THhk2GoGTNbiwhezvWhbYNwegMXiMXzrk0xyfE5kokM=; b=DAGOVhdJzxPROp3lSKRd1fhlXVvu+u2tPs/PoyeyuAOzlKC/uvQZffJ1 UG0JCDroSBY7sFXiOgwPaor9SDq4YxPBDEYkHbdEux69u+FDXUT8/+/+n 9Rlly4Jelhcm7zpdsIRZJR5cAHISrhUSxMutI92IXK3KdKgGacqDTSNOk C0CHHabLTMX+JiGkdnFIPiergHcbVT/VN5jFs+QK1+WbMvY0r1wv3HIq2 R7ZcFcVCDhVxgdHhy+wt7wgFAhn0/cP9Jxn3HOURQBGm9J0ZCAZpF0QdL SMnKzaPXqhwXVLMTZC/kF2Cq7o8W8itDYjLceHZwiTbSxAVFXApQeRX/f g==; X-IronPort-AV: E=Sophos;i="5.46,444,1511798400"; d="scan'208";a="70915270" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 02 Feb 2018 00:15:57 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 01 Feb 2018 08:10:58 -0800 Received: from ilb000042.sdcorp.global.sandisk.com ([10.0.231.79]) by uls-op-cesaip02.wdc.com with ESMTP; 01 Feb 2018 08:15:54 -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 v4 03/10] ufs: sysfs: interconnect descriptor Date: Thu, 1 Feb 2018 18:15:39 +0200 Message-Id: <1517501746-19075-4-git-send-email-stanislav.nijnikov@wdc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517501746-19075-1-git-send-email-stanislav.nijnikov@wdc.com> References: <1517501746-19075-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 372e281..460378b 100644 --- a/drivers/scsi/ufs/ufs-sysfs.c +++ b/drivers/scsi/ufs/ufs-sysfs.c @@ -264,9 +264,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, WORD); +UFS_INTERCONNECT_DESC_PARAM(mphy_version, _MPHY_VER, WORD); + +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