[U-Boot] CAN console

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

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

Mike Frysinger schrieb:
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

On Monday 26 October 2009 07:09:03 Matthias Weißer wrote:
Mike Frysinger schrieb:
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.
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

Mike Frysinger schrieb:
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?
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

On Monday 26 October 2009 08:20:03 Matthias Weißer wrote:
Mike Frysinger schrieb:
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 ...
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

Dear =?ISO-8859-15?Q?Matthias_Wei=DFer?=,
In message 4AE593F3.3030608@arcor.de 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.
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 :-)
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 ...
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

Wolfgang Denk wrote:
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 :-)
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:)

Mike Frysinger wrote:
On Monday 26 October 2009 07:09:03 Matthias Weißer wrote:
Mike Frysinger schrieb:
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.
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.

Matthias Weißer wrote:
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.
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
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.
participants (5)
-
Matthias Weißer
-
miaofng
-
Mike Frysinger
-
Wolfgang Denk
-
Wolfgang Grandegger