Skip to contentSkip to conversation

CANBUs Quesetion

Buildroot Ted Wood 6 participants 21 messages Jan 11, 2013 – Jan 15, 2013 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

Dear Ted Wood,

Quoted 5 lines · Ted Wood

I have a PCAN104 board, which is supplied with open source Linux drivers.

I have built my kernel with CAN support.

How do I incorporate the PCAN drivers into my Linux kernel build?

What is PCAN ? Is it a family of hardware ? Without more details, hard to help you.

To see the CAN hardware drivers available in your kernel, go in:

	Networking support
	 -> CAN bus subsystem support
	    -> CAN Device Drivers

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw
Quoted 2 lines · Thomas Petazzoni

What is PCAN ? Is it a family of hardware ? Without more details, hard to help you.

Ok, after a bit of googling (I should also do my homework before replying too fast), I guess you're talking about
http://www.phytec.com/products/can/pc-can-interfaces/peakusb.html.

So, it's known in the kernel as peak_usb, driver in drivers/net/can/usb/peak_usb. Config option to enable is CONFIG_CAN_PEAK_USB.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
author
#3 lore raw
In reply to Thomas Petazzoni

OK. I'll rephrase my original question...

I have an XXX CPU Board. I have fitted a YYY I/O board to it, which is supplied with open source Linux drivers.
How do I incorporate the YYY drivers into my Linux kernel build?

#4 lore raw

Dear Ted Wood,

Quoted 5 lines · Ted Wood

OK. I'll rephrase my original question...

I have an XXX CPU Board. I have fitted a YYY I/O board to it, which is supplied with open source Linux drivers.
How do I incorporate the YYY drivers into my Linux kernel build?

Depends on your definitions of XXX and YYY. But generally speaking, you need to adjust your Linux kernel configuration. So, in the context of Buildroot:

make linux-menuconfig

See also
http://buildroot.org/downloads/manual/manual.html#kernel-custom.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#6 lore raw
In reply to Ted Wood

Am 14.01.2013 12:26, schrieb Ted Wood:

Quoted 6 lines

OK. I'll rephrase my original question...

I have an XXX CPU Board. I have fitted a YYY I/O board to it, which is supplied with open source Linux drivers.
How do I incorporate the YYY drivers into my Linux kernel build?

Hello Ted,

I assume you are searching for help with a (possibly proprietary) driver that is meant to be built outside the kernel tree. I dealt with such things before I started to use buildroot.

Assuming that this driver comes with a Makefile I suggest to make a new buildroot package on top of the driver's makefile. There is good documentation for this in the buildroot manual.

If the driver is GPL another option might be to integrate it into your kernel source and make a kernel patch out of it. But beware: Doing such with a proprietary driver will brake the kernel license.

Hope this helps

Stephan

Quoted 5 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 4 lines
reLinux     -    Stephan Hoffmann
Am Schmidtgrund 124    50765 K?ln
Tel. +49.221.95595-19    Fax: -64
www.reLinux.de     sho at reLinux.de
author
#7 lore raw
Quoted 2 lines
Quoted 2 lines

If the driver is GPL another option might be to integrate it into your kernel source and make a kernel patch out of it.

Sorry, I failed to make the distinction between Open Source and GPL.

The drivers are GPL. Could you point me at some information on how to do this?

By the way, thanks for your patience.

#8 lore raw

Dear Ted Wood,

Quoted 4 lines · Ted Wood

Sorry, I failed to make the distinction between Open Source and GPL.

The drivers are GPL. Could you point me at some information on how to do this?

How to do what? Sorry but your question is far from being precise enough to be understood.

So the best reference I have for now is
http://www.catb.org/esr/faqs/smart-questions.html#beprecise.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
author
#9 lore raw
Quoted 2 lines
Quoted 2 lines

How to do what? Sorry but your question is far from being precise enough to be understood.

I'm really not sure how to make it any clearer than I did with my previous post. My response to Stephan Hoffman's suggestion that I integrate the driver into my kernel source and make a kernel patch out of it was to ask where I might find information on this. There is nothing in the Buildroot manual about it.

I'm not asking to be told how to do it, I'm asking for a pointer to where to find the information. As someone new to Embedded Linux I've been struggling to filter the huge volume of irrelevant and outdated material that Google throws up.

But thank you for the guide to asking questions. I shall bear it in mind in future.

#10 lore raw
Quoted 9 lines · Ted Wood
Quoted 2 lines
Quoted 2 lines

How to do what? Sorry but your question is far from being precise enough to be understood.

I'm really not sure how to make it any clearer than I did with my previous post. My response to Stephan Hoffman's suggestion that I integrate the driver into my kernel source and make a kernel patch out of it was to ask where I might find information on this. There is nothing in the Buildroot manual about it.

Quoted 8 lines

I'm not asking to be told how to do it, I'm asking for a pointer to where to find the information. As someone new to Embedded Linux I've been struggling to filter the huge volume of irrelevant and outdated material that Google throws up.

But thank you for the guide to asking questions. I shall bear it in mind in future.

A kernel module could be easily compiled out of the kernel. You should have a Makefile included with your driver. This Makefile will use the kernel Makefile to build, so you have to be sure that KDIR is pointing on the root directory of your kernel. If build with buildroot it should be something like buildroot/output/build/linux-x.y/

I will probably also need to set INSTALL_MOD_PATH to point on your rootfs.

But as suggested before if the driver is GPL you could add it directly in your kernel tree it would be cleaner.

Patrick

#11 lore raw
In reply to Ted Wood

Am 15.01.2013 11:58, schrieb Ted Wood:

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

How to do what? Sorry but your question is far from being precise enough to be understood.

I'm really not sure how to make it any clearer than I did with my previous post. My response to Stephan Hoffman's suggestion that I integrate the driver into my kernel source and make a kernel patch out of it was to ask where I might find information on this. There is nothing in the Buildroot manual about it.

Ted,

kernel hackng is not a part of buildroot's scope.

I do not know about a good tutorial or so.

Maybe you want to read "Linux Device Drivers"
http://shop.oreilly.com/product/9780596005900.do and/or the information provided on http://www.kernel.org/ and http://kernelnewbies.org/.

If you look at the driver's source code it should become clear. If it does not you might want to think whether paying for commercial assistance might be cheaper than learning it all.

You could also provide a link to the driver's source code, maybe someone wants to have a look at it and give you the hints you need.

Stephan

Quoted 17 lines

I'm not asking to be told how to do it, I'm asking for a pointer to where to find the information. As someone new to Embedded Linux I've been struggling to filter the huge volume of irrelevant and outdated material that Google throws up.

But thank you for the guide to asking questions. I shall bear it in mind in future.

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 4 lines
reLinux     -    Stephan Hoffmann
Am Schmidtgrund 124    50765 K?ln
Tel. +49.221.95595-19    Fax: -64
www.reLinux.de     sho at reLinux.de
author
#12 lore raw
Quoted 11 lines
Quoted 11 lines

kernel hackng is not a part of buildroot's scope.

I do not know about a good tutorial or so.

Maybe you want to read "Linux Device Drivers"
http://shop.oreilly.com/product/9780596005900.do and/or the information provided on http://www.kernel.org/ and
http://kernelnewbies.org/.

Quoted 7 lines
Quoted 7 lines

If you look at the driver's source code it should become clear. If it does not you might want to think whether paying for commercial assistance might be cheaper than learning it all.

You could also provide a link to the driver's source code, maybe someone wants to have a look at it and give you the hints you need.

Thanks Stephan. The links (especially kernelnewbies) look useful.

I have a copy of Linux Device Drivers open in front of me.

As for providing driver source code, I really wasn't expecting anyone to be prepared to dig around in it. That's supposed to be my job.

But for what it's worth the source code is at:

http://www.peak-system.com/fileadmin/media/linux/index.htm

#13 lore raw

Dear Ted Wood,

Quoted 6 lines · Ted Wood

As for providing driver source code, I really wasn't expecting anyone to be prepared to dig around in it. That's supposed to be my job.

But for what it's worth the source code is at:

http://www.peak-system.com/fileadmin/media/linux/index.htm

As I said already, the pcan-usb driver is already part of the mainline Linux kernel. Why aren't you using this driver, which is already part of any Linux kernel that you get, and doesn't require any patching or anything?

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#15 lore raw

Dear Will Moore,

Quoted 4 lines · Will Moore

I think CAN network support is mainline but
http://www.linuxdriverproject.org/mediawiki/index.php/Out_Of_Tree_Drivers#Contro
ller_Area_Network_.28CAN.2C_ISO_11898.29 suggests that the peak system drivers are out of tree? Or did I miss something?

I don't know exactly what the mainline driver supports, but:

$ ls drivers/net/can/usb/peak_usb/
Makefile  pcan_usb.c  pcan_usb_core.c  pcan_usb_core.h  pcan_usb_pro.c  pcan_usb_pro.h
$ cat drivers/net/can/usb/Kconfig
[...]
config CAN_PEAK_USB
	tristate "PEAK PCAN-USB/USB Pro interfaces"
	---help---
	  This driver supports the PCAN-USB and PCAN-USB Pro adapters
	  from PEAK-System Technik (http://www.peak-system.com).

(This is a 3.8-rc2 or -rc3 kernel, don't remember)

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#16 lore raw

I thought Ted Wood has PC104 card like this one
http://www.peak-system.com/PCAN-PC-104.210.0.html?&L=1. The newest kernel has support for PCAN PCI, PCIe and miniPCI, so I can imagine, that this card is supported too. see drivers/net/can/sja1000/

Yegor

Quoted 34 lines · Thomas Petazzoni

Dear Will Moore,

Quoted 4 lines · Will Moore

I think CAN network support is mainline but
http://www.linuxdriverproject.org/mediawiki/index.php/Out_Of_Tree_Drivers#Contro
ller_Area_Network_.28CAN.2C_ISO_11898.29 suggests that the peak system drivers are out of tree? Or did I miss something?

I don't know exactly what the mainline driver supports, but:

$ ls drivers/net/can/usb/peak_usb/
Makefile  pcan_usb.c  pcan_usb_core.c  pcan_usb_core.h  pcan_usb_pro.c  pcan_usb_pro.h
$ cat drivers/net/can/usb/Kconfig
[...]
config CAN_PEAK_USB
        tristate "PEAK PCAN-USB/USB Pro interfaces"
        ---help---
          This driver supports the PCAN-USB and PCAN-USB Pro adapters
          from PEAK-System Technik (http://www.peak-system.com).

(This is a 3.8-rc2 or -rc3 kernel, don't remember)

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#17 lore raw
In reply to Ted Wood

Dear Ted Wood,

Quoted 2 lines · Ted Wood

I'm really not sure how to make it any clearer than I did with my previous post.

You can easily be more precise: just say which driver you are talking about, where we can download the source code to have a look and make you useful suggestions.

If it's an external kernel module, then you can have a look at the lttng-modules, linux-fusion, igh-ethercat packages for some examples. But the exact steps to do will depend on how the build system of your driver has been written, which is why I'm asking to see the source code for it.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#18 lore raw
In reply to Ted Wood
Quoted 5 lines · Ted Wood
Quoted 2 lines
Quoted 2 lines

How to do what? Sorry but your question is far from being precise enough to be understood.

I'm really not sure how to make it any clearer than I did with my previous post.

Your previous post didn't include any context to indicate what task you were asking about.

Quoted 2 lines

My response to Stephan Hoffman's suggestion that I integrate the driver into my kernel source and make a kernel patch out of it

In many forums, it is expected that you would quote enough of Stephen Hoffman's suggestion so that when you post the question "how do I do that?", the post contains a referent for "that". This obviates the need for your gentle reader to sort through older posts and try to figure out what you're asking.

When asking somebody for help with something, it is considered polite to minimize the amount of effort required of them.

Signature · 3 lines
Grant Edwards               grant.b.edwards        Yow! Where's the Coke
                                  at               machine?  Tell me a joke!!
                              gmail.com            
#19 lore raw
Quoted 9 lines · Grant Edwards
Quoted 5 lines · Ted Wood
Quoted 2 lines
Quoted 2 lines

How to do what? Sorry but your question is far from being precise enough to be understood.

I'm really not sure how to make it any clearer than I did with my previous post.

Your previous post didn't include any context to indicate what task you were asking about.

Oops, my mistake -- I didn't see one line of quoted material. It was pretty clear that you were asking how to create a patch that would add your driver.

Signature · 3 lines
Grant Edwards               grant.b.edwards        Yow! HAIR TONICS, please!!
                                  at               
                              gmail.com            
author
#21 lore raw
In reply to Grant Edwards
Quoted 2 lines
Quoted 2 lines

Your previous post didn't include any context to indicate what task you were asking about.

I'd have to disagree with you there Grant. If you look at my post (partially quoted by Thomas) it actually quotes Stephan's words " If the driver is GPL another option might be to integrate it into
your kernel source and make a kernel patch out of it."