Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp234426imm; Thu, 14 Jun 2018 19:07:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJOSwQ4HDzmV9v43GNQK1RD0WQD4jeEoMnJ74bbH67Rd9fHduNSkjW7E9gNWHulK+YvAyzT X-Received: by 2002:a65:468e:: with SMTP id h14-v6mr4229114pgr.89.1529028477716; Thu, 14 Jun 2018 19:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529028477; cv=none; d=google.com; s=arc-20160816; b=PK3ObBihBv0isRcn56usGkMLgejt6mKxMneED12x3nhaXw7np9IuOm4aXYk9hrU+zP 1vnwtV0Mb23ctKOkDx5fYQ5XHGrdgxl3I0tHsdQQoS9xKKVJm0rT60644j8/FD9FSG69 ZKtV3wqzoTDU1cG8XvwycBl+6o/etkCaIeBo67m01ptcErfFYsCJw0CDPzs8RwC55RXo QUtseumfzvLSoxgi0lR6imJvmRUDQ4skOzC4XZMs9mzfe+7+Phbt7wY+lL819TOS00OV UCq4/Q2EKCnT9/gprCJ3iE1Ax9KtCuGIlYKoYKnlxl6DZp6JwD8EnF25a/wzA5Hnzpg1 teoQ== 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=2kKdK2qZqm7YxqxQreraVLLw0s8TN4UgsB3k/YpdPQI=; b=eIJKitXcZTnir3+G2seao95LvCNIxcXmvYqlEZH28KrdnuivWpMoKXtX+m8SW4jWda CA5RsnIJ7b0YDdzm7VkM/pU7l5ZYRX6SRd6sTKGRQMVq487RxHL4G0gMWIFyDcagJOJ1 ZT0QU+I3aOgQHjwmtzxjvE3QewQJiNNYxK1y0Xai0V7zXhy5oDZgSG7OWfkNPPU9FOrb G6VZYcZI2Mos4mw0+l+e3eLVud9rX+LyUPbKbBATXtzd2fzQERLWtD1bsbTLkjl0wvlG bKNUrpPp9PXYY0haESDwE5AO37fcSoHqQkfFbnYZAaxoRNnruOqaUgwEdOw//Lmvo+b7 /U/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X42FyhXC; 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 1-v6si6867034plz.379.2018.06.14.19.07.43; Thu, 14 Jun 2018 19:07:57 -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=X42FyhXC; 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 S965481AbeFOCFL (ORCPT + 99 others); Thu, 14 Jun 2018 22:05:11 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:44143 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965432AbeFOCFI (ORCPT ); Thu, 14 Jun 2018 22:05:08 -0400 Received: by mail-pl0-f65.google.com with SMTP id z9-v6so4524854plk.11 for ; Thu, 14 Jun 2018 19:05:08 -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=2kKdK2qZqm7YxqxQreraVLLw0s8TN4UgsB3k/YpdPQI=; b=X42FyhXCSenAv4Ga0WliOss8Cl4vi1DAOFgbG7LsvEkAlK+cozcgvYSxeKDBsForin n/y8/QlrCYewK5IuFj+O1Cq0LtADv76oEypKgWDIi6R1+WiSf2WPenAvItnsQ/Gpqweg m0nCrcwHPSKyp7nwaNgHYIfjmTmpw0qmJdoto= 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=2kKdK2qZqm7YxqxQreraVLLw0s8TN4UgsB3k/YpdPQI=; b=ZzAks3tduzQPoI44czszOdHGTJK+6OExGns3FbsuK+T4bM5w24OXIZIjiXeIyt8Jxc 4Fs4S9NA1/x9WXNlykGBOGqULysmUckn5oF/X7pa8rskMplg6u8M4JbWJ238u04Ju7P2 F75GRkyGeq94oy5Agl3Ttfv2dVvXVqnSZQw5WPBOd9obCETluGEkYX1CQrc+aqyWG/Fl dYxtM2nSih0JnbpVfVgSjms1KfDVfcV39cEUb6dqQhjTBN7Dk9v+B1Wm8KfQNg4J0zNZ jp6gY/0ccf3ebTT26y/aVKHjybHubUQl9Seqz9+H4w++WHPH30i2oCzIRtUk4z4vdgC5 kNAQ== X-Gm-Message-State: APt69E3RbrK3ibmK0hGmS7y+nsymHumi/SafGS+2ayQVi0BRJgO60+yT Xq6TEGmmFTYHKL2C7FE8xusX4w== X-Received: by 2002:a17:902:8206:: with SMTP id x6-v6mr5621199pln.220.1529028308184; Thu, 14 Jun 2018 19:05:08 -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.05.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jun 2018 19:05:07 -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 4/7] mmc: sdhci: add 32-bit block count support for v4 mode Date: Fri, 15 Jun 2018 10:04:12 +0800 Message-Id: <1529028255-6022-5-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 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 | 3 ++- drivers/mmc/host/sdhci.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 5d3b0d8..b8ee124 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -943,7 +943,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); } 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 820a863..1e84539 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)) -- 2.7.4