linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Larsson <andreas@gaisler.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org, software@gaisler.com
Subject: Re: [PATCH] can: grcan: Add device driver for GRCAN and GRHCAN cores
Date: Thu, 11 Oct 2012 14:08:48 +0200	[thread overview]
Message-ID: <5076B6D0.5020808@gaisler.com> (raw)
In-Reply-To: <5076AD65.6080909@pengutronix.de>

On 2012-10-11 13:28, Marc Kleine-Budde wrote:
> On 10/11/2012 01:22 PM, Andreas Larsson wrote:
>> On 2012-10-11 12:04, Marc Kleine-Budde wrote:
>>> On 10/04/2012 11:45 AM, Marc Kleine-Budde wrote:
>>>> Hello,
>>>>
>>>> On 10/02/2012 04:38 PM, Andreas Larsson wrote:
>>>>> This driver supports GRCAN and CRHCAN CAN controllers available in
>>>>> the GRLIB
>>>>> VHDL IP core library.
>>>>>
>>>>> Signed-off-by: Andreas Larsson <andreas@gaisler.com>
>>>>> ---
>>>>>    drivers/net/can/Kconfig  |    6 +
>>>>>    drivers/net/can/Makefile |    1 +
>>>>>    drivers/net/can/grcan.c  | 1283
>>>>> ++++++++++++++++++++++++++++++++++++++++++++++
>>>>>    drivers/net/can/grcan.h  |  273 ++++++++++
>>>>>    4 files changed, 1563 insertions(+), 0 deletions(-)
>>>>>    create mode 100644 drivers/net/can/grcan.c
>>>>>    create mode 100644 drivers/net/can/grcan.h
>>>>
>>>> Some general remarks while scrolling though the driver:
>>>> - please provide a device tree binding documentation
>>>>     Documentation/devicetree/bindings/net/can/grcan.txt
>>>>     and add devicetree-discuss@lists.ozlabs.org on Cc
>>>> - please provide a documentation for the sysfs entries:
>>>>     Documentation/ABI/testing/sys-XXX-grcan.txt
>>>> - please implement a NAPI
>>>> - please include the .h file into the C code,
>>>>     as the C code is the one and only user of the .h file
>>>> - please give every macro a GRCAN_ prefix
>>>
>>> Your driver should work on little as well as on big endian systems. You
>>> need probably two implementations of the grcan_{read,write}_reg
>>> functions, you can take the flexcan driver [1] as an example.
>>
>> Adding that is easy of course, but that gives the impression of support
>> for little endian systems. If the core would be instantiated in a little
>> endian fashion in a little endian environment, the DMA accessing parts
>> of the hardware would still not work in a little endian system without
>> modifications to the hardware design.
>
> Can you add this to the Kconfig help text.
>
>>  From the driver point of view either way works for me, but I am not sure
>> what is best.
>
> In this case you should limit the driver to big endian systems via kconfig.

That would of course be nice. One problem with that is that there seems 
to be no Kconfig configuration option to depend on to match big endian 
systems in general.

One solution is to depend on SPARC (the standard environment of the 
core) and having anyone instantiating the core outside of a sparc 
environment patch his or her kernel.

Another solution is of course to do the ifdef on endianness solution 
like in flexcan and have a note in Kconfig text about the hardware not 
being compatible with little endian in an unchanged fashion.

I am not comfortable to try to come up with some hairy dependency that 
tries to catch all kinds of architectures that might or might not be 
configured big endian at compile time.

Cheers,
Andreas


  reply	other threads:[~2012-10-11 12:08 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 14:38 [PATCH] can: grcan: Add device driver for GRCAN and GRHCAN cores Andreas Larsson
2012-10-04  9:45 ` Marc Kleine-Budde
2012-10-11 10:04   ` Marc Kleine-Budde
2012-10-11 11:22     ` Andreas Larsson
2012-10-11 11:28       ` Marc Kleine-Budde
2012-10-11 12:08         ` Andreas Larsson [this message]
2012-10-23  9:57     ` [PATCH v2] " Andreas Larsson
2012-10-23 16:26       ` Wolfgang Grandegger
2012-10-24 13:31         ` Andreas Larsson
2012-10-30  9:06           ` [PATCH v3] " Andreas Larsson
2012-10-30 10:07             ` Wolfgang Grandegger
2012-10-30 16:24               ` Andreas Larsson
2012-10-31 12:51                 ` Wolfgang Grandegger
2012-10-31 16:33                   ` Andreas Larsson
2012-10-31 16:39                     ` [PATCH v4] " Andreas Larsson
2012-10-31 20:21                     ` [PATCH v3] " Wolfgang Grandegger
2012-11-01 16:08                       ` Andreas Larsson
2012-11-02 14:23                         ` [PATCH v5] " Andreas Larsson
2012-11-05  9:28                         ` [PATCH v3] " Wolfgang Grandegger
2012-11-07  7:32                           ` Andreas Larsson
2012-11-07 11:15                             ` Wolfgang Grandegger
2012-11-07 12:55                               ` Andreas Larsson
2012-11-07 15:20                                 ` [PATCH v6] " Andreas Larsson
2012-11-08  8:29                                   ` Wolfgang Grandegger
2012-11-08  9:27                                     ` Marc Kleine-Budde
2012-11-08 10:37                                       ` Andreas Larsson
     [not found]                                       ` <509B7B1E.5040509-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-08 13:10                                         ` [PATCH v7] " Andreas Larsson
2012-11-09  0:01                                           ` Marc Kleine-Budde
2012-11-12 14:57                                             ` [PATCH v8] " Andreas Larsson
2012-11-13 21:15                                               ` Marc Kleine-Budde
2012-11-14  7:50                                                 ` Andreas Larsson
2012-11-14  8:43                                                   ` Marc Kleine-Budde
2012-11-14 11:02                                                     ` Andreas Larsson
2012-11-14 11:22                                                       ` Marc Kleine-Budde
2012-11-14 15:07                                                         ` Andreas Larsson
2012-11-14 15:12                                                           ` Marc Kleine-Budde
2012-11-15  7:47                                                             ` [PATCH v9] " Andreas Larsson
2012-11-15 20:32                                                               ` Marc Kleine-Budde
2012-11-16  6:17                                                                 ` Andreas Larsson
2012-11-08 10:33                                     ` [PATCH v6] " Andreas Larsson
2012-10-30  9:29           ` [PATCH v2] " Wolfgang Grandegger

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=5076B6D0.5020808@gaisler.com \
    --to=andreas@gaisler.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=software@gaisler.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).