All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Fuchs <matthias.fuchs@domain.hid>
To: Wolfgang Grandegger <wg@domain.hid>
Cc: Jan Kiszka <jan.kiszka@domain.hid>, xenomai@xenomai.org
Subject: Re: [Xenomai-core] Re: CAN updates & questions
Date: Sun, 10 Sep 2006 12:27:21 +0200	[thread overview]
Message-ID: <4503E889.2080306@domain.hid> (raw)
In-Reply-To: <45031D1F.8050507@domain.hid>

Hi Wolfgang,

Wolfgang Grandegger wrote:
> Hi Matthias,
> 
> Matthias Fuchs wrote:
>> Hi Wolfgang,
>>
>> Wolfgang Grandegger wrote:
>>> You have to define the real CAN system clock, which is 16/2 = 8 Mhz for
>>> most SJA 1000 hardware even if the oscillator is running at 16 MHz. I
>>> will add some reasonable note to rtcan_dev.h
>> Is there any special reason for this? Wouldn't it be more meaningful
>> to pass the SJA1000 externally applied clock frequency? I can imagine
>> that others will also run into this issue as Jan and I did yesterday ;-)
> 
> The frequency is used to calculate reasonable bit-timing parameters, not
> only for SJA 1000. It's used in a similar way in the Linux socket CAN
> driver.
I am not very familiar with the socket CAN driver, but after a quick
glance at its svn repository it seems to me that they are also passing
the SJA1000 external clock frequency to the module (clk-parameter).

So I think other controller's drivers may use an other meaning of the
clk/clock parameter. But for SJA1000 the ext. clock frequency is best.
> 
>>>> Then we will soon have to discuss how to deal with a rtcan_isa
>>>> derivative that uses ioremapped memory instead of ports (naming,
>>>> separation or integration).
>>> We could add a generic device similar to ISA (or extend ISA
>>> accordingly).
>> The SJA1000 isa driver is very simple - and so is the modified version
>> for the memory mapped SJA1000. I think that merging both ways of
>> access to the SJA1000 into a single driver will make the code much
>> more dirty. I would prefer different source files (= different drivers). 
> 
> I agree.
> 
>> It would be a compromise to add support for boards that use some kind
>> of indirect addressing to access the SJA1000 (address + data register)
>> into the isa and mem versions of the driver.
> 
> Fine if this could be done in a generic way. We also should add a
> generic PCI driver sooner than later.
> 
>> One more proposal: I think many (old) ISA drivers name the module
>> parameter for the ISA io port "io" instead of "isa". For the memory
>> mapped SJA1000 driver, I'd like to call the parameter "mem".
> 
> Well, I cannot remember why I used the name "isa". Common is "io" or
> "port" or "ioport", indeed. "io" and "mem" or "ioport" and "iomem" would
> be fine for me.
I will use mem for the mem'mapped driver. The socket CAN project uses
base_addr - they must have an affection to a long parameter name :-)

Matthias



      parent reply	other threads:[~2006-09-10 10:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-09 10:00 [Xenomai-core] CAN updates & questions Jan Kiszka
2006-09-09 10:35 ` [Xenomai-core] " Wolfgang Grandegger
2006-09-09 15:39   ` Matthias Fuchs
2006-09-09 19:59     ` Wolfgang Grandegger
2006-09-09 20:21       ` Wolfgang Grandegger
2006-09-10 10:27       ` Matthias Fuchs [this message]

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=4503E889.2080306@domain.hid \
    --to=matthias.fuchs@domain.hid \
    --cc=jan.kiszka@domain.hid \
    --cc=wg@domain.hid \
    --cc=xenomai@xenomai.org \
    /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.