From patchwork Fri Oct 28 02:37:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 79831 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp954200qge; Thu, 27 Oct 2016 19:37:39 -0700 (PDT) X-Received: by 10.98.206.1 with SMTP id y1mr20336460pfg.70.1477622259408; Thu, 27 Oct 2016 19:37:39 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fb11si9113896pac.234.2016.10.27.19.37.39; Thu, 27 Oct 2016 19:37:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-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 linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-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 S1034435AbcJ1Chi (ORCPT + 3 others); Thu, 27 Oct 2016 22:37:38 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:36292 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034365AbcJ1Chh (ORCPT ); Thu, 27 Oct 2016 22:37:37 -0400 Received: by mail-pf0-f172.google.com with SMTP id e6so28222399pfk.3 for ; Thu, 27 Oct 2016 19:37:37 -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=LtXdIeZsHfW12NxTrx/pNMsh/ZuuwzrNbJk0D2iA3D8=; b=FJzO5JH+3HMK/r06Tk+yPII/6LozVOPuseC7CZObXdxWZ6XOAE4GC+pEs0BIaLtggD 7ihLrDulJT5bl+QDVcCiwU8hmP1uMH/AhPZ8H1/sJQ2yPf1PS/eqvXK5ZO3SeTLDzqiO oaZFnSkscnseBm303MPD9u/8dRYdxvS0Hq/LU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LtXdIeZsHfW12NxTrx/pNMsh/ZuuwzrNbJk0D2iA3D8=; b=YCR/PsOXXA9yCMhcMNQjWc79IRyjxQQPLeR0GOlbZ+7wX7ThOHXzzpBXiZm/vqbwgp tutvfS8+ytyhgUTDl8ARdWBceeT4Hc5Om6Wu21zkRHHG9HAmGUeYgdPWtk3FJSAyA8vr hKxXQ6oGhGODvb7w8Ad4ElITUxvW1tQ2YwJLzrOIpjsKhrkzTaX8lbxiIPBIKz4N1gP3 4XXEGikyaqtCgpCDgAgo/5jDM1FrBuaQtmBiiXLXdrdu/Ui6mFDGOaiCVTNaSYsJYwXE rvt7sOS/tH2UEt+GvWTD3XeZIeLnF7ziUaWwbc8Si99evrQRpKyr2p8dLb55JYuR2rMi n5kg== X-Gm-Message-State: ABUngvfVFN4kRPQ/gJ4t6nVQOjFdYOF5wjDsl9RdzBH84XjLOF7H1hVoffwlGRrhya5ewib3 X-Received: by 10.98.159.130 with SMTP id v2mr20675782pfk.48.1477622257096; Thu, 27 Oct 2016 19:37:37 -0700 (PDT) Received: from localhost.localdomain ([188.42.255.212]) by smtp.gmail.com with ESMTPSA id e1sm14636767pap.11.2016.10.27.19.37.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Oct 2016 19:37:36 -0700 (PDT) From: Jun Nie To: shawn.guo@linaro.org, xie.baoyou@zte.com.cn Cc: ulf.hansson@linaro.org, jh80.chung@samsung.com, jason.liu@linaro.org, linux-mmc@vger.kernel.org, Jun Nie Subject: [PATCH v2 4/5] mmc: dw: Add fifo address property Date: Fri, 28 Oct 2016 10:37:08 +0800 Message-Id: <1477622229-32060-5-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477622229-32060-1-git-send-email-jun.nie@linaro.org> References: <1477622229-32060-1-git-send-email-jun.nie@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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 --- drivers/mmc/host/dw_mmc.c | 5 +++++ include/linux/mmc/dw_mmc.h | 2 ++ 2 files changed, 7 insertions(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" 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 1c9ee36..24ae05b6 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2955,6 +2955,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, "fifo-addr", &host->fifo_addr_override); + if (!of_property_read_u32(np, "clock-frequency", &clock_frequency)) pdata->bus_hz = clock_frequency; @@ -3163,6 +3165,9 @@ int dw_mci_probe(struct dw_mci *host) else host->fifo_reg = host->regs + DATA_240A_OFFSET; + if (host->fifo_addr_override) + host->fifo_reg = host->regs + host->fifo_addr_override; + tasklet_init(&host->tasklet, dw_mci_tasklet_func, (unsigned long)host); ret = devm_request_irq(host->dev, host->irq, dw_mci_interrupt, host->irq_flags, "dw-mci", host); diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index f5af2bd..4866ef5 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h @@ -107,6 +107,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. + * @fifo_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. @@ -154,6 +155,7 @@ struct dw_mci { spinlock_t irq_lock; void __iomem *regs; void __iomem *fifo_reg; + u32 fifo_addr_override; struct scatterlist *sg; struct sg_mapping_iter sg_miter;