From patchwork Thu Nov 25 10:11:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yauhen.kharuzhy@promwad.com X-Patchwork-Id: 356512 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAPACQxB027694 for ; Thu, 25 Nov 2010 10:12:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751398Ab0KYKM0 (ORCPT ); Thu, 25 Nov 2010 05:12:26 -0500 Received: from mail-ew0-f46.google.com ([209.85.215.46]:61118 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751257Ab0KYKMZ (ORCPT ); Thu, 25 Nov 2010 05:12:25 -0500 Received: by ewy5 with SMTP id 5so344023ewy.19 for ; Thu, 25 Nov 2010 02:12:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:from:to:cc :subject:date:message-id:x-mailer; bh=Mh4zhxANOtM7EvIziAiUD+xzwLkaD5punQzD7dH9mCI=; b=Bu+cvIFjiju3+78Qzg5C3w+bxGya3A7NoQLm5+8gW6rMMYDhAWAHSXcRiZeHFLs0qV JyWiJ98pxxBdSMXTkf4LsK7wO1Gx3RM3f+mQVHY1k7ILKwIhDsh0f6vIfhOWjroDOz/W 5nJpG4y7iyU8RWgV7P3M4ydtz5scL5xa5Z/ko= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; b=E6L0hapy6RE/J9VgGqChqZq1nGDpVoZfg46Tw/YMko5r2BqIqqN++FaeM30ssVKlOA MzBGOoOJY2uSxqy68nr92JO+LxXljk4kCCbW1NdrwslkW2uo6gnzX3DgSUD59YId1JJm dnS37nZyx+jS8x4v0GUdmFz33l9kqqPP5rMI4= Received: by 10.213.9.135 with SMTP id l7mr4839491ebl.7.1290679944166; Thu, 25 Nov 2010 02:12:24 -0800 (PST) Received: from localhost.localdomain (mx1.promwad.com [195.222.85.229]) by mx.google.com with ESMTPS id b52sm539624eei.13.2010.11.25.02.12.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 25 Nov 2010 02:12:23 -0800 (PST) Received: from jek by localhost.localdomain with local (Exim 4.72) (envelope-from ) id 1PLYoP-0001ZD-Fl; Thu, 25 Nov 2010 12:12:21 +0200 From: Yauhen Kharuzhy To: Nicolas Ferre , Chris Ball Cc: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Yauhen Kharuzhy Subject: [PATCH] MMC: Fix multiblock SDIO transfers in AT91 MCI Date: Thu, 25 Nov 2010 12:11:51 +0200 Message-Id: <1290679911-5992-1-git-send-email-yauhen.kharuzhy@promwad.com> X-Mailer: git-send-email 1.7.2.3 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 25 Nov 2010 10:12:27 +0000 (UTC) diff --git a/arch/arm/mach-at91/include/mach/at91_mci.h b/arch/arm/mach-at91/include/mach/at91_mci.h index 57f8ee1..27ac6f5 100644 --- a/arch/arm/mach-at91/include/mach/at91_mci.h +++ b/arch/arm/mach-at91/include/mach/at91_mci.h @@ -74,6 +74,8 @@ #define AT91_MCI_TRTYP_BLOCK (0 << 19) #define AT91_MCI_TRTYP_MULTIPLE (1 << 19) #define AT91_MCI_TRTYP_STREAM (2 << 19) +#define AT91_MCI_TRTYP_SDIO_BYTE (4 << 19) +#define AT91_MCI_TRTYP_SDIO_BLOCK (5 << 19) #define AT91_MCI_BLKR 0x18 /* Block Register */ #define AT91_MCI_BLKR_BCNT(n) ((0xffff & (n)) << 0) /* Block count */ diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c index 591ab54..d3e6a96 100644 --- a/drivers/mmc/host/at91_mci.c +++ b/drivers/mmc/host/at91_mci.c @@ -69,6 +69,7 @@ #include #include +#include #include #include @@ -493,10 +494,14 @@ static void at91_mci_send_command(struct at91mci_host *host, struct mmc_command else if (data->flags & MMC_DATA_WRITE) cmdr |= AT91_MCI_TRCMD_START; - if (data->flags & MMC_DATA_STREAM) - cmdr |= AT91_MCI_TRTYP_STREAM; - if (data->blocks > 1) - cmdr |= AT91_MCI_TRTYP_MULTIPLE; + if (cmd->opcode == SD_IO_RW_EXTENDED) { + cmdr |= AT91_MCI_TRTYP_SDIO_BLOCK; + } else { + if (data->flags & MMC_DATA_STREAM) + cmdr |= AT91_MCI_TRTYP_STREAM; + if (data->blocks > 1) + cmdr |= AT91_MCI_TRTYP_MULTIPLE; + } } else { block_length = 0;