Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp314321imm; Tue, 3 Jul 2018 20:04:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcHUlF6INE23m61zrHa4nkSmrDIXttKC/LSsFx1ukgrRs+k/pWEO9H7+zXjAqaS9vFg8Mw4 X-Received: by 2002:a65:450a:: with SMTP id n10-v6mr248427pgq.392.1530673462197; Tue, 03 Jul 2018 20:04:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530673462; cv=none; d=google.com; s=arc-20160816; b=vZ3HgZIs6wd7nQhFnt7aFsYauAEqmzUb2h1ikzv/MG9EnuS3hzxRUQa5jXR/tK5cuv OzkLQKk0wZUNZTOfC+KVwOCPxrHcgTFokYvMwEPB344JBwLl1uY7tq2zq3isbAuDpt2B tCR4RlyIqlKV/b9O4FjM/6MNlS+mhx8EdFExYqeJ+O+X597Xooub6JO4kZGxiDv0YY4p edpw5J4Rdpt4hlwHejMu5WCoBzznmXSgio7kmJZpES2HEIop5i4LlfbGF1pSPN173EyZ 2EEPRp/V5PU6EVGPj97gW1cg3mSykBn85x593wIVRA4QyoOnt5+oOTj5WjsMX408S55M Oq2w== 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=RNmXcrYd2wT2fnFEyy+Dhe4+Rj0tTtnM+6PukaKZB24=; b=diRpne92sOgPSsyVTZSF6Mwnz4X/tvuVfGqhwhVCsrQyo0MOX5yscwybhBDrnJtH7H KYUoUkqSRxjz4I2zYRrm2aNh4J7cO+6lDZKfK5a4waa2wW+7YMUWpsUl/jcIaXhZ4IGp 7QC97elaKiEoazIPe/YuAat7BuJbQaF/rLfDdqVB1z7Qm13Ko7MTgmPcXeuRZEYVTT3p tSEAc48mZ6/l63KAVx+mNnkDgY0NbJJTe+r+LJphmCXx/JCPNyJeLwOAxlK/McEU8y0l 3wHrae0Cj1yJ2xxpK1XTtnKN6Vun+gmMAtRCfV2rdh3TxfD/cyeQCWvo4zS7DoAw5Maf Hx1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jubHHkmB; 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 e21-v6si2363023pgl.148.2018.07.03.20.04.07; Tue, 03 Jul 2018 20:04:22 -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=jubHHkmB; 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 S932471AbeGDDD0 (ORCPT + 99 others); Tue, 3 Jul 2018 23:03:26 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:33439 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753623AbeGDDDY (ORCPT ); Tue, 3 Jul 2018 23:03:24 -0400 Received: by mail-lf0-f67.google.com with SMTP id u14-v6so3183483lfu.0; Tue, 03 Jul 2018 20:03:24 -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=RNmXcrYd2wT2fnFEyy+Dhe4+Rj0tTtnM+6PukaKZB24=; b=jubHHkmBbckn4VW5VMyLhVgTSbDGvo0XAdVd4viZg++2YlpGzB690rfRzDF6/sfopq +hixFh+lW6urg336DUwZePD09UHs7W2u59ihFfoIkJ7j4bSa5Gdil2gAjIMylqng4+uv UDZdIqkdL+/VvK+SSJUKrZtlwNxBvKOxsTJLBnG4TQNduMuHEaCsbpqcY4n5FQEqeURd bBnK74hn1FQxkmzFJGLJUnGWi36+kRfaqSzzqD4mRRXvKI3EdBTYh2G3kuHfhZtLOHpB c4Ku5+PaRtKct2TyUfVqV2k7v96nEu+tzdEYfvbthG7Z4QB88UXZpJq2mgtTNe2F83Uj 3KiA== 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=RNmXcrYd2wT2fnFEyy+Dhe4+Rj0tTtnM+6PukaKZB24=; b=mfoAW4vPg7ngmlIY6Rp/WM40PnV4I2Y11RuMIxwVgAMlhN87hGxNcYZtL3hIZF7Ul+ e3LmTEfh8WYub+AJDx0/k3XAZvvCAvA/flMu4i1mpGdoGj6/SVM61P0QRpXmpi7nGiSW NVw3f/2wT3zM/m334Y4OBE0IYEeXfMf0GxPUdMCelUrK00CfsLV9xVX4dMcyqJc8m31/ 0895AwYvJ3fR9RrJVHXSMTjbwkT10KcioQ/WpkudzwnqcH+7jNz2U5rMJzWIcKe5BjHq yiaYz5tr0krrCcArLGdDenl/gSbgjnWRko3MISSgicBtn4g1gok202BsfS1gXPxYn3u+ TRng== X-Gm-Message-State: APt69E3kBnunUqCEoPxzoWmZ0p/QEcPxHhQat0rZEbniUZDGnj1hVIsw Yi9SiTUskk2hAgcrN64NnJ7mtbRlXPWUpqd+eak= X-Received: by 2002:a19:b519:: with SMTP id e25-v6mr135732lff.119.1530673403379; Tue, 03 Jul 2018 20:03:23 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:1796:0:0:0:0:0 with HTTP; Tue, 3 Jul 2018 20:02:42 -0700 (PDT) In-Reply-To: <2eb994d3-7f23-6ff8-4740-7a444a581e9d@intel.com> References: <1529028255-6022-1-git-send-email-zhang.chunyan@linaro.org> <1529028255-6022-3-git-send-email-zhang.chunyan@linaro.org> <2eb994d3-7f23-6ff8-4740-7a444a581e9d@intel.com> From: Chunyan Zhang Date: Wed, 4 Jul 2018 11:02:43 +0800 Message-ID: Subject: Re: [PATCH V2 2/7] mmc: sdhci: made changes for System Address register of SDMA 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 On 21 June 2018 at 19:22, Adrian Hunter wrote: > On 15/06/18 05:04, Chunyan Zhang wrote: >> 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; > > reg could just be an int. Why? Shouldn't addresses be unsigned? > >> 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); > > Shouldn't we support 64-bit SDMA in version 4 mode? I will address. > > >> } >> } >> >> @@ -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); > > Shouldn't we support 64-bit SDMA in version 4 mode? > >> } >> >> if (intmask & SDHCI_INT_DATA_END) { >> >