From patchwork Tue Oct 3 22:35:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 821049 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FwXAuLzf"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3y6DRD3CfBz9t2c for ; Wed, 4 Oct 2017 09:36:40 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750865AbdJCWgj (ORCPT ); Tue, 3 Oct 2017 18:36:39 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:47269 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751120AbdJCWgi (ORCPT ); Tue, 3 Oct 2017 18:36:38 -0400 Received: by mail-wm0-f67.google.com with SMTP id t69so19410165wmt.2 for ; Tue, 03 Oct 2017 15:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=z3MFIa0DOGa6f8qgNn89qQWs37F8K7KkTFTUrYrqSS8=; b=FwXAuLzfHZygCthhOJ8muYMDNZK2UGTUWSwacUB1bFfM17IEazWWjUkT89nvQQIQEo 3Q6IG0whuVEoPb2FCdLTon5Ww7/+WhRcVaq3/qi3oKxDla/KbnaHckv4kR4dj2V8jXZZ TNieWGb/oQSbDw+8b6an9wwj71PyE3AVosn1nPGia/FH+7zZZWEtJEZD1AoWnD9kuovZ f5juC87G/j+JiCwCQbrZovTjcEsILzBPFbE/2llSVHVa2fo9Fm+rMrpGq62t+kWufvFT L4qkqTBbBtmvsKh+ySQvEs4oQ/R4fsNs7hOBubcvQoTAQQ4UvLQpfbjeDfdSMPHktXwU Gl9w== 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:in-reply-to:references; bh=z3MFIa0DOGa6f8qgNn89qQWs37F8K7KkTFTUrYrqSS8=; b=U4sjfdfalQ0R0GZySEPo5VA3/43CcAiE68YFGwdM0/ugKh3LcdM+oeubcOYcnxUPn0 kUIocKjh5FClOyvgTeGbAe8q3jTj8MBW0WyhR5seOXEmyoaQq6J0S3nA58nBuy1obOYu alDe5W3G97819dkIqIDsvY7X+R54QSWMnPcP3yS8YffCT/Txz8+1ygkIRazLjf7gYJ2m Wa4SfLyKDIy+v4o8yv3wfEaDwLT4K/w9AQWdyR4rE/9HbRxL3nHys6sbFGRaK1sB4r1C ob5zso9l35RTx7pKZjbwPULQjCB+jl773C95j0ujVsJPV6vHn6HClTafxcjcILInAfix mlfg== X-Gm-Message-State: AMCzsaVpsksNfRDDqIBBdqkSyqLUjbppoJGLyuI3WpGUG5uWf+prGPsm T3SN0/ZeDTQn6kRAwysPEgY= X-Google-Smtp-Source: AOwi7QCPC+h0vrQlCm8ui0e5Xwmp3onv1bgPARMmer6g2OLBLNgLSbGSt/NMQWshSWJ+XAHSQ1+aqQ== X-Received: by 10.28.196.205 with SMTP id u196mr13859470wmf.120.1507070197635; Tue, 03 Oct 2017 15:36:37 -0700 (PDT) Received: from localhost.localdomain (ppp109-252-55-163.pppoe.spdop.ru. [109.252.55.163]) by smtp.gmail.com with ESMTPSA id r68sm16192413wmd.4.2017.10.03.15.36.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Oct 2017 15:36:37 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter Cc: linux-tegra@vger.kernel.org Subject: [PATCH v2 1/2] soc/tegra: fuse: Fix reading registers using DMA on Tegra20 Date: Wed, 4 Oct 2017 01:35:08 +0300 Message-Id: <1fe535d4655ae00199a8d60768b384e87df3ed51.1507068874.git.digetx@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org DMA config is incorrect, because of it DMA transfer is never issued and tegra20_fuse_read() always returns 0x0. Signed-off-by: Dmitry Osipenko Acked-by: Jon Hunter --- drivers/soc/tegra/fuse/fuse-tegra.c | 1 + drivers/soc/tegra/fuse/fuse-tegra20.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c index b7c552e3133c..73a3a2c74021 100644 --- a/drivers/soc/tegra/fuse/fuse-tegra.c +++ b/drivers/soc/tegra/fuse/fuse-tegra.c @@ -132,6 +132,7 @@ static int tegra_fuse_probe(struct platform_device *pdev) /* take over the memory region from the early initialization */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + fuse->phys = res->start; fuse->base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(fuse->base)) return PTR_ERR(fuse->base); diff --git a/drivers/soc/tegra/fuse/fuse-tegra20.c b/drivers/soc/tegra/fuse/fuse-tegra20.c index 294413a969a0..a33f48c06771 100644 --- a/drivers/soc/tegra/fuse/fuse-tegra20.c +++ b/drivers/soc/tegra/fuse/fuse-tegra20.c @@ -59,7 +59,7 @@ static u32 tegra20_fuse_read(struct tegra_fuse *fuse, unsigned int offset) mutex_lock(&fuse->apbdma.lock); - fuse->apbdma.config.src_addr = fuse->apbdma.phys + FUSE_BEGIN + offset; + fuse->apbdma.config.src_addr = fuse->phys + FUSE_BEGIN + offset; err = dmaengine_slave_config(fuse->apbdma.chan, &fuse->apbdma.config); if (err) @@ -119,6 +119,7 @@ static int tegra20_fuse_probe(struct tegra_fuse *fuse) fuse->apbdma.config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; fuse->apbdma.config.src_maxburst = 1; fuse->apbdma.config.dst_maxburst = 1; + fuse->apbdma.config.direction = DMA_DEV_TO_MEM; init_completion(&fuse->apbdma.wait); mutex_init(&fuse->apbdma.lock);