Skip to contentSkip to conversation

CAN console

U-Boot Matthias Weißer 5 participants 10 messages Oct 26, 2009

lore
Share & tools
lore
#0 lore raw

Hi

I have a device here which has only a CAN interface to the outside world. I am currently thinking about implementing a "serial" driver using the CAN controller.

Is there any chance to get this accepted in the public u-boot tree?

A special program on the PC side would be needed to translate the CAN messages back to a serial stream and vice versa and make it available to a terminal program. But thats another story.

Regards,
Matthias Wei?er

#1 lore raw
Quoted 6 lines · On Monday 26 October 2009 04:20:02 Matthias Wei?er wrote:

I have a device here which has only a CAN interface to the outside world. I am currently thinking about implementing a "serial" driver using the CAN controller.

Is there any chance to get this accepted in the public u-boot tree?

someone just posted a port of the Linux CAN framework. if your driver used that to implement a serial layer, i dont see why it wouldnt be accepted. -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091026/92f6d591/attachment.pgp

#2 lore raw
Quoted 11 lines · Mike Frysinger
Quoted 6 lines · On Monday 26 October 2009 04:20:02 Matthias Wei?er wrote:

I have a device here which has only a CAN interface to the outside world. I am currently thinking about implementing a "serial" driver using the CAN controller.

Is there any chance to get this accepted in the public u-boot tree?

someone just posted a port of the Linux CAN framework. if your driver used that to implement a serial layer, i dont see why it wouldnt be accepted. -mike

Well, that means that I have to implement a full functional CAN driver and then additionally add a serial driver using the (completely new) CAN framework. My idea was that I just add a serial_ccan.c to drivers/serial.

Matthias Wei?er

#3 lore raw
Quoted 9 lines · On Monday 26 October 2009 07:09:03 Matthias Wei?er wrote:
Quoted 8 lines · Mike Frysinger
Quoted 6 lines · On Monday 26 October 2009 04:20:02 Matthias Wei?er wrote:

I have a device here which has only a CAN interface to the outside world. I am currently thinking about implementing a "serial" driver using the CAN controller.

Is there any chance to get this accepted in the public u-boot tree?

Quoted 7 lines
Quoted 3 lines

someone just posted a port of the Linux CAN framework. if your driver used that to implement a serial layer, i dont see why it wouldnt be accepted.

Well, that means that I have to implement a full functional CAN driver and then additionally add a serial driver using the (completely new) CAN framework. My idea was that I just add a serial_ccan.c to drivers/serial.

you would rather write a driver that is specific to one CAN hardware ? writing it to a common framework would allow every one with a CAN driver to use it ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091026/bc264a6d/attachment.pgp

#4 lore raw
Quoted 1 line · Mike Frysinger

you would rather write a driver that is specific to one CAN hardware ?

In general? No, I wouldn't. I would use a given CAN driver framework where I put my CAN driver in.

In this specific case: I think I would, as there is currently no CAN framework available in u-boot.

Is there any chance that the stuff posted by miaofng will be available in u-boot-next?

Quoted 2 lines

writing it to a common framework would allow every one with a CAN driver to use it ...

Yes. I totally agree here. And if there is a chance that there will be a CAN framework in u-boot in not to far future I will write my stuff against that.

I think I am not deep enough in u-boot that I will be able to write such a framework by myself.

Ragards,
Matthias Wei?er

#5 lore raw
Quoted 8 lines · On Monday 26 October 2009 08:20:03 Matthias Wei?er wrote:
Quoted 1 line · Mike Frysinger

you would rather write a driver that is specific to one CAN hardware ?

In general? No, I wouldn't. I would use a given CAN driver framework where I put my CAN driver in.

In this specific case: I think I would, as there is currently no CAN framework available in u-boot.

my point was more that a common driver would probably be more likely to be accepted, but this leads me to the next point ...

Quoted 2 lines

Is there any chance that the stuff posted by miaofng will be available in u-boot-next?

no idea, i'm not the maintainer. just part of the peanut gallery.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091026/a1577066/attachment.pgp

#6 lore raw
In reply to Matthias Weißer

Dear =?ISO-8859-15?Q?Matthias_Wei=DFer?=,

Quoted 3 lines · In message <[email protected]> you wrote:

In this specific case: I think I would, as there is currently no CAN framework available in u-boot.

This just means that your implementation requires a two-step approach. In step 1, implement the framework.

Quoted 2 lines

Is there any chance that the stuff posted by miaofng will be available in u-boot-next?

I'm not really sure. As Wolfgang Grandegger already commented, the implementation is really heavy for a mere boot loader. Sharing code with Linux is generally a good thing, but it has to fit, too. I'm not convinced it fits here. Let's see wht the now following discussion gives. In any case, this is too green for "next". IMHO it would even bee too green for "staging" if we had something like this (which we don't have :-)

Quoted 3 lines

Yes. I totally agree here. And if there is a chance that there will be a CAN framework in u-boot in not to far future I will write my stuff against that.

Do both things at once? The effort saved to re-implement your driver code against the to-be framwork can be thrown at implementing the framework in a first step ...

Quoted 2 lines

I think I am not deep enough in u-boot that I will be able to write such a framework by myself.

That's only a "not yet", believe me :-)

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The further the spiritual evolution of  mankind  advances,  the  more
certain  it seems to me that the path to genuine religiosity does not
lie through the fear of life, and the fear of death, and blind faith,
but through striving after rational knowledge.      - Albert Einstein
#7 lore raw
Quoted 4 lines · Wolfgang Denk
Quoted 3 lines

Is there any chance that the stuff posted by miaofng will be available in u-boot-next?

Quoted 10 lines

I'm not really sure. As Wolfgang Grandegger already commented, the implementation is really heavy for a mere boot loader. Sharing code with Linux is generally a good thing, but it has to fit, too. I'm not convinced it fits here. Let's see wht the now following discussion gives. In any case, this is too green for "next". IMHO it would even bee too green for "staging" if we had something like this (which we don't have :-)

In fact it's not so heavy, it is not socket can architecture based!!! I copied some of linux socket can based ->driver part<- of codes and added a small wrapped layer(by myself)
only because i am too lazy to rewrite the sja1000 driver.

For blocked or unblocked access problem, it does support both. To me, i agree mike's view if i write the sja1000 driver from scratch:)

#8 lore raw
In reply to Mike Frysinger
Quoted 12 lines · Mike Frysinger
Quoted 11 lines · On Monday 26 October 2009 07:09:03 Matthias Wei?er wrote:
Quoted 10 lines · Mike Frysinger
Quoted 6 lines · On Monday 26 October 2009 04:20:02 Matthias Wei?er wrote:

I have a device here which has only a CAN interface to the outside world. I am currently thinking about implementing a "serial" driver using the CAN controller.

Is there any chance to get this accepted in the public u-boot tree?

someone just posted a port of the Linux CAN framework. if your driver used that to implement a serial layer, i dont see why it wouldnt be accepted.

Quoted 7 lines
Quoted 3 lines

Well, that means that I have to implement a full functional CAN driver and then additionally add a serial driver using the (completely new) CAN framework. My idea was that I just add a serial_ccan.c to drivers/serial.

you would rather write a driver that is specific to one CAN hardware ? writing it to a common framework would allow every one with a CAN driver to use it ...

There are many simple USB CAN devices which are operated through the tty interface. See

http://prdownload.berlios.de/socketcan/SLCAN-API.pdf

Wolfgang.

#9 lore raw
In reply to Matthias Weißer
Quoted 5 lines · Matthias Wei?er

Hi

I have a device here which has only a CAN interface to the outside world. I am currently thinking about implementing a "serial" driver using the CAN controller.

OK, a dedicated CAN driver would make more sense.

Quoted 2 lines

Is there any chance to get this accepted in the public u-boot tree?

I think yes, if it does not mis-use U-BOOT

Quoted 3 lines

A special program on the PC side would be needed to translate the CAN messages back to a serial stream and vice versa and make it available to a terminal program. But thats another story.

Netconsole could do the job, but that would require to run IP over CAN.

Wolfgang.