From patchwork Mon Oct 13 09:16:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ye.Li" X-Patchwork-Id: 399105 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 2F135140095 for ; Mon, 13 Oct 2014 20:33:35 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B4420A7856; Mon, 13 Oct 2014 11:33:31 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Le7372DX3nuc; Mon, 13 Oct 2014 11:33:31 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 95DA7A7850; Mon, 13 Oct 2014 11:33:30 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D41CBA7850 for ; Mon, 13 Oct 2014 11:33:24 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qzKcAaDiEY0C for ; Mon, 13 Oct 2014 11:33:24 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0119.outbound.protection.outlook.com [157.56.111.119]) by theia.denx.de (Postfix) with ESMTPS id 3F7A9A73E8 for ; Mon, 13 Oct 2014 11:33:20 +0200 (CEST) Received: from BN3PR0301CA0072.namprd03.prod.outlook.com (25.160.152.168) by BY2PR03MB256.namprd03.prod.outlook.com (10.242.37.23) with Microsoft SMTP Server (TLS) id 15.0.1049.19; Mon, 13 Oct 2014 09:17:41 +0000 Received: from BL2FFO11FD021.protection.gbl (2a01:111:f400:7c09::126) by BN3PR0301CA0072.outlook.office365.com (2a01:111:e400:401e::40) with Microsoft SMTP Server (TLS) id 15.0.1049.19 via Frontend Transport; Mon, 13 Oct 2014 09:17:40 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD021.mail.protection.outlook.com (10.173.161.100) with Microsoft SMTP Server (TLS) id 15.0.1039.16 via Frontend Transport; Mon, 13 Oct 2014 09:17:40 +0000 Received: from leyoen-ubuntu.localdomain ([10.192.185.171]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s9D9HUa3028438; Mon, 13 Oct 2014 02:17:34 -0700 From: Ye.Li To: Date: Mon, 13 Oct 2014 17:16:56 +0800 Message-ID: <1413191816-28236-1-git-send-email-B37916@freescale.com> X-Mailer: git-send-email 1.7.4.1 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(80022003)(85852003)(120916001)(26826002)(47776003)(104166001)(50986999)(87286001)(87936001)(64706001)(20776003)(102836001)(4396001)(50226001)(104016003)(46102003)(89996001)(99396003)(76482002)(110136001)(88136002)(97736003)(81156004)(92726001)(2351001)(62966002)(107046002)(105606002)(92566001)(48376002)(6806004)(19580405001)(19580395003)(44976005)(50466002)(68736004)(106466001)(21056001)(69596002)(77156001)(85306004)(84676001)(93916002)(229853001)(36756003)(95666004)(31966008)(32563001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR03MB256; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB256; X-Forefront-PRVS: 03630A6A4A Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=Ye.Li@freescale.com; X-OriginatorOrg: freescale.com Cc: fabio.estevam@freescale.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/2] mmc: fsl_esdhc: Update esdhc driver for iMX6SX X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The reset value of "uSDHCx_INT_STATUS_EN" register is changed to 0 on iMX6SX. So the fsl_esdhc driver must update to set the register, otherwise no state can be detected. Signed-off-by: Ye.Li --- drivers/mmc/fsl_esdhc.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 97d0389..9c8a8d4 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -23,6 +23,11 @@ DECLARE_GLOBAL_DATA_PTR; +#define SDHCI_IRQ_EN_BITS (IRQSTATEN_CC | IRQSTATEN_TC | \ + IRQSTATEN_CINT | \ + IRQSTATEN_CTOE | IRQSTATEN_CCE | IRQSTATEN_CEBE | \ + IRQSTATEN_CIE | IRQSTATEN_DTOE | IRQSTATEN_DCE | IRQSTATEN_DEBE) + struct fsl_esdhc { uint dsaddr; /* SDMA system address register */ uint blkattr; /* Block attributes register */ @@ -492,8 +497,15 @@ static int esdhc_init(struct mmc *mmc) /* Set the initial clock speed */ mmc_set_clock(mmc, 400000); +#ifdef CONFIG_SYS_FSL_ESDHC_USE_PIO + /* Enable the BRR and BWR bits in IRQSTAT */ + esdhc_clrbits32(®s->irqstaten, IRQSTATEN_DINT); + esdhc_setbits32(®s->irqstaten, IRQSTATEN_BRR | IRQSTATEN_BWR); +#else /* Disable the BRR and BWR bits in IRQSTAT */ esdhc_clrbits32(®s->irqstaten, IRQSTATEN_BRR | IRQSTATEN_BWR); + esdhc_setbits32(®s->irqstaten, IRQSTATEN_DINT); +#endif /* Put the PROCTL reg back to the default */ esdhc_write32(®s->proctl, PROCTL_INIT); @@ -558,6 +570,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) esdhc_setbits32(®s->sysctl, SYSCTL_PEREN | SYSCTL_HCKEN | SYSCTL_IPGEN | SYSCTL_CKEN); + writel(SDHCI_IRQ_EN_BITS, ®s->irqstaten); memset(&cfg->cfg, 0, sizeof(cfg->cfg)); voltage_caps = 0;