Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753871AbbHJIfA (ORCPT ); Mon, 10 Aug 2015 04:35:00 -0400 Received: from mail-bl2on0116.outbound.protection.outlook.com ([65.55.169.116]:64704 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752830AbbHJIe5 (ORCPT ); Mon, 10 Aug 2015 04:34:57 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none; Date: Mon, 10 Aug 2015 16:25:01 +0800 From: Dong Aisheng To: Haibo Chen CC: , , , , , , , , , , , , , , , Subject: Re: [PATCH v5 2/6] mmc: sdhci-esdhc-imx: add tuning-step seting support Message-ID: <20150810082500.GB15036@shlinux1.ap.freescale.net> References: <1439194688-18335-1-git-send-email-haibo.chen@freescale.com> <1439194688-18335-3-git-send-email-haibo.chen@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1439194688-18335-3-git-send-email-haibo.chen@freescale.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11OLC003;1:CaZWfKRHAbZAZLYVvIslFprL6Lsz8z3BKlLpVs5mr9GNpOOE12F/Znb1XTGlLpH9BpGBJGaFvfz9WSl25PtVKxEo0gxGC3khKeDitUrQeJTIGbSG27JPoPgMVj2PkWUykyRppVOzLIVH/lnfE2t67FZ+CZwlPmW9qOi+ilAszF+DSM5PVxtwEm2gMEUoFuSPyVBVtZRzfikNkpB+y9u2tGawE3PXwfD0m6mdQYs2oWIUX1igFOuJ9YWzXXri8xBag2UOIh2Sem03PMNC6Tcd5sCzGTiQ62i8uNRTxOMtZDIaqg6r4eYn8vlmcSYlNfPg55WfbyAq4jm1MIvcyG3keA== X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(979002)(6009001)(2980300002)(339900001)(199003)(189002)(24454002)(97756001)(83506001)(46102003)(4001450100002)(23726002)(47776003)(33656002)(6806004)(106466001)(92566002)(105606002)(64706001)(104016003)(19580395003)(50466002)(189998001)(86362001)(19580405001)(62966003)(77156002)(97736004)(76176999)(54356999)(2950100001)(87936001)(4001350100001)(68736005)(77096005)(50986999)(69596002)(46406003)(85426001)(110136002)(230783001)(4001540100001)(5001920100001)(5001860100001)(5003600100002)(5001830100001)(81156007)(5001960100002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0301MB1308;H:az84smr01.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1308;2:sbq/2SfvpLERllZ1kEysuobXE0mvZEg68eKKMsiXJNy7uQn+/FrFivY3+RMVPiqVqRgrghLE2+aBqGf7A8iYUgHHchiqpxaMy+PytoKD8RU4Ke7/V8x+urES7H12k2tOYcOI14++evC7/GcvHhJaka1LI4WJ0b3exHT3PQGfKls=;3:U5zBCj9eWWeoW96ayfKDvrTcPWX89FAMMrhQufYeE6JCLqbGPL5wXc3TpJMfZkdfKrR8eUngGfrwRH+E6hSDinV/Ch9xrfRtuimzwTkWromvjJazeE6tQyvyTfoEVBqtF9QbeBGSu3KiWHchgWZo6Pr2PdNYVKfJanQ52Pmy2ZEbs0VOklg5VODwUxIUF1drfZXpN/tgazjmD+0XH2fx9KtOUii748j/hqKpp2zFw9w=;25:D7xkwMXqziwtu+F2W2UGiE7E8FtF+Au+z3Vk/SL+Rm7CVKXZ0eX01PfdRF48YFcfLg9SDEv6FpgIqxBcyiRnoDPFQGEs0TcHihM32EvZr63zMmghIxAj/CHIRxZ7vfpA4v9ZS7P1EgGIvWH703b0DBLzQYk3m4Bh+MJIPOHLdfi430ygjjLkX4gcwOulU3VJscHPGmfn5Y0cSC057FRcacPA9SodGTEw7VVuUPm1RffqhZzG/g3nTvGxRxk3/RRR X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1308; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1308;20:Vm7HLhDVYTgTjnkmKZRrVKbYl4OzecKhYQBFPeODKpIljQjUHTrCFp9tvNkoa4RenZmUEg0B2ERpbj5E5ByZWS/nu2PlSOtRCe5bSfzBMzybwsrF+0T1vE7K1U3JlVkLkQ6wPjEdT/euiN4qrG8FWGtiQkmjaZV/f8kA8J+psvW0mRKI9IK8pPZEkH1jthg09QxuN4T+J7bfKFx5n7oyPTjy+yekYs8NF2WgGA8X/aLlWtAlxy15x905GWgTS8O57KFUfvBQbB/DIK2MZSPWj/H0LP3ybvgEjLZxehrZeCdRdemEsSX7PbNPhHlinNpvqpJeA47jcPoXiPC+d6w+a1D8FCsizX+QTjdhjtNPQic=;4:Dwd5zqctr4nnK+2h1qWg4nswrf9CmZ3Db/SP9egvVrg5M3e/VSsNDxihFhyVZ+sKZh5iEH54582oBj0kvDrov8L+NIuuZA3ly7OuW0676Sham3kUk2CNu85QtD027eWJbR2BE7BQoAkaN7XFc7kNrnOlfiJgIp9+sxQIcYfV9cmxNZ/oCyUh7bFKVxXhWe/ieKm3Ax2Mkp/rkqEyhSXOD343e7yiVcBR+pWv9GwvaIUdmao+1qawkkFHMoElkplI/6wrODWulUkJINVPRplatQ3mI9fEX9RPhSnm0tN2EcM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:CY1PR0301MB1308;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1308; X-Forefront-PRVS: 06640999CA X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0301MB1308;23:qOCoy2594ot+mVocLJXe3i3bR5HMVETH14Sr5x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xFENfnPI//Bb4ZHOaU40dPci2PXh0cYJTMYJ?= =?us-ascii?Q?9RzIhITLykLJk5YBaSj+LAQiqbgPiPzp8xFfBHQVvqWcOGMgNvaOfkBMFAhk?= =?us-ascii?Q?6NmDQ8joGoBFCd/dYxLTL0S+wa9Qk77WG2HSyQCBAGWHxF6Pz0SoD9+72xK0?= =?us-ascii?Q?oaEb+UXhtlyZrIh4ryUmhdFfvOac5yBKDarXU/fYzFVQiXpZ5ziBqjnmq/ym?= =?us-ascii?Q?0708MZd+RUqlR95V1/PBPoo27derAFm011pBSCJ3l4/exwqaIMiZH8abVg6X?= =?us-ascii?Q?KxE1tAROzD8He1IQP9ig/dtnzD8MN2pDm/2tonLJVBePh85ntikZdIuZQovT?= =?us-ascii?Q?fSpi21PZ9vWNY7hRmQgcnt2RMBLSmRiMxv9DlmFQx8qXNRs12lP9r0y0vUuc?= =?us-ascii?Q?iZlc7WVOiE/IKyhpDgtT88nsW4UWt5rO94mu1cHKPGVofhbmZzbt/kTz1mJ/?= =?us-ascii?Q?bzW+3MQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1308;5:T3EPk8+j5IjIiFE3xeMLSS3f8JrymjRFq2fFbCxKhCpOBoH6dTByMTbMfFZwMuWwkvlmV9RAfHFNOlGds4PhvkWZyAfFuIqwJj+hByx5++4Ghls5xa/cgou1IEXSC+lTEvkvAAY0B3gR00JXX4CRQw==;24:/6QRzocFFWHkwP+Rj7EcAbfsgjcQ40VkgXKCdzGJSoDBU4hZtFug8vKN9pKfCdvSMStRenB2F4GonOWoCMlHYD0dzTalFdKhrvu76L0CdTk=;20:21LwizI8rEEfoH6pLe6ZsJu7FMcNZEKRNq/ztzVuA+8Q2zQHHDoCIyORh3AatdXKneMzpF3nM2bUV1XuT3D5Ww== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2015 08:34:53.5137 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB1308 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3354 Lines: 85 On Mon, Aug 10, 2015 at 04:18:04PM +0800, Haibo Chen wrote: > tuning-step is the delay cell steps in tuning procedure. The default value > of tuning-step is 1. Some boards or cards need another value to pass the > tuning procedure. For example, imx7d-sdb board need the tuning-step value > as 2, otherwise it can't pass the tuning procedure. > > So this patch add the tuning-step setting in driver, so that user can set > the tuning-step value in dts. > Fix a typo. For patch title: mmc: sdhci-esdhc-imx: add tuning-step seting support s/seting/setting Regards Dong Aisheng > Signed-off-by: Haibo Chen > --- > drivers/mmc/host/sdhci-esdhc-imx.c | 9 +++++++++ > include/linux/platform_data/mmc-esdhc-imx.h | 1 + > 2 files changed, 10 insertions(+) > > diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c > index 2a816ad..03c9f33 100644 > --- a/drivers/mmc/host/sdhci-esdhc-imx.c > +++ b/drivers/mmc/host/sdhci-esdhc-imx.c > @@ -75,6 +75,7 @@ > #define ESDHC_STD_TUNING_EN (1 << 24) > /* NOTE: the minimum valid tuning start tap for mx6sl is 1 */ > #define ESDHC_TUNING_START_TAP 0x1 > +#define ESDHC_TUNING_STEP_SHIFT 16 > > /* pinctrl state */ > #define ESDHC_PINCTRL_STATE_100MHZ "state_100mhz" > @@ -474,6 +475,7 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg) > } else if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) { > u32 v = readl(host->ioaddr + SDHCI_ACMD12_ERR); > u32 m = readl(host->ioaddr + ESDHC_MIX_CTRL); > + u32 tuning_ctrl; > if (val & SDHCI_CTRL_TUNED_CLK) { > v |= ESDHC_MIX_CTRL_SMPCLK_SEL; > } else { > @@ -484,6 +486,11 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg) > if (val & SDHCI_CTRL_EXEC_TUNING) { > v |= ESDHC_MIX_CTRL_EXE_TUNE; > m |= ESDHC_MIX_CTRL_FBCLK_SEL; > + tuning_ctrl = readl(host->ioaddr + ESDHC_TUNING_CTRL); > + tuning_ctrl |= ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP; > + if (imx_data->boarddata.tuning_step) > + tuning_ctrl |= imx_data->boarddata.tuning_step << ESDHC_TUNING_STEP_SHIFT; > + writel(tuning_ctrl, host->ioaddr + ESDHC_TUNING_CTRL); > } else { > v &= ~ESDHC_MIX_CTRL_EXE_TUNE; > } > @@ -965,6 +972,8 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, > if (gpio_is_valid(boarddata->wp_gpio)) > boarddata->wp_type = ESDHC_WP_GPIO; > > + of_property_read_u32(np, "fsl,tuning-step", &boarddata->tuning_step); > + > if (of_find_property(np, "no-1-8-v", NULL)) > boarddata->support_vsel = false; > else > diff --git a/include/linux/platform_data/mmc-esdhc-imx.h b/include/linux/platform_data/mmc-esdhc-imx.h > index e1571ef..95ccab3 100644 > --- a/include/linux/platform_data/mmc-esdhc-imx.h > +++ b/include/linux/platform_data/mmc-esdhc-imx.h > @@ -45,5 +45,6 @@ struct esdhc_platform_data { > int max_bus_width; > bool support_vsel; > unsigned int delay_line; > + unsigned int tuning_step; /* The delay cell steps in tuning procedure */ > }; > #endif /* __ASM_ARCH_IMX_ESDHC_H */ > -- > 1.9.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/