Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp512836ybl; Thu, 22 Aug 2019 00:10:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBHw0FJedgrQiwE+BkIzTAd7oOvWcnRDWI6dMc3Y/nNk5cQL/pmS8Z42dRZ05LpHYoQBG5 X-Received: by 2002:a17:90a:d990:: with SMTP id d16mr3741036pjv.55.1566457834382; Thu, 22 Aug 2019 00:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566457834; cv=none; d=google.com; s=arc-20160816; b=bZlT6UUAzOzI4Ok3XDdkOa5K0LJtps2Wcue/N5TnpXRYJOVR4AKHQ758fwA/GCjpoH V0i6Y6iurnPl8DdJDOxhl580rDv0AdhEBNK50onaqb5TcvMVWY4TfXSgn5tGaIlR5Y/l 6qhawLRAlcA3bvLq2OTfINOEIIvJUNLdo1NAoHV48XAf9HQ/QN7i9HLu8juJBxZRB4GU wY+byjdSsK97Quw4/z323lIvBjlQkvILMOFig3PLFNUr+g4uhE1AWqTj1Hq9vXxurD+y KE4wMCAOY3xGwyQypC2Bgvs6c6ntlTUZXZNeEhAH243bbUtCxt2c3V+GENjcxZb26HFC KueQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=IwMjYw2H+gM8LSBIgdaBEDa9klcgZTvL0sCG0xnYO9c=; b=p7dUkAuznUmhHLAB7nHY+OMNSeIx2M8MAe+PdM3WSouejKHMG7s6nrhS0R252L6qW3 e5JfPPRQS6oHYm+WjycW7y69ng9ifmxlHNvIqOnPE220sqA0dXufJJVx7l/DMjFL8Xgz kWNhp+okyNVRGouO0qL+6v3LPHGLTW7XWv4cUrS9JWcEaZUinnzktpMdEpbMK5QbEPNf fp3/0ED431PrWhKYalqowkAMW/JdhooB498BdHN6HzgDINsUw37eR3aul9VhzETiTf71 VFqjHYp9+eEkH3EwkoUYmfiF4q7JH92OLgIQ1Y3nj3Ne0XZcNaVEF5Ta5Kf70QP0A4e6 du9w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si16285890plj.194.2019.08.22.00.10.20; Thu, 22 Aug 2019 00:10: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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731819AbfHVGr5 (ORCPT + 99 others); Thu, 22 Aug 2019 02:47:57 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:4502 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730847AbfHVGr4 (ORCPT ); Thu, 22 Aug 2019 02:47:56 -0400 X-UUID: a74640b5860348139aa514829cad0918-20190822 X-UUID: a74640b5860348139aa514829cad0918-20190822 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0707 with TLS) with ESMTP id 1104521508; Thu, 22 Aug 2019 14:47:50 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 22 Aug 2019 14:47:45 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 22 Aug 2019 14:47:44 +0800 From: Chaotian Jing To: Ulf Hansson CC: Chaotian Jing , Matthias Brugger , , , , , Subject: [PATCH 2/2] mmc: mediatek: support 24bits segment size Date: Thu, 22 Aug 2019 14:47:41 +0800 Message-ID: <20190822064741.11196-3-chaotian.jing@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190822064741.11196-1-chaotian.jing@mediatek.com> References: <20190822064741.11196-1-chaotian.jing@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org MSDC IP which support 64G DRAM will support 24bits BDMA buffer length, so add support it. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 5cc422e5db69..4c72c5b73e87 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -328,6 +328,7 @@ struct mt_bdma_desc { u32 ptr; u32 bd_data_len; #define BDMA_DESC_BUFLEN (0xffff) /* bit0 ~ bit15 */ +#define BDMA_DESC_BUFLEN_EXT (0xffffff) /* bit0 ~ bit23 */ }; struct msdc_dma { @@ -641,8 +642,14 @@ static inline void msdc_dma_setup(struct msdc_host *host, struct msdc_dma *dma, bd[j].bd_info |= (upper_32_bits(dma_address) & 0xf) << 28; } - bd[j].bd_data_len &= ~BDMA_DESC_BUFLEN; - bd[j].bd_data_len |= (dma_len & BDMA_DESC_BUFLEN); + + if (host->dev_comp->support_64g) { + bd[j].bd_data_len &= ~BDMA_DESC_BUFLEN_EXT; + bd[j].bd_data_len |= (dma_len & BDMA_DESC_BUFLEN_EXT); + } else { + bd[j].bd_data_len &= ~BDMA_DESC_BUFLEN; + bd[j].bd_data_len |= (dma_len & BDMA_DESC_BUFLEN); + } if (j == data->sg_count - 1) /* the last bd */ bd[j].bd_info |= BDMA_DESC_EOL; @@ -2277,7 +2284,10 @@ static int msdc_drv_probe(struct platform_device *pdev) mmc->caps |= MMC_CAP_ERASE | MMC_CAP_CMD23; /* MMC core transfer sizes tunable parameters */ mmc->max_segs = MAX_BD_NUM; - mmc->max_seg_size = BDMA_DESC_BUFLEN; + if (host->dev_comp->support_64g) + mmc->max_seg_size = BDMA_DESC_BUFLEN_EXT; + else + mmc->max_seg_size = BDMA_DESC_BUFLEN; mmc->max_blk_size = 2048; mmc->max_req_size = 512 * 1024; mmc->max_blk_count = mmc->max_req_size / 512; -- 2.18.0