From patchwork Fri Jan 6 04:24:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 90099 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp9284599qgi; Thu, 5 Jan 2017 20:25:05 -0800 (PST) X-Received: by 10.84.210.35 with SMTP id z32mr151812428plh.112.1483676705171; Thu, 05 Jan 2017 20:25:05 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10si78073817pge.19.2017.01.05.20.25.04; Thu, 05 Jan 2017 20:25:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937939AbdAFEZE (ORCPT + 7 others); Thu, 5 Jan 2017 23:25:04 -0500 Received: from mail-pg0-f45.google.com ([74.125.83.45]:35635 "EHLO mail-pg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937881AbdAFEZD (ORCPT ); Thu, 5 Jan 2017 23:25:03 -0500 Received: by mail-pg0-f45.google.com with SMTP id i5so182901542pgh.2 for ; Thu, 05 Jan 2017 20:25:03 -0800 (PST) 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=tKXU7oL4vgjY12v9O5ibN4Zf/6hpkYHIBQESbp2fMM4=; b=Md8oZG/sU+dkGVEEvTZM3vQksrOt53dDNLdFCLZDqtaxGE3HO/vdac9s4rpIBj57Pj svrA8hunaF6WuXeaLPOEllsqF+es7rRjkbnZNDqjm3fekxJrWdMupJoymlK9gz9YaGin CbWGJHpD2mPJlviMASFAdNx7aCw/JCLf3+Rb8= 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=tKXU7oL4vgjY12v9O5ibN4Zf/6hpkYHIBQESbp2fMM4=; b=ANjySLBUiUNbtb4Aj28DQ1lxJZRx3lt4XNXexiqG70hXdrroz5ESeARl4LNaGVfZno 0jzZ70in9uLpZzbj/FoAc6DYN8KA+bXQ6a3wUlavsfMwC0IfyxUDH660BA4eFIBhRpHE w5YFMS8L94amFvhp8iLAuei4Ro+5GH6YUnVvaYOkEAUFTz9X5KC0DYt9SiAyuhx3W6OF wBeLBq39YITXEfnYorGSsgJAyb5TaEVWbIk/Fz7gkIvOJ++6n/uFKJdF2jlikGLerVpr but5IAbzCMFNPGP9lRGwshAjNwcDO92aKEI33hZ52dzfIoyWYhqungsAdxMw8kUdms6g OZfg== X-Gm-Message-State: AIkVDXIKK0COmODioNwWiQ2gL7iZEPVrCF5Su/Sb2oeP/xcYcen22Et77TaYcTGjwbgLbf8z X-Received: by 10.99.228.5 with SMTP id a5mr140015192pgi.1.1483676702711; Thu, 05 Jan 2017 20:25:02 -0800 (PST) Received: from localhost.localdomain (125-227-70-105.HINET-IP.hinet.net. [125.227.70.105]) by smtp.gmail.com with ESMTPSA id t25sm158142586pgo.9.2017.01.05.20.24.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jan 2017 20:25:02 -0800 (PST) From: Jun Nie To: robh+dt@kernel.org, mark.rutland@arm.com, shawn.guo@linaro.org, xie.baoyou@zte.com.cn, devicetree@vger.kernel.org Cc: ulf.hansson@linaro.org, jh80.chung@samsung.com, jason.liu@linaro.org, chen.chaokai@zte.com.cn, lai.binz@zte.com.cn, linux-mmc@vger.kernel.org, Jun Nie Subject: [PATCH v9 2/5] mmc: dw: Add fifo address property Date: Fri, 6 Jan 2017 12:24:43 +0800 Message-Id: <1483676686-17011-3-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1483676686-17011-1-git-send-email-jun.nie@linaro.org> References: <1483676686-17011-1-git-send-email-jun.nie@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The FIFO address may break default address assumption of 0x100 (version < 0x240A) and 0x200(version >= 0x240A) in current driver. The new property is introduced to override fifo address via DT node information. Signed-off-by: Jun Nie Reviewed-by: Shawn Lin --- drivers/mmc/host/dw_mmc.c | 6 +++++- include/linux/mmc/dw_mmc.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index b44306b..b600170 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2977,6 +2977,8 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host) of_property_read_u32(np, "card-detect-delay", &pdata->detect_delay_ms); + of_property_read_u32(np, "data-addr", &host->data_addr_override); + if (!of_property_read_u32(np, "clock-frequency", &clock_frequency)) pdata->bus_hz = clock_frequency; @@ -3180,7 +3182,9 @@ int dw_mci_probe(struct dw_mci *host) host->verid = SDMMC_GET_VERID(mci_readl(host, VERID)); dev_info(host->dev, "Version ID is %04x\n", host->verid); - if (host->verid < DW_MMC_240A) + if (host->data_addr_override) + host->fifo_reg = host->regs + host->data_addr_override; + else if (host->verid < DW_MMC_240A) host->fifo_reg = host->regs + DATA_OFFSET; else host->fifo_reg = host->regs + DATA_240A_OFFSET; diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 15db6f8..1c09cca 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h @@ -113,6 +113,7 @@ struct dw_mci_dma_slave { * @ciu_clk: Pointer to card interface unit clock instance. * @slot: Slots sharing this MMC controller. * @fifo_depth: depth of FIFO. + * @data_addr_override: override fifo reg offset with this value. * @data_shift: log2 of FIFO item size. * @part_buf_start: Start index in part_buf. * @part_buf_count: Bytes of partial data in part_buf. @@ -160,6 +161,7 @@ struct dw_mci { spinlock_t irq_lock; void __iomem *regs; void __iomem *fifo_reg; + u32 data_addr_override; struct scatterlist *sg; struct sg_mapping_iter sg_miter;