From patchwork Fri Nov 14 18:09:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Kleine-Budde X-Patchwork-Id: 40841 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8A255240ED for ; Fri, 14 Nov 2014 18:10:10 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id mc6sf10670712lab.7 for ; Fri, 14 Nov 2014 10:10:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=6uzwPE85t2hLRGS9Yl6NiNb7THomw5UMBVjM5tS7spk=; b=TikL3HxXrmjah95W9dL4cgiBYAQ4+hoTtnmPNTe33xiqC90pMKppGHkuSvyWkjfWUQ JiAirOHaWljCa1txbFGSqXgI+6WBuB4JV9UsiA901QFWggQzDrDWobDucGvDI1fB5Umg yYBiD0PTagJ5aSTnuMyM+IJ37SqCKOgTjEB1PzzcDyR6qVB2m1HWDVVTIKezGcx/IqZ3 MmSGNO/v0ymyysYEuxlJVliUZ8k38uxkUGrEEiL/n8hq+jV/hBPHnFWFta2RlaHAydD8 SNOsiQ2P7EDjMuprnHUrm5OCj8EHPDLUELXlnGmIsngwLMQ3VbaECrf4Is65r2TmEVXI 2PiQ== X-Gm-Message-State: ALoCoQl+GGPnejiQAfqSwm81zaufEeUMcXtknGifZNM9OKOhlr0rpi2yktAIFdUabhkuO3+4+BAO X-Received: by 10.180.100.100 with SMTP id ex4mr1378479wib.2.1415988609534; Fri, 14 Nov 2014 10:10:09 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.169 with SMTP id r9ls761388laj.57.gmail; Fri, 14 Nov 2014 10:10:08 -0800 (PST) X-Received: by 10.112.14.69 with SMTP id n5mr9645818lbc.34.1415988608944; Fri, 14 Nov 2014 10:10:08 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id f6si42611802lbc.6.2014.11.14.10.10.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Nov 2014 10:10:08 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id f15so14596320lbj.13 for ; Fri, 14 Nov 2014 10:10:08 -0800 (PST) X-Received: by 10.153.7.170 with SMTP id dd10mr9537063lad.44.1415988608794; Fri, 14 Nov 2014 10:10:08 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp809409lbc; Fri, 14 Nov 2014 10:10:07 -0800 (PST) X-Received: by 10.70.45.72 with SMTP id k8mr11973321pdm.146.1415988607139; Fri, 14 Nov 2014 10:10:07 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kj7si29059118pab.98.2014.11.14.10.10.05 for ; Fri, 14 Nov 2014 10:10:07 -0800 (PST) Received-SPF: none (google.com: linux-omap-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161732AbaKNSKD (ORCPT + 5 others); Fri, 14 Nov 2014 13:10:03 -0500 Received: from metis.ext.pengutronix.de ([92.198.50.35]:51614 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161516AbaKNSKB (ORCPT ); Fri, 14 Nov 2014 13:10:01 -0500 Received: from gallifrey.ext.pengutronix.de ([2001:6f8:1178:4:5054:ff:fe8d:eefb] helo=hardanger.do.blackshift.org) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1XpLJl-00039L-CY; Fri, 14 Nov 2014 19:09:57 +0100 From: Marc Kleine-Budde To: linux-can@vger.kernel.org Cc: wsa@the-dreams.de, linux-omap@vger.kernel.org, rogerq@ti.com, kernel@pengutronix.de, Marc Kleine-Budde Subject: [PATCH v8 5/8] can: c_can: Add support for START pulse in RAMINIT sequence Date: Fri, 14 Nov 2014 19:09:48 +0100 Message-Id: <1415988591-6032-6-git-send-email-mkl@pengutronix.de> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1415988591-6032-1-git-send-email-mkl@pengutronix.de> References: <1415988591-6032-1-git-send-email-mkl@pengutronix.de> X-SA-Exim-Connect-IP: 2001:6f8:1178:4:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-omap@vger.kernel.org Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mkl@pengutronix.de X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Roger Quadros Some SoCs e.g. (TI DRA7xx) need a START pulse to start the RAMINIT sequence i.e. START bit must be set and cleared before checking for the DONE bit status. Signed-off-by: Roger Quadros Signed-off-by: Marc Kleine-Budde --- drivers/net/can/c_can/c_can.h | 1 + drivers/net/can/c_can/c_can_platform.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/can/c_can/c_can.h b/drivers/net/can/c_can/c_can.h index 28a73d14ea8d..8acdc7fa4792 100644 --- a/drivers/net/can/c_can/c_can.h +++ b/drivers/net/can/c_can/c_can.h @@ -188,6 +188,7 @@ struct c_can_raminit { struct regmap *syscon; /* for raminit ctrl. reg. access */ unsigned int reg; /* register index within syscon */ struct raminit_bits bits; + bool needs_pulse; }; /* c_can private data structure */ diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c index 1fbfa1d59c29..41fa460c3592 100644 --- a/drivers/net/can/c_can/c_can_platform.c +++ b/drivers/net/can/c_can/c_can_platform.c @@ -120,6 +120,12 @@ static void c_can_hw_raminit_syscon(const struct c_can_priv *priv, bool enable) ctrl |= 1 << raminit->bits.start; regmap_write(raminit->syscon, raminit->reg, ctrl); + /* clear START bit if start pulse is needed */ + if (raminit->needs_pulse) { + ctrl &= ~(1 << raminit->bits.start); + regmap_write(raminit->syscon, raminit->reg, ctrl); + } + ctrl |= 1 << raminit->bits.done; c_can_hw_raminit_wait_syscon(priv, mask, ctrl); } @@ -325,6 +331,7 @@ static int c_can_plat_probe(struct platform_device *pdev) } raminit->bits = drvdata->raminit_bits[id]; + raminit->needs_pulse = drvdata->raminit_pulse; priv->raminit = c_can_hw_raminit_syscon; } else {