All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@domain.hid>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] Re: CAN updates & questions
Date: Sat, 09 Sep 2006 12:35:47 +0200	[thread overview]
Message-ID: <45029903.7030108@domain.hid> (raw)
In-Reply-To: <450290AC.6000009@domain.hid>

Jan Kiszka wrote:
> Hi Wolfgang,
> 
> as one result of a hacking session on a PPC405 with SJA1000 on board I
> applied two minor fixes to rtcan_isa.c to SVN, see end of mail for
> reference. The first one gave an "interesting" effect on big-endian
> because irq is an integer, the second one reveals that we should do some
> multiport test with the ISA driver soon.

OK, I see. Unfortunately I do not have a ISA CAN device for testing.

> Questions arose regarding the meaning of rtcan_device.can_sys_clock
> (BTW, comment in rtcan_dev.h is wrong). What clock rate does it
> describe? For the SJA1000 drivers its obviously clock/2. I'm asking
> because of a) the output in rtcan_calc_bit_time() and b) the module
> parameter of rtcan_isa and its description. We first hacked 16 MHz into
> the latter yesterday as I didn't recall quickly enough that our Phytec
> board also runs at 16 MHZ, thus the default value of 8 MHZ was already
> correct. Confused? At least we were...

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

> And another suggestion: In order make module names shorter, what about
> the renaming xeno_rtcan* -> xeno_can*?

Fine for me.

> 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).

> 
> Jan
> 

Wolfgang.

> --
> 
> Index: ksrc/drivers/can/sja1000/rtcan_isa.c
> ===================================================================
> --- ksrc/drivers/can/sja1000/rtcan_isa.c	(Revision 1564)
> +++ ksrc/drivers/can/sja1000/rtcan_isa.c	(Arbeitskopie)
> @@ -56,7 +56,7 @@ static u8 ocr[RTCAN_ISA_MAX_DEV];
>  static u8 cdr[RTCAN_ISA_MAX_DEV];
> 
>  compat_module_short_param_array(isa, RTCAN_ISA_MAX_DEV);
> -compat_module_byte_param_array(irq, RTCAN_ISA_MAX_DEV);
> +compat_module_int_param_array(irq, RTCAN_ISA_MAX_DEV);
>  compat_module_int_param_array(clock, RTCAN_ISA_MAX_DEV);
>  compat_module_byte_param_array(ocr, RTCAN_ISA_MAX_DEV);
>  compat_module_byte_param_array(cdr, RTCAN_ISA_MAX_DEV);
> @@ -187,9 +187,10 @@ static void __exit rtcan_isa_exit(void)
>      int i;
>      struct rtcan_device *dev;
> 
> -    for (i = 0, dev = rtcan_isa_devs[i];
> -	 i < RTCAN_ISA_MAX_DEV && dev != NULL;
> -	 i++) {
> +    for (i = 0; i < RTCAN_ISA_MAX_DEV; i++) {
> +	dev = rtcan_isa_devs[i];
> +	if (!dev)
> +	    continue;
>  	rtcan_sja1000_unregister(dev);
>      }
>  }
> 



  reply	other threads:[~2006-09-09 10:35 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 ` Wolfgang Grandegger [this message]
2006-09-09 15:39   ` [Xenomai-core] " Matthias Fuchs
2006-09-09 19:59     ` Wolfgang Grandegger
2006-09-09 20:21       ` Wolfgang Grandegger
2006-09-10 10:27       ` Matthias Fuchs

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=45029903.7030108@domain.hid \
    --to=wg@domain.hid \
    --cc=jan.kiszka@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.