From patchwork Wed Nov 20 08:31:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 3212171 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5EA2AC045B for ; Wed, 20 Nov 2013 08:31:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55A3B206DC for ; Wed, 20 Nov 2013 08:31:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8BD72206ED for ; Wed, 20 Nov 2013 08:31:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752177Ab3KTIbP (ORCPT ); Wed, 20 Nov 2013 03:31:15 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:63179 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751609Ab3KTIbO (ORCPT ); Wed, 20 Nov 2013 03:31:14 -0500 Received: by mail-pd0-f175.google.com with SMTP id w10so7203653pde.34 for ; Wed, 20 Nov 2013 00:31:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:sender:message-id:to:cc:in-reply-to:references:from:subject :mime-version:content-type; bh=ybQZYV2a2m1+KzRiYhyukZtZPVWk2TFScADqmNOudK8=; b=hVyR4Jeu4Nxbt5OrtxDGwPhg3tdTxsM2o/yud6YNNz8zk6tHAnnSCbzoTSzM6O9kPd hVYi1A0loWAXwr2RVz0I9/INcrAoJ7ZqmPNmDw5JpIivUG7TDDjqnrKPK0KSdK/b2f+6 T2iBKHEWv9J7tJ5hiQSzaTNBVGAyR8eoR1Nq6+c+cf8euwuzP8iWrqIKJm4Ve0X81mYt 16HzCGVt75SCjAqpn1X6QPtpAr+iyobtdUdfUCD5KyuYm8UE9wAp3vH5x3vT5RKpqPDA 5le4ofRjXBLZaaTb1dMIveBXzRhPYh4mqylW1R8dvq4wfq1OVLsbIYRjnI1U909hA5Fa 9yJA== X-Received: by 10.68.253.129 with SMTP id aa1mr89656pbd.189.1384936273598; Wed, 20 Nov 2013 00:31:13 -0800 (PST) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id er3sm36017381pbb.40.2013.11.20.00.31.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 20 Nov 2013 00:31:13 -0800 (PST) Date: Wed, 20 Nov 2013 00:31:13 -0800 (PST) Message-ID: <87d2lv8ofl.wl%kuninori.morimoto.gx@renesas.com> To: Simon , Chris Ball Cc: Magnus , Linux-SH , Kuninori Morimoto , linux-mmc@vger.kernel.org In-Reply-To: <87iovn8ohs.wl%kuninori.morimoto.gx@renesas.com> References: <87iovn8ohs.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 4/4] mmc: SDHI: add SoC specific workaround via HW version MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP One of Renesas SDHI chip needs workaround to use it, and, we can judge it based on chip version. This patch adds very quick-hack workaround method, since we still don't know how many chips need workaround in the future. Signed-off-by: Kuninori Morimoto --- drivers/mmc/host/sh_mobile_sdhi.c | 11 +++++++++++ include/linux/mmc/tmio.h | 1 + 2 files changed, 12 insertions(+) diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index f1e35a7..d241d86 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c @@ -33,6 +33,8 @@ #include "tmio_mmc.h" +#define EXT_ACC 0xe4 + struct sh_mobile_sdhi_of_data { unsigned long tmio_flags; }; @@ -137,6 +139,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) int irq, ret, i = 0; bool multiplexed_isr = true; struct tmio_mmc_dma *dma_priv; + u16 ver; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) @@ -219,6 +222,14 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) goto eprobe; /* + * FIXME: + * this Workaround can be more clever method + */ + ver = sd_ctrl_read16(host, CTL_VERSION); + if (ver == 0xCB0D) + sd_ctrl_write16(host, EXT_ACC, 1); + + /* * Allow one or more specific (named) ISRs or * one or more multiplexed (un-named) ISRs. */ diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h index a1c1f32..84d9053 100644 --- a/include/linux/mmc/tmio.h +++ b/include/linux/mmc/tmio.h @@ -33,6 +33,7 @@ #define CTL_SDIO_IRQ_MASK 0x38 #define CTL_DMA_ENABLE 0xd8 #define CTL_RESET_SD 0xe0 +#define CTL_VERSION 0xe2 #define CTL_SDIO_REGS 0x100 #define CTL_CLK_AND_WAIT_CTL 0x138 #define CTL_RESET_SDIO 0x1e0