From patchwork Mon Dec 12 15:36:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 5600 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 8C24523E18 for ; Mon, 12 Dec 2011 15:36:38 +0000 (UTC) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 73D3FA1854F for ; Mon, 12 Dec 2011 15:36:38 +0000 (UTC) Received: by mail-bw0-f52.google.com with SMTP id 17so7484197bke.11 for ; Mon, 12 Dec 2011 07:36:38 -0800 (PST) Received: by 10.204.156.208 with SMTP id y16mr10128931bkw.72.1323704198255; Mon, 12 Dec 2011 07:36:38 -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.205.129.2 with SMTP id hg2cs50799bkc; Mon, 12 Dec 2011 07:36:38 -0800 (PST) Received: by 10.213.7.68 with SMTP id c4mr3533785ebc.23.1323704196771; Mon, 12 Dec 2011 07:36:36 -0800 (PST) Received: from eu1sys200aog118.obsmtp.com (eu1sys200aog118.obsmtp.com. [207.126.144.145]) by mx.google.com with SMTP id 12si9565339eeh.177.2011.12.12.07.36.34 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Dec 2011 07:36:36 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.145 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.145; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.145 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) smtp.mail=ulf.hansson@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob118.postini.com ([207.126.147.11]) with SMTP ID DSNKTuYfgkpT9GZ8toSEiF1zUdZkTb79wOan@postini.com; Mon, 12 Dec 2011 15:36:36 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E26AC1AC; Mon, 12 Dec 2011 15:36:32 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9CF9E29B3; Mon, 12 Dec 2011 15:36:32 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 77AB2A8095; Mon, 12 Dec 2011 16:36:26 +0100 (CET) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Mon, 12 Dec 2011 16:36:32 +0100 From: Ulf Hansson To: , Cc: Russell King , Ulf Hansson , Lee Jones Subject: [PATCH 5/5] mmc: mmci: Support any block sizes for ux500v2 variant Date: Mon, 12 Dec 2011 16:36:07 +0100 Message-ID: <1323704167-10247-6-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1323704167-10247-1-git-send-email-ulf.hansson@stericsson.com> References: <1323704167-10247-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 For the ux500v2 variant of the PL18x block, any block sizes are supported. This will make it possible to decrease data overhead for SDIO transfers. This patch is based upon a patch from Stefan Nilsson. Signed-off-by: Ulf Hansson --- drivers/mmc/host/mmci.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 94c04c3..1c6c874 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -57,6 +57,7 @@ static unsigned int fmax = 515633; * @pwrreg_powerup: power up value for MMCIPOWER register * @signal_direction: input/out direction of bus signals can be indicated * @pwrreg_ctrl_power: bits in MMCIPOWER register controls ext. power supply + * @any_blksize: true if block any sizes are supported */ struct variant_data { unsigned int clkreg; @@ -71,6 +72,7 @@ struct variant_data { u32 pwrreg_powerup; bool signal_direction; bool pwrreg_ctrl_power; + bool any_blksize; }; static struct variant_data variant_arm = { @@ -124,6 +126,7 @@ static struct variant_data variant_ux500v2 = { .blksz_datactrl16 = true, .pwrreg_powerup = MCI_PWR_ON, .signal_direction = true, + .any_blksize = true, }; /* @@ -132,10 +135,12 @@ static struct variant_data variant_ux500v2 = { static int mmci_validate_data(struct mmci_host *host, struct mmc_data *data) { + struct variant_data *variant = host->variant; + if (!data) return 0; - if (!is_power_of_2(data->blksz)) { + if (!is_power_of_2(data->blksz) && !variant->any_blksize) { dev_err(mmc_dev(host->mmc), "unsupported block size (%d bytes)\n", data->blksz); return -EINVAL; @@ -669,7 +674,6 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) writel(host->size, base + MMCIDATALENGTH); blksz_bits = ffs(data->blksz) - 1; - BUG_ON(1 << blksz_bits != data->blksz); if (variant->blksz_datactrl16) datactrl = MCI_DPSM_ENABLE | (data->blksz << 16);