From patchwork Thu Nov 14 10:31:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 3181691 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ED72B9F3A0 for ; Thu, 14 Nov 2013 10:31:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2AB9B201C8 for ; Thu, 14 Nov 2013 10:31:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1AE4620174 for ; Thu, 14 Nov 2013 10:31:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753195Ab3KNKbv (ORCPT ); Thu, 14 Nov 2013 05:31:51 -0500 Received: from mail-pd0-f180.google.com ([209.85.192.180]:55849 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752514Ab3KNKbj (ORCPT ); Thu, 14 Nov 2013 05:31:39 -0500 Received: by mail-pd0-f180.google.com with SMTP id v10so1788221pde.25 for ; Thu, 14 Nov 2013 02:31:39 -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=zp58jcypcPbTHUYx7BT0KREwlTqNeL91wi4bBdjquXCzHa2b/BJa4QZg36DTNGCtWs g6mdYHCbI2spE7UN6u46NfHmb+VlzapfHBm7V9THR2epsz6hoPAHiWIjCmnBrRM322nt MqfEdYYPqRrxF/TP/gKvdK5Lr7rl5AYdDwaKxZAmt5jepO2aiYvUjw8jEtHNbEfSGErE yePGCGqUmF4DTGjigXQlf9LdiSPhur42mPX4w0YNzJYygAy2SgH/HEDMjsou+mucrCwo DbnU99czCLfEUo0FQzyiuk1fwGzZCKX6kf+KqgaezZuXerp+w4iBiqk1f+LDTvz/C0Zi z6IA== X-Received: by 10.66.2.234 with SMTP id 10mr657853pax.39.1384425099013; Thu, 14 Nov 2013 02:31:39 -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 uf2sm5846784pbc.28.2013.11.14.02.31.36 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 14 Nov 2013 02:31:38 -0800 (PST) Date: Thu, 14 Nov 2013 02:31:38 -0800 (PST) Message-ID: <871u2jz33t.wl%kuninori.morimoto.gx@renesas.com> To: Chris Ball Cc: Simon , Laurent , Magnus , Linux-SH , Kuninori Morimoto , linux-mmc@vger.kernel.org In-Reply-To: <8761rvz37d.wl%kuninori.morimoto.gx@renesas.com> References: <87li0rz3to.wl%kuninori.morimoto.gx@renesas.com> <8761rvz37d.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 11/17] mmc: SDHI: add SoC specific workaround via HW version MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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