From patchwork Fri Aug 20 06:22:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 177262 Return-path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on void.printf.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.9 tests=RCVD_IN_DNSWL_LOW autolearn=disabled version=3.2.5 Envelope-to: chris@printf.net Delivery-date: Fri, 20 Aug 2010 07:23:01 +0100 Received: from lists.laptop.org ([18.85.2.145] helo=mail.laptop.org) by void.printf.net with esmtp (Exim 4.69) (envelope-from ) id 1OmL0H-0001Ug-FO for chris@printf.net; Fri, 20 Aug 2010 07:23:01 +0100 Received: by mail.laptop.org (Postfix) id F362623B73; Fri, 20 Aug 2010 02:22:42 -0400 (EDT) Delivered-To: cjb@laptop.org Received: from spam.laptop.org (spam.laptop.org [18.85.46.23]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.laptop.org (Postfix) with ESMTPS id E699F23B72 for ; Fri, 20 Aug 2010 02:22:42 -0400 (EDT) X-ASG-Debug-ID: 1282285378-0b74fc3d0001-zHW3sV Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by spam.laptop.org with ESMTP id cYzouCdeQ75lbY5n for ; Fri, 20 Aug 2010 02:22:58 -0400 (EDT) X-Barracuda-Envelope-From: linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751202Ab0HTGW6 (ORCPT ); Fri, 20 Aug 2010 02:22:58 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:47162 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751184Ab0HTGW5 (ORCPT ); Fri, 20 Aug 2010 02:22:57 -0400 Received: by iwn5 with SMTP id 5so470701iwn.19 for ; Thu, 19 Aug 2010 23:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:cc:content-type; bh=/+MGC1H0kHYeYDGAwyIotjgC4MkNtqVXKPoDp1pyQsc=; b=TTkZnFual31GY/muvAJ+NKkPbgBsI4xuTLMM4q83dEk5pSOvlP2YgPSB9b66SDijhT 7Dc3uTsopwTSPlCsFkF80RoiOyWk2w8uOnvrByguca7om1AtLILHmzS8fvG197CyeDDJ AAENdDxauGi3yhz2aN6DG+9sjXAOhJrimiLIk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=Gg+/f1GhFTdz5R2bBEgzc6Xrq9cUnt7H3URbBj9HfxI5dzhciPY5jbpdCe1iMmMfWL mBkvlfTujwE1UgeyJjcmMrSDK8O/c1x0zl+FwyT0bpcGPwUe3L3PeOlDFfd1mf4ikwtg z8BRkuD0mlCkAPwlaHJanaV4wwUdGvEPBWGkw= MIME-Version: 1.0 Received: by 10.231.145.16 with SMTP id b16mr948133ibv.198.1282285376895; Thu, 19 Aug 2010 23:22:56 -0700 (PDT) Received: by 10.231.199.12 with HTTP; Thu, 19 Aug 2010 23:22:56 -0700 (PDT) Date: Fri, 20 Aug 2010 02:22:56 -0400 Message-ID: X-ASG-Orig-Subj: [patch 1/1] sdhci-base-clock-freqency-change-in-spec-3.0 Subject: [patch 1/1] sdhci-base-clock-freqency-change-in-spec-3.0 From: zhangfei gao To: Andrew Morton , linux-mmc@vger.kernel.org Cc: Anton Vorontsov , Ben Dooks , Wolfram Sang , Matt Fleming , Haojian Zhuang , Eric Miao Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Barracuda-Connect: vger.kernel.org[209.132.180.67] X-Barracuda-Start-Time: 1282285378 X-Barracuda-URL: http://18.85.46.23:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at laptop.org X-Barracuda-Spam-Score: 0.50 X-Barracuda-Spam-Status: No, SCORE=0.50 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.5 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.38485 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M From 6b82bd3c0fe55b7060b8d96801e5e2c4fecc79b7 Mon Sep 17 00:00:00 2001 From: Zhangfei Gao Date: Fri, 20 Aug 2010 14:02:36 -0400 Subject: [PATCH] sdhci: base clock freqency change in spec 3.0 sdhc spec 3.0: Capabilities Register bits[15-08] is Base Clock Freqency sdhc spec 1.0 & 2.0: Capabilities Register bits[13-08] is Base Clock Freqency Signed-off-by: Zhangfei Gao --- drivers/mmc/host/sdhci.c | 8 ++++++-- drivers/mmc/host/sdhci.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 7855121..458e5d4 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1778,8 +1778,12 @@ int sdhci_add_host(struct sdhci_host *host) mmc_dev(host->mmc)->dma_mask = &host->dma_mask; } - host->max_clk = - (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; + if (host->version >= SDHCI_SPEC_300) + host->max_clk = + (caps & SDHCI_CLOCK_V3_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; + else + host->max_clk = + (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; host->max_clk *= 1000000; if (host->max_clk == 0 || host->quirks & SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN) { diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 036cfae..8f71f56 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -140,6 +140,7 @@ #define SDHCI_TIMEOUT_CLK_SHIFT 0 #define SDHCI_TIMEOUT_CLK_UNIT 0x00000080 #define SDHCI_CLOCK_BASE_MASK 0x00003F00 +#define SDHCI_CLOCK_V3_BASE_MASK 0x0000FF00 #define SDHCI_CLOCK_BASE_SHIFT 8 #define SDHCI_MAX_BLOCK_MASK 0x00030000 #define SDHCI_MAX_BLOCK_SHIFT 16 -- 1.7.0.4