Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S947448AbcJaWNe (ORCPT ); Mon, 31 Oct 2016 18:13:34 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:45792 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S947383AbcJaWNc (ORCPT ); Mon, 31 Oct 2016 18:13:32 -0400 X-AuditID: cbfee61a-f79926d000005981-11-5817c2098d34 Subject: Re: [RFC 1/2] mmc: sdhci: dt: Add device tree properties sdhci-caps and sdhci-caps-mask To: Adrian Hunter , Ulf Hansson , Zach Brown References: <1477425538-3315-1-git-send-email-zach.brown@ni.com> <1477425538-3315-2-git-send-email-zach.brown@ni.com> <6031045c-0eb2-7bea-1efd-874dade0f009@samsung.com> <7bc4cb38-6864-c87e-390e-7f9f3f133dd6@intel.com> Cc: Rob Herring , Mark Rutland , linux-mmc , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" From: Jaehoon Chung Message-id: Date: Tue, 01 Nov 2016 07:13:29 +0900 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-version: 1.0 In-reply-to: <7bc4cb38-6864-c87e-390e-7f9f3f133dd6@intel.com> Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFIsWRmVeSWpSXmKPExsVy+t9jQV3OQ+IRBquWaFucfLKGzWL+kXOs Fpd3zWGzOPK/n9Fi6fWLTBate4+wWxxfG27xan+cA4fHmnlrGD0W73nJ5LFpVSebx51re9g8 rp/ZzuTxeZNcAFuUm01GamJKapFCal5yfkpmXrqtUmiIm66FkkJeYm6qrVKErm9IkJJCWWJO KZBnZIAGHJwD3IOV9O0S3DLmfVjJXHBUqWLuqbmsDYxtMl2MnBwSAiYSO/9tZYWwxSQu3FvP 1sXIxSEkMItR4vmL1YwQzgNGiVtr/wM5HBzCAkkSGxc7gDSICBRLfH//gRmi5heTxIPjk9lB HGaBD4wSf3aANHBysAnoSGz/dpwJxOYVsJN42N/PDDKIRUBV4un5WhBTVCBM4nmjE0SFoMSP yfdYQGxOAVuJ+a9+soOUMAuoS0yZkgsSZhaQl9i85i3zBEagIxE6ZiFUzUJStYCReRWjRGpB ckFxUnquYV5quV5xYm5xaV66XnJ+7iZGcLw9k9rBeHCX+yFGAQ5GJR7eDZ7iEUKsiWXFlbmH GCU4mJVEeBm3AYV4UxIrq1KL8uOLSnNSiw8xmgI9MZFZSjQ5H5gK8kriDU3MTcyNDSzMLS1N jJTEeRtnPwsXEkhPLEnNTk0tSC2C6WPi4JRqYDzx8be07y7rogeuMUE9MV841jRn5tlPl94j LaTDe2X1qd2LaoqeirH2z1yfvEJBf9mC/rW/F8sl8O/b1Tlr8614084a58cHnwvm3bz1dXWD zfHEkkZ/jxVH1TziL28Qni2on7V7JeOtf/tfuYnFbj775opm1Z6vPv9/3amWin7FNqX/yQvX 86VKLMUZiYZazEXFiQBYcKb+zQIAAA== X-MTR: 20000000000000000@CPGS Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4307 Lines: 112 On 10/31/2016 09:34 PM, Adrian Hunter wrote: > On 31/10/16 13:59, Jaehoon Chung wrote: >> On 10/28/2016 05:12 PM, Ulf Hansson wrote: >>> On 25 October 2016 at 21:58, Zach Brown wrote: >>>> On some systems the sdhci capabilty registers are incorrect for one >>>> reason or another. >>>> >>>> The sdhci-caps-mask property specifies which bits in the registers >>>> are incorrect and should be turned off before using sdhci-caps to turn >>>> on bits. >>>> >>>> The sdhci-caps property specifies which bits should be turned on. >>>> >>>> Signed-off-by: Zach Brown >>>> --- >>>> Documentation/devicetree/bindings/mmc/mmc.txt | 7 +++++++ >>>> 1 file changed, 7 insertions(+) >>>> >>>> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt >>>> index 8a37782..1415aa0 100644 >>>> --- a/Documentation/devicetree/bindings/mmc/mmc.txt >>>> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt >>> >>> The bindings in this document are common mmc DT bindings, not bindings >>> specific to a mmc controller. >>> >>> So unless these bindings are applicable for another controller than >>> sdhci, I suggest we create a new file to document these. >>> How about Documentation/devicetree/bindings/mmc/sdhci.txt? >>> >>>> @@ -52,6 +52,13 @@ Optional properties: >>>> - no-sdio: controller is limited to send sdio cmd during initialization >>>> - no-sd: controller is limited to send sd cmd during initialization >>>> - no-mmc: controller is limited to send mmc cmd during initialization >>>> +- sdhci-caps-mask: The sdhci capabilities registers are incorrect. This 64bit >>> >>> /s/registers/register >>> >>> This applies to some more places below as well. >>> >>>> + property corresponds to the bits in the sdhci capabilty registers. If the bit >>>> + is on in the mask then the bit is incorrect in the registers and should be >>>> + turned off. >>>> +- sdhci-caps: The sdhci capabilities registers are incorrect. This 64bit >>>> + property corresponds to the bits in the sdhci capability registers. If the >>>> + bit is on in the property then the bit should be on in the reigsters. >>> >>> /s/reigsters/register >>> >>>> >>>> *NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line >>>> polarity properties, we have to fix the meaning of the "normal" and "inverted" >>>> -- >>>> 2.7.4 >>>> >>> >>> Overall, I like this idea as it gives us good flexibility. Thus it >>> should avoid us to having to add any further new similar "sdhci broken >>> cap" DT binding. We could also decide to start deprecate some of the >>> existing sdhci bindings, if we think that makes sense. >>> >>> The downside is that we get a "magic" hex value in the dts. Although, >>> people could address this issue by providing some comments about what >>> the bits it means in the dts files themselves. >> >> I think it's not good about getting "magic" hex value. >> In my experience, it's too difficult what bits means and calculate.. >> Because some people who i know had already used like this.(locally..) >> >> It needs to consider this...otherwise..it should become really complex magic code. > > The bits we use are listed in sdhci.h and how we use them can be determined > from the sdhci source code. Also, from the hardware perspective, there is > the SDHCI specification. So what the bits mean is readily available. > > With regard to calculating the values, won't it be obvious from testing if > they are wrong? You're right. But I didn't see the real use case for this properties. If it needs to add these properties, why didn't add codes relevant to these in device-tree? Otherwise, this code should be dead code. Best Regards, Jaehoon Chung > >> >> Best Regards, >> Jaehoon Chung >> >>> >>> Let's see what Rob thinks about this. >>> >>> Kind regards >>> Uffe >>> -- >>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in >>> the body of a message to majordomo@vger.kernel.org >>> More majordomo info at http://vger.kernel.org/majordomo-info.html >>> >>> >>> >> >> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > >