All of lore.kernel.org
 help / color / mirror / Atom feed
From: =?gb18030?B?SmFjayBMZWU=?= <jacklee11@foxmail.com>
To: =?gb18030?B?eGVub21haQ==?= <xenomai@xenomai.org>
Subject: [Xenomai] rt-socket-can "no device" problem with advantech PCM-26D2CA CAN board
Date: Fri, 2 Sep 2016 16:19:25 +0800	[thread overview]
Message-ID: <tencent_010CF19618CECFA947D4EC41@qq.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 5246 bytes --]

> Hello,
> 
> Am 02.09.2016 um 09:23 schrieb Jack Lee:
> >> Hello,
> >>
> >> Am 02.09.2016 um 08:23 schrieb Jack Lee:
> >>> Hi, everyone£¡
> >>>   I am using the advantech PCM-26D2CA CAN board, its details can be found here at
> >>> http://www.advantech.com/products/14263729-aaa3-4552-b990-99d16cdfee24/pcm-26d2ca/mod_9a1e9dbf-e22d-4770-a896-cecf40607084.
> >>> The original driver works fine, but I need it to be realtime.
> >>>   rt-can driver was compiled as modules previously. When booted and "#modprobe xeno_can_adv_pci" was executed,
> >>> "#dmesg | grep -i can" output was
> >>> ...
> >>> RT-Socket-CAN 0.90-2 - (c) 2006 RT-Socket-CAN Development Team
> >>> RTCAN SJA1000 driver initialized
> >>>
> >>> "#lsmod | grep -i can" output was
> >>> xeno_can_adv_pci
> >>> xeno_can_sja1000    used by xeno_can_adv_pci
> >>> xeno_can                  used by xeno_can_sja1000, xeno_can_adv_pci
> >>>
> >>> What strange is that /proc/rtcan/devices has no devices like rtcan0.
> >>> The /proc/rtcan directory just has three files: devices, sockets and versio
> >>
> >> What is the PCI device id of the CAN device? You can use "lspci -vv" to
> >> list the ids.
> >>
> >>> Does this CAN board supported by rt-socket-can? How can I implement real-timer driver for it?
> >>
> >> Most likely the device id is missing in the driver PCI device list:
> >>
> >>
> >> http://git.xenomai.org/xenomai-2.6.git/tree/ksrc/drivers/can/sja1000/rtcan_adv_pci.c#n87
> >>
> >> Wolfgang.
> >
> > Thank you, Wolfgang! My mailbox delays that I cannot add you in the contact, so I send to the xenomai list. Sorry for that.
> 
> No problem.
> 
> > CAN board information is below.
> > #lspci -vv
> > 03:00.0 CANBUS: Advantech Co. Ltd MIOe-3680 2-Port CAN-Bus MIOe Module with Isolation Protection
> > 	Subsystem: Advantech Co. Ltd MIOe-3680 2-Port CAN-Bus MIOe Module with Isolation Protection
> > 	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> > 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> > 	Latency: 0, Cache Line Size: 64 bytes
> > 	Interrupt: pin A routed to IRQ 10
> > 	Region 0: Memory at d0c02000 (32-bit, non-prefetchable) [size=2K]
> > 	Region 1: Memory at d0c01000 (32-bit, non-prefetchable) [size=128]
> > 	Region 2: Memory at d0c00000 (32-bit, non-prefetchable) [size=128]
> > 	Capabilities: <access denied>
> 
> Could you please use "lspci -vvn" to get  numbers (instead of strings).
> 
> Wolfgang.

Thanks! The information is below.
#lspci -vvn
03:00.0 0c09: 13fe:c302
	Subsystem: 13fe:c302
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 10
	Region 0: Memory at d0c02000 (32-bit, non-prefetchable) [size=2K]
	Region 1: Memory at d0c01000 (32-bit, non-prefetchable) [size=128]
	Region 2: Memory at d0c00000 (32-bit, non-prefetchable) [size=128]
	Capabilities: [40] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-)
		Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [48] MSI: Enable- Count=1/2 Maskable- 64bit+
		Address: 0000000000000000  Data: 0000
	Capabilities: [58] Express (v1) Legacy Endpoint, MSI 00
		DevCap:	MaxPayload 512 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
			ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
			RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr+ UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s, Exit Latency L0s unlimited, L1 unlimited
			ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk-
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-


Is ¡°0c09: 13fe:c302¡± the device ID? Can you show me some instructions to make this device work? I am really new to this.
I opened the link you paste above, perhaps the following two places should be modified.

A new line "ADV_PCI_DEVICE(0xc302), " should be added?
---------------------------------------------------------------
	static DEFINE_PCI_DEVICE_TABLE(adv_pci_tbl) = {
		ADV_PCI_DEVICE(0x1680),
		ADV_PCI_DEVICE(0x3680),
		ADV_PCI_DEVICE(0x2052),
		ADV_PCI_DEVICE(0x1681),
		ADV_PCI_DEVICE(0xc001),
		ADV_PCI_DEVICE(0xc002),
		ADV_PCI_DEVICE(0xc004),
		ADV_PCI_DEVICE(0xc101),
		ADV_PCI_DEVICE(0xc102),
		ADV_PCI_DEVICE(0xc104),
		/* required last entry */
		{ }
	};

How to deal with this one?
---------------------------------------------------------------
	switch (pdev->device) {
	case 0xc001:
	case 0xc002:
	case 0xc004:
	case 0xc101:
	case 0xc102:
	case 0xc104:
		nb_ports = pdev->device & 0x7;
		offset = 0x100;
		bar = 0;
		break;
	case 0x1680:
	case 0x2052:
		nb_ports = 2;
		bar = 2;
		bar_flag = 1;
		break;
	case 0x1681:
		nb_ports = 1;
		bar = 2;
		bar_flag = 1;
		break;
	default:
		goto failure_regions;
	}

             reply	other threads:[~2016-09-02  8:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02  8:19 =?gb18030?B?SmFjayBMZWU=?= [this message]
2016-09-02  8:52 ` [Xenomai] rt-socket-can "no device" problem with advantech PCM-26D2CA CAN board Wolfgang Grandegger
  -- strict thread matches above, loose matches on Subject: below --
2016-09-03  0:54 =?gb18030?B?SmFjayBMZWU=?=
2016-09-03  9:46 ` Wolfgang Grandegger
2016-09-02  9:11 =?gb18030?B?SmFjayBMZWU=?=
2016-09-02  7:43 =?gb18030?B?SmFjayBMZWU=?=
2016-09-02  7:23 =?gb18030?B?SmFjayBMZWU=?=
2016-09-02  7:33 ` Wolfgang Grandegger
2016-09-02  6:23 =?gb18030?B?SmFjayBMZWU=?=
2016-09-02  6:42 ` 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=tencent_010CF19618CECFA947D4EC41@qq.com \
    --to=jacklee11@foxmail.com \
    --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.