From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 536ACC433F5 for ; Mon, 14 Mar 2022 09:31:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B572E83997; Mon, 14 Mar 2022 10:31:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="QoXJvYkJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8195583993; Mon, 14 Mar 2022 10:31:26 +0100 (CET) Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C7C29839A7 for ; Mon, 14 Mar 2022 10:31:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jh80.chung@samsung.com Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20220314093110epoutp025cb553962aafc5a6bc1cc1f4060b5588~cNWTAubIT1258912589epoutp02B for ; Mon, 14 Mar 2022 09:31:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20220314093110epoutp025cb553962aafc5a6bc1cc1f4060b5588~cNWTAubIT1258912589epoutp02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1647250270; bh=fC3ScsvXd8EDtl61wVDuuu2w5NirraoGa9ui7LlLA2k=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=QoXJvYkJbi2Uec5veLrQFMoYxmKN4uW+r9laonAw7T/fe66+JtqGUyO9DFSr+6gMi bRXprsMcB8x6A15AINne84oKEw856IiwKPorg7P7GnIq97fCX2XAtNv5XFsNvHh0E4 oHkVYLRlcWUgXAUAKLD3z/dIF2pOYBlOMQqA65i8= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20220314093109epcas1p305fe7038a24d7bafcbfbffbef68afc39~cNWSDd6531449714497epcas1p3J; Mon, 14 Mar 2022 09:31:09 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.38.231]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4KHB9h5KDmz4x9Pv; Mon, 14 Mar 2022 09:31:04 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 71.55.28648.85B0F226; Mon, 14 Mar 2022 18:31:04 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20220314093104epcas1p4c9e46703e5b60dee4aa5f2e2588d7b7f~cNWNNVDFn2280722807epcas1p40; Mon, 14 Mar 2022 09:31:04 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220314093104epsmtrp17ee498aec1f0a5c9fcfa1b7e229307ee~cNWNMZD6s0284302843epsmtrp1P; Mon, 14 Mar 2022 09:31:04 +0000 (GMT) X-AuditID: b6c32a39-003ff70000006fe8-01-622f0b5812da Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 1B.99.29871.85B0F226; Mon, 14 Mar 2022 18:31:04 +0900 (KST) Received: from [10.113.113.235] (unknown [10.113.113.235]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220314093103epsmtip1ff571499e786dc35ee83f6e15cf12e2b~cNWMwTJJP0338303383epsmtip1P; Mon, 14 Mar 2022 09:31:03 +0000 (GMT) Message-ID: <4ac84c0b-deb1-3c17-cfe6-d2a66dd437b4@samsung.com> Date: Mon, 14 Mar 2022 18:31:03 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2] mmc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON when necessary Content-Language: en-US To: Tom Rini , haibo.chen@nxp.com, Peng Fan , Stefano Babic Cc: festevam@gmail.com, sean.anderson@seco.com, u-boot@lists.denx.de, marex@denx.de, aford173@gmail.com, tharvey@gateworks.com, andrey.zhizhikin@leica-geosystems.com, uboot-imx@nxp.com From: Jaehoon Chung In-Reply-To: <20220309161052.GA2128647@bill-the-cat> Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEJsWRmVeSWpSXmKPExsWy7bCmrm4Et36SwbmLmhZ3bp9mtnj2/B2r xcOr/hb9V1cyWrxpa2S0+LHqC6tF+ykfi3n3W5gsLp74xGwxddJmdou3ezvZLaY8Xs/uwOMx b9YJFo9zPXfZPHbOusvu8erAKnaPh4desHmcvbOD0WPjux1MHs/+fWMP4IjKtslITUxJLVJI zUvOT8nMS7dV8g6Od443NTMw1DW0tDBXUshLzE21VXLxCdB1y8wBulZJoSwxpxQoFJBYXKyk b2dTlF9akqqQkV9cYquUWpCSU2BaoFecmFtcmpeul5daYmVoYGBkClSYkJ0x48g75oINohVP /zSyNTAuE+xi5OSQEDCRuNm0h7WLkYtDSGAHo8S2n0tYIJxPjBIPnn9hhHC+MUq03j3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nrtsHjtn3WX3eHVgFbvHw0Mv2DzO3tnB6LHx3Q4mj2f/vrEHcERx2aSk5mSWpRbp 2yVwZcw48o65YINoxdM/jWwNjMsEuxg5OSQETCQmH33D3MXIxSEksJtR4ljDSiaIhJTE56dT 2boYOYBsYYnDh4shat4ySrQvamMGqeEVsJNYuaOBBcRmEVCV2N58mgUiLihxcuYTMFtUIEKi bdkUsHphIHvuxumMIDazgLjErSfzwXaJCJRILLy3CCq+B+iIne4Qy/YzSuz73swGkmAT0JHY /u04WAMn0NXHHq9hBjmOWUBdYv08IYheeYnmrbOZJzAKzUJyxiwk62YhdMxC0rGAkWUVo2Rq QXFuem6xYYFhXmq5XnFibnFpXrpecn7uJkZwBGpp7mDcvuqD3iFGJg7GQ4wSHMxKIrxWS/WS hHhTEiurUovy44tKc1KLDzFKc7AoifNe6DoZLySQnliSmp2aWpBaBJNl4uCUamCSqfO/WeC8 WK4q8ZryIw21DhaZytnlG3YwLK+VzjmpvDvLOXzH6496Vm+9mCsm6Cr6O1i+WPfpKadyDkdZ vtDNs5xqOzQ2mjbppOddPXfXbLFl9WUho/y7ul/cA1VsWKuvOM46+npKbMZe/k3a8t2vpOVO 171aOqvhb1B9xzuBnGe/3+rddm54cdmSd5/Exj+nH6bc6TNdoP0zfIZYEdexJm1z3sOaWQ+8 Jj/S0ooytCm1jI2T/OR9hjfw2/y04u0Ld/P+eGfV+eL8p/dxgZcWubSybP/O1vvvxSPHMKaF 6fPOp4isVEt5qxh/SDrI9/y26p7bnmr9lwOE8lJqHjMzTvz+/FWk03TeyRfzIpRYijMSDbWY i4oTAU1YdKYvAwAA X-CMS-MailID: 20220314093104epcas1p4c9e46703e5b60dee4aa5f2e2588d7b7f X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220309161100epcas1p220eb7114562d7abef976bbf750940035 References: <1645500498-5500-1-git-send-email-haibo.chen@nxp.com> <20220309161052.GA2128647@bill-the-cat> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On 3/10/22 01:10, Tom Rini wrote: > On Tue, Feb 22, 2022 at 11:28:18AM +0800, haibo.chen@nxp.com wrote: > >> From: Haibo Chen >> >> After commit f132aab40327 ("Revert "mmc: fsl_esdhc_imx: use >> VENDORSPEC_FRC_SDCLK_ON to control card clock output""), it >> involve issue in mmc_switch_voltage(), because of the special >> design of usdhc. >> >> For FSL_USDHC, it do not implement VENDORSPEC_CKEN/PEREN/HCKEN/IPGEN, >> these are reserved bits(Though RM contain the definition of these bits, >> but actually internal IC logic do not implement, already confirm with >> IC team). Instead, use VENDORSPEC_FRC_SDCLK_ON to gate on/off the card >> clock output. Here is the definition of this bit in RM: >> >> [8] FRC_SDCLK_ON >> Force CLK output active >> Do not set this bit to 1 unless it is necessary. Also, make sure that >> this bit is cleared when uSDHC’s clock is about to be changed (frequency >> change, clock source change, or delay chain tuning). >> 0b - CLK active or inactive is fully controlled by the hardware. >> 1b - Force CLK active >> >> In default, the FRC_SDCLK_ON is 0. This means, when there is no command >> or data transfer on bus, hardware will gate off the card clock. But in >> some case, we need the card clock keep on. Take IO voltage 1.8v switch >> as example, after IO voltage change to 1.8v, spec require gate off the >> card clock for 5ms, and gate on the clock back, once detect the card >> clock on, then the card will draw the dat0 to high immediately. If there >> is not clock gate off/on behavior, some card will keep the dat0 to low >> level. This is the reason we fail in mmc_switch_voltage(). >> >> To fix this issue, and concern that this is only the fsl usdhc hardware >> design limitation, set the bit FRC_SDCLK_ON in the beginning of the >> wait_dat0() and clear it in the end. To make sure the 1.8v IO voltage >> switch process align with SD specification. >> >> For standard tuning process, usdhc specification also require the card >> clock keep on, so also add these behavior in fsl_esdhc_execute_tuning(). >> >> Reviewed-by: Marek Vasut >> Tested-by: Fabio Estevam >> Signed-off-by: Haibo Chen >> Reviewed-by: Peng Fan >> Reviewed-by: Jaehoon Chung >> --- >> drivers/mmc/fsl_esdhc_imx.c | 25 ++++++++++++++++++++++--- >> include/fsl_esdhc_imx.h | 2 ++ >> 2 files changed, 24 insertions(+), 3 deletions(-) > > Is this going to get picked up in the imx or mmc trees soon, or should I > take this directly? Thanks! Applied to u-boot-mmc. Thanks! Sorry for late. Best Regards, Jaehoon Chung >