From patchwork Mon Jan 21 11:02:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2010651 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 566C0DF23A for ; Mon, 21 Jan 2013 10:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752581Ab3AUKej (ORCPT ); Mon, 21 Jan 2013 05:34:39 -0500 Received: from co9ehsobe001.messaging.microsoft.com ([207.46.163.24]:46327 "EHLO co9outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752403Ab3AUKej (ORCPT ); Mon, 21 Jan 2013 05:34:39 -0500 Received: from mail189-co9-R.bigfish.com (10.236.132.241) by CO9EHSOBE031.bigfish.com (10.236.130.94) with Microsoft SMTP Server id 14.1.225.23; Mon, 21 Jan 2013 10:34:39 +0000 Received: from mail189-co9 (localhost [127.0.0.1]) by mail189-co9-R.bigfish.com (Postfix) with ESMTP id F374BC80159; Mon, 21 Jan 2013 10:34:38 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275dhz2dh87h2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h1155h) X-FB-DOMAIN-IP-MATCH: fail Received: from mail189-co9 (localhost.localdomain [127.0.0.1]) by mail189-co9 (MessageSwitch) id 1358764437469451_21607; Mon, 21 Jan 2013 10:33:57 +0000 (UTC) Received: from CO9EHSMHS006.bigfish.com (unknown [10.236.132.236]) by mail189-co9.bigfish.com (Postfix) with ESMTP id 6EDBC74004A; Mon, 21 Jan 2013 10:33:57 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO9EHSMHS006.bigfish.com (10.236.130.16) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 21 Jan 2013 10:33:55 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.318.3; Mon, 21 Jan 2013 10:33:54 +0000 Received: from S2100-06.ap.freescale.net (S2100-06.ap.freescale.net [10.192.242.65]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id r0LAXi1x009268; Mon, 21 Jan 2013 03:33:52 -0700 From: Shawn Guo To: CC: Sascha Hauer , Chris Ball , Shawn Guo Subject: [PATCH 2/6] mmc: sdhci-esdhc-imx: manually reset MIX_CTRL for usdhc Date: Mon, 21 Jan 2013 19:02:25 +0800 Message-ID: <1358766149-9534-3-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358766149-9534-1-git-send-email-shawn.guo@linaro.org> References: <1358766149-9534-1-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org It's another violation to SDHC spec that software reset on usdhc does not reset MIX_CTRL register. Have to do it manually, otherwise the preserving of the register bits (e.g. AC23EN) may cause mmc card fail to be initialized. Signed-off-by: Shawn Guo --- drivers/mmc/host/sdhci-esdhc-imx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 48832c5..968a70f 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -318,8 +318,15 @@ static void esdhc_writeb_le(struct sdhci_host *host, u8 val, int reg) * circuit relies on. To work around it, we turn the clocks on back * to keep card detection circuit functional. */ - if ((reg == SDHCI_SOFTWARE_RESET) && (val & 1)) + if ((reg == SDHCI_SOFTWARE_RESET) && (val & 1)) { esdhc_clrset_le(host, 0x7, 0x7, ESDHC_SYSTEM_CONTROL); + /* + * The reset on usdhc fails to clear MIX_CTRL register. + * Do it manually here. + */ + if (is_imx6q_usdhc(imx_data)) + writel(0, host->ioaddr + ESDHC_MIX_CTRL); + } } static unsigned int esdhc_pltfm_get_max_clock(struct sdhci_host *host)