Received: by 10.223.185.116 with SMTP id b49csp1945238wrg; Thu, 15 Feb 2018 04:15:41 -0800 (PST) X-Google-Smtp-Source: AH8x224JG123dLKKu0QJWzG2gpcpn3wIxm4tHrjzKWy/PXP00sCfNAjbxL0OGgKbt1QjMlcbNuP1 X-Received: by 2002:a17:902:3064:: with SMTP id u91-v6mr2348505plb.421.1518696941458; Thu, 15 Feb 2018 04:15:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518696941; cv=none; d=google.com; s=arc-20160816; b=ZHTg8SXbw3lIsXcblmGOETrkKZ8sxplv2AHH/13KWgksUTjgUyjt8P470FHMUKVaCV wyEWT/QBRgqhF4iOiTkxFqUkWHy8Ui5bFEJi2Z0v6tggIwIYtfIO/IVw8KmhdmVOiqMt ECfzHCEnsIjqsjp01R+6AVLQrVoKFiSWgnlFjEB+dqhIsabDcS2ZPPur9w5QywIheeaA XLQvjVeKIZW3okRX8KDLiigWqDrLKmpvO4ma+iOeQH5X8WU5SdCyAV0VE/3GlQqhGj1v /6dhmbwG3SBgjqh2snbqVrc/s2ayuvP3Yv5b81ghon4NNLUFzf/iPgHid9Pofcvt+kWN jMOA== 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=4JeNUjYgJEhzeRlLNwUvBD8QbN4vuM4hjM02o9daM8Q=; b=DopP6qeK1RqNuSpmBBzGAl5H4dWcWgR6+xBxRIs/URjWqLO9HeUpEg6+ILU/232L1y rCEA3yx72huuuFvGJZ2EDzXtrfVeWFH9kx74FjhVcis1EX8ZxEjOgYHiuj8SX85CBHEP 2GG/UWNtJnPoDZvg9z6VMMy0atBDiepX2d62KbC5r+FFh1AMqN6YSazymxJbPTeEo8K0 /vUB21nhAfYaPrA5WJcQwwbGBpkg97WlZtLhegEdoz5nXhpPzsljgpEdIjN9ccox0UbZ Ujt4NrgIakYPom6rtZP6aWzkmfPjNPMZAKCJ1XCmvDe80jU1K99KMnTE71ie0XePmqKy 6s5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=NiVpcT09; 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 u15-v6si2545026plk.130.2018.02.15.04.15.25; Thu, 15 Feb 2018 04:15:41 -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=NiVpcT09; 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 S967994AbeBOMO2 (ORCPT + 99 others); Thu, 15 Feb 2018 07:14:28 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:18741 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967980AbeBOMOY (ORCPT ); Thu, 15 Feb 2018 07:14:24 -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=1518696865; x=1550232865; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=0ck+FQAQy6ZE4eLPAnE6s7UaOBeDC7sS0POkyEKOojw=; b=NiVpcT09f/OJtpYACZKIT9hyuuRMLh5peZLsJLdczUbsKS+rhrKs8dXu UnW+S2F7ozM3P/75YhqH7k6AqvglrYgEm8R0PHxeF3dzVjcDzctQ+Pj7f fS4U1ejKC6ZpuH5TO5NHk4jwGEDCoCt7QyRa2P3Jpx5ILerP0EkpdaLox 1P/OJ+Wvnm+wTLK4QzLZQcAvsldvTwkr2mGZSMkwLQeIxYraEwqlPJ8Zl 936incu7Tc9FfiNKuGhGkklS+I8Vid60U5sf2ob9TmFrhakJixrLV4u0v Dvq5IuyKIeObgfUbjQc3TfyVDrwUPcc/mk8guA4VZ4QlGc3CQl2Dp1iNd A==; X-IronPort-AV: E=Sophos;i="5.46,517,1511798400"; d="scan'208";a="71975447" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 15 Feb 2018 20:14:25 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 15 Feb 2018 04:08:26 -0800 Received: from ilb000042.sdcorp.global.sandisk.com ([10.0.231.79]) by uls-op-cesaip02.wdc.com with ESMTP; 15 Feb 2018 04:14:22 -0800 From: Stanislav Nijnikov To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, jaegeuk@kernel.org, Bart.VanAssche@wdc.com Cc: alex.lemberg@wdc.com, Stanislav Nijnikov Subject: [PATCH v6 03/11] scsi: ufs: sysfs: interconnect descriptor Date: Thu, 15 Feb 2018 14:14:03 +0200 Message-Id: <1518696851-6730-4-git-send-email-stanislav.nijnikov@wdc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518696851-6730-1-git-send-email-stanislav.nijnikov@wdc.com> References: <1518696851-6730-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 440b94e..ba229d9 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