Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp232883imm; Thu, 14 Jun 2018 19:05:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIYIPTC1VqebYB6YLAVcL/zpqZLgW+bv364G/xiyBlY7NhOLGWTxYH/zs+ThGLv6Fxvi0IJ X-Received: by 2002:a62:da59:: with SMTP id w25-v6mr11967840pfl.161.1529028353803; Thu, 14 Jun 2018 19:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529028353; cv=none; d=google.com; s=arc-20160816; b=NvDXHqhJdGT7Xq5358b4c7m/yTAw2HuDqwM9YOS1xnTHxbTVsfr7CQuHlKl79gDUYW E11fo76O2FQRoJbqDg0K6bBbQcWaksRr1pjO2DY7SKqvOSUO/9yNPVYo/Ak2fgCg2+d9 FYCWL9QbWO8OwohC1hTMRiSDyuG+WPrEAWzXTXvQS8ulWyZqvt2i7uGSFf25IK10rhZU CGZUqK6EfkP1cu+fi9x8f24IYWLgxus8G+UejBVGgi37MnbX1JifYaIc4w/JreAATlvA DrvhdANX6AcmszJLy7anQX2wO9hl+K1+ra/ABKS1z3kwztBTXma8/edUqD9tEIz96kHU nF+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=HweywlkV3W7hX6j4jAziXnB8202QrrYYO0FfXOW5ydM=; b=uf6j6OI074TNp7ZMZCenQJcOntZTq6pdCkGxQM8YkUozaglAtYQwNUAB0f4XnvU9O4 MmudPG9ev+GgZfoiTu+2HPBVILuprcHw6u6x9I06P2aEEHGBHtmGtpDZyZJOdFrQHzvN 9+3qMyfKMA+hfT8ge3S1sMC8r84tlRcLg9S9tMcNG+vv4PoemE6GOXIuk3ssP5E5XCmj hmOEdS1XMrmmNZGVR9hI4MneNYl5BNS1nqW5ta61Bs40tgL6UmD4uiOCb1RGS/PyABkh 95s6UjWiqzdXztFC8TwOjkFdujHIEoI/QONc/a2DSKdtdpWYwFkpVMJur/cUzX65+EE0 Y70g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hd8DOIb1; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s137-v6si5522910pgc.444.2018.06.14.19.05.39; Thu, 14 Jun 2018 19:05:53 -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=@linaro.org header.s=google header.b=Hd8DOIb1; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965439AbeFOCE4 (ORCPT + 99 others); Thu, 14 Jun 2018 22:04:56 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:46080 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965401AbeFOCEx (ORCPT ); Thu, 14 Jun 2018 22:04:53 -0400 Received: by mail-pl0-f67.google.com with SMTP id 30-v6so4522068pld.13 for ; Thu, 14 Jun 2018 19:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HweywlkV3W7hX6j4jAziXnB8202QrrYYO0FfXOW5ydM=; b=Hd8DOIb1VuXzTzCRG00r3F7KyoIp6qzwSDWD10+FgpacBq615zkgwJMx/NESKdxh9x bbhe+SJPEhLTFVBYPt9fmsT+7oxAB4YdUq2e4u1SJpz6oN+GtGvV6DzYLXIdxMPA0krI Ds/XBBX8oyipU8HJLCrdxFqbwKtWm82cEMdWU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HweywlkV3W7hX6j4jAziXnB8202QrrYYO0FfXOW5ydM=; b=pRlmWBy4kuSvOlNQk55b2qtVQp/pgeueAOAhWg+Ynv5yrW0kgH7h1gZL4uo+Qo4QpV hA1Op0Iy8YbIwFB4thjRpbd35JJQijiy8Ff7PhiiUFU/NApoFWrt9EL+G8ckQsrVJ08G 44j5QWi5wQ1+nO+3XTnzhHdeRp9R0Cfn1eG7RSzcF05eSyCmg35Sp+ISopx7dNR/fvj4 s/0jQwudJuywm7PAnGvqnojRNSvKYNRt2dsft1h3H2GmK+IpuYnwOjYwfWU9Q858d3TK EeccpH1sauh9wgDGiHekvlkrYTxSWi0h/IDJo1xmvAcDcVvc0k5jy5NKWgekoRuzNh2+ VBBA== X-Gm-Message-State: APt69E3QAgSeDnax58SJBfKBHzDDECt6O2M+ctbwE00hg1A3fkRSw1Gj mRU6mblUwgtgJhKKMutdZhcdDA== X-Received: by 2002:a17:902:c6b:: with SMTP id 98-v6mr5695123pls.37.1529028293264; Thu, 14 Jun 2018 19:04:53 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id k69-v6sm9504953pgc.39.2018.06.14.19.04.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jun 2018 19:04:52 -0700 (PDT) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Orson Zhai , Baolin Wang , Billows Wu , zhang.lyra@gmail.com Subject: [PATCH V2 2/7] mmc: sdhci: made changes for System Address register of SDMA Date: Fri, 15 Jun 2018 10:04:10 +0800 Message-Id: <1529028255-6022-3-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1529028255-6022-1-git-send-email-zhang.chunyan@linaro.org> References: <1529028255-6022-1-git-send-email-zhang.chunyan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org According to the SD host controller specification version 4.10, when Host Version 4 is enabled, SDMA uses ADMA System Address register (05Fh-058h) instead of using SDMA System Address register to support both 32-bit and 64-bit addressing. Signed-off-by: Chunyan Zhang --- drivers/mmc/host/sdhci.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index cf5695f..f57201f 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -805,6 +805,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; if (sdhci_data_line_cmd(cmd)) @@ -894,8 +895,10 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) SDHCI_ADMA_ADDRESS_HI); } else { WARN_ON(sg_cnt != 1); + reg = host->v4_mode ? SDHCI_ADMA_ADDRESS : + SDHCI_DMA_ADDRESS; sdhci_writel(host, sdhci_sdma_address(host), - SDHCI_DMA_ADDRESS); + reg); } } @@ -2721,6 +2724,7 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) */ if (intmask & SDHCI_INT_DMA_END) { u32 dmastart, dmanow; + u32 reg; dmastart = sdhci_sdma_address(host); dmanow = dmastart + host->data->bytes_xfered; @@ -2733,7 +2737,9 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) host->data->bytes_xfered = dmanow - dmastart; DBG("DMA base 0x%08x, transferred 0x%06x bytes, next 0x%08x\n", dmastart, host->data->bytes_xfered, dmanow); - sdhci_writel(host, dmanow, SDHCI_DMA_ADDRESS); + reg = host->v4_mode ? SDHCI_ADMA_ADDRESS : + SDHCI_DMA_ADDRESS; + sdhci_writel(host, dmanow, reg); } if (intmask & SDHCI_INT_DATA_END) { -- 2.7.4