Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3293689imm; Tue, 17 Jul 2018 02:16:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpevic4oNBvfvdzJSQB4WCSBIFc65qSeqKMIh0VInmDPSXzg2d+jVidTYK4UP9AsZF0+vPdD X-Received: by 2002:a17:902:292b:: with SMTP id g40-v6mr828282plb.273.1531818994440; Tue, 17 Jul 2018 02:16:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531818994; cv=none; d=google.com; s=arc-20160816; b=iCZGH42u9Sw/gnvOY5PWOt0LLmvejWV9pt/QbQUW6vAh6hJFsiTgY4qiMG9aGmdVWP 90KlPpYguO/yR2Xlzj91WblXWPmnCSCqi2QRCQ/nt9GBWCwFRwIhJbSZLy0nO1hS2hzh qf3CySNmJ0SwO5WBe3k1c3n/zeAE4GT6vlEPgo7L7x+ycZCImsFKBcAzgHBg7PbnhpPb aNfbF8Y2X1as5Nw3RjI9rGMuX4onlFYtMZ5VQj+QPb6XeWiA5TkNCFr184I+uld3njGS SauyeJzOWih2WNg42Qhe+XkQajHkaYSlakVLhFmFgET4FIrG5scY/OXw0HdfwwtyYhf2 VsAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=chURNAgvrwHXXxWGTAVtOLs6g18i5+gldP0KxRgPQaE=; b=IxkxLak5+DpuY5jPZLo94EFF/gFEY15tGgRInMbxG+j+lqergZ8aAR7aAQHY5mhEB2 8qnD0TCR7lYA8L1DOQH+mzRf9C5QRxYbzaGUwon7yT3rEYwCUZQZcI+B9HsXtiN0Y6Ll ERxnW9fXFap4INEegU38S79nqYcsBqqI0Vy46JPUrHKQEkf5A2QzlFgnacsvlOmfv75k Boruhcv1J6oDY8itRjohi9BnRifmlVD+xoqH3cLigojpFUBrUd5zvyztj7TIdi039bjH Ngoh4OKjA/rtagBn4vqyeY55JbOU1N1fDHX2PPmcPhGzWnowRzdXT3EnmP/MdMZSrFZr epLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GC++esJI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2-v6si460719pge.124.2018.07.17.02.16.19; Tue, 17 Jul 2018 02:16:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GC++esJI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729727AbeGQJqs (ORCPT + 99 others); Tue, 17 Jul 2018 05:46:48 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:33212 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728843AbeGQJqr (ORCPT ); Tue, 17 Jul 2018 05:46:47 -0400 Received: by mail-lj1-f194.google.com with SMTP id s12-v6so370786ljj.0; Tue, 17 Jul 2018 02:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=chURNAgvrwHXXxWGTAVtOLs6g18i5+gldP0KxRgPQaE=; b=GC++esJIZpzHpinfmacA3R6L0S+fwXKOl/7gVi8G4g9QfgAwfHDJjkrfyJMtGk8tNv +u+bV0SKcawfF0r9i2Rv2RhZdH/toagYWkZSwVM1qhXbFTkFKeyfcaZG1pc+ZzfzOmZ4 ChimVTn98+qR96YcGBisYdMxEl5Bwae0mXuP9NrxkXuBIX5Xib/F/Keox1oGTF68fz4P N3EWWlAz1DnD3625v1W6KcRXlul1xMe7Ze6yrflVOdRA+BpRlOOuWh0PEFMwdaf1xbjY Ffxcfcoyg3Ji0iFShh5n6DeAisRnxZFw9K0EwCFT3u+N5J2D8oewQ6AIKQVj/reZM0pG wyRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=chURNAgvrwHXXxWGTAVtOLs6g18i5+gldP0KxRgPQaE=; b=Y8b1iD4vYNGqBgSCPTDIBtp2PkSthQjrIvWe9YxP9pObR4YQPYzRLffgsulif895Y7 FZvlj9wGCxG4j2623uttiJneRMbL3F2yItK6tmflWnYeo+WK84Tvrdeuho3sgQqPW0Cp 1HHKbGPxdwSOLfhoEukAcD3BP8yFa1KSBJ5tSrk42kevU2ex2oeuLMpYxzH4OtRtAtg+ x1isXWjqUAe9uFS7bnlASWxPoUl2ZGTG7BksHAA3zBXluvWHxSodO1ZlyipF3cfc8YUL KwIPnVfSqGyEBKKSFRQGcSlmdvGDuqgiSEnvWa+ZqB2HQuU1FBBio3wAcS3HGHaKXm6c Pteg== X-Gm-Message-State: AOUpUlGZ+8tNBThPOq2SDEKj96T0PIzUmcGsqlBNAgIxYwxeTjCYWC9T pTkJTMneyNzzZssBjRj7jFgA9QMp7WD/q4P5ZDQ= X-Received: by 2002:a2e:2d2:: with SMTP id y79-v6mr785667lje.100.1531818908080; Tue, 17 Jul 2018 02:15:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:631a:0:0:0:0:0 with HTTP; Tue, 17 Jul 2018 02:14:27 -0700 (PDT) In-Reply-To: <892181d5-61f2-55da-2a79-1d2cbfc00f8f@intel.com> References: <1531106398-14062-1-git-send-email-zhang.chunyan@linaro.org> <1531106398-14062-5-git-send-email-zhang.chunyan@linaro.org> <892181d5-61f2-55da-2a79-1d2cbfc00f8f@intel.com> From: Chunyan Zhang Date: Tue, 17 Jul 2018 17:14:27 +0800 Message-ID: Subject: Re: [PATCH V3 4/7] mmc: sdhci: add 32-bit block count support for v4 mode To: Adrian Hunter Cc: Chunyan Zhang , Ulf Hansson , linux-mmc@vger.kernel.org, Linux Kernel Mailing List , Orson Zhai , Baolin Wang , Billows Wu Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 17 July 2018 at 16:29, Adrian Hunter wrote: > On 09/07/18 06:19, Chunyan Zhang wrote: >> When Host Version 4 is enabled, SDMA System Address register is >> re-defined as 32-bit Block Count, and SDMA uses ADMA System >> Address register (05Fh-058h) instead. >> >> Signed-off-by: Chunyan Zhang >> --- >> drivers/mmc/host/sdhci.c | 4 +++- >> drivers/mmc/host/sdhci.h | 1 + >> 2 files changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c >> index 7871ae2..f64e766 100644 >> --- a/drivers/mmc/host/sdhci.c >> +++ b/drivers/mmc/host/sdhci.c >> @@ -889,6 +889,7 @@ static void sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd) >> static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) >> { >> u8 ctrl; >> + u32 reg; >> struct mmc_data *data = cmd->data; >> >> host->data_timeout = 0; >> @@ -1021,7 +1022,8 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) >> /* Set the DMA boundary value and block size */ >> sdhci_writew(host, SDHCI_MAKE_BLKSZ(host->sdma_boundary, data->blksz), >> SDHCI_BLOCK_SIZE); >> - sdhci_writew(host, data->blocks, SDHCI_BLOCK_COUNT); >> + reg = host->v4_mode ? SDHCI_32BIT_BLK_CNT : SDHCI_BLOCK_COUNT; >> + sdhci_writew(host, data->blocks, reg); > > The specification says to set 16-bit block count register to zero when using > 32-bit block count. It also says it is valid for V4.1 onwards and also for > V4 with SDMA and auto-CMD23. > > So maybe we should continue to use the 16-bit block count register with V4.0 Ok. Where can I get a V4.0 specification? I only have V4.10 on hands. > >> } >> >> static inline bool sdhci_auto_cmd12(struct sdhci_host *host, >> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h >> index 24fa58a..889e48b 100644 >> --- a/drivers/mmc/host/sdhci.h >> +++ b/drivers/mmc/host/sdhci.h >> @@ -28,6 +28,7 @@ >> >> #define SDHCI_DMA_ADDRESS 0x00 >> #define SDHCI_ARGUMENT2 SDHCI_DMA_ADDRESS >> +#define SDHCI_32BIT_BLK_CNT SDHCI_DMA_ADDRESS >> >> #define SDHCI_BLOCK_SIZE 0x04 >> #define SDHCI_MAKE_BLKSZ(dma, blksz) (((dma & 0x7) << 12) | (blksz & 0xFFF)) >> >