All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
To: Ulrich Hecht <ulrich.hecht@gmail.com>
Cc: "mkl@pengutronix.de" <mkl@pengutronix.de>,
	"wg@grandegger.com" <wg@grandegger.com>,
	"socketcan@hartkopp.net" <socketcan@hartkopp.net>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Chris Paterson <Chris.Paterson2@renesas.com>,
	Simon Horman <horms@verge.net.au>,
	Magnus Damm <magnus.damm@gmail.com>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>
Subject: RE: [RESEND PATCH v5 1/2] can: rcar_canfd: Add Renesas R-Car CAN FD driver
Date: Fri, 3 Jun 2016 06:42:12 +0000	[thread overview]
Message-ID: <KL1PR06MB1031E61B9DD9A59B305CCC15C3590@KL1PR06MB1031.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <CAO3366wP+tBaGbrMceupcJu0agW5Euo3NBNwijNCmpM1XcDGmQ@mail.gmail.com>

Hi Uli,

Thanks for the review

> Thank you for your patch.
> 
> On Thu, Jun 2, 2016 at 11:45 AM, Ramesh Shanmugasundaram
> <ramesh.shanmugasundaram@bp.renesas.com> wrote:
> [...]
> > diff --git a/drivers/net/can/rcar/rcar_canfd.c
> > b/drivers/net/can/rcar/rcar_canfd.c
> > new file mode 100644
> > index 0000000..e198732
> > --- /dev/null
> > +++ b/drivers/net/can/rcar/rcar_canfd.c
> > @@ -0,0 +1,1624 @@
> > +/* Renesas R-Car CAN FD device driver
> > + *
> > + * Copyright (C) 2015 Renesas Electronics Corp.
> > + *
> > + * This program is free software; you can redistribute  it and/or
> > +modify it
> > + * under  the terms of  the GNU General  Public License as published
> > +by the
> > + * Free Software Foundation;  either version 2 of the  License, or
> > +(at your
> > + * option) any later version.
> > + */
> > +
> > +/* The R-Car CAN FD controller can operate in either one of the below
> > +two modes
> > + *  - CAN FD only mode
> > + *  - Classical CAN (CAN 2.0) only mode
> > + *
> > + * This driver puts the controller in CAN FD only mode by default. In
> > +this
> > + * mode, the controller acts as a CAN FD node that can also
> > +interoperate with
> > + * CAN 2.0 nodes.
> > + *
> > + * As of now, this driver does not support the Classical CAN (CAN
> > +2.0) mode,
> > + * which is handled by a different register map compared to CAN FD only
> mode.
> > + */
> > +
> > +#include <linux/module.h>
> > +#include <linux/moduleparam.h>
> > +#include <linux/kernel.h>
> > +#include <linux/types.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/errno.h>
> > +#include <linux/netdevice.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/can/led.h>
> > +#include <linux/can/dev.h>
> > +#include <linux/clk.h>
> > +#include <linux/of.h>
> > +#include <linux/of_device.h>
> > +#include <linux/bitmap.h>
> > +#include <linux/bitops.h>
> > +#include <linux/iopoll.h>
> > +
> > +#define RCANFD_DRV_NAME                        "rcar_canfd"
> > +
> > +#define RCANFD_FIFO_DEPTH              8       /* Tx FIFO depth */
> > +#define RCANFD_NAPI_WEIGHT             8       /* Rx poll quota */
> > +
> > +#define RCANFD_NUM_CHANNELS            2       /* Two channels max */
> > +#define RCANFD_CHANNELS_MASK           BIT((RCANFD_NUM_CHANNELS) - 1)
> > +
> > +/* Rx FIFO is a global resource of the controller. There are 8 such
> > +FIFOs
> > + * available. Each channel gets a dedicated Rx FIFO (i.e.) the
> > +channel
> > + * number is added to RFFIFO index.
> > + */
> > +#define RCANFD_RFFIFO_IDX              0
> > +
> > +/* Tx/Rx or Common FIFO is a per channel resource. Each channel has 3
> > +Common
> > + * FIFOs dedicated to them. Use the first (index 0) FIFO out of the 3
> for Tx.
> > + */
> > +#define RCANFD_CFFIFO_IDX              0
> > +
> > +/* Global register bits */
> > +#define RCANFD_GINTF_CANFD             BIT(0)
> > +
> > +#define RCANFD_GCFG_TPRI               BIT(0)
> > +#define RCANFD_GCFG_DCE                        BIT(1)
> > +#define RCANFD_GCFG_DCS                        BIT(4)
> > +#define RCANFD_GCFG_CMPOC              BIT(5)
> 
> What reference are the register layouts based on? This bit, for instance,
> is marked reserved in R-Car-Gen3-rev0.51e.pdf, and many are named
> differently.

It is based on rev0.51e Gen3 h/w manual. This controller has two register maps within itself for classical CAN only mode or CAN FD only mode. Section 52A.7.3.1 defines GCFG classical CAN only mode where bit 5 is reserved and Section 52A.9.3.1 defines GCFG CAN FD mode where bit 5 is defined as CMPOC.

It is explained in the initial comments section of this driver 

-------------
+/* The R-Car CAN FD controller can operate in either one of the below two modes
+ *  - CAN FD only mode
+ *  - Classical CAN (CAN 2.0) only mode
+ *
+ * This driver puts the controller in CAN FD only mode by default. In this
+ * mode, the controller acts as a CAN FD node that can also interoperate with
+ * CAN 2.0 nodes.
+ *
+ * As of now, this driver does not support the Classical CAN (CAN 2.0) mode,
+ * which is handled by a different register map compared to CAN FD only mode
--------------

Thanks,
Ramesh

  reply	other threads:[~2016-06-03  6:47 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01  9:34 [PATCH] can: rcar_canfd: Add Renesas R-Car CAN FD driver Ramesh Shanmugasundaram
     [not found] ` <1456824849-7987-1-git-send-email-ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2016-03-01 20:41   ` Marc Kleine-Budde
2016-03-01 20:41     ` Marc Kleine-Budde
2016-03-02  8:41     ` Ramesh Shanmugasundaram
2016-03-02  9:20       ` Marc Kleine-Budde
2016-03-02 10:08         ` Ramesh Shanmugasundaram
2016-03-02 10:21           ` Marc Kleine-Budde
2016-03-03 13:48             ` Ramesh Shanmugasundaram
2016-03-01 21:07 ` Oliver Hartkopp
2016-03-02  8:45   ` Ramesh Shanmugasundaram
2016-03-03 15:38 ` [PATCH v2] " Ramesh Shanmugasundaram
2016-03-05  4:30   ` Rob Herring
2016-03-07  9:33     ` Ramesh Shanmugasundaram
2016-03-06 11:32   ` Oliver Hartkopp
2016-03-07  8:02     ` Ramesh Shanmugasundaram
2016-03-07  8:08       ` Marc Kleine-Budde
2016-03-07  8:32         ` Ramesh Shanmugasundaram
2016-03-08  7:46           ` Oliver Hartkopp
2016-03-08  8:57             ` Ramesh Shanmugasundaram
2016-03-08 12:25               ` Oliver Hartkopp
2016-03-08 12:48                 ` Ramesh Shanmugasundaram
2016-03-08 17:16                   ` Oliver Hartkopp
2016-03-11  7:14                     ` Ramesh Shanmugasundaram
2016-03-12 18:49                       ` Oliver Hartkopp
2016-03-15  9:48   ` [PATCH v3] " Ramesh Shanmugasundaram
2016-03-15 12:46     ` Oliver Hartkopp
2016-03-15 14:17       ` Ramesh Shanmugasundaram
2016-03-15 19:38         ` Oliver Hartkopp
2016-03-16  7:45           ` Ramesh Shanmugasundaram
2016-03-16  9:47             ` Oliver Hartkopp
2016-03-16 10:50               ` Ramesh Shanmugasundaram
2016-03-16 21:20                 ` Oliver Hartkopp
2016-03-17 12:03                   ` Ramesh Shanmugasundaram
2016-03-17 20:46                     ` Oliver Hartkopp
2016-03-18 13:23                       ` Ramesh Shanmugasundaram
2016-03-18 19:44                         ` Oliver Hartkopp
2016-03-21  8:30                           ` Ramesh Shanmugasundaram
2016-03-21 15:30                             ` Oliver Hartkopp
2016-03-21 15:43                               ` Ramesh Shanmugasundaram
2016-03-21 15:49                                 ` Oliver Hartkopp
2016-03-15 12:51     ` Marc Kleine-Budde
2016-03-15 14:26       ` Ramesh Shanmugasundaram
2016-03-18 21:07     ` Rob Herring
2016-03-21 16:45     ` [PATCH v4 0/2] Add CAN FD driver support to r8a7795 SoC Ramesh Shanmugasundaram
2016-03-21 16:45       ` [PATCH 1/2] can: rcar_canfd: Add Renesas R-Car CAN FD driver Ramesh Shanmugasundaram
2016-03-21 16:45       ` [PATCH 2/2] can: rcar_can: Move Renesas CAN driver to rcar dir Ramesh Shanmugasundaram
2016-03-31 20:51   ` [PATCH v2] can: rcar_canfd: Add Renesas R-Car CAN FD driver Marc Kleine-Budde
2016-04-01 12:48     ` Ramesh Shanmugasundaram
2016-04-13  6:25       ` Ramesh Shanmugasundaram
2016-04-28  6:27         ` Oliver Hartkopp
2016-04-28 12:31           ` Ramesh Shanmugasundaram
2016-04-28 12:23 ` [PATCH v5 0/2] Add CAN FD driver support to r8a7795 SoC Ramesh Shanmugasundaram
2016-04-28 12:23   ` [PATCH v5 1/2] can: rcar_canfd: Add Renesas R-Car CAN FD driver Ramesh Shanmugasundaram
2016-05-03 16:47     ` Rob Herring
2016-05-04  6:23       ` Ramesh Shanmugasundaram
2016-04-28 12:23   ` [PATCH v5 2/2] can: rcar_can: Move Renesas CAN driver to rcar dir Ramesh Shanmugasundaram
2016-05-16 15:52   ` [PATCH v5 0/2] Add CAN FD driver support to r8a7795 SoC Chris Paterson
2016-06-02  9:45 ` [RESEND PATCH " Ramesh Shanmugasundaram
2016-06-02  9:45   ` [RESEND PATCH v5 1/2] can: rcar_canfd: Add Renesas R-Car CAN FD driver Ramesh Shanmugasundaram
2016-06-02 16:01     ` Ulrich Hecht
2016-06-03  6:42       ` Ramesh Shanmugasundaram [this message]
2016-06-03 17:03         ` Ulrich Hecht
2016-06-03 17:15           ` Oliver Hartkopp
2016-06-03 18:39             ` David Miller
2016-06-07 13:18               ` Ramesh Shanmugasundaram
2016-06-08  6:38                 ` [PATCH v6 0/2] Add CAN FD driver support to r8a7795 SoC Ramesh Shanmugasundaram
2016-06-08  6:38                   ` [PATCH v6 1/2] can: rcar_canfd: Add Renesas R-Car CAN FD driver Ramesh Shanmugasundaram
2016-06-13  8:42                     ` Ulrich Hecht
2016-06-14  7:23                       ` Ramesh Shanmugasundaram
2016-06-08  6:38                   ` [PATCH v6 2/2] can: rcar_can: Move Renesas CAN driver to rcar dir Ramesh Shanmugasundaram
2016-06-13  7:12                   ` [PATCH v6 0/2] Add CAN FD driver support to r8a7795 SoC Chris Paterson
2016-06-02  9:45   ` [RESEND PATCH v5 2/2] can: rcar_can: Move Renesas CAN driver to rcar dir Ramesh Shanmugasundaram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=KL1PR06MB1031E61B9DD9A59B305CCC15C3590@KL1PR06MB1031.apcprd06.prod.outlook.com \
    --to=ramesh.shanmugasundaram@bp.renesas.com \
    --cc=Chris.Paterson2@renesas.com \
    --cc=horms@verge.net.au \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    --cc=ulrich.hecht@gmail.com \
    --cc=wg@grandegger.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.