From patchwork Fri Nov 25 10:18:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Hui X-Patchwork-Id: 5316 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0CA6623E03 for ; Fri, 25 Nov 2011 10:09:59 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 01E53A18234 for ; Fri, 25 Nov 2011 10:09:58 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id a26so4349277faa.11 for ; Fri, 25 Nov 2011 02:09:58 -0800 (PST) Received: by 10.152.162.10 with SMTP id xw10mr19685273lab.12.1322215798759; Fri, 25 Nov 2011 02:09:58 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.41.198 with SMTP id h6cs333772lal; Fri, 25 Nov 2011 02:09:58 -0800 (PST) Received: by 10.220.38.70 with SMTP id a6mr3022446vce.1.1322215795807; Fri, 25 Nov 2011 02:09:55 -0800 (PST) Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe006.messaging.microsoft.com. [216.32.181.186]) by mx.google.com with ESMTPS id u18si4800146vcq.63.2011.11.25.02.09.55 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Nov 2011 02:09:55 -0800 (PST) Received-SPF: neutral (google.com: 216.32.181.186 is neither permitted nor denied by best guess record for domain of jason.hui@linaro.org) client-ip=216.32.181.186; Authentication-Results: mx.google.com; spf=neutral (google.com: 216.32.181.186 is neither permitted nor denied by best guess record for domain of jason.hui@linaro.org) smtp.mail=jason.hui@linaro.org Received: from mail162-ch1-R.bigfish.com (10.43.68.254) by CH1EHSOBE013.bigfish.com (10.43.70.63) with Microsoft SMTP Server id 14.1.225.22; Fri, 25 Nov 2011 10:09:11 +0000 Received: from mail162-ch1 (localhost [127.0.0.1]) by mail162-ch1-R.bigfish.com (Postfix) with ESMTP id DF9343C01B4; Fri, 25 Nov 2011 10:10:51 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bh8275dhz2dh87h2a8h668h839h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail162-ch1 (localhost.localdomain [127.0.0.1]) by mail162-ch1 (MessageSwitch) id 1322215849652603_28786; Fri, 25 Nov 2011 10:10:49 +0000 (UTC) Received: from CH1EHSMHS019.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.254]) by mail162-ch1.bigfish.com (Postfix) with ESMTP id 8F9025C0047; Fri, 25 Nov 2011 10:10:49 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS019.bigfish.com (10.43.70.19) with Microsoft SMTP Server (TLS) id 14.1.225.22; Fri, 25 Nov 2011 10:09:09 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.339.2; Fri, 25 Nov 2011 04:09:51 -0600 Received: from r64343-desktop.ap.freescale.net (r64343-desktop.ap.freescale.net [10.192.242.36]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id pAPA9eGT013347; Fri, 25 Nov 2011 04:09:50 -0600 (CST) From: Jason Liu To: CC: Subject: [U-Boot][PATCH V3 4/5] i.mx: fsl_esdhc: add the i.mx6q support Date: Fri, 25 Nov 2011 18:18:04 +0800 Message-ID: <1322216285-23479-5-git-send-email-jason.hui@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1322216285-23479-1-git-send-email-jason.hui@linaro.org> References: <1322216285-23479-1-git-send-email-jason.hui@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com The mmc host controller on the i.mx6q is called usdhc which is redesigned based on the freescale esdhc controller. The usdhc controller is almost compatible with esdhc except it adds one mix register to support debug/SD3.0 and move the low bit 0-6 of XFERTYP register to the mix control reg low bit 0-6. Thus on i.mx6q, we have the following compared with the previous soc: (can refer to RM of chapter 56.3.3) i.mx6q: mix control: bit 31 - bit 7: Added for debug/SD3.0 support bit 6 - bit 0: move in the XFERTYP register bit 6-0 on previous soc XFERTYP register: bit 31 - bit 7: the same as before, bit 6 - bit 0: no-use previous soc mix control: no XFERTYP register: bit 31 - bit 0: xfertype information Signed-off-by: Jason Liu Cc: Andy Fleming Cc: Stefano Babic Acked-by: Stefano Babic --- v3: cc Andy for mmc maintainer v2: extend the commit message by adding mix/xtertype register change remove one #ifdef as Marek suggested change the print of USDHC/ESDHC to SDHC --- drivers/mmc/fsl_esdhc.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index ec953f0..ddd1b4c 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -58,7 +58,8 @@ struct fsl_esdhc { uint autoc12err; uint hostcapblt; uint wml; - char reserved1[8]; + uint mixctrl; + char reserved1[4]; uint fevt; char reserved2[168]; uint hostver; @@ -298,8 +299,13 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) /* Send the command */ esdhc_write32(®s->cmdarg, cmd->cmdarg); +#if defined(CONFIG_FSL_USDHC) + esdhc_write32(®s->mixctrl, + (esdhc_read32(®s->mixctrl) & 0xFFFFFF80) | (xfertyp & 0x7F)); + esdhc_write32(®s->xfertyp, xfertyp & 0xFFFF0000); +#else esdhc_write32(®s->xfertyp, xfertyp); - +#endif /* Wait for the command to complete */ while (!(esdhc_read32(®s->irqstat) & IRQSTAT_CC)) ; @@ -482,7 +488,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) mmc = malloc(sizeof(struct mmc)); - sprintf(mmc->name, "FSL_ESDHC"); + sprintf(mmc->name, "FSL_SDHC"); regs = (struct fsl_esdhc *)cfg->esdhc_base; /* First reset the eSDHC controller */