Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3410213imm; Fri, 25 May 2018 05:21:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq7Z2rMdiHuCsO5ebzLS2/WDxusKPKjmoaVfA1AovnR839zoWy9AtpFovOKLu99WIvztj1t X-Received: by 2002:a17:902:57d0:: with SMTP id g16-v6mr2407397plj.222.1527250906724; Fri, 25 May 2018 05:21:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527250906; cv=none; d=google.com; s=arc-20160816; b=YGL0uxmMMA4ppuJKyvLyJfXhtqbontkZ2uUSHqUjEznc0f+DA+4kH9iRcCoR6a38mj sHsw2mbwtxR9LNRZDABm9QVyPxK8Qh6Yn+/Ky3qUnTjVhwW8lyVJH0WHOAWfByPJ3Erq aPiOyNu/R9a4bD2QwmR7VYhqq3D2LyZkvTVCMw+IMmP1jC6mYYU3Jv8IckEC+dgrCMrm v/fS0hHcIciicsKWY0Adoduqff/FjO4kksjTkhOtzbBu76UXqy/0Vl/zbFWArZT5Z5GA y7S45nEYxImFgr1t18eFNa5MqfgRyV0yKH1/yJ6GTJ9lI8vXZPgyQshoJboEbx4UT/Kd F5eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:dmarc-filter:dkim-signature :dkim-signature:arc-authentication-results; bh=g4A5vrWPVWhMiN9/Ee6F3mHd7SnbH3Utzs0SDUeyeAM=; b=BfcNCDD0rtxWhXtizDXd2lQyMLSL4bTmftVMvHxO1JScL///IUGVBjI26KP7BeQ6XU 4ToQ5NWZskDDp6E+K6yCyNuwBFEkr8bQu5G+HCdKG+x22Sc6TICztozlDE7SQANMDrbg mhprKny+3cnyY2GpkDAJNGMsMNNS616UVMe3yEAvylBhyJLHkGukGcxGUNWsT8KfBeqQ h0ZYSXhFuUNyT2UIcPdN3btV4+OKKHjCSLbWBKVu0C3xtkwBzGQHcVTSir/TKT8Qj+Vw xYxUNi6Ves9xE02/p+COlhLyPJyPVFfx2WszHQENvWkUyCmw/W6A/yHQcoa6eUyjPt/s Tl1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=T8BbgKml; dkim=pass header.i=@codeaurora.org header.s=default header.b=N+bfTbGz; 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 m13-v6si18714818pgp.542.2018.05.25.05.21.31; Fri, 25 May 2018 05:21:46 -0700 (PDT) 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=pass header.i=@codeaurora.org header.s=default header.b=T8BbgKml; dkim=pass header.i=@codeaurora.org header.s=default header.b=N+bfTbGz; 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 S966725AbeEYMUw (ORCPT + 99 others); Fri, 25 May 2018 08:20:52 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:45928 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966513AbeEYMUu (ORCPT ); Fri, 25 May 2018 08:20:50 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EB93160AF9; Fri, 25 May 2018 12:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527250850; bh=XEpqeKrfv3uwEkbZLlCBBUp62+9MMYPQIwOZN93PByk=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=T8BbgKmlWqVFkVJKVik5TTLV8yRQ1OWIsHBoPEMhvHLYz01xINsolP/ZUrm6DDyPO 8Eew9CbKSWb4kQFwnJwohkfKnhZ85HFM5nseVraW5rdEYnwFc37pkeH/TZ4fa86xsl sINWC5XmAlG37a4akSZG09UyguZbhA+FkqUt1syY= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,TVD_RCVD_SINGLE,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from SAYALIL (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sayalil@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id AA80960C4F; Fri, 25 May 2018 12:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527250847; bh=XEpqeKrfv3uwEkbZLlCBBUp62+9MMYPQIwOZN93PByk=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=N+bfTbGzA8ERMEmTz/o4mg+aaH2HWDtzr7iXOsj2Bsn6ghFGfkP1j5NhVcRytEjxk /aD/5ZsZ/ATdbDksp9WFf/3+aXfbl5mlM63saySLMQX0UujEukjml70seWPgp6Zcqv pByQYYp9wUTzhFUPw5xOywJw6cy3uzg2ja6HeFP8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org AA80960C4F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sayalil@codeaurora.org From: "sayali" To: "'Rob Herring'" Cc: , , , , , , , , , "'Mark Rutland'" , "'Mathieu Malaterre'" , "'open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS'" , "'open list'" References: <1526962900-20683-1-git-send-email-sayalil@codeaurora.org> <1526962900-20683-2-git-send-email-sayalil@codeaurora.org> <20180523184830.GA29198@rob-hp-laptop> In-Reply-To: <20180523184830.GA29198@rob-hp-laptop> Subject: RE: [PATCH RFC 1/3] scsi: ufs: set the device reference clock setting Date: Fri, 25 May 2018 17:50:40 +0530 Message-ID: <000101d3f422$cfae7a20$6f0b6e60$@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQKWBGBX46Bq7JsJ16hs/xS09lqmJgL6NwMhAka/az+ikjISAA== Content-Language: en-us Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, For UFS provisioning, all we need is ref_clk to be set to 19.2MHz before actual descriptor write happens. So I can actually avoid parsing it via DT and use REF_CLK_FREQ_19_2_MHZ from enum ref_clk_freq (which is already added in my current implementation). Thanks, Sayali -----Original Message----- From: Rob Herring [mailto:robh@kernel.org] Sent: Thursday, May 24, 2018 12:19 AM To: Sayali Lokhande Cc: subhashj@codeaurora.org; cang@codeaurora.org; vivek.gautam@codeaurora.org; rnayak@codeaurora.org; vinholikatti@gmail.com; jejb@linux.vnet.ibm.com; martin.petersen@oracle.com; asutoshd@codeaurora.org; linux-scsi@vger.kernel.org; Mark Rutland ; Mathieu Malaterre ; open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS ; open list Subject: Re: [PATCH RFC 1/3] scsi: ufs: set the device reference clock setting On Tue, May 22, 2018 at 09:51:38AM +0530, Sayali Lokhande wrote: > From: Subhash Jadavani > > UFS host supplies the reference clock to UFS device and UFS device > specification allows host to provide one of the 4 frequencies (19.2 > MHz, > 26 MHz, 38.4 MHz, 52 MHz) for reference clock. Host should set the > device reference clock frequency setting in the device based on what > frequency it is supplying to UFS device. > > Signed-off-by: Subhash Jadavani > [cang@codeaurora.org: Resolved trivial merge conflicts] > Signed-off-by: Can Guo > Signed-off-by: Sayali Lokhande > --- > .../devicetree/bindings/ufs/ufshcd-pltfrm.txt | 8 +++ > drivers/scsi/ufs/ufs.h | 9 ++++ > drivers/scsi/ufs/ufshcd-pltfrm.c | 20 ++++++++ > drivers/scsi/ufs/ufshcd.c | 60 ++++++++++++++++++++++ > drivers/scsi/ufs/ufshcd.h | 2 + > 5 files changed, 99 insertions(+) > > diff --git a/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt > b/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt > index c39dfef..ac94220 100644 > --- a/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt > +++ b/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt > @@ -41,6 +41,12 @@ Optional properties: > -lanes-per-direction : number of lanes available per direction - either 1 or 2. > Note that it is assume same number of lanes is used both > directions at once. If not specified, default is 2 lanes per direction. > +- dev-ref-clk-freq : Specify the device reference clock frequency, must be one of the following: > + 0: 19.2 MHz > + 1: 26 MHz > + 2: 38.4 MHz > + 3: 52 MHz > + Defaults to 26 MHz if not specified. You already have "ref_clk", can't you just read its frequency? Rob