From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934190AbdBQONF (ORCPT ); Fri, 17 Feb 2017 09:13:05 -0500 Received: from mail-bl2nam02on0082.outbound.protection.outlook.com ([104.47.38.82]:61364 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933938AbdBQOND (ORCPT ); Fri, 17 Feb 2017 09:13:03 -0500 From: Piotr Sroka To: Ulf Hansson CC: "linux-mmc@vger.kernel.org" , Rob Herring , Mark Rutland , Adrian Hunter , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" Subject: RE: [PATCH 2/2] [2/2] mmc: sdhci-cadence: Update PHY delay configuration Thread-Topic: [PATCH 2/2] [2/2] mmc: sdhci-cadence: Update PHY delay configuration Thread-Index: AQHSiFWcVcUvA5eEp0uvXhBjGr1siKFrvM+AgAFxi1A= Date: Fri, 17 Feb 2017 14:12:59 +0000 Message-ID: References: <1487250413-5769-1-git-send-email-piotrs@cadence.com> <1487250413-5769-2-git-send-email-piotrs@cadence.com> In-Reply-To: Accept-Language: pl-PL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-dg-tag-bcast: x-dg-ref: PG1ldGE+PGF0IG5tPSJib2R5LnR4dCIgcD0iYzpcdXNlcnNccGlvdHJzXGFwcGRhdGFccm9hbWluZ1wwOWQ4NDliNi0zMmQzLTRhNDAtODVlZS02Yjg0YmEyOWUzNWJcbXNnc1xtc2ctMmNmMGI4ODQtZjUxYi0xMWU2LWJiZDQtYjg3NjNmYWJhNWQxXGFtZS10ZXN0XDJjZjBiODg2LWY1MWItMTFlNi1iYmQ0LWI4NzYzZmFiYTVkMWJvZHkudHh0IiBzej0iNzUzOCIgdD0iMTMxMzE4MTQzNzU4NTc0MzE3IiBoPSJhdDJSeitoWG5Oc2tGaStxei90QkV6clJ6bk09IiBpZD0iIiBibD0iMCIgYm89IjEiLz48L21ldGE+ x-dg-paste: authentication-results: spf=none (sender IP is ) smtp.mailfrom=piotrs@cadence.com; x-originating-ip: [213.131.238.28] x-ms-office365-filtering-correlation-id: f3c96c9b-4052-4124-ff90-08d4573f13e1 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR07MB3086; x-microsoft-exchange-diagnostics: 1;MWHPR07MB3086;7:UlNypFj18dS9JXOdNEl9DNB2cZOeJJc6/MbTTtsPiIkj+bK94f0ya0Wg6ZFQT7ot+5k1HAEezgeMqFCheYuSUz8/gtoBw8TeSoDRkri/a48CFQpMMj90x3pZBteT2OOaKthskIspqzLl7t6K/Cjabz+fpNjy414llBMULXoZYRpimT1K49IQ+AK+0K19ieSAxWGEREEWylNfMTuzddmpJPQB/a2JBcDUeB20MirHOpv9VmKqu8aFTrdlrzwdNQ4UrJqOhC9LQaWIqJN0Otld5OVMRok/mWDlvrBAVlNtl3NodZV0Uze/U+mhh6qq9wQf9SX6HKqZFzvHbcN/WWCw4A==;20:dqQN4CnV+v7Rg0B9Jz0RZPz64ZzQB34r5/fYDxyVIB034SsVG6ZA24DM50roU52Fn73XFtKmZ05BQ4Q7MvKGV/KlHUJudyvyhbrAW1tV7y9V5xLU4G8W8w0KyOeTDmN2gP65v7tuAb92fci74H9SSJQrgS6/73lmbFCzwls8lE59hJeXhKmttaExPZLibP6K+8+wsdHbOyIXKVal9UEXVePWtGmg8KJsFQFFGHPfyGveenJtQJEcjLOnS5crOFzA x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(72806322054110); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(20161123558025)(6072148);SRVR:MWHPR07MB3086;BCL:0;PCL:0;RULEID:;SRVR:MWHPR07MB3086; x-forefront-prvs: 02213C82F8 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(39450400003)(24454002)(199003)(13464003)(377454003)(36092001)(189002)(54906002)(99286003)(122556002)(3280700002)(6506006)(25786008)(7736002)(55016002)(8936002)(53936002)(33656002)(9686003)(66066001)(86362001)(6436002)(110136004)(189998001)(53546006)(305945005)(38730400002)(6246003)(81166006)(229853002)(76176999)(8676002)(81156014)(68736007)(575784001)(3660700001)(2906002)(6916009)(74316002)(5660300001)(5890100001)(4326007)(106356001)(106116001)(50986999)(54356999)(7696004)(2950100002)(105586002)(101416001)(15650500001)(3846002)(97736004)(2900100001)(92566002)(77096006)(102836003)(6116002);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR07MB3086;H:MWHPR07MB3088.namprd07.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Feb 2017 14:12:59.1314 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3086 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v1HEDLqY013604 > -----Original Message----- > From: Ulf Hansson [mailto:ulf.hansson@linaro.org] > Sent: 16 February, 2017 4:10 PM > Subject: Re: [PATCH 2/2] [2/2] mmc: sdhci-cadence: Update PHY delay > configuration > > On 16 February 2017 at 14:06, Piotr Sroka wrote: > > DTS properties are used instead of fixed data because PHY settings can > > be different for different platforms. > > Configuration of new three PHY delays were added > > > > Signed-off-by: Piotr Sroka > > --- > > .../devicetree/bindings/mmc/sdhci-cadence.txt | 54 ++++++++++++++ > > Please split this patch. > > DT docs should be a separate patch and make sure it precedes the changes > where the new bindings are being parsed in the driver code. > Ok I will do it in next version of patch. > > drivers/mmc/host/sdhci-cadence.c | 83 +++++++++++++++++++- > -- > > 2 files changed, 129 insertions(+), 8 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/mmc/sdhci-cadence.txt > > b/Documentation/devicetree/bindings/mmc/sdhci-cadence.txt > > index c0f37cb..221d3fe 100644 > > --- a/Documentation/devicetree/bindings/mmc/sdhci-cadence.txt > > +++ b/Documentation/devicetree/bindings/mmc/sdhci-cadence.txt > > @@ -19,6 +19,59 @@ if supported. See mmc.txt for details. > > - mmc-hs400-1_8v > > - mmc-hs400-1_2v > > > > +- phy-input-delay-sd-hs: > > + Value of the delay in the input path for High Speed work mode. > > + Valid range = [0:0x1F]. > > Please specify what unit this in. And then also a suffix, like "-ns" > to the name of the binding. The delay starts from 5ns (for delay parameter equal to 0), and it is increased by 2.5ns. 0 - means 5ns, 1 means 7.5 ns etc. I will add this description. I think the suffix in this case will not be necessary because the unit is a 2.5ns. What is your opinion? > > Similar comment applies to all new bindings below. > > > + Delay configuration stay unchanged if this property is not provided. > > I would remove this information from the DT doc, it's just confusion when > you refer to something that should remain "unchanged". > Ok I will remove it in next version of patch. > Similar comment applies to all new bindings below. > > > +- phy-input-delay-sd-default: > > + Value of the delay in the input path for Default Speed work mode. > > + Valid range = [0:0x1F]. > > + Delay configuration stay unchanged if this property is not provided. > > +- phy-input-delay-sd-sdr12: > > + Value of the delay in the input path for SDR12 work mode. > > + Valid range = [0:0x1F]. > > + Delay configuration stay unchanged if this property is not provided. > > +- phy-input-delay-sd-sdr25: > > + Value of the delay in the input path for SDR25 work mode. > > + Valid range = [0:0x1F]. > > + Delay configuration stay unchanged if this property is not provided. > > +- phy-input-delay-sd-sdr50: > > + Value of the delay in the input path for SDR50 work mode. > > + Valid range = [0:0x1F]. > > + Delay configuration stay unchanged if this property is not provided. > > +- phy-input-delay-sd-ddr50: > > + Value of the delay in the input path for DDR50 work mode. > > + Valid range = [0:0x1F]. > > + Delay configuration stay unchanged if this property is not provided. > > +- phy-input-delay-emmc-legacy: > > Legacy? As in legacy speed mode? Yes as legacy speed mode. But there are two delays each for one specific mode. One for SD legacy mode and one for MMC legacy mode. > > > + Value of the delay in the input path for eMMC legacy work mode. > > + Valid range = [0:0x1F]. > > + Delay configuration stay unchanged if this property is not provided. > > +- phy-input-delay-emmc-sdr: > > + Value of the delay in the input path for eMMC SDR work mode. > > + Valid range = [0:0x1F]. > > + Delay configuration stay unchanged if this property is not provided. > > +- phy-input-delay-emmc-ddr: > > + Value of the delay in the input path for eMMC DDR work mode. > > + Valid range = [0:0x1F]. > > + Delay configuration stay unchanged if this property is not provided. > > +- phy-dll-delay-sdclk: > > + Value of the delay introduced on the sdclk output > > + for all modes except HS200, HS400 and HS400_ES. > > + Valid range = [0:0x7F]. > > + Delay configuration stay unchanged if this property is not provided. > > +- phy-dll-delay-sdclk-hsmmc: > > + Value of the delay introduced on the sdclk output > > + for HS200, HS400 and HS400_ES speed modes. > > + Valid range = [0:0x7F]. > > + Delay configuration stay unchanged if this property is not provided. > > +- phy-dll-delay-strobe: > > + Value of the delay introduced on the dat_strobe input > > + used in HS400 / HS400_ES speed modes. > > + Valid range = [0:0x7F]. > > + Delay configuration stay unchanged if this property is not provided. > > A general comment, is that I suggest you look at the generic mmc DT bindings > for the different speedmodes, and align these new names of DT bindings to > those. Ok thanks for suggestion. Does below property names looks more clearly? phy-input-delay-sd-highspeed, phy-input-delay-sd-legacy, phy-input-delay-sd-uhs-sdr12 phy-input-delay-sd-uhs-sdr25 phy-input-delay-sd-uhs-sdr50 phy-input-delay-sd-uhs-ddr50 phy-input-delay-mmc-legacy, phy-input-delay-mmc-ddr phy-input-delay-mmc-h200 phy-input-delay-mmc-h400 The last three delays are used for few modes so I will add the names of these modes in description of each property. I propose do not change the names. phy-dll-delay-sdclk phy-dll-delay-sdclk-hsmmc phy-dll-delay-strobe > > + if (ret) > > + return ret; > > + } > > + if (!of_property_read_u32(np, "phy-dll-delay-sdclk-hsmmc", &tmp)) { > > + ret = sdhci_cdns_write_phy_reg(priv, > > + SDHCI_CDNS_PHY_DLY_HSMMC, tmp); > > + if (ret) > > + return ret; > > + } > > + if (!of_property_read_u32(np, "phy-dll-delay-strobe", &tmp)) { > > + ret = sdhci_cdns_write_phy_reg(priv, > > + SDHCI_CDNS_PHY_DLY_STROBE, tmp); > > + if (ret) > > + return ret; > > + } > > + return 0; > > This all looks very weird. Should you write all this to the phy register, even > before you know anything about what kind of eMMC/MMC/SD/SDIO card > that is attached? Does that even work? Yes it is initial configuration of PHY. Each mode has own input delay. Delay for legacy timing mode is not used in high speed mode. The do not interfere with each other. It works. > > } > > > > static inline void *sdhci_cdns_priv(struct sdhci_host *host) @@ > > -224,10 +288,11 @@ static int sdhci_cdns_probe(struct platform_device > *pdev) > > struct sdhci_host *host; > > struct sdhci_pltfm_host *pltfm_host; > > struct sdhci_cdns_priv *priv; > > + struct device *dev = &pdev->dev; > > struct clk *clk; > > int ret; > > > > - clk = devm_clk_get(&pdev->dev, NULL); > > + clk = devm_clk_get(dev, NULL); > > This seems like and unrelated change. Please remove this change from the > patch. Ok it will be removed. Regards Piotr