From patchwork Fri Nov 7 14:49:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 40423 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3C1E1240F7 for ; Fri, 7 Nov 2014 14:50:49 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id x13sf1968921wgg.9 for ; Fri, 07 Nov 2014 06:50:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=G9UTOP6VPJ2qsF9zED5DV/2lXmE66VWGWBN7oBKaeIc=; b=Yqycs5bETC4KdczSKRY7cSj16swh/PPxLkbQK9ZLjA5MPG3zMfVxV0eQ7wfcRYf+3H VxDAeCb2v8MKi0cUQZkTj5KCECRL1DbjV80PLvrwK5yJLiOXufNt3jWbtHQww7xee5wi 4hfXgo5rPu3WLrsTbFxvcZwO48EJLbRRh/CK6pvifYUYCKGSchgYNwU8wuTiw3EJuQwi 1NLvbbxuAt+pHvkAGCnbh6uNPJG85LkK9vxHoj/ngrgeW1zbusYaBUQ2SvPeQTIRqQrT VsEHpZmzCJUzitMIatLdv8FqqwyTlw54i66zqY/6H9cIC1CPgb6wbYgfRQiVgrRKNk2W AkAQ== X-Gm-Message-State: ALoCoQl1Qj/mU3j8wHuV4izizT/8OHCEmXrMVv/YjkzSLOUDs05vzSnVQTAtqD9z/XIY+gBAy8WF X-Received: by 10.112.159.199 with SMTP id xe7mr107877lbb.21.1415371848321; Fri, 07 Nov 2014 06:50:48 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.97 with SMTP id s1ls222656lag.81.gmail; Fri, 07 Nov 2014 06:50:48 -0800 (PST) X-Received: by 10.112.180.198 with SMTP id dq6mr11524782lbc.56.1415371847977; Fri, 07 Nov 2014 06:50:47 -0800 (PST) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id tl10si15185706lbb.131.2014.11.07.06.50.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Nov 2014 06:50:47 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id z11so2288013lbi.19 for ; Fri, 07 Nov 2014 06:50:47 -0800 (PST) X-Received: by 10.152.5.38 with SMTP id p6mr11623188lap.44.1415371847883; Fri, 07 Nov 2014 06:50:47 -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 ew9csp210547lbc; Fri, 7 Nov 2014 06:50:47 -0800 (PST) X-Received: by 10.66.244.233 with SMTP id xj9mr12827789pac.67.1415371846334; Fri, 07 Nov 2014 06:50:46 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qf7si9134006pbb.205.2014.11.07.06.50.45 for ; Fri, 07 Nov 2014 06:50:46 -0800 (PST) Received-SPF: none (google.com: netdev-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 S1753060AbaKGOun (ORCPT + 3 others); Fri, 7 Nov 2014 09:50:43 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:52494 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752987AbaKGOuW (ORCPT ); Fri, 7 Nov 2014 09:50:22 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id sA7Enu4b014641; Fri, 7 Nov 2014 08:49:56 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA7EnuxQ023786; Fri, 7 Nov 2014 08:49:56 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Fri, 7 Nov 2014 08:49:56 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA7EnX7H007870; Fri, 7 Nov 2014 08:49:53 -0600 From: Roger Quadros To: , CC: , , , , , , , , , , , , Roger Quadros Subject: [PATCH v4 5/8] net: can: c_can: Add support for START pulse in RAMINIT sequence Date: Fri, 7 Nov 2014 16:49:19 +0200 Message-ID: <1415371762-29885-6-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1415371762-29885-1-git-send-email-rogerq@ti.com> References: <1415371762-29885-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: netdev@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: rogerq@ti.com 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.174 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: , 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 --- 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 0e17c7b..c6715ca 100644 --- a/drivers/net/can/c_can/c_can.h +++ b/drivers/net/can/c_can/c_can.h @@ -185,6 +185,7 @@ struct c_can_raminit { unsigned int reg; /* register index within syscon */ u8 start_bit; u8 done_bit; + 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 3776483..b838c6b 100644 --- a/drivers/net/can/c_can/c_can_platform.c +++ b/drivers/net/can/c_can/c_can_platform.c @@ -124,6 +124,12 @@ static void c_can_hw_raminit_syscon(const struct c_can_priv *priv, bool enable) ctrl |= 1 << start_bit; regmap_write(raminit->syscon, raminit->reg, ctrl); + /* clear START bit if start pulse is needed */ + if (raminit->needs_pulse) { + ctrl &= ~(1 << start_bit); + regmap_write(raminit->syscon, raminit->reg, ctrl); + } + ctrl |= 1 << done_bit; c_can_hw_raminit_wait_syscon(priv, mask, ctrl); } @@ -330,6 +336,7 @@ static int c_can_plat_probe(struct platform_device *pdev) raminit->start_bit = drvdata->raminit_start_bits[id]; raminit->done_bit = drvdata->raminit_done_bits[id]; + raminit->needs_pulse = drvdata->raminit_pulse; priv->raminit = c_can_hw_raminit_syscon; } else {