linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: Alexander Stein <alexander.stein@systec-electronic.com>
Cc: Linux-CAN <linux-can@vger.kernel.org>,
	"bhupesh.sharma" <bhupesh.sharma@st.com>,
	Tomoya MORINAGA <tomoya.rohm@gmail.com>
Subject: Re: [RFC/PATCH] c_can: add driver for the PCH CAN controller
Date: Mon, 12 Mar 2012 18:53:40 +0100	[thread overview]
Message-ID: <4F5E3824.3050401@grandegger.com> (raw)
In-Reply-To: <2646233.lgKcZ8lAQj@ws-stein>

Hi Alexander,

On 03/07/2012 08:31 AM, Alexander Stein wrote:
> Hello Wolfgang,
> 
> Am Mittwoch, 22. Februar 2012, 13:57:36 schrieb Wolfgang Grandegger:
>> For maintenance reasons, this diver should replace the "pch_can" driver
>> sooner than later as it uses the same CAN controller core. I named it
>> "pch_pci". Maybe "pch_can" would be more appropriate (common). This
>> patch is for 2.6.39, but likely it applies fine also to more recent
>> versions of the Linux kernel.
>>
>> Alexander, Tomoya, or anybody else, it would be nice if you could test
>> this patch and give some feedback. Thanks.
> 
> Unfortunately this doesn't work, yet. I do get a can0 interface but I don't 
> receive/send messages actually to the bus. I disabled pch_can in the kernel 
> config and enabled CONFIG_CAN_C_CAN and CONFIG_CAN_C_CAN_PCH_PCI
> All messages containging "can" (related to CAN) I get in dmesg are:
> [    0.338083] CAN device driver interface                                                                                                                                                                           
> [    0.339059] pch_pci 0000:02:0c.3: can0: Features changed: 0x00004804 -> 
> 0x00004004                                                                                                                                
> [    0.827528] can: controller area network core (rev 20090105 abi 8)                                                                                                                                                
> [    0.827646] can: raw protocol (rev 20090105)                                                                                                                                                                      
> [    9.773280] pch_pci 0000:02:0c.3: can0: setting BTR=2504 BRPE=0000


Hm, the accessor functions are untested and might be wrong and the
driver does not verify register acessibility. The following looks better: 

static u16 pch_pci_read_reg(struct c_can_priv *priv, void *reg)
{
	u32 __iomem *addr = reg + (long)reg - (long)priv->regs;

	return (u16)ioread32(addr);
}

static void pch_pci_write_reg(struct c_can_priv *priv, void *reg, u16 val)
{
	u32 __iomem *addr = reg + (long)reg - (long)priv->regs;

	iowrite32((u32)val, addr);
}


> I also noted that my system does noot reboot when using "reboot". This works 
> fine when using pch_can.

Hm, strange.

> Unfortunately I can't spend more time on testing this at the moment.

OK. Thanks for your effort.

Wolfgang.

      reply	other threads:[~2012-03-12 17:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-22 12:57 [RFC/PATCH] c_can: add driver for the PCH CAN controller Wolfgang Grandegger
2012-02-23  0:13 ` Tomoya MORINAGA
2012-02-23  7:44   ` Wolfgang Grandegger
2012-02-23  8:08     ` Tomoya MORINAGA
2012-02-23  9:28       ` Wolfgang Grandegger
2012-02-23  8:27 ` Alexander Stein
2012-02-23  9:27   ` Wolfgang Grandegger
2012-02-23  9:48     ` Bhupesh SHARMA
2012-02-23  9:56       ` Alexander Stein
2012-02-23 10:00         ` Bhupesh SHARMA
2012-03-07  7:31 ` Alexander Stein
2012-03-12 17:53   ` Wolfgang Grandegger [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=4F5E3824.3050401@grandegger.com \
    --to=wg@grandegger.com \
    --cc=alexander.stein@systec-electronic.com \
    --cc=bhupesh.sharma@st.com \
    --cc=linux-can@vger.kernel.org \
    --cc=tomoya.rohm@gmail.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).